/* ═══════════════════════════════════════════════════════
   SELF-HOSTED FONTS
   Downloaded latin subsets only — no Google Fonts CDN needed.
   DM Sans and Playfair Display are variable fonts so each
   weight declaration shares the same woff2 file.

   font-display: optional — with rel=preload the font is ready
   before first paint so it's used immediately with zero CLS.
   On the rare case it misses the window the size-adjusted
   fallback faces below minimise any reflow.
═══════════════════════════════════════════════════════ */

/* DM Sans — latin — weights 300 / 400 / 500 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 500;
  font-display: optional;
  src: url('assets/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Playfair Display — latin — weights 400 / 700, normal */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url('assets/fonts/playfair-display-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Playfair Display — latin — weights 400 / 700, italic */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: optional;
  src: url('assets/fonts/playfair-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Size-adjusted fallback faces — minimise reflow if fonts miss the
   optional window. Georgia scaled to match Playfair Display's cap
   height (~0.70 vs 0.66 → 106%). system-ui scaled to DM Sans (~102%). */
@font-face {
  font-family: 'Playfair Display Fallback';
  src: local('Georgia');
  size-adjust: 106%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'DM Sans Fallback';
  src: local('Arial');
  size-adjust: 102%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* ═══════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
═══════════════════════════════════════════════════════ */
:root {
  --pink-deep:       #C1445E;
  --green-tropical:  #2D6A4F;
  --coral-sunset:    #E8735A;
  --cream-warm:      #F5EDD8;
  --green-forest:    #1A3D2B;
  --sand-muted:      #C8B89A;
  --off-white:       #FAF7F2;
  --font-serif:      'Playfair Display', 'Playfair Display Fallback', Georgia, serif;
  --font-sans:       'DM Sans', 'DM Sans Fallback', system-ui, sans-serif;
  --section-py:      120px;
  --container-w:     1100px;
  --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h:           64px;
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  /* No scroll-behavior:smooth — JS handles it to avoid double-animation */
}

body {
  font-family: var(--font-sans);
  background-color: var(--off-white);
  color: var(--green-forest);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════════════ */
h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.15;
}

h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.75;
  color: var(--green-forest);
  opacity: 0.9;
}

em { font-style: italic; }
strong { font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   LAYOUT UTILITIES
═══════════════════════════════════════════════════════ */
.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.section-eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral-sunset);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--green-forest);
  margin-bottom: 3rem;
}

.section-header {
  margin-bottom: 3.5rem;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  background-color: var(--pink-deep);
  color: white;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.2s ease;
  border: 2px solid transparent;
}

.btn:hover {
  background-color: var(--coral-sunset);
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--coral-sunset);
  outline-offset: 3px;
}

.btn--outline {
  background-color: transparent;
  border-color: var(--green-tropical);
  color: var(--green-tropical);
  margin-top: 2rem;
}

.btn--outline:hover {
  background-color: var(--green-tropical);
  color: white;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS
═══════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.22s; }
.reveal--delay-3 { transition-delay: 0.38s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ═══════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background-color: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 184, 154, 0.3);
  opacity: 0;
  transform: translateY(-100%);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  pointer-events: none;
}

.site-nav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-inner {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pink-deep);
  letter-spacing: 0.04em;
  margin-right: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--green-forest);
  padding: 0.4rem 0.75rem;
  border-radius: 3px;
  transition: color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background-color: var(--coral-sunset);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--pink-deep);
}

.nav-link.is-active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link--cta {
  background-color: var(--pink-deep);
  color: white !important;
  padding: 0.4rem 1rem;
  margin-left: 0.5rem;
}

.nav-link--cta::after { display: none; }

.nav-link--cta:hover {
  background-color: var(--coral-sunset);
}

/* Burger button */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.nav-burger:hover { background-color: rgba(193, 68, 94, 0.08); }

.burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--green-forest);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-burger[aria-expanded="true"] .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] .burger-line:nth-child(2) {
  opacity: 0;
}
.nav-burger[aria-expanded="true"] .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════════
   PARALLAX LAYER CONTAINERS
═══════════════════════════════════════════════════════ */
.parallax-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  /* will-change on container only, not individual images */
  will-change: transform;
}

/* ═══════════════════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════════════════ */

/* Tall scroll container — hero pins inside while leaves scatter */
.hero-scroll-track {
  height: 300vh;
  position: relative;
}

