/* =========================================================
   TechTailor — Bespoke AI
   Design tokens
   ========================================================= */
:root {
  /* Color */
  --ink:        #0B1020;   /* base midnight-indigo */
  --ink-2:      #0E1426;   /* alt background band */
  --panel:      #141B30;   /* cards / panels */
  --panel-2:    #1A2340;   /* raised panels */
  --line:       #263155;   /* hairline borders */
  --line-soft:  #1D2640;

  --text:       #E9ECF6;   /* primary text */
  --muted:      #9AA6C4;   /* secondary text */
  --faint:      #66739A;   /* captions */

  /* AI gradient (cool intelligence) */
  --ai-1:       #5B8CFF;
  --ai-2:       #8B6CFF;
  --ai-glow:    rgba(114, 124, 255, 0.35);

  /* Thread accent (warm craft) — used sparingly */
  --thread:     #E9B872;
  --thread-dim: rgba(233, 184, 114, 0.5);

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Inter", "Segoe UI", system-ui, sans-serif;
  --mono:    "Space Mono", ui-monospace, "Courier New", monospace;

  /* Layout */
  --wrap: 1160px;
  --gap: clamp(1rem, 3vw, 2rem);
  --radius: 16px;
  --radius-sm: 10px;

  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* =========================================================
   Reset / base
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient atmosphere — soft AI glow anchored top-right */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 82% -10%, rgba(139, 108, 255, 0.16), transparent 60%),
    radial-gradient(50rem 40rem at -10% 15%, rgba(91, 140, 255, 0.12), transparent 55%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(100% - 2.4rem, var(--wrap)); margin-inline: auto; }

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.9rem); font-optical-sizing: auto; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); font-weight: 600; letter-spacing: -0.01em; }

p { color: var(--muted); }
strong { color: var(--text); font-weight: 600; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--thread);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 2.2rem;
  height: 0;
  border-top: 1.5px dashed var(--thread-dim); /* stitch */
}

.grad {
  background: linear-gradient(100deg, var(--ai-1), var(--ai-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* stitched underline — the signature seam */
.stitch {
  position: relative;
  white-space: nowrap;
}
.stitch::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.14em;
  border-bottom: 2px dashed var(--thread-dim);
}

/* =========================================================
   Header / nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line-soft); }
.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  height: 74px;
}

/* Wordmark logo */
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand-mark-svg { width: 30px; height: 30px; flex: none; }
.brand-word {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.42rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-word .ai {
  position: relative;
  background: linear-gradient(100deg, var(--ai-1), var(--ai-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}
.brand-word .ai::after {
  content: "";
  position: absolute;
  left: -1px; right: -1px; bottom: -2px;
  border-bottom: 2px dashed var(--thread);
  opacity: .85;
}

.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  display: block;
  margin-top: 3px;
  border-bottom: 2px dashed var(--thread-dim);
}

/* Language toggle */
.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.lang button {
  background: transparent;
  color: var(--faint);
  border: 0;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: color .2s, background .2s;
}
.lang button.active { color: var(--ink); background: var(--thread); font-weight: 700; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: .3s var(--ease); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .2s, border-color .2s;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(100deg, var(--ai-1), var(--ai-2));
  box-shadow: 0 12px 30px -12px var(--ai-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px var(--ai-glow); }
.btn-ghost { color: var(--text); border-color: var(--line); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--thread-dim); transform: translateY(-2px); }
.btn-arrow { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* =========================================================
   Sections
   ========================================================= */
section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 5vw, 3.4rem); }
.section-head h2 { margin-top: 0.9rem; }
.section-head p { margin-top: 1rem; font-size: 1.08rem; }
.band { background: var(--ink-2); border-block: 1px solid var(--line-soft); }

/* Hero */
.hero { padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(3.5rem, 8vw, 6rem); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin: 1.2rem 0 1.4rem; }
.hero h1 .measure { color: var(--thread); font-style: italic; }
.hero-lead { font-size: 1.18rem; max-width: 34rem; }
.hero-cta { display: flex; gap: 0.9rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 2.2rem; margin-top: 2.8rem; flex-wrap: wrap; }
.hero-meta .stat .n { font-family: var(--display); font-size: 2rem; color: var(--text); }
.hero-meta .stat .l { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

/* Hero visual — the "pattern" panel (a tailor's cutting pattern rendered as data) */
.hero-visual {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  padding: 1.4rem;
  overflow: hidden;
}
.hero-visual::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .35;
  mask-image: radial-gradient(120% 90% at 60% 20%, #000, transparent 75%);
}
.hero-visual .pattern-tag {
  position: relative;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  display: flex; justify-content: space-between;
  margin-bottom: 0.8rem;
}
.hero-visual svg { position: relative; width: 100%; height: auto; display: block; }

/* =========================================================
   Cards / grids
   ========================================================= */
.grid { display: grid; gap: 1.2rem; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.7rem;
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line); background: var(--panel-2); }
.card .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--thread);
  letter-spacing: 0.14em;
}
.card .ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(114,124,255,0.08);
  margin-bottom: 1.1rem;
}
.card .ic svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 0.5rem; }
.card p { font-size: 0.96rem; }

/* Service card — with stitched top seam on hover */
.svc { padding-top: 1.9rem; }
.svc::before {
  content: "";
  position: absolute; left: 1.7rem; right: 1.7rem; top: 0;
  border-top: 2px dashed transparent;
  transition: border-color .3s var(--ease);
}
.svc:hover::before { border-top-color: var(--thread-dim); }
.svc ul { list-style: none; margin-top: 1rem; display: grid; gap: 0.5rem; }
.svc ul li { font-size: 0.9rem; color: var(--muted); padding-left: 1.3rem; position: relative; }
.svc ul li::before { content: "—"; position: absolute; left: 0; color: var(--thread); }

