/* =========================================================
   TMF ENGINEERINGS — Design System
   Palette derived from brand mark: near-black chip substrate,
   signal blue (from logo gradient) + circuit-gold accent.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  color-scheme: light;
  /* Surfaces */
  --bg:            #FFFFFF;
  --bg-alt:        #F4F8FD;
  --surface:       #FFFFFF;
  --surface-2:     #EEF4FC;
  --surface-3:     #E2EDFA;
  --border:        rgba(11,32,64,0.10);
  --border-strong: rgba(11,32,64,0.18);

  /* Text */
  --text:          #0B1220;
  --text-dim:      #4B5C71;
  --text-faint:    #5C6E85;

  /* Brand accents */
  --blue:          #0B5FCC;
  --blue-bright:   #1565D8;
  --blue-deep:     #073F8C;
  --gold:          #0E63FF;
  --gold-deep:     #073F8C;

  /* Gradients */
  --grad-signal: linear-gradient(120deg, #073F8C 0%, #0B5FCC 55%, #2F8FFF 100%);
  --grad-gold:   linear-gradient(120deg, #073F8C 0%, #0E63FF 100%);
  --grad-bg-glow: radial-gradient(60% 60% at 50% 0%, rgba(47,143,255,0.12) 0%, rgba(255,255,255,0) 70%);

  /* Type */
  --f-display: 'Space Grotesk', sans-serif;
  --f-body:    'Inter', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  /* Layout */
  --maxw: 1220px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-soft: 0 20px 50px -20px rgba(15,35,70,0.18);
}

html[data-theme="dark"]{
  color-scheme: dark;
  --bg:            #0B1220;
  --bg-alt:        #0F1A2E;
  --surface:       #111C33;
  --surface-2:     #16233D;
  --surface-3:     #1C2C4A;
  --border:        rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);

  --text:          #F4F8FD;
  --text-dim:      #B6C2D9;
  --text-faint:    #8CA0BF;

  --blue:          #2F8FFF;
  --blue-bright:   #4FA3FF;
  --blue-deep:     #0B5FCC;
  --gold:          #2F8FFF;
  --gold-deep:     #0B5FCC;

  --grad-signal:  linear-gradient(120deg, #0B5FCC 0%, #2F8FFF 55%, #7EC1FF 100%);
  --grad-gold:    linear-gradient(120deg, #0B5FCC 0%, #2F8FFF 100%);
  --grad-bg-glow: radial-gradient(60% 60% at 50% 0%, rgba(47,143,255,0.18) 0%, rgba(11,18,32,0) 70%);
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
html,body{ margin:0; padding:0; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before{
  content:"";
  position: fixed;
  inset:0;
  background: var(--grad-bg-glow);
  pointer-events: none;
  z-index: 0;
}

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
button{ font-family: inherit; }

:focus-visible{
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

h1,h2,h3,h4{
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

h1{ font-size: clamp(2.4rem, 5vw, 4.1rem); font-weight: 700; }
h2{ font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3{ font-size: 1.3rem; }
p{ margin: 0 0 1em; color: var(--text-dim); }

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 16px;
}
.eyebrow::before{
  content:"";
  width: 22px; height:1px;
  background: var(--blue-bright);
  display:inline-block;
}

.section{
  position: relative;
  padding: 108px 0;
  z-index: 1;
}
.section-tight{ padding: 72px 0; }
.section-head{
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head.center{ margin-left:auto; margin-right:auto; text-align:center; }

.text-dim{ color: var(--text-dim); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 15px 30px;
  border-radius: 100px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: .95rem;
  cursor:pointer;
  border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
  white-space: nowrap;
}
.btn-primary{
  background: var(--grad-gold);
  color: #FFFFFF;
  box-shadow: 0 10px 30px -10px rgba(14,99,255,0.45);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(14,99,255,0.6); }

.btn-outline{
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover{ border-color: var(--blue-bright); color: var(--blue-bright); transform: translateY(-2px); }

.btn-ghost{
  background: rgba(11,32,64,0.04);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover{ background: rgba(11,32,64,0.07); }

.btn-block{ width:100%; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; transform:none !important; }

/* ---------- Navbar ---------- */
.navbar{
  position: sticky;
  top:0;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.navbar .container{
  display:flex;
  align-items:center;
  justify-content: space-between;
  height: 84px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-mark{
  height: 62px;
  display:flex; align-items:center; justify-content:left;
}
.brand-mark img{ height:100%; width:auto; object-fit:contain; }
.brand-word{
  font-family: var(--f-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-word span{ color: var(--blue-bright); }

.nav-links{
  display:flex;
  align-items:center;
  gap: 40px;
}
.nav-links a{
  font-size: .93rem;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}
.nav-links a::after{
  content:"";
  position:absolute; left:0; bottom:0;
  width:0; height:2px;
  background: var(--grad-signal);
  transition: width .25s ease;
}
.nav-links a:hover,
.nav-links a.active{ color: var(--text); }
.nav-links a.active::after,
.nav-links a:hover::after{ width:100%; }

.nav-cta{ display:flex; align-items:center; gap:18px; }
.nav-toggle{
  display:none;
  width: 42px; height:42px;
  border-radius: 10px;
  background: rgba(11,32,64,0.05);
  border: 1px solid var(--border);
  align-items:center; justify-content:center;
  cursor:pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after{
  content:"";
  display:block;
  width: 18px; height:2px;
  background: var(--text);
  position: relative;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle span::before{ position:absolute; top:-6px; }
.nav-toggle span::after{ position:absolute; top:6px; }
.nav-toggle.open span{ background: transparent; }
.nav-toggle.open span::before{ top:0; transform: rotate(45deg); background:var(--text); }
.nav-toggle.open span::after{ top:0; transform: rotate(-45deg); background:var(--text); }

/* ---------- Footer ---------- */
.footer{
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 64px 0 28px;
  z-index: 1;
}
.footer-top{
  display:flex;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--border);
}
.footer-brand .brand{ margin-bottom: 14px; }
.footer-brand p{ max-width: 320px; }
.footer-cols{
  display:flex;
  gap: 64px;
  flex-wrap: wrap;
}
.footer-col h4{
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.footer-col a{
  display:block;
  color: var(--text-dim);
  font-size: .92rem;
  margin-bottom: 12px;
  transition: color .2s ease;
}
.footer-col a:hover{ color: var(--blue-bright); }

.footer-bottom{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding-top: 26px;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-copy{ font-size: .84rem; color: var(--text-faint); }

.social-row{ display:flex; gap:12px; }
.social-row a{
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display:flex; align-items:center; justify-content:center;
  color: var(--text-dim);
  transition: all .25s ease;
}
.social-row a:hover{
  color: var(--bg);
  background: var(--grad-signal);
  border-color: transparent;
  transform: translateY(-3px);
}
.social-row svg{ width:18px; height:18px; }

/* ---------- Page header (inner pages) ---------- */
.page-header{
  padding: 72px 0 56px;
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow:hidden;
}
.page-header .container{ position:relative; z-index:2; }
.page-header-tag{ font-family: var(--f-mono); font-size:.8rem; letter-spacing:.14em; color:var(--blue-bright); text-transform:uppercase; }
.page-header h1{ margin-top:10px; max-width: 720px; }
.page-header p{ max-width: 560px; font-size: 1.05rem; }

/* ---------- Circuit trace divider (signature element) ---------- */
.trace-divider{
  width:100%;
  height: 46px;
  display:block;
  color: var(--border-strong);
}
.trace-divider path{
  fill:none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.trace-divider circle{ fill: var(--blue); }
.trace-divider .pulse{
  stroke: var(--blue-bright);
  stroke-width: 1.6;
  stroke-dasharray: 8 420;
  animation: trace-flow 5.5s linear infinite;
  opacity: .9;
  filter: drop-shadow(0 0 4px rgba(111,193,255,.8));
}
@keyframes trace-flow{
  0%{ stroke-dashoffset: 0; }
  100%{ stroke-dashoffset: -428; }
}

/* ---------- Cards ---------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 32px;
  box-shadow: 0 10px 30px -22px rgba(15,35,70,0.16);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.card:hover{
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

/* ---------- Grid helpers ---------- */
.grid{ display:grid; gap: 26px; }
.grid-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Stats strip ---------- */
.stats-strip{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow:hidden;
  background: var(--surface);
  box-shadow: 0 10px 30px -22px rgba(15,35,70,0.16);
}
.stat-item{
  padding: 34px 24px;
  text-align:center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child{ border-right:none; }
.stat-num{
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 6vw, 2.3rem);
  font-weight: 700;
  color: var(--text);
  background: var(--grad-signal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
}
.stat-label{
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 6px;
}

/* ---------- Chip / IC badge (used for field cards) ---------- */
.chip-icon{
  width: 56px; height:56px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  display:flex; align-items:center; justify-content:center;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: .95rem;
  color: var(--blue-bright);
  margin-bottom: 22px;
}
.chip-icon::before,
.chip-icon::after{
  content:"";
  position:absolute;
  left: 10px; right:10px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}
.chip-icon::before{ top:-6px; }
.chip-icon::after{ bottom:-6px; }

/* ---------- Forms ---------- */
.form-grid{ display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field{ display:flex; flex-direction:column; gap:8px; }
.field.full{ grid-column: 1 / -1; }
.field label{
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field label .req{ color: var(--gold); }
.field input[type=text],
.field input[type=tel],
.field input[type=email],
.field select,
.field textarea{
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--f-body);
  font-size: .95rem;
  transition: border-color .2s ease, background .2s ease;
  width: 100%;
}
.field textarea{ resize: vertical; min-height: 120px; }
.field input:focus,
.field select:focus,
.field textarea:focus{
  outline:none;
  border-color: var(--blue);
  background: var(--surface-3);
}
.field select{ appearance:none; -webkit-appearance:none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9'><path d='M1 1l6 6 6-6' stroke='%234B5C71' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat:no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.field-hint{ font-size:.8rem; color: var(--text-faint); margin-top:2px; }

.file-drop{
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-s);
  padding: 22px 16px;
  text-align:center;
  cursor:pointer;
  background: var(--surface-2);
  transition: border-color .2s ease, background .2s ease;
  font-size: .9rem;
  color: var(--text-dim);
}
.file-drop:hover{ border-color: var(--blue); background: var(--surface-3); }
.file-drop input{ display:none; }
.file-drop .fname{ color: var(--blue-bright); font-family: var(--f-mono); font-size:.82rem; margin-top:6px; }

.form-note{
  font-size: .85rem;
  color: var(--text-faint);
  background: rgba(59,158,255,0.08);
  border: 1px solid rgba(59,158,255,0.2);
  padding: 12px 16px;
  border-radius: var(--radius-s);
}

/* ---------- Misc utility ---------- */
.mt-0{ margin-top:0; }
.reveal{ opacity:0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in{ opacity:1; transform:none; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px){
  .grid-4{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-strip{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-item:nth-child(2){ border-right:none; }
  .stat-item{ border-bottom: 1px solid var(--border); }
}

@media (max-width: 860px){
  .nav-links{
    position: fixed;
    top: 84px; left:0; right:0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 28px 34px;
    gap: 20px;
    transform: translateY(-140%);
    opacity:0;
    transition: transform .3s ease, opacity .3s ease;
  }
  .nav-links.open{ transform: translateY(0); opacity:1; }
  .nav-toggle{ display:flex; }
  .nav-cta .btn-outline{ display:none; }
  .grid-2{ grid-template-columns: minmax(0, 1fr); }
  .form-grid{ grid-template-columns: minmax(0, 1fr); }
  .footer-top{ flex-direction:column; }
}

@media (max-width: 600px){
  .grid-4,.grid-3{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section{ padding: 76px 0; }
  .stats-strip{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px){
  .container{ padding: 0 18px; }
  .grid-3,.grid-4{ grid-template-columns: minmax(0, 1fr); }
  .card{ padding: 22px; }
  .stat-item{ padding: 22px 12px; }
}