#hero {
  position: sticky;
  top: 0;
  height: 100vh;          /* fixed height required for sticky scroll math */
  background: linear-gradient(135deg, #F9EDD5 0%, #F0D8C8 40%, #E8C4B8 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* ─── Three depth-of-field layer wrappers ─────────────────────────
   Each fills #hero (position:absolute inset:0) at its own z-index.
   hero__inner sits at z:2, so BG(1) is behind content, MG(5) and
   FG(10) are in front. pointer-events:none so leaves don't block clicks.
──────────────────────────────────────────────────────────────────── */

.layer-foreground,
.layer-midground,
.layer-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer-foreground { z-index: 10; }
.layer-midground  { z-index: 5;  }
.layer-background { z-index: 1;  }

/* ─── Depth-of-field leaf classes ──────────────────────────────────
   CSS sets initial blur/brightness. JS animates filter on .leaf-fg
   (blur 8px→0, brightness 0.8→1.0 as they scatter). .leaf-bg blur
   is static (4px). will-change scoped per class.
──────────────────────────────────────────────────────────────────── */

/* Foreground — closest, largest, scatter fastest */
.leaf-fg {
  will-change: transform, opacity;
}

/* Midground — medium, standard fade */
.leaf-mg {
  will-change: transform, opacity;
}

/* Background — farthest, scale(0.85) in JS, slightly dimmed */
.leaf-bg {
  opacity: 0.65;
  will-change: transform, opacity;
}

/* ─── Hero jungle botanical positions ─────────────────────────────
   16 elements framing left/right edges, centre-safe zone.
   No CSS transform here — rotations/flips live in data-base-transform
   so the JS scatter translate always moves in world space.
────────────────────────────────────────────────────────────────── */

/* Background layer — 4 corner anchors */
.hero__leaf-b1 {
  position: absolute;
  top: 5%;
  left: -4%;
  width: clamp(120px, 18vw, 240px);
}

.hero__leaf-b2 {
  position: absolute;
  top: 8%;
  right: -4%;
  width: clamp(130px, 20vw, 260px);
}

.hero__leaf-b3 {
  position: absolute;
  bottom: -5%;
  left: 2%;
  width: clamp(160px, 22vw, 290px);
}

.hero__leaf-b4 {
  position: absolute;
  bottom: -3%;
  right: 3%;
  width: clamp(150px, 21vw, 280px);
}

/* Midground layer — 5 leaves */
.hero__leaf-m1 {
  position: absolute;
  top: 0%;
  left: 0%;
  width: clamp(200px, 34vw, 440px);
}

.hero__leaf-m2 {
  position: absolute;
  top: -2%;
  right: -2%;
  width: clamp(200px, 36vw, 460px);
}

.hero__leaf-m3 {
  position: absolute;
  top: 35%;
  left: -3%;
  width: clamp(170px, 28vw, 360px);
}

.hero__leaf-m4 {
  position: absolute;
  top: 30%;
  right: -3%;
  width: clamp(170px, 29vw, 370px);
}

.hero__leaf-m5 {
  position: absolute;
  bottom: -4%;
  left: -2%;
  width: clamp(190px, 32vw, 420px);
}

/* Midground layer — 3 flower accents */
.hero__flower-m6 {
  position: absolute;
  top: 22%;
  left: -5%;
  width: clamp(160px, 22vw, 290px);
}

.hero__flower-m7 {
  position: absolute;
  top: 18%;
  right: -5%;
  width: clamp(150px, 21vw, 280px);
}

.hero__flower-m8 {
  position: absolute;
  bottom: -6%;
  left: 12%;
  width: clamp(180px, 26vw, 340px);
}

/* Foreground layer — 3 huge leaves */
.hero__leaf-f1 {
  position: absolute;
  top: -5%;
  left: -3%;
  width: clamp(280px, 48vw, 620px);
}

.hero__leaf-f2 {
  position: absolute;
  top: -8%;
  right: -4%;
  width: clamp(260px, 46vw, 600px);
}

.hero__leaf-f3 {
  position: absolute;
  bottom: -6%;
  right: -3%;
  width: clamp(240px, 42vw, 540px);
}

/* Foreground layer — corner flower accent (dimmer) */
.hero__flower-f4 {
  position: absolute;
  top: 2%;
  right: 5%;
  width: clamp(100px, 14vw, 180px);
  opacity: 0.75;
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block: var(--section-py);
}

/* Portrait */
.hero__portrait-wrap {
  position: relative;
  width: fit-content;
  justify-self: end;
}

/* Warm tint overlay — multiply blends the coral into the photo */
.hero__portrait-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: var(--coral-sunset);
  opacity: 0.18;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.hero__portrait {
  width: 100%;
  max-width: 320px;
  border-radius: 4px;
  /* Desaturate slightly and warm up to match cream/coral palette */
  filter: saturate(0.78) sepia(0.18) brightness(0.97);
  box-shadow:
    0 20px 60px rgba(26, 61, 43, 0.12),
    0 4px 16px rgba(26, 61, 43, 0.08);
}

/* Hero text */
.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral-sunset);
  margin-bottom: 0;
}