/* Process — a real sequence, so numbering is earned */
.steps { display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-top: 1px dashed var(--line);
  align-items: start;
}
.step:last-child { border-bottom: 1px dashed var(--line); }
.step .idx { font-family: var(--mono); color: var(--thread); font-size: 0.85rem; letter-spacing: 0.1em; padding-top: 0.35rem; }
.step h3 { margin-bottom: 0.4rem; }
.step p { font-size: 0.98rem; }

/* Case study */
.case {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.8rem);
}
.case .tag {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--thread); text-transform: uppercase;
}
.case h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0.6rem 0 1rem; }
.case .kpis { display: flex; gap: 2rem; margin-top: 1.6rem; flex-wrap: wrap; }
.case .kpi .n { font-family: var(--display); font-size: 1.9rem; color: var(--text); }
.case .kpi .l { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* Email Assistant mock preview */
.mock {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--ink-2), var(--panel));
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mock .bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line-soft); }
.mock .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock .bar span { margin-left: 0.6rem; font-family: var(--mono); font-size: 0.68rem; color: var(--faint); }
.mock .body { padding: 1rem; display: grid; gap: 0.7rem; }
.mock .line { height: 9px; border-radius: 5px; background: var(--line-soft); }
.mock .line.short { width: 55%; }
.mock .line.mid { width: 78%; }
.mock .reply { border: 1px solid var(--line); border-left: 2px dashed var(--thread-dim); border-radius: 8px; padding: 0.8rem; background: rgba(114,124,255,0.05); display: grid; gap: 0.55rem; }
.mock .reply .tag { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; color: var(--ai-1); }
.mock .line.g { background: linear-gradient(90deg, var(--ai-1), transparent); }

/* Values / about */
.lead-quote {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 30ch;
}
.principles { display: grid; gap: 0; margin-top: 2.5rem; }
.principle { padding: 1.6rem 0; border-top: 1px dashed var(--line); display: grid; grid-template-columns: 0.9fr 1.4fr; gap: 1.5rem; }
.principle:last-child { border-bottom: 1px dashed var(--line); }
.principle h3 { font-family: var(--display); font-weight: 500; }

/* =========================================================
   CTA band
   ========================================================= */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: 1.1rem; }
.cta-band p { max-width: 40rem; margin: 0 auto 2rem; font-size: 1.1rem; }

/* =========================================================
   Contact
   ========================================================= */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-info .item { padding: 1.2rem 0; border-top: 1px dashed var(--line); }
.contact-info .item:first-of-type { border-top: 0; }
.contact-info .k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.contact-info .v { font-size: 1.05rem; color: var(--text); margin-top: 0.3rem; }
.contact-info .v a:hover { color: var(--ai-1); }

form.contact {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.4rem);
  display: grid;
  gap: 1.1rem;
}
.field { display: grid; gap: 0.4rem; }
.field label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--body);
  font-size: 0.98rem;
  padding: 0.8rem 0.95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ai-1);
  box-shadow: 0 0 0 3px rgba(91,140,255,0.15);
}
.field.two { grid-template-columns: 1fr 1fr; gap: 1.1rem; display: grid; }
@media (max-width: 560px) { .field.two { grid-template-columns: 1fr; } }
form.contact .btn-primary { justify-content: center; margin-top: 0.4rem; }

/* =========================================================
   Booking (Google Calendar embed)
   ========================================================= */
.booking { max-width: 900px; margin-inline: auto; }
.cal-inline {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-inline iframe { border-radius: var(--radius); }
.cal-loading {
  min-height: 640px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.booking-alt { text-align: center; margin-top: 1.3rem; font-size: 0.9rem; color: var(--faint); }
.booking-alt a { color: var(--muted); }
.booking-alt a:hover { color: var(--ai-1); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { border-top: 1px solid var(--line-soft); padding-block: 3.2rem; background: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid p { font-size: 0.92rem; margin-top: 1rem; max-width: 26rem; }
.foot-col h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; font-weight: 400; }
.foot-col a { display: block; color: var(--muted); font-size: 0.94rem; padding: 0.3rem 0; }
.foot-col a:hover { color: var(--text); }
.footer-base { display: flex; justify-content: space-between; align-items: center; margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px dashed var(--line); flex-wrap: wrap; gap: 1rem; }
.footer-base small { color: var(--faint); font-size: 0.82rem; }

/* =========================================================
   Reveal animation
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--ai-1); outline-offset: 3px; border-radius: 4px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .case, .contact-grid, .footer-grid, .principle { grid-template-columns: 1fr; }
  .case .mock { max-width: 480px; }
}
@media (max-width: 720px) {
  .nav-links, .lang.desktop { display: none; }
  .nav-toggle { display: block; }
  .site-header.open .nav-links {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 74px; left: 0; right: 0;
    background: var(--ink); border-bottom: 1px solid var(--line);
    padding: 0.8rem 1.2rem 1.4rem; gap: 0.2rem;
  }
  .site-header.open .lang.mobile { display: inline-flex; margin: 0.6rem 1.2rem 0; }
  .lang.mobile { display: none; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 0.4rem; }
  .footer-base { flex-direction: column; align-items: flex-start; }
}
.lang.mobile { display: none; }
