/* =================================================================
   vatan.app — Case Study
   Faithful build of the Figma source (node 57:2).
   Fonts: Geist (display/body) · JetBrains Mono (labels)
   ================================================================= */

:root {
  /* Surfaces */
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #1e1e1e;
  --border-strong: #2a2a2a;

  /* Text */
  --text: #ededed;
  --muted: #8a8a8a;

  /* Accent (violet) */
  --accent: #a78bfa;
  --accent-tint: rgba(167, 139, 250, 0.10);
  --accent-border: rgba(167, 139, 250, 0.40);
  --on-accent: #0a0a0a;

  /* Layout */
  --maxw: 1440px;
  --pad-x: 60px;

  /* Type */
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* ----------------------------- Reset ----------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ----------------------------- Helpers ----------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.num { color: var(--accent); }

/* A standard content section */
.section { padding-block: 110px; }
.section--bordered { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Shared section header: index column + heading/lead */
.section-head {
  display: flex;
  gap: 56px;
  align-items: flex-start;
  margin-bottom: 56px;
}
.section-head__index {
  flex: 0 0 220px;
  font-size: 12px;
  letter-spacing: 1.44px;
  color: var(--muted);
  padding-top: 6px;
}
.section-head__body { flex: 1 1 auto; min-width: 0; }

.h2 {
  font-weight: 600;
  font-size: 64px;
  line-height: 1.0;
  letter-spacing: -1.92px;
  color: var(--text);
}
.h2--sm { font-size: 40px; line-height: 1.1; letter-spacing: -1.2px; }

.lead {
  margin-top: 18px;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
}
.lead--sm { max-width: 620px; font-size: 16px; line-height: 1.6; }

.kicker {
  font-size: 12px;
  letter-spacing: 1.68px;
  color: var(--muted);
}

/* =================================================================
   CS01 · Breadcrumb
   ================================================================= */
.breadcrumb {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.breadcrumb__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.breadcrumb__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: opacity .2s ease;
}
.breadcrumb__link:hover { opacity: .7; }
.breadcrumb__link .mono { font-size: 12px; font-weight: 500; letter-spacing: 1.2px; }
.breadcrumb__center { font-size: 12px; letter-spacing: 1.44px; color: var(--muted); }
.arrow { color: var(--accent); font-weight: 700; font-size: 14px; line-height: 1; }

/* =================================================================
   CS02 · Hero
   ================================================================= */
.hero { padding-block: 80px 64px; }
.hero__inner { display: flex; flex-direction: column; gap: 56px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .96px;
  white-space: nowrap;
}
.badge--accent {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent);
}

.hero__title { display: flex; flex-direction: column; gap: 28px; }
.hero__name {
  font-weight: 600;
  font-size: 132px;
  line-height: 0.9;
  letter-spacing: -5.28px;
  color: var(--text);
}
.hero__desc {
  max-width: 900px;
  font-size: 24px;
  line-height: 1.45;
  letter-spacing: -0.24px;
  color: var(--muted);
}
.hero__media {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1320 / 620;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* =================================================================
   CS03 · Overview — meta grid
   ================================================================= */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.meta-cell {
  background: var(--surface);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.meta-cell dt { margin: 0; }
.meta-cell dd {
  margin: 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.16px;
  color: var(--text);
}

/* =================================================================
   CS04 · Challenge
   ================================================================= */
.challenge__body { display: flex; gap: 80px; align-items: flex-start; }
.challenge__copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.prose-lg { font-size: 20px; line-height: 1.6; letter-spacing: -0.2px; color: var(--text); }
.prose-muted { font-size: 17px; line-height: 1.7; color: var(--muted); }

.constraints {
  flex: 0 0 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.constraint {
  display: flex;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}
.constraint:last-child { border-bottom: 0; }
.constraint__tag {
  flex: 0 0 36px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .96px;
  padding-top: 1px;
}
.constraint__title { font-weight: 500; font-size: 16px; letter-spacing: -0.16px; color: var(--text); margin-bottom: 6px; }
.constraint__desc { font-size: 14px; line-height: 1.55; color: var(--muted); }

/* =================================================================
   CS05 · Approach — steps
   ================================================================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step__eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.step__eyebrow .num { font-weight: 700; letter-spacing: .96px; }
.step__label { color: var(--text); font-weight: 500; letter-spacing: 1.68px; }
.step__title { font-weight: 500; font-size: 22px; line-height: 1.25; letter-spacing: -0.22px; color: var(--text); }
.step__desc { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* =================================================================
   CS06 / CS07 / CS08 — figures & subheads
   ================================================================= */
.shot {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.shot img { width: 100%; }
.shot--plain { border-radius: 16px; }

.figcap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.figcap .num { letter-spacing: 1.2px; }
.figcap__no { color: var(--muted); }

.subhead { text-align: center; margin-top: 56px; margin-bottom: 32px; }
.subhead__title { font-weight: 600; font-size: 40px; line-height: 1.1; letter-spacing: -1.2px; color: var(--text); }
.subhead__sub { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.subhead--left { text-align: left; }
.subhead--left .subhead__title { font-size: 32px; letter-spacing: -0.96px; }
.subhead--left .subhead__sub { max-width: 740px; }

/* Figures with the caption ABOVE the image (App + AI Generation) */
.fig { display: flex; flex-direction: column; gap: 16px; }
.fig + .subhead, .fig + .fig { margin-top: 56px; }
.fig__cap { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; letter-spacing: 1.2px; color: var(--muted); white-space: nowrap; }
.fig__cap .num { letter-spacing: 1.2px; }
.fig__img { width: 100%; height: auto; border-radius: 12px; }
.fig--phones .fig__img { max-width: 1064px; margin-inline: auto; border-radius: 0; }

/* =================================================================
   CS07 · System — panels, swatches, ramp, spacing
   ================================================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.panel:last-child { margin-bottom: 0; }
.panel__title { margin-top: 8px; font-weight: 500; font-size: 22px; letter-spacing: -0.22px; color: var(--text); }

.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.panel-row .panel { margin-bottom: 0; }

/* swatches */
.swatches {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.swatch { display: flex; flex-direction: column; }
.swatch__chip {
  height: 64px;
  border-radius: 10px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.swatch__name { margin-top: 12px; font-size: 12px; font-weight: 500; letter-spacing: .5px; color: var(--text); }
.swatch__hex { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* type ramp */
.ramp { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.ramp__row { display: flex; align-items: baseline; gap: 24px; }
.ramp__aa { font-weight: 600; color: var(--text); width: 140px; flex: 0 0 140px; line-height: 1; }
.ramp__meta { font-size: 12px; letter-spacing: 1px; color: var(--muted); }

/* spacing scale */
.spacing { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; }
.spacing__row { display: flex; align-items: center; }
.spacing__track {
  position: relative;
  flex: 0 0 88px;
  height: 14px;
  display: flex;
  align-items: center;
}
.spacing__track::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--border-strong);
}
.spacing__bar {
  position: relative;
  z-index: 1;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
}
.spacing__label { font-size: 12px; letter-spacing: .5px; color: var(--muted); }
.spacing__label b { color: var(--text); font-weight: 500; }

/* =================================================================
   CS09 · Outcomes — stat band + list
   ================================================================= */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0;
}
.stat { background: var(--surface); padding: 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.stat__num { font-weight: 500; font-size: 52px; line-height: 1; letter-spacing: -1.56px; color: var(--text); }
.stat__label { font-size: 12px; letter-spacing: 1.44px; color: var(--muted); }

.outcomes { margin-top: 24px; border: 1px solid var(--border); }
.outcome {
  display: flex;
  gap: 56px;
  padding: 28px;
  border-bottom: 1px solid var(--border);
}
.outcome:last-child { border-bottom: 0; }
.outcome__tag { flex: 0 0 160px; color: var(--accent); font-size: 12px; font-weight: 500; letter-spacing: 1.44px; padding-top: 6px; }
.outcome__text { flex: 1 1 auto; min-width: 0; font-weight: 500; font-size: 22px; line-height: 1.4; letter-spacing: -0.22px; color: var(--text); }

/* =================================================================
   CS10 · Reflection — quote
   ================================================================= */
.quote { display: flex; gap: 32px; align-items: flex-start; }
.quote__mark { flex: 0 0 120px; font-weight: 600; font-size: 120px; line-height: 0.8; color: var(--accent); }
.quote__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.quote__text { font-weight: 500; font-size: 36px; line-height: 1.4; letter-spacing: -0.72px; color: var(--text); }
.quote__cite { font-style: normal; font-size: 12px; letter-spacing: 1.2px; color: var(--muted); }

/* =================================================================
   CS11 · Next
   ================================================================= */
.next { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding-block: 110px; }
.next__inner { display: flex; flex-direction: column; gap: 40px; }
.next__eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 1.68px; color: var(--muted); }
.next__row { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.next__lead { display: flex; flex-direction: column; gap: 18px; }
.next__name { font-weight: 600; font-size: 88px; line-height: 0.95; letter-spacing: -2.64px; color: var(--text); }
.next__desc { max-width: 560px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.next__cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 22px 32px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.next__cta span:first-child { font-weight: 600; font-size: 18px; letter-spacing: -0.18px; }
.next__cta .arrow { color: var(--on-accent); font-size: 20px; }
.next__cta:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(167, 139, 250, 0.3); }

/* =================================================================
   CS12 · Footer
   ================================================================= */
.footer { border-top: 1px solid var(--border); padding-block: 28px 36px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer__copy, .footer__meta { font-size: 12px; letter-spacing: .96px; color: var(--muted); }
.footer__meta { display: inline-flex; align-items: center; gap: 10px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* =================================================================
   Subtle entrance animation (CSS-only, flash-free).
   The from-state is applied on first paint (CSS is render-blocking),
   so there is no flash-of-hidden-content and no JS dependency.
   ================================================================= */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
  main > section,
  .footer {
    animation: fadeUp .6s cubic-bezier(.22, .61, .36, 1) both;
  }
}

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 1200px) {
  :root { --pad-x: 40px; }
  .hero__name { font-size: clamp(72px, 11vw, 132px); letter-spacing: -0.04em; }
  .h2 { font-size: clamp(40px, 5.2vw, 64px); letter-spacing: -0.03em; }
  .next__name { font-size: clamp(56px, 8vw, 88px); letter-spacing: -0.03em; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .section { padding-block: 80px; }
  .section-head { flex-direction: column; gap: 20px; }
  .section-head__index { flex-basis: auto; padding-top: 0; }
  .challenge__body { flex-direction: column; gap: 40px; }
  .constraints { flex-basis: auto; width: 100%; align-self: stretch; }
  .steps { grid-template-columns: 1fr; }
  .panel-row { grid-template-columns: 1fr; }
  .next__row { flex-direction: column; align-items: flex-start; }
  .quote { gap: 20px; }
  .quote__mark { flex-basis: 64px; font-size: 80px; }
}

@media (max-width: 720px) {
  :root { --pad-x: 22px; }
  /* tighter, even mobile rhythm — ~52px between sections (was up to 160px) */
  .section { padding-block: 26px; }
  .next { padding-block: 36px; }
  .section-head { margin-bottom: 26px; }
  .subhead { margin-top: 32px; margin-bottom: 20px; }
  .fig + .subhead, .fig + .fig { margin-top: 32px; }
  .hero { padding-block: 56px 40px; }
  .hero__inner { gap: 40px; }
  .hero__desc { font-size: 19px; }
  .meta-grid { grid-template-columns: 1fr; }
  .stat-band { grid-template-columns: 1fr 1fr; }
  .stat { padding: 24px 20px; }
  .stat__num { font-size: 40px; letter-spacing: -1.2px; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .ramp__aa { width: 96px; flex-basis: 96px; }
  .outcome { flex-direction: column; gap: 12px; }
  .outcome__tag { padding-top: 0; }
  .outcome__text { font-size: 19px; }
  .quote__text { font-size: 26px; letter-spacing: -0.4px; }
  .breadcrumb__center { display: none; }
  .h2--sm, .subhead__title { font-size: 30px; letter-spacing: -0.6px; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .next__cta { transition: none; }
}