.hero__name {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--green-forest);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero__tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--pink-deep);
  line-height: 1.4;
}

.hero__intro {
  max-width: 40ch;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--green-forest);
  opacity: 0.85;
}

.hero__cta {
  margin-top: 0.5rem;
}

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4; /* above jungle layer */
}

.scroll-line {
  display: block;
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--sand-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* Hero: prefers-reduced-motion — collapse track, restore normal scroll */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-track {
    height: auto;
  }
  #hero {
    position: relative;
    height: auto;
    min-height: 100vh;
  }
  /* Hide all botanical layers when motion is reduced */
  .layer-foreground,
  .layer-midground,
  .layer-background {
    display: none;
  }
}

/* Reduced-motion on mobile: restore nav-height padding (nav is visible) */
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
  .hero__inner {
    padding-top: calc(var(--section-py) + var(--nav-h));
  }
}

/* ═══════════════════════════════════════════════════════
   CHAPTER SECTIONS
═══════════════════════════════════════════════════════ */
.chapter {
  position: relative;
  overflow: hidden;
  background-color: var(--chapter-bg, var(--off-white));
  transition: background-color 0.6s ease;
  padding-block: var(--section-py);
}

/* Chapter bg colors per data-chapter */
[data-chapter="1"] { --chapter-bg: #FAF7F2; }
[data-chapter="2"] { --chapter-bg: #F3EDE4; }
[data-chapter="3"] { --chapter-bg: #EAF0EB; }
[data-chapter="4"] { --chapter-bg: #F0EBF5; }

.chapter__botanicals {
  z-index: 0;
}

/* Botanical positions per chapter */
.chapter__leaf--br {
  position: absolute;
  bottom: -60px;
  right: -30px;
  width: clamp(150px, 22vw, 300px);
  opacity: 0.4;
  transform: rotate(15deg);
}

.chapter__vine--left {
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  width: clamp(40px, 7vw, 80px);
  opacity: 0.35;
}

.chapter__hibiscus--tr {
  position: absolute;
  top: 40px;
  right: 5%;
  width: clamp(80px, 12vw, 160px);
  opacity: 0.35;
}

.chapter__palm--tl {
  position: absolute;
  top: -20px;
  left: -40px;
  width: clamp(150px, 25vw, 340px);
  opacity: 0.35;
  transform: scaleX(-1) rotate(-10deg);
}

.chapter__leaf--br-alt {
  position: absolute;
  bottom: -40px;
  right: 8%;
  width: clamp(120px, 18vw, 240px);
  opacity: 0.35;
  transform: rotate(-20deg) scaleX(-1);
}

.chapter__vine--right-alt {
  position: absolute;
  right: 3%;
  top: 0;
  bottom: 0;
  width: clamp(40px, 6vw, 70px);
  opacity: 0.3;
  transform: scaleX(-1);
}

.chapter__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

/* Chapter meta (number + label) */
.chapter__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
}

.chapter__number {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  color: var(--pink-deep);
  opacity: 0.15;
  line-height: 1;
  letter-spacing: -0.02em;
}

.chapter__label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral-sunset);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: 0.75rem;
}

.chapter__content {
  max-width: 680px;
}

.chapter__heading {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--green-forest);
  margin-bottom: 2rem;
  line-height: 1.2;
}

.chapter__heading em {
  color: var(--pink-deep);
  display: block;
}

.chapter__body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Place tags */
.chapter__places {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.place-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--sand-muted);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--green-tropical);
  background-color: rgba(255,255,255,0.5);
}

/* Chapter quote */
.chapter__quote {
  border-left: 3px solid var(--pink-deep);
  padding-left: 1.5rem;
  margin-top: 2.5rem;
}

.chapter__quote p {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-style: italic;
  color: var(--green-forest);
  opacity: 1;
}

/* Malaysia facts */
.chapter__facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background-color: rgba(255,255,255,0.5);
  border-radius: 6px;
  border: 1px solid rgba(45, 106, 79, 0.15);
}

.fact-icon {
  font-size: 1.1rem;
}

