/* ==========================================================================
   TechEvo — design system
   Dark-first "modern developer studio". One stylesheet, no build step.
   ========================================================================== */

/* ---- Fonts (self-hosted variable woff2, latin subset) ------------------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/spacegrotesk.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrainsmono.woff2') format('woff2');
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  /* palette */
  --canvas:      #0B0D12;
  --surface:     #14171F;
  --surface-2:   #1B1F2A;
  --border:      rgba(255, 255, 255, 0.08);
  --border-hi:   rgba(255, 255, 255, 0.16);
  --text:        #F5F7FA;
  --text-muted:  #9AA4B2;
  --accent:      #6366F1;   /* brand indigo — decorative / glows */
  --accent-2:    #8B5CF6;   /* brand violet */
  --accent-text: #A5B4FC;   /* AA-safe accent for links/labels on dark */
  --ship:        #10B981;   /* success / "we shipped" */
  /* button fill uses deeper endpoints so white text clears WCAG AA (~5:1) */
  --btn-grad:    linear-gradient(135deg, #4F46E5, #7C3AED);
  --glow:        radial-gradient(60% 60% at 50% 0%, rgba(99,102,241,0.18), transparent 70%);

  /* type */
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4:  clamp(2.6rem, 2rem + 3vw, 4.25rem);

  /* space + shape */
  --container: 1120px;
  --gap: clamp(1rem, 0.6rem + 2vw, 1.75rem);
  --section-y: clamp(3.5rem, 2rem + 7vw, 7rem);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}

/* ---- Reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: dark; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1rem; color: var(--text-muted); max-width: 62ch; }
p.lead { font-size: var(--step-1); color: var(--text); }

/* accessibility: visible focus + skip link */
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--text); padding: 0.6rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Layout helpers ----------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 0.5rem + 3vw, 2rem); }
.section { padding-block: var(--section-y); }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text);
  margin: 0 0 0.9rem;
}
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.grad-text {
  background: linear-gradient(120deg, #C7D2FE, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 600; font-size: var(--step-0);
  padding: 0.8rem 1.4rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--btn-grad); color: #fff; box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.6); }
.btn-primary:hover { box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.75); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-hi); }
.btn-ghost:hover { background: var(--surface); border-color: var(--accent-text); }
.btn-lg { padding: 1rem 1.7rem; font-size: var(--step-1); }

/* ---- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 18, 0.72); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg, .brand img { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-muted); font-size: var(--step-0); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .btn-primary, .nav-links .btn-primary:hover { color: #fff; }  /* CTA keeps white text over the gradient (beats .nav-links a) */
.nav-cta { margin-left: 0.5rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-hi); border-radius: 8px; padding: 0.4rem 0.55rem; cursor: pointer; color: var(--text); }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; inset: 68px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0.25rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 1rem clamp(1.1rem, 0.5rem + 3vw, 2rem) 1.5rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 0; width: 100%; }
  .nav-cta { margin: 0.5rem 0 0; }
}

/* ---- Hero --------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(4rem, 2rem + 9vw, 8rem) var(--section-y); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 75%);
          mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { max-width: 16ch; }
.hero .lead { max-width: 54ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-values { margin-top: clamp(2rem, 1rem + 3vw, 3.5rem); }
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem;
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border); padding: 0.4rem 0.8rem; border-radius: 999px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ship); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* ---- Trust bar ---------------------------------------------------------- */
.trust { border-block: 1px solid var(--border); padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.trust p { text-align: center; font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; margin: 0 auto 1.2rem; }
.trust-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(1.2rem, 1rem + 3vw, 3rem); opacity: 0.7; }
.trust-logos span { font-family: var(--font-head); font-weight: 600; font-size: var(--step-1); color: var(--text-muted); }

/* ---- Cards / grids ------------------------------------------------------ */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.3rem, 1rem + 1vw, 1.8rem); transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-3px); background: var(--surface-2); }
.card h3 { margin-bottom: 0.4rem; }
.card p { margin-bottom: 0; }
.card .icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 1.1rem;
  display: grid; place-items: center; color: var(--accent-text);
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.12));
  border: 1px solid var(--border);
}
.card .icon svg { width: 22px; height: 22px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 0.25rem 0.6rem; border-radius: 6px; }

/* ---- Process (numbered steps) ------------------------------------------ */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 3.5rem; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-weight: 500;
  color: var(--accent-text); font-size: 1.05rem;
  width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
  border: 1px solid var(--border-hi); border-radius: 10px; background: var(--surface);
}
.step h3 { margin-bottom: 0.3rem; }

