/* ============================================================
   STYLES.CSS — Pranupong Saleephol Portfolio
   Order: tokens → base → typography → layout → components
          → sections → responsive → motion
   ============================================================ */

/* ─── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --bg:           #FAF7F2;
  --surface:      #FFFFFF;
  --surface-alt:  #F2EDE6;
  --ink:          #1F1B16;
  --muted:        #6B6257;
  --accent:       #B4552A;
  --accent-soft:  #EADFD5;
  --border:       #E4DCD1;

  --font-serif:   "Fraunces", "Instrument Serif", Georgia, serif;
  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max-w:        1120px;
  --px:           clamp(1rem, 4vw, 1.5rem);

  --radius-card:  14px;
  --radius-pill:  999px;

  --transition:   200ms ease;

  --shadow-soft:  0 1px 3px rgba(31,27,22,.06), 0 4px 14px rgba(31,27,22,.06);
}

/* ─── Dark mode ─────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #171412;
    --surface:     #211E1B;
    --surface-alt: #1C1A17;
    --ink:         #F2EDE6;
    --muted:       #A99D92;
    --accent:      #D4714A;
    --accent-soft: #3A2518;
    --border:      #322E2A;
    --shadow-soft: 0 1px 3px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  }
}

/* ─── 2. BASE RESET ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  min-height: 100dvh;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover {
  color: var(--ink);
}

/* Visible focus ring — never suppress without replacement */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─── 3. TYPOGRAPHY ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
}

p {
  color: var(--muted);
  max-width: 68ch;
}

/* Eyebrow */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* Pull-quote */
.pull-quote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin-top: 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

/* ─── 4. LAYOUT ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--px);
}

/* Section shared */
.section {
  padding-block: clamp(4rem, 8vw, 6.5rem);
}

.section--bg {
  background-color: var(--surface-alt);
}

.section__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

.section__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .section__inner {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

.section__body p + p {
  margin-top: 1.25rem;
}

/* ─── 5. COMPONENTS ─────────────────────────────────────────── */

/* --- Buttons -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.65em 1.5em;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--accent:hover,
.btn--accent:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--accent);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

/* --- Cards ---------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: 0 6px 24px rgba(31,27,22,.1);
  transform: translateY(-2px);
}

.card__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-serif);
}

.card__text {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: none;
}

/* --- Chips / Tags --------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.85em;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--ink);
  border: 1.5px solid transparent;
}

.chip--learning {
  border-style: dashed;
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

/* ─── 6. SECTIONS ───────────────────────────────────────────── */

/* --- Nav ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}

.nav__wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav__wordmark:hover {
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  padding: 0.4em 0.75em;
  border-radius: var(--radius-pill);
  transition: color var(--transition), background var(--transition);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav__cta {
  font-size: 0.825rem;
  padding: 0.5em 1.1em;
  flex-shrink: 0;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background var(--transition);
}

.nav__hamburger:hover,
.nav__hamburger:focus-visible {
  background: var(--accent-soft);
}

.hamburger-bar {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Hamburger open state */
.nav--open .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .hamburger-bar:nth-child(2) { opacity: 0; }
.nav--open .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 767px) {
  .nav__hamburger { display: flex; }
  .nav__cta       { display: none; }

  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem var(--px) 1rem;
    gap: 0.25rem;
    box-shadow: 0 16px 40px rgba(31,27,22,.14);
  }

  .nav--open .nav__links {
    display: flex;
  }

  .nav__link {
    padding: 0.7em 1em;
    font-size: 1rem;
  }
}

/* --- Hero ----------------------------------------------------- */
.hero {
  padding-block: clamp(5rem, 12vw, 8rem) clamp(3rem, 6vw, 5rem);
  background: var(--bg);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 768px) {
  .hero__inner {
    grid-template-columns: 1fr auto;
  }
}

