/* Theme 2 — Mộc Editorial. Warm organic magazine. */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #F6F2EA;
  --paper-2: #EDE6D8;
  --ink: #1d2a21;
  --green: #266B3F;
  --blue: #1E9AD6;
  --gold: #9E7B3B;
  --forest: #14301f;
  --rule: color-mix(in srgb, #1d2a21 18%, transparent);
  --serif: "Fraunces", "Playfair Display", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --max: 90rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 4.25rem;
}
@supports (color: oklch(0 0 0)) {
  :root {
    --paper: oklch(0.962 0.012 85);
    --paper-2: oklch(0.925 0.02 85);
    --ink: oklch(0.27 0.03 155);
    --green: oklch(0.47 0.1 154);
    --blue: oklch(0.65 0.14 235);
    --gold: oklch(0.61 0.09 85);
    --forest: oklch(0.28 0.05 155);
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-weight: 400; line-height: 1.65; color: var(--ink);
  background-color: var(--paper); overflow-x: clip; text-wrap: pretty;
}
body::before { /* paper grain */
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .4  0 0 0 0 .33  0 0 0 0 .2  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 200; }
.skip:focus { left: 0; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.35rem; border-radius: 99px;
  font: 500 .9rem/1 var(--sans); text-decoration: none; border: 1px solid var(--ink); cursor: pointer; white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
  &:hover { transform: translateY(-2px); }
}
.btn--solid { background: var(--green); border-color: var(--green); color: #fff; &:hover { background: var(--forest); } }
.btn--line { background: transparent; &:hover { background: var(--ink); color: var(--paper); } }
.btn--gold { background: var(--gold); border-color: var(--gold); color: #fff; &:hover { background: color-mix(in oklab, var(--gold), black 20%); } }

/* ---------- 4. Header + anchor-positioned nav indicator ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-inline: var(--pad); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; white-space: nowrap; flex: none; font-family: var(--serif); font-size: 1.15rem; font-weight: 500;
  img { width: 36px; height: 36px; object-fit: contain; }
}
.nav { display: none; gap: 1.6rem; font-size: .88rem; position: relative; }
.nav a { text-decoration: none; padding-block: .3rem; anchor-name: --nav-link; white-space: nowrap; }
.nav a { anchor-name: none; }
.nav a:nth-child(n) { transition: color .3s; &:hover, &:focus-visible { color: var(--green); } }
.nav__ink { position: absolute; bottom: -2px; height: 1.5px; background: var(--gold); width: 0; left: 0; transition: left .35s var(--ease), width .35s var(--ease); }
@supports (anchor-name: --a) and (position-anchor: --a) {
  .nav a:hover, .nav a:focus-visible { anchor-name: --nav-active; }
  .nav__ink { position-anchor: --nav-active; left: anchor(left); width: anchor-size(width); bottom: auto; top: calc(anchor(bottom) + 2px); transition: opacity .3s; opacity: 0; }
  .nav:has(a:hover, a:focus-visible) .nav__ink { opacity: 1; }
}
.header-cta { display: none; gap: .5rem; }
@media (min-width: 62rem) { .nav { display: flex; } .header-cta { display: flex; } }

/* ---------- 5. Hero ---------- */
.hero {
  max-width: var(--max); margin-inline: auto; padding: clamp(2.5rem, 6vw, 5rem) var(--pad) 2rem;
  display: grid; gap: 2rem; grid-template-columns: repeat(12, 1fr);
}
.eyebrow { grid-column: 1 / -1; margin: 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; display: flex; gap: .8rem; border-top: 1px solid var(--ink); padding-top: .8rem;
  span { color: var(--gold); font-weight: 600; } }
.hero__title {
  grid-column: 1 / -1; display: flex; flex-direction: column; font-size: clamp(3rem, 11.5vw, 10rem); letter-spacing: -.035em; line-height: .92;
  font-variation-settings: "opsz" 144, "wght" 400;
  em { color: var(--green); font-weight: 300; padding-left: clamp(0rem, 8vw, 8rem); }
  > span:last-child { align-self: flex-end; padding-right: .08em; }
}
.hero__side { grid-column: 1 / -1; display: grid; gap: 1.5rem; align-content: start; }
.hero__lede { margin: 0; font-size: 1.05rem; max-width: 38ch; }
@media (max-width: 47.99rem) {
  .hero-wrap .field { height: 14rem; margin-top: 7.5rem; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); }
  .hero__lede, .hero__actions { position: relative; z-index: 1; }
}
.hero__actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero__photo { grid-column: 1 / -1; margin: 0; position: relative;
  img { width: 100%; aspect-ratio: 16/10; object-fit: cover; clip-path: inset(0 0 0 0 round 2px); }
  figcaption { font-size: .78rem; opacity: .7; margin-top: .6rem; border-top: 1px solid var(--rule); padding-top: .5rem; }
}
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 0; border-top: 1px solid var(--ink);
  div { padding-top: 1rem; }
  dt { font-family: var(--serif); font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1; font-variation-settings: "opsz" 144, "wght" 300; color: var(--green);
    small { font-size: .38em; margin-left: .15em; color: var(--gold); } }
  dd { margin: .4rem 0 0; font-size: .82rem; }
}
@media (min-width: 62rem) {
  .hero__side { grid-column: 1 / 5; grid-row: 3; align-self: end; }
  .hero__photo { grid-column: 5 / -1; grid-row: 3; }
  .hero__photo img { aspect-ratio: 4/3; }
}

/* ---------- 6. Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--ink); background: var(--forest); color: var(--paper); margin-block: 2rem; }
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee ul { display: flex; list-style: none; margin: 0; padding: 0; }
.marquee li { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2.5vw, 1.6rem); padding: .9rem 1.5rem; white-space: nowrap;
  &::after { content: "✦"; color: var(--gold); margin-left: 3rem; font-style: normal; } }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 7. Sections ---------- */
.section { max-width: var(--max); margin-inline: auto; padding: clamp(3.5rem, 9vw, 8rem) var(--pad); }
.section--ink { max-width: none; background: var(--forest); color: var(--paper);
  > * { max-width: calc(var(--max) - 2 * var(--pad)); margin-inline: auto; } }
.section__head { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
.section__head h2 { font-size: clamp(2.4rem, 7vw, 6rem); letter-spacing: -.035em; line-height: .98; font-variation-settings: "opsz" 144, "wght" 380; em { color: var(--green); font-weight: 300; } }
.section--ink h2 em { color: color-mix(in oklab, var(--gold), white 35%); }
.label { margin: 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; display: flex; gap: .5rem; align-items: center;
  b { font-family: var(--serif); font-weight: 600; font-size: clamp(3.4rem, 13vw, 7.5rem); line-height: .85; color: transparent; -webkit-text-stroke: 1.2px var(--gold); letter-spacing: -.04em; font-variation-settings: "opsz" 144; }
  &::after { content: ""; flex: 0 0 6rem; height: 10px; background: currentColor; opacity: .45; -webkit-mask: url("wave.svg") repeat-x left center / auto 10px; mask: url("wave.svg") repeat-x left center / auto 10px; } }
.section--ink .label b { -webkit-text-stroke-color: color-mix(in oklab, var(--gold), white 30%); }
.footer .label b { font-size: 1.3rem; color: var(--gold); -webkit-text-stroke: 0; letter-spacing: 0; }
.drop { max-width: 56ch; margin: 0; }
@supports (initial-letter: 2) {
  .drop::first-letter { initial-letter: 2.4; font-family: var(--serif); color: var(--green); margin-right: .5rem; font-weight: 500; }
}
@supports not (initial-letter: 2) {
  .drop::first-letter { float: left; font: 500 3.6rem/.85 var(--serif); color: var(--green); padding: .25rem .5rem 0 0; }
}
@media (min-width: 62rem) { .section__head { grid-template-columns: 1fr 1fr; align-items: end; } .label { grid-column: 1 / -1; } .section__head:not(:has(.drop)) { grid-template-columns: 1fr; } }

/* ---------- 8. Bento ---------- */
.bento { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.bento > * { background: var(--paper); padding: clamp(1.4rem, 3vw, 2.4rem); }
.bento h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: .8rem 0; letter-spacing: -.01em; }
.bento p { margin: 0; }
.num { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.4rem; }
.bento__a { background: var(--paper-2) !important; }
.bento__d { padding: 0 !important; overflow: hidden; img { width: 100%; height: 100%; object-fit: cover; min-height: 14rem; } }
@media (min-width: 52rem) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento__a { grid-column: span 3; grid-row: span 2; }
  .bento__b, .bento__c { grid-column: span 3; }
  .bento__d { grid-column: 1 / -1; }
  .bento__d img { max-height: 22rem; }
}
@media (min-width: 52rem) { .bento__a { min-height: 22rem; } }

/* ---------- 9. Products (subgrid) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip { font: 500 .85rem var(--sans); padding: .55rem 1.1rem; border-radius: 99px; border: 1px solid var(--rule); background: transparent; color: inherit; cursor: pointer; transition: all .3s var(--ease);
  &:hover { border-color: var(--ink); }
  &[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); } }
.grid { display: grid; gap: 2.5rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.card { display: grid; grid-template-rows: auto auto auto auto auto; gap: .5rem; align-content: start; }
@supports (grid-template-rows: subgrid) {
  .card { grid-row: span 5; grid-template-rows: subgrid; gap: 0; row-gap: .5rem; }
}
.card[hidden] { display: none; }
.card__img { position: relative; aspect-ratio: 1; background: var(--paper-2); overflow: hidden;
  img { width: 100%; height: 100%; object-fit: contain; padding: 6%; transition: transform .7s var(--ease); } }
.card:hover .card__img img { transform: scale(1.06); }
.card__img { cursor: pointer; clip-path: inset(0 round 0); transition: clip-path .7s var(--ease); }
.card:hover .card__img, .card:focus-within .card__img { clip-path: inset(0 round 50% 50% 0 0 / 36% 36% 0 0); }
.card__tag { position: absolute; top: .6rem; left: .6rem; background: var(--gold); color: #fff; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 99px; }
.card__cat { margin: .4rem 0 0; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.card__title { font-size: 1.3rem; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__desc { margin: 0; font-size: .86rem; opacity: .8; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--rule); padding-top: .7rem; margin-top: .4rem; }
.price { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; color: var(--green); cursor: help; position: relative; }
.tip { position: absolute; bottom: calc(100% + .5rem); left: 0; width: max-content; max-width: 14rem; background: var(--ink); color: var(--paper); font: 400 .74rem/1.35 var(--sans);
  padding: .4rem .7rem; border-radius: 4px; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .25s, transform .25s; z-index: 5;
  @starting-style { opacity: 0; } }
.price:hover .tip, .price:focus-visible .tip { opacity: 1; transform: none; }
@supports (position-anchor: --a) and (top: anchor(top)) {
  .tip { position: fixed; left: anchor(left); bottom: anchor(top); margin-bottom: .5rem; position-try-fallbacks: flip-block, flip-inline; }
}
.more { font: 500 .8rem var(--sans); background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; color: var(--ink); padding: 0 0 2px; &:hover { color: var(--green); } }

/* ---------- 10. Calculator ---------- */
.calc { display: grid; gap: 2rem; }
.calc__rows { list-style: none; margin: 0; padding: 0; display: grid; }
.calc__row { display: grid; grid-template-columns: 3.6rem 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
  img { width: 3.6rem; height: 3.6rem; object-fit: contain; background: var(--paper); border-radius: 4px; padding: 4px; }
  strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.15rem; line-height: 1.2; }
  small { opacity: .7; }
  &:has(input:not([value="0"]):valid.active) strong { color: color-mix(in oklab, var(--gold), white 40%); }
  &.is-on strong { color: color-mix(in oklab, var(--gold), white 40%); } }
