/* =========================================================
   Theme 3 · Hydro Bento — Đại Thủy Mộc
   Bento grid · light/dark (light-dark) · modern web platform
   ========================================================= */

/* ---------- 0. Registered props ---------- */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@property --mx { syntax: '<length-percentage>'; initial-value: 50%; inherits: false; }
@property --my { syntax: '<length-percentage>'; initial-value: 50%; inherits: false; }
@property --bx1 { syntax: '<percentage>'; initial-value: 20%; inherits: false; }
@property --by1 { syntax: '<percentage>'; initial-value: 10%; inherits: false; }
@property --bx2 { syntax: '<percentage>'; initial-value: 85%; inherits: false; }
@property --by2 { syntax: '<percentage>'; initial-value: 30%; inherits: false; }
@property --bx3 { syntax: '<percentage>'; initial-value: 55%; inherits: false; }
@property --by3 { syntax: '<percentage>'; initial-value: 95%; inherits: false; }

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light dark;
  interpolate-size: allow-keywords;

  --f-display: 'Inter Tight', 'Manrope', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --green-500: oklch(48% 0.1 152);   /* #266B3F */
  --blue-500:  oklch(66% 0.14 237);  /* #1E9AD6 */
  --gold-500:  oklch(59% 0.09 85);   /* #9E7B3B */

  --bg:      light-dark(oklch(97.6% 0.007 200), oklch(14.5% 0.013 225));
  --tile:    light-dark(oklch(100% 0 0),        oklch(19.5% 0.015 225));
  --tile-2:  light-dark(oklch(96.2% 0.01 200),  oklch(23.5% 0.016 225));
  --line:    light-dark(oklch(90.5% 0.01 210),  oklch(30% 0.016 225));
  --ink:     light-dark(oklch(22% 0.025 235),   oklch(96.5% 0.006 200));
  --muted:   light-dark(oklch(47% 0.02 235),    oklch(73% 0.015 215));
  --green:   light-dark(oklch(46% 0.1 152),     oklch(76% 0.15 152));
  --blue:    light-dark(oklch(55% 0.14 237),    oklch(76% 0.12 230));
  --gold:    light-dark(oklch(52% 0.09 85),     oklch(80% 0.11 85));
  --solid:   light-dark(oklch(46% 0.1 152),     oklch(50% 0.12 152));
  --on-solid: oklch(99% 0 0);
  --shadow:  light-dark(0 1px 2px oklch(30% 0.03 230 / .06), 0 1px 2px oklch(0% 0 0 / .4));
  --shadow-lg: light-dark(0 24px 60px -24px oklch(35% 0.05 230 / .28), 0 24px 60px -24px oklch(0% 0 0 / .7));
  --packshot: oklch(97.5% 0.008 220);

  --r: 24px;
  --r-sm: 14px;
  --gap: 16px;
  --wrap: 1280px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; scroll-timeline: --page block; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-display);
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--f-mono); font-feature-settings: 'zero'; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ambient background */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 85% -10%, color-mix(in oklch, var(--blue-500) 16%, transparent), transparent 70%),
    radial-gradient(50vmax 40vmax at -10% 20%, color-mix(in oklch, var(--green-500) 14%, transparent), transparent 70%),
    radial-gradient(40vmax 30vmax at 60% 110%, color-mix(in oklch, var(--gold-500) 10%, transparent), transparent 70%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .3;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%);
}

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
section { padding-block: 28px; }