.hero__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.hero__heading {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.hero__sub {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1.25rem;
  max-width: none;
}

.hero__pitch {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 2rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero visual */
.hero__visual {
  flex-shrink: 0;
}

.hero__gradient-frame {
  width: clamp(200px, 30vw, 280px);
  aspect-ratio: 4/5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero__gradient-frame svg {
  width: 100%;
  height: 100%;
}

/* --- Stats strip ---------------------------------------------- */
.stats-strip {
  background: var(--bg);
  border-block: 1px solid var(--border);
  padding-block: 2rem;
}

.stats-strip__inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 2rem;
}

@media (min-width: 640px) {
  .stats-strip__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-strip__inner {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat__value {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat__label {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* --- Project card enrichment (v3 Phase 1) -------------------- */

/* Subtitle — one-line plain-language label under the title */
.project-card__subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  max-width: none;
  margin-top: -0.35rem; /* tuck under title */
}

/* Badge row — role + status pills */
.project-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.7em;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--role {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1.5px solid var(--accent-soft);
}

.badge--status {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

/* Key contributions bullet list */
.project-card__contributions-title {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: none;
}

.project-card__contributions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0;
}

.project-card__contributions li {
  font-size: 0.875rem;
  color: var(--muted);
  padding-left: 1.1em;
  position: relative;
}

.project-card__contributions li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1.65;
}

/* Inline SVG diagram wrapper */
.project-card__diagram {
  width: 100%;
  border-radius: calc(var(--radius-card) - 2px);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.project-card__diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Project cards (Selected Work) -------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  box-shadow: 0 6px 24px rgba(31,27,22,.1);
  transform: translateY(-2px);
}

.project-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  max-width: none;
  border: 1.5px dashed var(--accent);
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

.project-card__title {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--ink);
}

.project-card__section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-card__section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: none;
}

.project-card__section-body {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: none;
}

/* Key-outcome rows — mirrors the reference's quantified result strip.
   Label on the left, a short bold value on the right. */
.project-card__outcomes {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.project-card__outcome {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.project-card__outcome-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.project-card__outcome-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

.project-card__outcomes-title {
  margin: 1rem 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* --- Process grid -------------------------------------------- */
.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .process-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.process-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.process-step__num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-soft);
  line-height: 1;
  margin-bottom: 0.5rem;
  /* Overlay style */
  color: var(--accent);
  opacity: 0.25;
}

.process-step__title {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.process-step__text {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: none;
}

/* --- Tech stack bento grid ------------------------------------ */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.bento-cell {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card, 1rem);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

/* Cell 1 and Cell 3 span 2 columns on ≥640 px */
@media (min-width: 640px) {
  .bento-cell--wide {
    grid-column: span 2;
  }
}

/* Cell 4 — Currently Exploring: visually distinct border */
.bento-cell--learning {
  border-style: dashed;
  border-color: var(--accent);
  background: transparent;
}

.bento-cell__title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.bento-cell--learning .bento-cell__title {
  color: var(--accent);
}

.bento-cell__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --- Timeline ------------------------------------------------ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--border);
  padding-left: clamp(1.25rem, 3vw, 2rem);
  margin-left: 0.5rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.25rem, 3vw, 2rem) - 1px + 0.5px);
  top: 0.35rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
  transform: translateX(-50%);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.timeline-item__date {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2em 0.7em;
  border-radius: var(--radius-pill);
  margin-bottom: 0;
}

.timeline-item__title {
  font-size: 1.1rem;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
}

.timeline-item__company {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.75rem;
  max-width: none;
}

.timeline-item__list {
  list-style: disc;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-item__list li {
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Timeline location badge + tech tags (v3 Phase 3) -------- */
.timeline-item__location {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.2em 0.65em;
  border-radius: var(--radius-pill);
  margin-top: 0.3rem;
}

.timeline-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* --- Superpowers --------------------------------------------- */
.superpower-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .superpower-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.superpower-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.superpower-item__title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.superpower-item p {
  font-size: 0.9rem;
  max-width: none;
}

/* --- Contact -------------------------------------------------- */
.contact-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 560px;
}

.contact-tagline {
  font-size: 1.05rem;
  font-family: var(--font-serif);
  color: var(--muted);
  max-width: 52ch;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
}

.contact-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.contact-list__icon {
  flex-shrink: 0;
  width: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-list__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.contact-list__item a {
  color: var(--ink);
}

.contact-list__item a:hover {
  color: var(--accent);
}

.contact-cta {
  align-self: flex-start;
}

/* --- Footer --------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding-block: 1.75rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-footer__copy {
  font-size: 0.825rem;
  color: var(--border);
  max-width: none;
}

.site-footer__links {
  display: flex;
  gap: 1.25rem;
}

.site-footer__links a {
  font-size: 0.825rem;
  color: var(--border);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer__links a:hover {
  color: var(--accent);
}

/* ─── 7. SCROLL REVEAL ──────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Grid containers fade only; the slide is carried by the
   per-child stagger below. Without this the container
   translate compounds with the children's own translate. */
.card-grid[data-reveal],
.stats-strip__inner[data-reveal],
.process-grid[data-reveal],
.superpower-grid[data-reveal],
.projects-grid[data-reveal] {
  transform: none;
}

/* Staggered cascade for grouped items (cards, stats, steps,
   superpowers, project cards) — mirrors the reference's
   per-item FadeIn delay. The grid container carries
   data-reveal and receives .is-visible. */
.card-grid .card,
.stats-strip__inner .stat,
.process-grid .process-step,
.superpower-grid .superpower-item,
.projects-grid .project-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.card-grid.is-visible .card,
.stats-strip__inner.is-visible .stat,
.process-grid.is-visible .process-step,
.superpower-grid.is-visible .superpower-item,
.projects-grid.is-visible .project-card {
  opacity: 1;
  transform: none;
}

.card-grid .card:nth-child(1),
.stats-strip .stat:nth-child(1),
.process-grid .process-step:nth-child(1),
.superpower-grid .superpower-item:nth-child(1),
.projects-grid .project-card:nth-child(1) { transition-delay: 0.05s; }

.card-grid .card:nth-child(2),
.stats-strip .stat:nth-child(2),
.process-grid .process-step:nth-child(2),
.superpower-grid .superpower-item:nth-child(2),
.projects-grid .project-card:nth-child(2) { transition-delay: 0.15s; }

.card-grid .card:nth-child(3),
.stats-strip .stat:nth-child(3),
.process-grid .process-step:nth-child(3),
.superpower-grid .superpower-item:nth-child(3) { transition-delay: 0.25s; }

.card-grid .card:nth-child(4),
.stats-strip .stat:nth-child(4),
.process-grid .process-step:nth-child(4),
.superpower-grid .superpower-item:nth-child(4) { transition-delay: 0.35s; }

.process-grid .process-step:nth-child(5) { transition-delay: 0.45s; }
.process-grid .process-step:nth-child(6) { transition-delay: 0.55s; }

/* ─── 8. REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Staggered children must also be forced visible when motion is off */
  .card,
  .stat,
  .process-step,
  .superpower-item,
  .project-card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .nav__link,
  .site-header {
    transition: none;
  }
}

/* ─── 9. RESPONSIVE OVERFLOW GUARD ─────────────────────────── */
/* Prevent horizontal scroll at any viewport */
html, body {
  overflow-x: hidden;
}

.section__inner,
.hero__inner,
.nav__inner,
.stats-strip__inner,
.site-footer__inner {
  min-width: 0;
}

/* On small phones (< 360px guard) */
@media (max-width: 380px) {
  .hero__ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