.qty { display: flex; align-items: center; border: 1px solid color-mix(in srgb, var(--paper) 35%, transparent); border-radius: 99px;
  button { width: 2.2rem; height: 2.2rem; background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; border-radius: 50%; &:hover { background: color-mix(in srgb, var(--paper) 15%, transparent); } }
  input { width: 2.6rem; text-align: center; background: none; border: 0; color: inherit; font: 500 1rem var(--sans); -moz-appearance: textfield; &::-webkit-inner-spin-button { appearance: none; } } }
.calc__sum { display: grid; gap: .8rem; align-content: start; justify-items: start; padding: 1.6rem; border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent);
  p { margin: 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
  output { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; font-variation-settings: "opsz" 144, "wght" 300; }
  small { opacity: .65; font-size: .78rem; } }
@media (min-width: 62rem) { .calc { grid-template-columns: 1.4fr 1fr; gap: 4rem; } }

/* ---------- 11. Filmstrip (sticky + scroll-driven translateX) ---------- */
.film { view-timeline: --film block; position: relative; height: auto; padding: clamp(3rem, 8vw, 6rem) 0; max-width: var(--max); margin-inline: auto; }
.film__pin { padding-inline: var(--pad); }
.film__window { overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); scrollbar-width: thin; }
.film__strip { display: flex; gap: 1rem; width: max-content; }
.film figure { margin: 0; flex: none; width: min(78vw, 30rem); scroll-snap-align: start;
  img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
  figcaption { font-family: var(--serif); font-style: italic; color: var(--gold); margin-top: .4rem; } }