.fact-text {
  font-size: 0.85rem;
  color: var(--green-forest);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════
   NEUROMARK MOCK ANIMATION
═══════════════════════════════════════════════════════ */
.neuromark-mock {
  margin-top: 2.5rem;
  padding: 2.5rem;
  background-color: rgba(255,255,255,0.7);
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.mock-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.mock-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 10px;
  background-color: white;
  border: 2px solid rgba(45, 106, 79, 0.15);
  min-width: 130px;
  opacity: 0.3;
  transform: translateY(8px);
  transition:
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s ease;
}

.mock-step.is-active {
  opacity: 1;
  transform: translateY(0);
  border-color: var(--green-tropical);
}

.mock-step__icon {
  width: 48px;
  height: 48px;
  color: var(--green-tropical);
}

.mock-step.is-active .mock-step__icon {
  animation: iconPulse 1.5s ease-in-out;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.1); }
}

.mock-step__label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--green-forest);
  opacity: 0.8;
}

.mock-arrow {
  width: 40px;
  height: 16px;
  color: var(--sand-muted);
  flex-shrink: 0;
}

.mock-caption {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-muted);
}

/* ═══════════════════════════════════════════════════════
   PORTFOLIO SECTION
═══════════════════════════════════════════════════════ */

@keyframes portfolio-card-flash {
  0%   { background-color: white; }
  40%  { background-color: #F0EBF5; }
  100% { background-color: white; }
}

/* No fill-mode: after animation ends, background-color reverts to the
   value defined in CSS (white for regular cards, transparent for the
   featured gradient card — so the gradient reappears naturally). */
.portfolio-card.is-flashing {
  animation: portfolio-card-flash 0.65s ease-out;
}
#portfolio {
  padding-block: var(--section-py);
  background-color: var(--cream-warm);
}

.portfolio__inner {
  /* container handles layout */
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.portfolio-card {
  background-color: white;
  border-radius: 10px;
  padding: 2rem;
  border: 1px solid rgba(200, 184, 154, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(26, 61, 43, 0.1);
}

.portfolio-card--featured {
  background: linear-gradient(135deg, #F0EBF5 0%, #E8EFF5 100%);
  border-color: rgba(45, 106, 79, 0.25);
}

.portfolio-card__tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-sunset);
}

.portfolio-card__title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-forest);
}

.portfolio-card__desc {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--green-forest);
  opacity: 0.8;
  flex: 1;
}

.portfolio-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(200, 184, 154, 0.4);
}

.portfolio-card__status {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.portfolio-card__status--live {
  background-color: rgba(45, 106, 79, 0.12);
  color: var(--green-tropical);
}

.portfolio-card__status--wip {
  background-color: rgba(232, 115, 90, 0.12);
  color: var(--coral-sunset);
}

.portfolio-card__link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--pink-deep);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.portfolio-card__link:hover {
  color: var(--coral-sunset);
  transform: translateX(2px);
}

/* ═══════════════════════════════════════════════════════
   PORTFOLIO / PHILOSOPHY DIVIDER FLOWER
═══════════════════════════════════════════════════════ */
.flower-divider {
  position: relative;
  height: 0;
  pointer-events: none;
  z-index: 5; /* above both adjacent sections */
}

.flower-divider__img {
  position: absolute;
  top: 0;
  left: 50%;
  width: clamp(60px, 8vw, 100px);
  transform: translate(-50%, -50%);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .flower-divider { display: none; }
}

@media (max-width: 480px) {
  .flower-divider { display: none; }
}

/* ═══════════════════════════════════════════════════════
   PHILOSOPHY SECTION
═══════════════════════════════════════════════════════ */
#philosophy {
  padding-block: var(--section-py);
  background-color: var(--green-forest);
  position: relative;
  overflow: hidden;
}

#philosophy .section-eyebrow {
  color: var(--sand-muted);
}

#philosophy .section-heading {
  color: var(--cream-warm);
}

.philosophy-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.philosophy-item {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  font-style: italic;
  color: var(--cream-warm);
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(200, 184, 154, 0.15);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  line-height: 1.2;
}

.philosophy-item:last-child {
  border-bottom: none;
}

.philosophy-marker {
  color: var(--pink-deep);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: clamp(1rem, 2vw, 1.5rem);
  flex-shrink: 0;
}