/* scroll progress (scroll-timeline) */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--green-500), var(--blue-500), var(--gold-500)); }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: 0 1.1em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--tile); color: var(--ink);
  font-weight: 600; font-size: .95rem; white-space: nowrap; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), translate .2s ease-out, background .25s, border-color .25s, box-shadow .25s;
  &:hover { transform: translateY(-1px); border-color: color-mix(in oklch, var(--blue) 50%, var(--line)); }
  &:active { transform: translateY(0) scale(.98); }
  &.primary { background: var(--solid); color: var(--on-solid); border-color: transparent;
    box-shadow: 0 8px 24px -10px color-mix(in oklch, var(--green-500) 80%, transparent); }
  &.zalo { background: var(--blue-500); color: oklch(99% 0 0); border-color: transparent; }
  &.sm { min-height: 38px; font-size: .88rem; padding: 0 .95em; }
  &.block { width: 100%; }
}
.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--tile); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .25s var(--ease), border-color .25s;
  &:hover { border-color: color-mix(in oklch, var(--blue) 50%, var(--line)); transform: translateY(-1px); }
}
kbd { font: 500 .72rem/1 var(--f-mono); padding: .3em .5em; border-radius: 6px; border: 1px solid var(--line); background: var(--tile-2); color: var(--muted); }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; padding-block: 10px;
  background: color-mix(in oklch, var(--bg) 70%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid color-mix(in oklch, var(--line) 70%, transparent);
}
.hbar { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; margin-right: auto; min-width: 0; }
.brand img { height: 40px; width: auto; border-radius: 10px; background: oklch(100% 0 0); padding: 2px; }
.brand span { display: none; font-size: 1.02rem; }
.nav { display: none; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: color .2s, background .2s; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--tile-2); }
.search-btn { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--tile); color: var(--muted); font-size: .9rem; box-shadow: var(--shadow); }
.search-btn:hover { border-color: color-mix(in oklch, var(--blue) 50%, var(--line)); }
.hcta { display: none; gap: 8px; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: block; }

@media (min-width: 760px) { .brand span { display: inline; } .search-btn { display: inline-flex; } .iconbtn.search-icon { display: none; } }
@media (min-width: 1080px) { .nav { display: flex; } .hcta { display: flex; } }

/* ---------- 5. Bento primitives ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; }
.s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
@media (max-width: 1000px) {
  .s8, .s7, .s5, .fw-md { grid-column: span 12; }
  .s4, .s3 { grid-column: span 6; }
}
@media (max-width: 640px) {
  .s6, .s4, .fw-sm { grid-column: span 12; }
  .s3 { grid-column: span 6; }
  :root { --gap: 12px; --r: 20px; }
}

.tile {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  container-type: inline-size;
  background: color-mix(in oklch, var(--tile) 88%, transparent); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: clamp(18px, 4cqi, 28px);
  transition: border-color .3s, box-shadow .4s var(--ease), transform .45s var(--ease), --mx .25s ease-out, --my .25s ease-out;
  /* spotlight following cursor */
  &::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(560px circle at var(--mx) var(--my), color-mix(in oklch, var(--blue-500) 26%, transparent), color-mix(in oklch, var(--green-500) 8%, transparent) 40%, transparent 68%);
  }
  &:hover { border-color: color-mix(in oklch, var(--blue) 35%, var(--line)); box-shadow: var(--shadow-lg), 0 0 40px -12px color-mix(in oklch, var(--blue-500) 45%, transparent); transform: translateY(-4px); }
  &:hover::after { opacity: 1; }
}

/* animated conic gradient border */
.glow { border-color: transparent; }
.glow::before {
  content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: color-mix(in oklch, var(--blue) 40%, var(--line));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@supports (background: conic-gradient(from var(--angle), red, blue)) {
  .glow::before {
    background: conic-gradient(from var(--angle), transparent 0 55%, var(--blue-500) 72%, var(--green-500) 88%, transparent 100%);
    animation: spin 6s linear infinite;
  }
}
@keyframes spin { to { --angle: 360deg; } }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 .75rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--green) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 20px; }
.sec-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; margin-top: 10px; }
.sec-head p { color: var(--muted); max-width: 46ch; text-wrap: pretty; }

/* ---------- 6. Hero ---------- */
.hero { padding-top: 20px; }
.hero-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 460px; background:
  radial-gradient(70% 90% at 100% 0%, color-mix(in oklch, var(--blue-500) 18%, transparent), transparent 60%),
  radial-gradient(60% 80% at 0% 100%, color-mix(in oklch, var(--green-500) 16%, transparent), transparent 60%), color-mix(in oklch, var(--tile) 88%, transparent); }