@supports (animation-timeline: view()) {
  @media (min-width: 48rem) and (prefers-reduced-motion: no-preference) {
    .film { height: 260vh; padding: 0; }
    .film__pin { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; justify-content: center; overflow: clip; }
    .film__window { overflow: visible; scroll-snap-type: none; margin: 0; padding: 0; }
    .film__strip { animation: film-slide linear both; animation-timeline: --film; animation-range: cover 28% cover 72%; }
    .film figure { width: min(38vw, 34rem); }
  }
}
@supports (animation-timeline: view()) {
  @keyframes film-slide { from { transform: translateX(0); } to { transform: translateX(calc(-100% + min(100vw, 90rem) - 2 * var(--pad))); } }
}

/* ---------- 12. Steps + FAQ ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--ink); counter-reset: s;
  li { display: grid; grid-template-columns: 4rem 1fr; gap: .2rem 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
  span { grid-row: span 2; font-family: var(--serif); font-size: 3rem; font-weight: 600; font-style: italic; color: transparent; -webkit-text-stroke: 1.2px var(--gold); line-height: 1; }
  h3 { font-size: 1.6rem; } p { margin: 0; max-width: 46ch; } }
@media (min-width: 62rem) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; border-top: 0; }
  .steps li { grid-template-columns: 1fr; border-top: 1px solid var(--ink); border-bottom: 0; padding-top: 1rem; }
  .steps span { grid-row: auto; font-size: 5.5rem; margin-bottom: 1rem; }
}
.faq { max-width: 52rem; border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 1.3rem 2.5rem 1.3rem 0; font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 1.6rem); position: relative;
  &::-webkit-details-marker { display: none; }
  &::after { content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%; font-size: 1.8rem; color: var(--gold); transition: rotate .3s var(--ease); }
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 1.4rem; max-width: 60ch; }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content { block-size: 0; overflow: clip; transition: block-size .4s var(--ease), content-visibility .4s allow-discrete; }
  .faq details[open]::details-content { block-size: auto; }
}

/* ---------- 13. Footer ---------- */
.footer { background: var(--forest); color: var(--paper); padding: clamp(3rem, 8vw, 6rem) var(--pad) 6rem; display: grid; gap: 2.5rem; }
.footer__big { max-width: var(--max); .label { margin-bottom: 1rem; } p { margin: .5rem 0 0; opacity: .75; } }
.footer__tel { font-family: var(--serif); font-size: clamp(2.6rem, 10vw, 8rem); line-height: 1; text-decoration: none; letter-spacing: -.03em; font-variation-settings: "opsz" 144, "wght" 300; &:hover { color: color-mix(in oklab, var(--gold), white 35%); } }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; border-top: 1px solid color-mix(in srgb, var(--paper) 25%, transparent); padding-top: 1.5rem;
  li { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; word-break: break-word; } span { opacity: .6; font-size: .85rem; } em { font-style: normal; } }
