/* Page-specific layouts */

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: 100vh;
  /* W1L.6d: home main padding-top is dropped to 0 (see tokens.css), so .hero
     fully owns nav clearance. 124px = ~74px fixed nav + ~50px editorial gap. */
  padding: 124px var(--gutter) 72px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  opacity: .4;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(56px, 8.2vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 32px;
}
.hero-copy h1 .arrow-accent {
  color: var(--brand-teal);
  display: inline-block;
  transform: translateY(-0.08em) rotate(0deg);
}
.hero-copy .body-l {
  max-width: 480px; margin-bottom: 40px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  position: relative;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.hero-meta-item .num {
  font-family: var(--font-display);
  font-size: 40px; letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero-meta-item .num [data-count] {
  display: inline-block;
  min-width: 1.2em;
  text-align: right;
}
.hero-meta-item .num .unit { color: var(--brand-teal); }
.hero-meta-item .lbl {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 8px;
}
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  /* W1L.6d: tablet portrait — keep the H1 close to the nav without losing
     editorial breathing room. */
  .hero { padding: 108px var(--gutter) 56px; }
}
@media (max-width: 540px) {
  /* W1L.6c: pull the H1 higher, trim trailing whitespace under the graph,
     and tighten the gap between copy and visual so the graph reads as the
     hero centerpiece on phone widths.
     W1L.6d: home main padding-top is dropped to 0; hero now owns the full
     ~74px nav clearance plus ~22px editorial breathing room. */
  .hero { padding: 96px 16px 28px; }
  .hero-inner { gap: 24px; }
  .hero-copy h1 { margin-bottom: 20px; }
  .hero-copy .body-l { margin-bottom: 24px; }
}

/* ─── Swarm visualizer (home hero right column) ─── */
.swarm-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
}
.swarm-canvas { width: 100%; height: 100%; display: block; }

/* Dark accent card (reserved styles) */
.nexus-card {
  background: var(--nx-bg);
  border: 1px solid var(--nx-line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-2), 0 0 80px rgba(45, 230, 242, 0.08);
  font-family: var(--font-mono);
  color: var(--nx-ink);
}
.nexus-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--nx-cyan), transparent);
  opacity: .6;
}
.nexus-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--nx-line);
  background: var(--nx-bg-2);
}
.nexus-title {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--nx-cyan); display: flex; align-items: center; gap: 10px;
}
.nexus-title .tag {
  color: var(--nx-ink-dim); text-transform: none; letter-spacing: 0;
  font-size: 10px;
}
.nexus-status {
  font-size: 10px; color: var(--nx-ink-dim); display: flex; align-items: center; gap: 8px;
}
.nexus-status .dot {
  width: 6px; height: 6px; background: var(--nx-green); border-radius: 50%;
  box-shadow: 0 0 8px var(--nx-green);
  animation: pulse 1.6s ease-in-out infinite;
}
.nexus-body { padding: 18px; font-size: 11px; }

/* ─── Problem / Solution Split ─── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}
.split > div {
  padding: 80px 64px;
  display: flex; flex-direction: column; justify-content: center;
}
.split .old {
  background: var(--bg-sub);
  color: var(--ink-3);
  border-right: 1px solid var(--line);
}
.split .new {
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.split .new::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 230, 242, 0.18), transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(208, 49, 45, 0.12), transparent 60%);
}
.split h3 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 40px; font-weight: 500;
}
.split .headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05;
  letter-spacing: -0.025em; margin-bottom: 40px;
  position: relative;
}
.split .old .headline { color: var(--ink-3); }
.split .new .headline { color: #fff; }
.split .new .headline em { color: var(--brand-teal); font-style: italic; }
.split ul { list-style: none; padding: 0; margin: 0; }
.split li {
  padding: 16px 0;
  border-top: 1px solid;
  font-size: 14px;
  display: flex; align-items: center; gap: 14px;
  position: relative;
  font-family: var(--font-mono);
}
.split .old li { border-color: var(--line); color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.2); }
.split .new li { border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.split .new li::before {
  content: '→'; color: var(--brand-teal); font-weight: 700;
}
.split .old li::before {
  content: '×'; color: var(--brand-red); font-weight: 700;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split > div { padding: 56px 32px; }
  .split .old { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ─── Services ─── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.service-card {
  background: var(--bg);
  padding: 48px 40px;
  min-height: 340px;
  display: flex; flex-direction: column;
  gap: 16px;
  position: relative;
  transition: background .3s var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.service-card:hover { background: var(--bg-card); }
.service-card .num {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em;
  color: var(--ink-4);
}
.service-card h3 {
  font-size: 28px; line-height: 1.1;
  margin-top: 24px;
  letter-spacing: -0.02em;
}
.service-card .desc {
  color: var(--ink-3); font-size: 14px;
  margin-top: auto;
  max-width: 320px;
}
.service-card .arrow {
  position: absolute;
  top: 48px; right: 40px;
  width: 24px; height: 24px;
  color: var(--ink-4);
  transition: transform .3s var(--ease-out), color .3s;
}
.service-card:hover .arrow {
  color: var(--brand-teal);
  transform: translate(4px, -4px);
}
.service-card.featured {
  background: var(--ink);
  color: var(--bg);
}
.service-card.featured h3 { color: #fff; }
.service-card.featured .desc { color: rgba(255,255,255,0.65); }
.service-card.featured .num { color: var(--brand-teal); }
.service-card.featured .arrow { color: var(--brand-teal); }
.service-card.featured:hover { background: var(--brand-maroon-deep); }

@media (max-width: 860px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ─── Metrics band ─── */
.metrics-band {
  padding: 120px 0;
  background: var(--ink);
  color: var(--bg);
  border-block: 1px solid var(--ink);
  position: relative; overflow: hidden;
}
.metrics-band .container { position: relative; }
.metrics-eye { color: var(--brand-teal); }
.metrics-headline {
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 72px);
  line-height: 1.05; letter-spacing: -0.03em;
  max-width: 960px; margin-bottom: 80px;
}
.metrics-headline em { color: var(--brand-teal); font-style: italic; }
.metrics-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 48px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 48px;
}
.metric {
  display: flex; flex-direction: column; gap: 8px;
}
.metric .big {
  font-family: var(--font-display);
  font-size: clamp(48px, 5.5vw, 88px);
  line-height: 1; letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.metric .big [data-count] {
  display: inline-block;
  min-width: 1.3em;
  text-align: right;
}
.metric .big .sym { color: var(--brand-teal); }
.metric .lbl {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-top: 16px;
}
.metric .desc {
  font-size: 14px; color: rgba(255,255,255,0.7);
  max-width: 220px; margin-top: 4px;
}
@media (max-width: 860px) { .metrics-row { grid-template-columns: 1fr 1fr; } }

/* ─── How it works (horizontal pin-scroll) ─── */
.how-it-works {
  background: var(--bg-sub);
  overflow: hidden;
}
.how-track {
  display: grid; grid-template-columns: repeat(4, minmax(360px, 1fr));
  gap: 24px;
  padding: 40px 0;
}
.how-step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px;
  min-height: 360px;
  position: relative;
}
.how-step .step-num {
  font-family: var(--font-display);
  font-size: 96px; line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--brand-teal);
  margin-bottom: 32px;
}
.how-step h4 {
  font-size: 24px; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.how-step p { font-size: 14px; color: var(--ink-3); line-height: 1.55; }
.how-step .step-label {
  position: absolute; top: 24px; right: 24px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-4);
}