.philosophy__botanical {
  position: absolute;
  bottom: -60px;
  right: -40px;
  width: clamp(150px, 20vw, 260px);
  opacity: 0.15;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   CONTACT SECTION
═══════════════════════════════════════════════════════ */
#contact {
  padding-block: var(--section-py);
  background: linear-gradient(135deg, #F5EDD8 0%, #EAE0D0 100%);
  position: relative;
  overflow: hidden;
}

.contact__botanicals {
  z-index: 0;
}

.contact__palm {
  position: absolute;
  top: -40px;
  right: -30px;
  width: clamp(150px, 22vw, 320px);
  opacity: 0.2;
}

.contact__leaf {
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: clamp(120px, 18vw, 240px);
  opacity: 0.2;
  transform: rotate(30deg);
}

.contact__inner {
  position: relative;
  z-index: 1;
}

.contact__tagline {
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 50ch;
  margin-bottom: 3rem;
  color: var(--green-forest);
  opacity: 0.8;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease;
}

.contact__link:hover {
  transform: translateY(-2px);
}

.contact__link--email {
  background-color: var(--pink-deep);
  color: white;
}

.contact__link--email:hover {
  background-color: var(--coral-sunset);
}

.contact__link--linkedin {
  background-color: transparent;
  border-color: var(--green-tropical);
  color: var(--green-tropical);
}

.contact__link--linkedin:hover {
  background-color: var(--green-tropical);
  color: white;
}

.contact__link--neuromark {
  background-color: transparent;
  border-color: var(--sand-muted);
  color: var(--green-forest);
}

.contact__link--neuromark:hover {
  background-color: var(--green-forest);
  color: var(--cream-warm);
  border-color: var(--green-forest);
}

.contact__link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact__link-icon svg {
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.site-footer {
  background-color: var(--green-forest);
  padding-block: 2rem;
}

.footer__text {
  font-size: 0.8rem;
  color: var(--sand-muted);
  opacity: 0.7;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — 768px
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --section-py: 72px;
  }

  /* Hero → single column, portrait on top.
     Nav is hidden during sticky hero reveal, so no extra nav-h offset. */
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: var(--section-py);
    text-align: center;
  }

  .hero__portrait-wrap {
    justify-self: center;
    order: -1;
  }

  .hero__portrait {
    max-width: 280px;
  }

  .hero__text {
    align-items: center;
  }

  .hero__intro {
    max-width: 100%;
  }

  /* Chapter → single column */
  .chapter__inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .chapter__meta {
    flex-direction: row;
    gap: 1rem;
  }

  .chapter__label {
    writing-mode: horizontal-tb;
    transform: none;
    margin-top: 0;
  }

  .chapter__number {
    font-size: 2.5rem;
    opacity: 0.2;
  }

  /* Portfolio → 1 col */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Philosophy font reduce */
  .philosophy-item {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

  /* Nav: burger on, links hidden by default */
  .nav-burger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background-color: var(--off-white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
  }

  .nav-links.is-open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
  }

  .nav-link--cta {
    margin-left: 0;
    margin-top: 1rem;
  }

  /* NeuroMark mock on mobile */
  .mock-pipeline {
    flex-direction: column;
    gap: 0.5rem;
  }

  .mock-arrow {
    transform: rotate(90deg);
  }

  /* Facts grid on mobile */
  .chapter__facts {
    grid-template-columns: 1fr;
  }

  /* Contact links */
  .contact__links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact__link {
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — 480px
═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  :root {
    --section-py: 56px;
  }

  /* Disable sticky hero on small screens — use normal flow instead */
  .hero-scroll-track {
    height: auto;
  }
  #hero {
    position: relative;
    height: auto;
    min-height: 100vh;
  }
  /* FG/MG leaves are large and sit in front of hero content (z:10, z:5).
     Show only the BG layer (z:1, behind content) as static edge decoration. */
  .layer-foreground,
  .layer-midground {
    display: none;
  }

  .hero__name {
    font-size: clamp(2.8rem, 12vw, 4rem);
  }

  .chapter__heading {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .neuromark-mock {
    padding: 1.5rem 1rem;
  }

  .mock-step {
    min-width: 100px;
    padding: 1rem;
  }

  .philosophy-item {
    font-size: clamp(1.3rem, 7vw, 2rem);
    gap: 0.5rem;
  }
}

/* ═══════════════════════════════════════════════════════
   FOCUS STYLES
═══════════════════════════════════════════════════════ */
:focus-visible {
  outline: 3px solid var(--coral-sunset);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip nav (accessibility) */
.skip-nav {
  position: absolute;
  top: -999px;
  left: -999px;
  background: var(--green-forest);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 3px;
  z-index: 999;
}

.skip-nav:focus {
  top: 1rem;
  left: 1rem;
}