.footer__copy { margin: 0; font-size: .78rem; opacity: .55; }

/* ---------- 14. Dialog + view transitions ---------- */
.pd { border: 0; padding: 0; width: min(54rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); background: var(--paper); color: var(--ink); overflow: auto; border-radius: 4px;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45);
  display: none; grid-template-columns: 1fr; opacity: 0; transform: translateY(20px) scale(.98);
  transition: opacity .35s var(--ease), transform .35s var(--ease), display .35s allow-discrete, overlay .35s allow-discrete;
  &[open] { display: grid; opacity: 1; transform: none; @starting-style { opacity: 0; transform: translateY(20px) scale(.98); } }
  &::backdrop { background: color-mix(in srgb, var(--forest) 70%, transparent); backdrop-filter: blur(4px); }
  img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper-2); padding: 1.5rem; }
  h3 { font-size: 2rem; margin: .4rem 0 .8rem; }
  p { margin: 0 0 .8rem; } }
.pd__body { padding: 1.5rem; align-self: center; }
.pd__price { font-family: var(--serif); font-size: 2rem; color: var(--green); }
.pd__pack { opacity: .7; font-size: .85rem; }
.pd__x { position: absolute; top: .6rem; right: .8rem; z-index: 2; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); font-size: 1.4rem; cursor: pointer; line-height: 1; }
@media (min-width: 44rem) { .pd[open] { grid-template-columns: 1fr 1fr; } .pd__body { padding: 2.5rem; } }
@media (min-width: 44rem) { .pd img { aspect-ratio: auto; height: 100%; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }

/* ---------- 15. Badge + sticky bar ---------- */
.badge { position: fixed; left: .8rem; bottom: .8rem; z-index: 60; background: var(--ink); color: var(--paper); text-decoration: none; font-size: .72rem; padding: .45rem .9rem; border-radius: 99px; box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
.sticky-bar { display: none; }
@media (max-width: 47.99rem) {
  .sticky-bar { position: fixed; inset: auto 0 0 0; z-index: 70; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-top: 1px solid var(--ink);
    a { text-align: center; padding: .95rem; font-weight: 600; text-decoration: none; &:first-child { background: var(--green); color: #fff; } } }
  .badge { bottom: 3.9rem; }
  body { padding-bottom: 3.2rem; }
}

/* ---------- 16. Scroll-driven animations ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* headline weight / size morph while hero leaves viewport */
    .hero__title { animation: morph linear both; animation-timeline: scroll(root); animation-range: 0 60vh; transform-origin: left top; }
    @keyframes morph { from { font-variation-settings: "opsz" 144, "wght" 300; letter-spacing: -.02em; } to { font-variation-settings: "opsz" 144, "wght" 800; letter-spacing: -.05em; } }
    /* masked image reveal */
    .hero__photo img { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    @keyframes reveal { from { clip-path: inset(30% 20% 30% 20% round 200px); scale: 1.2; } to { clip-path: inset(0 0 0 0 round 2px); scale: 1; } }
    .bento__d img { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .section__head h2 { animation: h2w linear both; animation-timeline: view(); animation-range: entry 10% cover 45%; }
    @keyframes h2w { from { font-variation-settings: "opsz" 9, "wght" 200; opacity: .3; } to { font-variation-settings: "opsz" 144, "wght" 380; opacity: 1; } }
    .card, .steps li, .bento > * { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes rise { from { opacity: 0; translate: 0 2rem; } to { opacity: 1; translate: 0 0; } }
    /* reading progress rule under header */
    .site-header::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--gold); transform-origin: left; animation: prog linear both; animation-timeline: scroll(root); }
    @keyframes prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }
}

/* ---------- 17. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stalk, .grain, .pile, .wave-sep::before { animation: none !important; }
  .w .ch { transform: none !important; }
  .river__flow { stroke-dashoffset: 0; }
  .bubble { display: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee__track { animation: none; transform: none; overflow-x: auto; }
}

/* ======================================================================
   18. Dong lua - living rice field (hero)
   ====================================================================== */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hero-wrap { position: relative; overflow: clip; isolation: isolate; }
.hero-wrap .hero { position: relative; z-index: 1; }
.field {
  position: absolute; inset: 0 0 auto 0; height: clamp(21rem, 46vw, 35rem); z-index: 0; pointer-events: none; overflow: clip;
  margin-top: clamp(3rem, 7vw, 6rem);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28%, #000 78%, transparent 100%);
}
.field::before { /* low sun glow */
  content: ""; position: absolute; width: min(60vw, 40rem); aspect-ratio: 1; right: 6%; top: 8%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, #E8B84A 38%, transparent), transparent);
}
.field__layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.field__layer--1 { --stem: #6f9a58; --leaf: #8bb36d; --grain: #cbb56a; --k: .5; opacity: .3; }
.field__layer--2 { --stem: #4f8a46; --leaf: #6aa656; --grain: #cbb56a; --k: .7; opacity: .42; }
.field__layer--3 { --stem: #a98532; --leaf: #b99a4a; --grain: #dcae3e; --k: 1; opacity: .58; }
.field__layer--4 { --stem: #9a7424; --leaf: #b08f3c; --grain: #e2b441; --k: 1.25; opacity: .7; }
.stalk { animation: sway 6s ease-in-out infinite; animation-delay: calc(var(--p) * -6s); }
.field__layer--1 .stalk, .field__layer--2 .stalk { animation-duration: 8s; animation-delay: calc(var(--p) * -8s); }
.gust { transform: skewX(calc(var(--g, 0) * 1deg)); }
.field.is-off .stalk { animation-play-state: paused; }
@keyframes sway {
  0%, 100% { rotate: calc(var(--amp) * var(--k) * -.7deg); }
  50% { rotate: calc(var(--amp) * var(--k) * 1.2deg); }
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .field__layer { animation: fpar linear both; animation-timeline: scroll(root); animation-range: 0 110vh; }
    .field__layer--1 { --s: 80px; } .field__layer--2 { --s: 52px; } .field__layer--3 { --s: 22px; } .field__layer--4 { --s: -18px; }
    @keyframes fpar { to { transform: translateY(var(--s)); } }
  }
}

/* ======================================================================
   19. Ruong bac thang - contour lines
   ====================================================================== */
.has-contours { position: relative; isolation: isolate; overflow: clip; }
.contours {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; fill: none; stroke-width: 1.3;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  path { stroke-dasharray: 1; stroke-dashoffset: 0; }
}
.contours--paper .c0 { stroke: #266B3F; stroke-opacity: .2; }
.contours--paper .c1 { stroke: #9E7B3B; stroke-opacity: .28; }
.contours--ink .c0 { stroke: #d9b866; stroke-opacity: .2; }
.contours--ink .c1 { stroke: #7fb98a; stroke-opacity: .2; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .contours path {
      stroke-dashoffset: 1; animation: draw linear both; animation-timeline: view();
      animation-range: cover calc(var(--k) * 1.5%) cover calc(38% + var(--k) * 3%);
    }
    @keyframes draw { to { stroke-dashoffset: 0; } }
  }
}

/* ======================================================================
   20. Song nuoc - meandering river + Dong Son wave ornaments
   ====================================================================== */
main { position: relative; }
.river { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; overflow: visible; display: none; }
@media (min-width: 62rem) { .river { display: block; } }
.river__bed { fill: none; stroke: var(--blue); stroke-opacity: .3; stroke-width: 1; stroke-dasharray: 2 7; }
.river__flow { fill: none; stroke: var(--blue); stroke-opacity: .75; stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.river__nodes circle { fill: var(--paper); stroke: var(--gold); stroke-width: 1.5; transition: fill .5s var(--ease); }
.river__nodes circle.on { fill: var(--gold); }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .river__flow { animation: river-draw linear both; animation-timeline: scroll(root); }
    @keyframes river-draw { to { stroke-dashoffset: 0; } }
  }
}
.wave-sep { position: relative; height: 16px; overflow: clip; margin: 2rem auto; max-width: var(--max); color: var(--gold); opacity: .7; }
.wave-sep::before {
  content: ""; position: absolute; inset: 0 -32px; background: currentColor;
  -webkit-mask: url("wave.svg") repeat-x left center / 32px 16px; mask: url("wave.svg") repeat-x left center / 32px 16px;
  animation: wave-drift 3.2s linear infinite;
}
@keyframes wave-drift { to { transform: translateX(32px); } }
.wave-sep--ink { margin: 0 auto -1px; max-width: none; color: var(--forest); opacity: 1; }

/* ======================================================================
   21. Split text, bubble cursor
   ====================================================================== */
.w { display: inline-block; overflow: clip; padding: .14em .03em .1em; margin: -.14em -.03em -.1em; vertical-align: top; }
.w .ch { display: inline-block; transform: translateY(115%); transition: transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 28ms); }
.is-in .w .ch { transform: none; }
h2 .w .ch { transition-delay: calc(var(--i, 0) * 70ms); }
.bubble { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; will-change: transform; }
.bubble span {
  display: grid; place-items: center; width: 5rem; height: 5rem; margin: -2.5rem 0 0 -2.5rem; border-radius: 50%;
  background: var(--gold); color: #fff; font: 500 .85rem var(--sans); letter-spacing: .06em; text-transform: uppercase;
  transform: scale(.3); opacity: 0; transition: transform .35s var(--ease), opacity .25s;
}
.bubble.on span { transform: scale(1); opacity: .95; }
@media (hover: none), (pointer: coarse) { .bubble { display: none; } }
.film figure img { clip-path: inset(0 round 0); transition: clip-path .7s var(--ease); }
@media (hover: hover) { .film figure:hover img { clip-path: inset(0 round 50% 50% 0 0 / 30% 30% 0 0); } }

/* ======================================================================
   22. Commitments bento + rice pour
   ====================================================================== */
.mini { margin: 2.5rem 0 1rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.bento--commit > * { position: relative; overflow: hidden; }
.bento--commit .big { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(6rem, 16vw, 12rem); line-height: .85; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.5px var(--gold); font-variation-settings: "opsz" 144; }
.k-a { background: var(--paper-2) !important; }
.pour { background: var(--forest) !important; color: var(--paper); min-height: 20rem; display: grid; align-content: start; }
.pour h3 { color: var(--paper); max-width: 12ch; }
.pour .num { color: color-mix(in oklab, var(--gold), white 35%); }
.pour__txt { position: relative; z-index: 1; }
.pour svg { position: absolute; right: 0; bottom: 0; width: min(62%, 15rem); height: auto; color: #E9D9A6; }
.grain { fill: #E9D9A6; transform-box: fill-box; transform-origin: center; opacity: 0; animation: drop 2.8s cubic-bezier(.5, 0, .9, .6) infinite; animation-delay: var(--d); }
.pour:not(.is-live) .grain, .pour:not(.is-live) .pile { animation-play-state: paused; }
.pile { transform-origin: 120px 300px; animation: pile 6s ease-in-out infinite; }
.pile--b { fill: #B8944A; } .pile--a { fill: #D9BD73; animation-delay: -2s; }
@keyframes drop {
  0% { transform: translate(0, -6px) rotate(var(--r)); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translate(var(--dx), 205px) rotate(calc(var(--r) + 140deg)); opacity: 0; }
}
@keyframes pile { 0%, 100% { transform: scaleY(.94); } 50% { transform: scaleY(1.05); } }
@media (min-width: 52rem) {
  .bento--commit { grid-template-columns: repeat(6, 1fr); grid-template-areas: "a a a p p p" "b b b p p p" "c c c d d d"; }
  .k-a { grid-area: a; min-height: 16rem; } .k-b { grid-area: b; } .k-p { grid-area: p; min-height: 100%; }
  .k-c { grid-area: c; } .k-d { grid-area: d; }
}