.hero-tile > * { position: relative; z-index: 1; }
.hero-tile h1 { font-size: clamp(2.7rem, 14.5cqi, 7.6rem); line-height: 1.1; letter-spacing: -.04em; word-spacing: .08em; font-weight: 800; margin-top: 18px; }
.hero-tile h1 .grad { display: block; background: linear-gradient(100deg, var(--green) 0%, var(--blue) 55%, var(--gold) 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s ease-in-out infinite alternate; padding-block: .16em .08em; }
@keyframes shimmer { to { background-position: 100% 0; } }
.hero-tile h1 .sub { display: block; font-size: .42em; line-height: 1.15; letter-spacing: -.03em; font-weight: 600; color: var(--ink); margin-top: .35em; }
.hero-lead { color: var(--muted); max-width: 52ch; font-size: clamp(1rem, 2.4cqi, 1.12rem); text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: .82rem; font-weight: 500; color: var(--muted);
  background: color-mix(in oklch, var(--tile-2) 80%, transparent); border: 1px solid var(--line); }
.pill .icon { color: var(--green); }

/* tracker widget */
.tracker { display: flex; flex-direction: column; gap: 14px; justify-content: space-between; }
.tracker-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.countdown { font: 700 clamp(2.6rem, 17cqi, 4rem)/1 var(--f-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.countdown small { display: block; margin-top: 8px; font: 500 .72rem/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.badge-live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font: 500 .7rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--green); background: color-mix(in oklch, var(--green) 12%, transparent); border: 1px solid color-mix(in oklch, var(--green) 30%, transparent); }
.badge-live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.route { width: 100%; height: auto; overflow: visible; color: var(--muted); }
.route .track { fill: none; stroke: color-mix(in oklch, var(--ink) 45%, transparent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 8; }
.route .trail { fill: none; stroke: url(#routeGrad); stroke-width: 4; stroke-linecap: round; }
.route .node { fill: var(--tile-2); stroke: var(--line); stroke-width: 1.5; }
.route .truck { fill: var(--blue-500); stroke: var(--tile); stroke-width: 3; filter: drop-shadow(0 0 8px color-mix(in oklch, var(--blue-500) 70%, transparent)); }
.route text { font: 500 10px var(--f-mono); fill: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.route .glyph { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tracker-foot { display: flex; justify-content: space-between; gap: 10px; font: 500 .75rem/1.3 var(--f-mono); color: var(--muted); }
.progress-line { height: 4px; border-radius: 4px; background: var(--tile-2); overflow: hidden; }
.progress-line b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green-500), var(--blue-500)); border-radius: inherit; }

/* stats */
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 170px; }
.stat .num { font: 700 clamp(2.1rem, 19cqi, 3.6rem)/1 var(--f-mono); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.stat .num sup { font-size: .38em; letter-spacing: 0; margin-left: .15em; vertical-align: top; color: var(--muted); font-weight: 500; position: relative; top: .35em; }
.stat p { color: var(--muted); font-size: .92rem; line-height: 1.4; text-wrap: balance; }
.stat .ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in oklch, var(--c, var(--blue)) 14%, transparent); color: var(--c, var(--blue)); }
.stat:nth-child(1) { --c: var(--blue); } .stat:nth-child(2) { --c: var(--green); } .stat:nth-child(3) { --c: var(--gold); }
.clock { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 170px; }
.clock .time { font: 700 clamp(1.8rem, 16cqi, 3rem)/1 var(--f-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock .status { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); line-height: 1.35; }
.clock .status i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in oklch, var(--green) 20%, transparent); }
.clock[data-open="false"] .status i { background: var(--gold); box-shadow: 0 0 0 4px color-mix(in oklch, var(--gold) 20%, transparent); }

/* ---------- 7. Audience ---------- */
.aud { display: flex; flex-direction: column; gap: 14px; min-height: 270px; }
.aud .ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; font-size: 1.4rem; color: var(--c); background: color-mix(in oklch, var(--c) 13%, transparent); border: 1px solid color-mix(in oklch, var(--c) 25%, transparent); }
.aud h3 { font-size: 1.4rem; letter-spacing: -.025em; line-height: 1.15; }
.aud p { color: var(--muted); text-wrap: pretty; }
.aud ul { margin-top: auto; display: grid; gap: 8px; font-size: .92rem; }
.aud li { display: flex; gap: 9px; align-items: start; }
.aud li .icon { color: var(--c); margin-top: .2em; }
.aud:nth-child(1) { --c: var(--blue); } .aud:nth-child(2) { --c: var(--green); } .aud:nth-child(3) { --c: var(--gold); }
.banner-tile { padding: 0; min-height: 220px; display: grid; }
.banner-tile img { grid-area: 1/1; width: 100%; height: 100%; object-fit: cover; }
.banner-tile .cap { grid-area: 1/1; align-self: end; padding: 20px 24px; background: linear-gradient(to top, oklch(12% 0.02 230 / .85), transparent); color: oklch(98% 0 0); display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.banner-tile .cap b { font-size: clamp(1.1rem, 3.4cqi, 1.6rem); letter-spacing: -.02em; }

/* ---------- 8. Products ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem;
  background: var(--tile); border: 1px solid var(--line); color: var(--muted); transition: all .25s var(--ease); }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip em { font: 500 .72rem/1 var(--f-mono); font-style: normal; padding: 3px 7px; border-radius: 999px; background: var(--tile-2); }
.chip:hover { color: var(--ink); }
.chip:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:has(input:checked) em { background: color-mix(in oklch, var(--bg) 22%, transparent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--gap); }
.pcard { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.pcard[hidden] { display: none; }
.pcard:target, .pcard.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--blue-500), var(--shadow-lg); } 100% { box-shadow: var(--shadow); } }
.pshot { position: relative; aspect-ratio: 1 / 1; border-radius: calc(var(--r) - 10px); overflow: hidden; display: grid; place-items: center; padding: 14px;
  background: radial-gradient(circle at 50% 35%, oklch(100% 0 0), var(--packshot) 70%); border: 1px solid color-mix(in oklch, var(--line) 60%, transparent); }
.pshot img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.pcard:hover .pshot img { transform: scale(1.06) translateY(-2px); }
.ptag { position: absolute; top: 10px; left: 10px; z-index: 1; font: 500 .66rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px;
  background: oklch(100% 0 0 / .85); color: oklch(35% 0.03 230); border: 1px solid oklch(85% 0.01 220); backdrop-filter: blur(6px); }
.ptag.hot { background: var(--gold-500); color: oklch(99% 0 0); border-color: transparent; left: auto; right: 10px; }
.pbody { display: flex; flex-direction: column; gap: 8px; padding: 0 6px; flex: 1; }
.pbody h3 { font-size: 1.05rem; line-height: 1.28; letter-spacing: -.015em; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.28em * 2); }
.pbody h3 a:hover { color: var(--blue); }
.pbody .desc { color: var(--muted); font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.45em * 2); }
.pmeta { font: 500 .75rem/1.3 var(--f-mono); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pfoot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font: 700 1.2rem/1 var(--f-mono); letter-spacing: -.03em; color: var(--green); }
.price small { font-weight: 500; font-size: .68em; color: var(--muted); letter-spacing: 0; }
.pact { padding: 0 6px 6px; }

/* view transitions */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
.vt-filter .pcard { view-transition-name: var(--vt); }
.vt-filter::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }

/* ---------- 9. Calculator ---------- */
.calc { display: grid; gap: 22px; }
@container (min-width: 780px) { .calc { grid-template-columns: 1.35fr 1fr; align-items: start; gap: 32px; } }
.crows { display: grid; gap: 10px; }
.crow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); background: var(--tile-2); border: 1px solid transparent; transition: border-color .25s, background .25s; }
.crow:has(.qty:not([value="0"])) { border-color: color-mix(in oklch, var(--green) 45%, transparent); }
.crow.on { border-color: color-mix(in oklch, var(--green) 55%, transparent); background: color-mix(in oklch, var(--green) 7%, var(--tile-2)); }
.crow .th { width: 56px; height: 56px; border-radius: 12px; background: var(--packshot); display: grid; place-items: center; padding: 4px; }
.crow .th img { width: 100%; height: 100%; object-fit: contain; }
.crow .nm { font-weight: 600; font-size: .93rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crow .pr { font: 500 .76rem/1.2 var(--f-mono); color: var(--muted); margin-top: 3px; }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--tile); }
.stepper button { width: 36px; height: 40px; border: 0; background: none; font-size: 1.15rem; border-radius: 999px; color: var(--ink); }
.stepper button:hover { color: var(--blue); }
.stepper .qty { width: 34px; border: 0; background: none; text-align: center; font: 600 .95rem var(--f-mono); padding: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 480px) { .crow { grid-template-columns: 48px minmax(0, 1fr); } .crow .th { width: 48px; height: 48px; } .crow .stepper { grid-column: 1 / -1; justify-self: end; } }
.csum { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-sm); background: var(--tile-2); border: 1px solid var(--line); }
.csum .lines { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); min-height: 1.4em; }
.csum .lines div { display: flex; justify-content: space-between; gap: 12px; }
.csum .lines span:last-child { font-family: var(--f-mono); color: var(--ink); white-space: nowrap; }
.csum .total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.csum .total output { font: 700 clamp(1.5rem, 8cqi, 2rem)/1 var(--f-mono); letter-spacing: -.04em; color: var(--green); }
.csum textarea { field-sizing: content; min-height: 3.2em; max-height: 9em; width: 100%; resize: none; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--tile); font-size: .92rem; line-height: 1.45; }
.csum textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.csum small { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 120; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .3s, translate .3s var(--ease); translate: -50% 12px; }
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- 10. Gallery ---------- */
.gal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; gap: var(--gap); }
.gal figure { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--tile-2); }
.gal figure:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gal figure:nth-child(4) { grid-row: span 2; }
.gal figure:nth-child(6) { grid-column: span 2; }
.gal button { all: unset; position: absolute; inset: 0; cursor: zoom-in; display: block; }
.gal button:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; }
.gal img, .gal video { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.gal figure:hover img { transform: scale(1.05); }
.gal figcaption { position: absolute; left: 12px; bottom: 12px; pointer-events: none; font: 500 .7rem/1 var(--f-mono); letter-spacing: .06em; padding: 6px 9px; border-radius: 999px; background: oklch(12% 0.02 230 / .6); color: oklch(98% 0 0); backdrop-filter: blur(6px); }
@media (max-width: 900px) {
  .gal { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; }
  .gal figure:nth-child(n) { grid-column: auto; grid-row: auto; }
  .gal figure:nth-child(1), .gal figure:nth-child(8) { grid-column: span 2; grid-row: span 2; }
}

dialog.lightbox { border: 0; padding: 0; background: transparent; color: oklch(98% 0 0); width: min(96vw, 1100px); max-width: 96vw; max-height: 92vh; margin: auto; overflow: visible; }
dialog.lightbox::backdrop { background: oklch(8% 0.02 230 / .82); backdrop-filter: blur(10px); }
dialog.lightbox[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; scale: .96; } }
.lb-fig { margin: 0; display: grid; gap: 10px; }
.lb-fig img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: var(--r); background: oklch(15% 0.01 230); }
.lb-fig figcaption { text-align: center; font: 500 .8rem var(--f-mono); color: oklch(85% 0.01 220); }
.lb-btn { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 50%; border: 1px solid oklch(100% 0 0 / .2); background: oklch(15% 0.02 230 / .7); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.lb-btn:hover { background: oklch(25% 0.03 230 / .85); }
.lb-btn.prev { left: 8px; } .lb-btn.next { right: 8px; }
.lb-btn.close { top: 12px; right: 12px; translate: none; }

/* ---------- 11. Steps ---------- */
.step { display: flex; flex-direction: column; gap: 14px; min-height: 230px; }
.step .no { font: 700 2.8rem/1 var(--f-mono); letter-spacing: -.06em; background: linear-gradient(135deg, var(--blue), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step h3 { font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.2; }
.step p { color: var(--muted); font-size: .94rem; text-wrap: pretty; }
.step .t { margin-top: auto; font: 500 .72rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }

/* ---------- 12. FAQ ---------- */
.faq-side { display: flex; flex-direction: column; gap: 16px; justify-content: space-between; }
.faq-side h2 { font-size: clamp(1.7rem, 8cqi, 2.4rem); letter-spacing: -.03em; line-height: 1.08; margin-top: 10px; }
.faq-side p { color: var(--muted); }
.faq-list { display: grid; gap: 10px; align-content: start; }
details.qa { border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--tile-2); overflow: hidden; transition: background .25s, border-color .25s; }
details.qa[open] { background: var(--tile); border-color: color-mix(in oklch, var(--blue) 40%, var(--line)); }
details.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 18px; font-weight: 600; letter-spacing: -.01em; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary .icon { transition: rotate .35s var(--ease); color: var(--muted); }
details.qa[open] summary .icon { rotate: 45deg; color: var(--blue); }
details.qa .ans { padding: 0 18px 18px; color: var(--muted); text-wrap: pretty; }
@supports selector(::details-content) {
  details.qa::details-content { block-size: 0; overflow: clip; transition: block-size .4s var(--ease), content-visibility .4s allow-discrete; }
  details.qa[open]::details-content { block-size: auto; }
}

/* ---------- 13. Footer ---------- */
.foot { padding-bottom: 40px; }
.foot-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-height: 260px; }
.foot-brand .word { font-size: clamp(2.2rem, 13cqi, 4.6rem); line-height: .95; font-weight: 800; letter-spacing: -.045em; background: linear-gradient(100deg, var(--green), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .05em; }
.foot-brand p { color: var(--muted); max-width: 40ch; }
.contact { display: flex; flex-direction: column; gap: 6px; min-height: 124px; justify-content: space-between; }
.contact .lbl { font: 500 .72rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.contact .val { font-size: clamp(1.05rem, 6cqi, 1.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.contact .val.mono { font-family: var(--f-mono); letter-spacing: -.04em; }
a.contact:hover .val { color: var(--blue); }
.copy { text-align: center; color: var(--muted); font-size: .82rem; padding-top: 22px; }

/* ---------- 14. Command palette (popover) ---------- */
.cmdk { padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--tile); color: var(--ink); width: min(640px, 92vw); margin: 11vh auto auto; box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in oklch, var(--blue) 12%, transparent); overflow: hidden;
  opacity: 0; translate: 0 -14px; scale: .98;
  transition: opacity .25s, translate .3s var(--ease), scale .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete; }
.cmdk:popover-open { opacity: 1; translate: 0 0; scale: 1; }
@starting-style { .cmdk:popover-open { opacity: 0; translate: 0 -14px; scale: .98; } }
.cmdk::backdrop { background: oklch(10% 0.02 230 / 0); transition: background .3s, overlay .3s allow-discrete, display .3s allow-discrete; }
.cmdk:popover-open::backdrop { background: oklch(10% 0.02 230 / .5); }
@starting-style { .cmdk:popover-open::backdrop { background: oklch(10% 0.02 230 / 0); } }
@supports not selector(:popover-open) {
  .cmdk { display: none; position: fixed; inset: 0 0 auto 0; z-index: 200; }
  .cmdk.is-open { display: block; opacity: 1; translate: 0 0; scale: 1; }
}
.cmdk-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-top input { flex: 1; min-width: 0; border: 0; background: none; font-size: 1.05rem; color: var(--ink); outline: none; }
.cmdk-top input::-webkit-search-cancel-button { display: none; }
#cmdk-list { max-height: min(52vh, 420px); overflow: auto; padding: 8px; overscroll-behavior: contain; }
#cmdk-list .grp { font: 500 .68rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 6px; }
#cmdk-list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 12px; background: none; }
#cmdk-list button[aria-selected="true"] { background: var(--tile-2); }
#cmdk-list .th { width: 38px; height: 38px; flex: none; border-radius: 9px; background: var(--packshot); display: grid; place-items: center; padding: 3px; }
#cmdk-list .th img { width: 100%; height: 100%; object-fit: contain; }
#cmdk-list .th.ic { background: var(--tile-2); color: var(--blue); }
#cmdk-list .tx { flex: 1; min-width: 0; }
#cmdk-list .tx b { display: block; font-weight: 600; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cmdk-list .tx span { font: 500 .72rem var(--f-mono); color: var(--muted); }
#cmdk-list mark { background: color-mix(in oklch, var(--blue-500) 25%, transparent); color: inherit; border-radius: 3px; }
#cmdk-list .none { padding: 28px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font: 500 .72rem var(--f-mono); color: var(--muted); }

/* ---------- 15. Mobile bar & badge ---------- */
.mbar { position: fixed; inset: auto 0 0 0; z-index: 70; display: none; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in oklch, var(--bg) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); border-top: 1px solid var(--line); }
.mbar .btn { flex: 1; min-height: 48px; }
@media (max-width: 760px) { .mbar { display: flex; } body { padding-bottom: 76px; } }
.t3-badge { position: fixed; left: 14px; bottom: 14px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font: 500 .72rem/1 var(--f-mono); letter-spacing: .04em;
  background: color-mix(in oklch, var(--tile) 85%, transparent); border: 1px solid var(--line); color: var(--muted); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.t3-badge:hover { color: var(--ink); border-color: var(--blue); }
.t3-badge i { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-500), var(--green-500)); }
@media (max-width: 760px) { .t3-badge { bottom: 84px; } }

/* ---------- 16. Scroll-driven animations ---------- */
@keyframes rise { from { opacity: 0; translate: 0 36px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes grow { to { transform: scaleX(1); } }
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  .progress { animation: grow linear both; animation-timeline: --page; }
}

/* ---------- 17. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .progress { opacity: 0; }
}