/* ─── Case study preview ─── */
.case-list { display: grid; grid-template-columns: 1fr; gap: 0; }
.case-row {
  display: grid;
  grid-template-columns: 80px 2fr 1fr 1fr 60px;
  gap: 32px;
  padding: 40px 0;
  align-items: center;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding .3s var(--ease-out);
  position: relative;
}
.case-row:last-child { border-bottom: 1px solid var(--line); }
.case-row:hover { padding-left: 16px; }
.case-row .idx { font-family: var(--font-mono); font-size: 12px; color: var(--ink-4); letter-spacing: 0.1em; }
.case-row .name { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.02em; }
.case-row .industry { font-size: 13px; color: var(--ink-3); font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.case-row .result {
  font-family: var(--font-display); font-size: 24px; color: var(--brand-teal);
  letter-spacing: -0.02em;
}
.case-row .arr {
  justify-self: end;
  transition: transform .3s var(--ease-out);
  color: var(--ink-3);
}
.case-row:hover .arr { transform: translate(4px, -4px); color: var(--brand-teal); }
@media (max-width: 860px) {
  .case-row { grid-template-columns: 40px 1fr 60px; gap: 12px; }
  .case-row .industry, .case-row .result { display: none; }
}

/* ─── CTA band ─── */
.cta-band {
  padding: 160px var(--gutter);
  background: var(--bg);
  text-align: center;
  position: relative; overflow: hidden;
}
.cta-band .eyebrow { margin-bottom: 32px; }
.cta-band h2 {
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.98; letter-spacing: -0.03em;
  margin-bottom: 48px;
}
.cta-band h2 em { color: var(--brand-teal); font-style: italic; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Testimonial ─── */
.testimonial {
  padding: 140px var(--gutter);
  background: var(--bg-sub);
}
.testimonial-inner {
  max-width: 1000px; margin: 0 auto;
}
.testimonial blockquote {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 48px;
  text-wrap: balance;
}
.testimonial blockquote em { color: var(--brand-maroon); font-style: italic; }
.testimonial-who {
  display: flex; align-items: center; gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.testimonial-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-maroon), var(--brand-red));
}
.testimonial-who .name { font-weight: 500; }
.testimonial-who .role { color: var(--ink-3); font-size: 14px; }

/* ─── Form ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.form-field input, .form-field textarea, .form-field select {
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-card);
  transition: border-color .2s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--brand-teal);
}
.form-field textarea { min-height: 120px; resize: vertical; }

/* ─── Tweaks panel ─── */
.tweaks-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 320px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 12px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  z-index: 200;
  box-shadow: var(--shadow-2);
  display: none;
  border: 1px solid #2A2A27;
}
.tweaks-panel.active { display: block; }
.tweaks-panel h4 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand-teal);
  margin: 0 0 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-panel .tw-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-top: 1px solid #2A2A27;
}
.tweaks-panel .tw-row label {
  letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 10px; color: rgba(255,255,255,0.6);
}
.tweaks-panel .tw-row .ctrl {
  display: flex; gap: 4px;
}
.tweaks-panel button.sw {
  background: #2A2A27; color: #fff;
  border: 1px solid #3A3A37;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: all .2s;
}
.tweaks-panel button.sw.active {
  background: var(--brand-teal); border-color: var(--brand-teal); color: #001;
}
.tweaks-panel input[type="range"] { width: 120px; }