/* ---- Work / case-study cards ------------------------------------------- */
.work-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.work-card .thumb { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1B1F2A, #101725); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.work-card .body { padding: clamp(1.3rem, 1rem + 1vw, 1.7rem); }
.work-card .result { color: var(--ship); font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500; }

/* ---- Differentiator ("why senior-led") --------------------------------- */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.check-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.check-list li { display: flex; gap: 0.75rem; align-items: flex-start; color: var(--text); }
.check-list svg { flex: none; width: 22px; height: 22px; color: var(--ship); margin-top: 3px; }
.code-panel {
  background: #0d1017; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.code-panel .bar { display: flex; gap: 0.4rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.code-panel .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-2); display: block; }
.code-panel pre { margin: 0; padding: 1.2rem 1.3rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.7; color: #cdd6f4; }
.code-panel .k { color: #c4b5fd; } .code-panel .s { color: #a5d6a7; } .code-panel .c { color: #6b7280; }

/* ---- FAQ (native details) ---------------------------------------------- */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 1.2rem 2.5rem 1.2rem 0; position: relative; font-family: var(--font-head); font-weight: 600; font-size: var(--step-1); color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 1.5rem; color: var(--accent-text); transition: transform 0.2s ease; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 1.3rem; margin: 0; }

/* ---- Contact / form ----------------------------------------------------- */
.contact-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.5rem, 1rem + 3vw, 3rem); box-shadow: var(--shadow); }
.form-grid { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: var(--step--1); font-weight: 600; color: var(--text); }
.field label .req { color: var(--accent-text); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: var(--step-0); color: var(--text);
  background: var(--canvas); border: 1px solid var(--border-hi); border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem; width: 100%; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25); }
.field input::placeholder, .field textarea::placeholder { color: #5b6472; }
/* honeypot — hidden from humans, catches bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: var(--step--1); color: var(--text-muted); margin: 0.4rem 0 0; }
.form-status { font-size: var(--step-0); margin: 0; }
.form-status.err { color: #fca5a5; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem); margin-top: var(--section-y); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-grid p { margin: 0.5rem 0 0; max-width: 34ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--text-muted); font-size: var(--step-0); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.footer-bottom small { color: var(--text-muted); font-size: var(--step--1); }

/* ---- Utilities ---------------------------------------------------------- */
.center { text-align: center; margin-inline: auto; }
.mt-2 { margin-top: 2rem; }
.cta-band { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08)); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(2rem, 1.5rem + 3vw, 3.5rem); text-align: center; }
.cta-band h2 { max-width: 20ch; margin-inline: auto; }

/* ---- Light theme -------------------------------------------------------- */
/* Applied via data-theme on <html>, set by the inline <head> script from the
   visitor's saved choice or their OS setting; the header toggle flips + saves it.
   No-JS visitors get the dark default. */
:root[data-theme="light"] {
  color-scheme: light;
  --canvas:      #F7F8FB;
  --surface:     #FFFFFF;
  --surface-2:   #EDF0F5;
  --border:      rgba(15, 23, 42, 0.10);
  --border-hi:   rgba(15, 23, 42, 0.20);
  --text:        #0F172A;
  --text-muted:  #505A72;   /* ~5.8:1 on --canvas (AA body text) */
  --accent-text: #4F46E5;   /* ~5.6:1 links/labels on white */
  --ship:        #047857;   /* AA success text on light */
  --glow:        radial-gradient(60% 60% at 50% 0%, rgba(99,102,241,0.10), transparent 70%);
  --shadow:      0 18px 45px -22px rgba(15, 23, 42, 0.28);
}
:root[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.72); }
:root[data-theme="light"] .hero::after { background-image: radial-gradient(circle at 1px 1px, rgba(15,23,42,0.05) 1px, transparent 0); }
/* background-image (not the `background` shorthand) so background-clip:text survives */
:root[data-theme="light"] .grad-text { background-image: linear-gradient(120deg, #4F46E5, #7C3AED); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="light"] .form-status.err { color: #DC2626; }

/* ---- Theme toggle (header) ---------------------------------------------- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--border-hi); border-radius: 8px; padding: 0.4rem 0.5rem; color: var(--text-muted); cursor: pointer; }
.theme-toggle:hover { color: var(--text); border-color: var(--accent-text); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
