/* Garden House case study. One theme family (night), one accent (the nguyenlnp.com green, owner draft 4): --brand
   #148b3e fills buttons, --accent is the same green lifted for text on each background. Radius scale: 0 for images, 999px for
   interactive pills, 14px for panels. Dark by default, a light token set follows the system setting. */
:root {
  --bg: #0b0e0d;
  --bg-2: #121614;
  --bg-3: #181d1b;
  --line: rgb(232 228 218 / 0.12);
  --line-2: rgb(232 228 218 / 0.22);
  --text: #ece8de;
  --text-2: rgb(236 232 222 / 0.68);
  --text-3: rgb(236 232 222 / 0.46);
  --accent: #34b866;
  --accent-ink: #ffffff;
  --brand: #148b3e;
  --glow: rgb(20 139 62 / 0.35);
  --shadow: 0 30px 80px rgb(0 0 0 / 0.45);
  --radius: 14px;
  --pad: clamp(20px, 4vw, 64px);
  --max: 1440px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f1efe9;
    --bg-2: #e8e5dd;
    --bg-3: #dedad0;
    --line: rgb(22 26 24 / 0.12);
    --line-2: rgb(22 26 24 / 0.24);
    --text: #161a18;
    --text-2: rgb(22 26 24 / 0.7);
    --text-3: rgb(22 26 24 / 0.5);
    --accent: #0f7a35;
    --accent-ink: #ffffff;
    --glow: rgb(20 139 62 / 0.22);
    --shadow: 0 30px 80px rgb(40 30 20 / 0.18);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f1efe9; --bg-2: #e8e5dd; --bg-3: #dedad0; --line: rgb(22 26 24 / 0.12); --line-2: rgb(22 26 24 / 0.24);
  --text: #161a18; --text-2: rgb(22 26 24 / 0.7); --text-3: rgb(22 26 24 / 0.5); --accent: #0f7a35; --accent-ink: #ffffff; --glow: rgb(20 139 62 / 0.22);
  --shadow: 0 30px 80px rgb(40 30 20 / 0.18); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand); color: var(--accent-ink); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.muted { color: var(--text-2); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: clamp(36px, 5.2vw, 76px); }
h3 { font-size: clamp(20px, 1.7vw, 26px); letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: clamp(18px, 1.5vw, 22px); color: var(--text-2); max-width: 60ch; line-height: 1.55; }

/* grain: fixed, never on scrolling containers */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80; height: 64px; display: flex; align-items: center;
}
/* the backing fades out below the bar instead of ending on a hard edge (owner draft 4: "grey strip") */
.nav::before {
  content: ""; position: absolute; inset: 0 0 -36px 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.5s var(--ease);
  background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, transparent) 55%, transparent 100%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.nav.is-solid::before { opacity: 1; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 70%, var(--accent) 0 34%, transparent 35%), conic-gradient(from 200deg, var(--text) 0 50%, transparent 0); border: 1.5px solid var(--text); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { text-decoration: none; font-size: 14px; color: var(--text-2); padding: 8px 12px; border-radius: 999px; transition: color 0.2s, background 0.2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: var(--line); }
.nav-progress { position: absolute; left: 0; top: 0; height: 2px; background: var(--accent); width: 100%; transform-origin: 0 50%; transform: scaleX(0); }
/* over the hero photo the nav is always light, whatever the theme */
.nav:not(.is-solid) .brand, .nav:not(.is-solid) .nav-links a { color: rgb(242 238 229 / 0.86); }
.nav:not(.is-solid) .nav-links a:hover { color: #f2eee5; background: rgb(242 238 229 / 0.14); }
.nav:not(.is-solid) .brand-mark { border-color: #f2eee5; background: radial-gradient(circle at 50% 70%, var(--accent) 0 34%, transparent 35%), conic-gradient(from 200deg, #f2eee5 0 50%, transparent 0); }
@media (max-width: 900px) { .nav-links { display: none; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none;
  font-size: 15px; font-weight: 500; white-space: nowrap; transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
  border: 1px solid var(--line-2); cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: var(--accent-ink); border-color: var(--brand); box-shadow: 0 10px 30px -10px var(--glow); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, white); box-shadow: 0 14px 40px -8px var(--glow); }
.btn-ghost { background: rgb(11 14 13 / 0.35); color: #f2eee5; border-color: rgb(242 238 229 / 0.4); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: #f2eee5; }
.btn i { font-size: 18px; }

/* hero */
.hero { position: relative; min-height: 100dvh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; color: #f2eee5; }
.hero-media { position: absolute; inset: -4% 0 0 0; z-index: -2; }
.hero-media img { width: 100%; height: 108%; object-fit: cover; object-position: 50% 40%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(8 10 9 / 0.62) 0%, rgb(8 10 9 / 0.18) 55%, transparent 80%), linear-gradient(180deg, rgb(8 10 9 / 0.35) 0%, rgb(8 10 9 / 0) 25%, rgb(8 10 9 / 0.55) 70%, var(--bg) 100%); }
.static .hero { min-height: 900px; }
.hero-inner { padding-bottom: clamp(48px, 9vh, 110px); padding-top: 120px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 104px); max-width: none; line-height: 0.98; letter-spacing: -0.045em; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .line > span { display: inline-block; }
.hero h1 em { font-style: italic; font-weight: 500; color: #4fd07f; text-shadow: 0 0 40px rgb(52 184 102 / 0.45); }
.hero p { font-size: clamp(17px, 1.4vw, 21px); max-width: 46ch; color: rgb(242 238 229 / 0.82); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* numbers */
.numbers { padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); }
.numbers-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; border-top: 1px solid var(--line); }
.num { padding: 28px 28px 0 0; }
.num + .num { padding-left: 28px; border-left: 1px solid var(--line); }
.num b { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(44px, 5.4vw, 84px); letter-spacing: -0.06em; line-height: 1; }
.num > span { display: block; margin-top: 12px; color: var(--text-2); font-size: 15px; max-width: 24ch; }
@media (max-width: 900px) {
  .numbers-grid { grid-template-columns: 1fr 1fr; }
  .num { padding: 24px 16px 24px 0; border-bottom: 1px solid var(--line); }
  .num + .num { padding-left: 16px; }
  .num:nth-child(3) { padding-left: 0; border-left: 0; }
}

section { position: relative; }
.sec { padding: clamp(80px, 11vw, 170px) 0; }

/* brief + before/after */
.brief { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 88px); align-items: center; }
.brief-text { display: grid; gap: 22px; }
.brief-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin-top: 10px; }
.brief-list div { border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; color: var(--text-2); }
.brief-list strong { display: block; color: var(--text); font-weight: 500; font-size: 16px; }
.compare { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg-2); user-select: none; touch-action: pan-y; cursor: ew-resize; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 1px; background: #f2eee5; transform: translateX(-0.5px); }
.compare .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 999px; background: rgb(11 14 13 / 0.55); border: 1px solid rgb(242 238 229 / 0.7); backdrop-filter: blur(6px); }
.compare .handle i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; color: #f2eee5; font-size: 20px; }
.compare-tags { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--text-3); }
.compare input { position: absolute; inset: 0; opacity: 0; cursor: ew-resize; width: 100%; height: 100%; margin: 0; }
@media (max-width: 900px) { .brief { grid-template-columns: 1fr; } .brief-list { grid-template-columns: 1fr; } }

/* part headers */
.part { padding: clamp(90px, 13vw, 200px) 0 clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); }
.part-kicker { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.part h2 { font-size: clamp(48px, 8.6vw, 148px); letter-spacing: -0.055em; line-height: 0.92; margin-top: 22px; }
.part h2 .dim { color: var(--text-3); }
.part .lede { margin-top: 32px; }

/* horizontal timeline */
.track-wrap { position: relative; overflow: hidden; }
.track { display: flex; gap: clamp(18px, 2vw, 32px); padding: 8px var(--pad) 40px; width: max-content; }
.vcard { width: clamp(300px, 34vw, 520px); flex: none; display: grid; gap: 16px; align-content: start; }
.vcard figure { margin: 0; position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--bg-2); }
.vcard figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.vcard:hover figure img { transform: scale(1.04); }
.vcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.vcard-head b { font-family: var(--mono); font-weight: 500; font-size: 30px; letter-spacing: -0.04em; }
.vcard-head span { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.vcard p { color: var(--text-2); font-size: 15.5px; max-width: 46ch; }
.vcard.is-lost figure { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--bg-2) 0 14px, var(--bg-3) 14px 15px); }
.vcard.is-lost figure p { font-family: var(--mono); color: var(--text-3); font-size: 14px; text-align: center; padding: 24px; }
.track-hint { display: none; }
@media (prefers-reduced-motion: reduce), (max-width: 760px) {
  .track-wrap { overflow-x: auto; scroll-snap-type: x mandatory; }
  .vcard { scroll-snap-align: start; width: 82vw; }
}

/* same-camera scrubber */
.scrub { display: grid; grid-template-columns: 8fr 4fr; gap: clamp(28px, 4vw, 64px); align-items: end; }
.scrub-stage { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-2); }
.scrub-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s var(--ease); }
.scrub-stage img.is-on { opacity: 1; }
.scrub-side { display: grid; gap: 22px; }
.scrub-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.scrub-steps button { height: 44px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-family: var(--mono); font-size: 13px; cursor: pointer; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.scrub-steps button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.scrub-note { min-height: 5.5em; color: var(--text-2); }
.scrub-note b { color: var(--text); font-weight: 500; display: block; margin-bottom: 4px; }
@media (max-width: 900px) { .scrub { grid-template-columns: 1fr; } }

/* methods bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(180px, auto); gap: 14px; margin-top: 56px; }
.cell { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); padding: 26px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-height: 220px; }
.cell p { color: var(--text-2); font-size: 15.5px; max-width: 52ch; }
.cell i.ph { font-size: 26px; color: var(--accent); margin-bottom: auto; }
.cell.img { color: #f2eee5; border: 0; }
.cell.img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform 1.4s var(--ease); }
.cell.img:hover img { transform: scale(1.05); }
.cell.img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 30%, rgb(8 10 9 / 0.86)); }
.cell.img > *:not(img) { position: relative; z-index: 2; }
.cell.img p { color: rgb(242 238 229 / 0.8); }
.cell.tint { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--bg-2)), var(--bg-2) 70%); }
.c-a { grid-column: span 4; grid-row: span 2; }
.c-b { grid-column: span 2; }
.c-c { grid-column: span 2; }
.c-d { grid-column: span 2; }
.c-e { grid-column: span 2; }
.c-f { grid-column: span 2; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr; } .bento > * { grid-column: auto !important; grid-row: auto !important; } .c-a { min-height: 360px; } }

/* galleries */
.masonry { columns: 3 320px; column-gap: 14px; margin-top: 56px; }
.masonry button { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: var(--bg-2); cursor: zoom-in; break-inside: avoid; overflow: hidden; position: relative; }
.masonry img { width: 100%; transition: transform 1s var(--ease), opacity 0.6s; }
.masonry button:hover img { transform: scale(1.035); }
.cap { display: block; text-align: left; padding: 10px 2px 2px; font-size: 14px; color: var(--text-3); background: var(--bg); }

/* part 2: pipelines */
.pipes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pipe { border-radius: var(--radius); border: 1px solid var(--line); padding: clamp(24px, 3vw, 40px); background: var(--bg-2); display: grid; gap: 22px; align-content: start; }
.pipe.is-b { background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 14%, var(--bg-2)), var(--bg-2) 60%); }
.pipe-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.pipe-top b { font-family: var(--mono); font-size: clamp(56px, 6vw, 96px); font-weight: 500; letter-spacing: -0.06em; line-height: 0.9; }
.pipe-top b small { font-size: 0.35em; color: var(--text-3); letter-spacing: 0; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; white-space: nowrap; }
.flow i.ph-arrow-right { color: var(--text-3); }
.score { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.score div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 8px; }
.score div b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.score div b.win { color: var(--accent); }
@media (max-width: 900px) { .pipes { grid-template-columns: 1fr; } .score { grid-template-columns: 1fr; } }

.ab { margin-top: 56px; display: grid; gap: 16px; }
.ab-tabs { display: flex; gap: 8px; }
.ab-tabs button { height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 14px; }
.ab-tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.compare.wide { aspect-ratio: 3 / 2; }

/* final gallery */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; }
.filters button { height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 14px; transition: background 0.25s, color 0.25s; }
.filters button[aria-pressed="true"] { background: var(--brand); color: var(--accent-ink); border-color: var(--brand); }
.filters button sup { font-family: var(--mono); font-size: 11px; margin-left: 4px; opacity: 0.7; }
.grid-final { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-flow: dense; gap: 14px; margin-top: 28px; }
.grid-final button { grid-column: span 4; padding: 0; border: 0; background: var(--bg-2); cursor: zoom-in; overflow: hidden; position: relative; aspect-ratio: 3 / 2; }
.grid-final button.wide { grid-column: span 8; aspect-ratio: 3 / 1; }
.grid-final button.tall { grid-row: span 2; aspect-ratio: auto; }
.grid-final img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.grid-final button:hover img { transform: scale(1.04); }
.grid-final .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 10px; background: linear-gradient(180deg, transparent, rgb(8 10 9 / 0.78)); color: #f2eee5; opacity: 0; transition: opacity 0.3s; font-size: 13.5px; }
.grid-final button:hover .cap, .grid-final button:focus-visible .cap { opacity: 1; }
.grid-final button.is-hidden { display: none; }
@media (max-width: 900px) { .grid-final { grid-template-columns: 1fr 1fr; } .grid-final button, .grid-final button.wide { grid-column: span 2; } .grid-final .cap { opacity: 1; } }

/* findings carousel */
.find-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.find-nav { display: flex; gap: 8px; }
.find-nav button { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 20px; transition: background 0.2s; }
.find-nav button:hover { background: var(--line); }
.find-track { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(280px, 30vw, 420px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 40px var(--pad) 24px; margin: 0 calc(var(--pad) * -1); scrollbar-width: none; }
.find-track::-webkit-scrollbar { display: none; }
.find { scroll-snap-align: start; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); padding: 28px; display: grid; gap: 14px; align-content: start; min-height: 300px; }
.find .mono { font-size: 12.5px; color: var(--accent); letter-spacing: 0.04em; }
.find p { color: var(--text-2); font-size: 15.5px; }
.find .fix { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--text); }

/* feedback */
.loop { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(32px, 5vw, 88px); }
.loop-list { display: grid; gap: 0; }
.loop-item { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 26px 0; border-top: 1px solid var(--line); }
.loop-item blockquote { margin: 0; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.35; letter-spacing: -0.015em; }
.loop-item blockquote::before { content: "\201C"; color: var(--accent); }
.loop-item blockquote::after { content: "\201D"; color: var(--accent); }
.loop-item p { color: var(--text-2); font-size: 15.5px; }
@media (max-width: 900px) { .loop, .loop-item { grid-template-columns: 1fr; gap: 12px; } }

/* setup */
.setup { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 56px; }
.spec { grid-column: span 3; border-radius: var(--radius); border: 1px solid var(--line); padding: 24px; background: var(--bg-2); display: grid; gap: 8px; align-content: start; }
.spec .mono { font-size: 12.5px; color: var(--text-3); letter-spacing: 0.04em; }
.spec b { font-weight: 500; font-size: 19px; letter-spacing: -0.01em; line-height: 1.3; }
.spec p { color: var(--text-2); font-size: 14.5px; }
.spec.wide { grid-column: span 6; }
@media (max-width: 1000px) { .spec, .spec.wide { grid-column: span 6; } }
@media (max-width: 640px) { .spec, .spec.wide { grid-column: span 12; } }

.timeline { margin-top: 72px; }
.tl-bar { position: relative; height: 120px; border-top: 1px solid var(--line-2); }
.tl-tick { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; padding-top: 14px; }
.tl-tick::before { content: ""; position: absolute; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--text); }
.tl-tick.is-big::before { background: var(--brand); border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.tl-tick b { font-family: var(--mono); font-weight: 500; font-size: 14px; }
.tl-tick span { font-family: var(--mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tl-tick.lo { padding-top: 56px; }
.tl-fill { position: absolute; top: -1px; left: 0; height: 1px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.tl-ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--text-3); margin-top: 8px; }
@media (max-width: 760px) { .tl-tick span { display: none; } .tl-tick.lo { padding-top: 14px; } }

/* closing */
.close { padding: clamp(100px, 14vw, 220px) 0 60px; }
.close h2 { max-width: 16ch; }
.close .lede { margin-top: 28px; }
.foot { margin-top: clamp(80px, 10vw, 140px); padding-top: 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--text-3); }
.foot a { color: var(--text-2); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: 1fr auto; background: rgb(6 8 7 / 0.94); opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease); }
.lb.is-open { opacity: 1; pointer-events: auto; }
.lb figure { margin: 0; display: grid; place-items: center; padding: 64px 72px 0; min-height: 0; }
.lb img { max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; box-shadow: var(--shadow); transform: scale(0.97); transition: transform 0.5s var(--ease); }
.lb.is-open img { transform: none; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px 22px; color: #e9e5db; }
.lb-bar p { font-size: 15px; }
.lb-bar .mono { color: rgb(233 229 219 / 0.55); font-size: 13px; }
.lb button { width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgb(233 229 219 / 0.3); background: rgb(20 24 22 / 0.6); color: #e9e5db; cursor: pointer; display: grid; place-items: center; font-size: 20px; }
.lb .lb-close { position: absolute; top: 14px; right: 18px; }
.lb .lb-prev, .lb .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb .lb-prev { left: 16px; } .lb .lb-next { right: 16px; }
@media (max-width: 700px) { .lb figure { padding: 60px 8px 0; } .lb .lb-prev, .lb .lb-next { top: auto; bottom: 74px; transform: none; } }

/* reveal base state (only when JS + motion are on) */
.js-motion [data-reveal] { opacity: 0; transform: translateY(28px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* owner links */
a.owner { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 2px; transition: color 0.2s; }
a.owner:hover { color: var(--accent); }

/* film samples */
.film-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.film { margin: 0; display: grid; gap: 10px; }
.film video, .film img { width: 100%; height: auto; aspect-ratio: 2.39 / 1; object-fit: cover; background: var(--bg-2); display: block; }
.film.wide { grid-column: 1 / -1; }
.film figcaption { font-size: 14px; color: var(--text-3); }
@media (max-width: 900px) { .film-grid { grid-template-columns: 1fr; } }

/* tools */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.tool { border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); padding: 24px; display: grid; gap: 10px; align-content: start; }
.tool:nth-child(-n+2) { background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 16%, var(--bg-2)), var(--bg-2) 65%); }
.tool .mono { font-size: 12.5px; color: var(--accent); letter-spacing: 0.04em; }
.tool p { color: var(--text-2); font-size: 15px; }
@media (max-width: 1100px) { .tools { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .tools { grid-template-columns: 1fr; } }

/* closing note in the owner's voice */
.why { margin-top: 30px; display: grid; gap: 18px; max-width: 64ch; padding-left: 22px; border-left: 2px solid var(--accent); }
.why p { font-size: clamp(19px, 1.6vw, 24px); line-height: 1.45; letter-spacing: -0.01em; }

/* ---------- draft 4 (owner msg 1678) ---------- */

/* hero: the owner's real notes typed into a chat bubble, and a scroll cue */
.chat {
  position: absolute; right: var(--pad); bottom: clamp(48px, 9vh, 110px); width: 300px; padding: 16px 18px; border-radius: 18px 18px 18px 4px;
  background: rgb(11 14 13 / 0.5); border: 1px solid rgb(242 238 229 / 0.18); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; gap: 10px; font-size: 15px; box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}
.chat-head { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgb(242 238 229 / 0.6); }
.chat-dot { width: 8px; height: 8px; border-radius: 50%; background: #34b866; animation: ping 2s infinite; }
.chat-msg { min-height: 2.9em; line-height: 1.45; color: #f2eee5; }
.chat-msg.typing::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: #34b866; animation: blink 0.9s steps(1) infinite; }
.chat-reply { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: rgb(242 238 229 / 0.78); border-top: 1px solid rgb(242 238 229 / 0.14); padding-top: 10px; transition: opacity 0.4s, transform 0.4s var(--ease); }
.chat-reply i { color: #34b866; font-size: 17px; margin-top: 1px; }
.chat-reply.is-hidden { opacity: 0; transform: translateY(6px); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgb(52 184 102 / 0.6); } 70%, 100% { box-shadow: 0 0 0 9px rgb(52 184 102 / 0); } }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 1100px) { .chat { display: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 24px; height: 38px; margin-left: -12px; border: 1.5px solid rgb(242 238 229 / 0.55); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: #f2eee5; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@media (max-width: 760px) { .scroll-cue { display: none; } }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.06em; height: 0.06em; background: currentColor; border-radius: 2px; transform-origin: 0 50%; transform: scaleX(var(--u, 1)); }
.hero h1 em { position: relative; }

/* headings split into words that rise through a mask */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.w > span { display: inline-block; }

/* part headers: a dome that draws itself, twinkling stars, a line before the kicker */
.part .wrap { position: relative; }
.part-dome { position: absolute; right: var(--pad); top: clamp(-165px, -11vw, -70px); width: clamp(130px, 17vw, 250px); overflow: visible; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.part-dome .d-base { stroke: var(--text-3); }
.part-dome .d-star { fill: var(--accent); stroke: none; animation: twinkle 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.part-dome .s2 { animation-delay: 1.1s; }
.part-dome .s3 { animation-delay: 2.2s; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.25; transform: scale(0.6); } }
@media (max-width: 760px) { .part-dome { width: 92px; } }
.part-dome.big { top: 0; width: clamp(220px, 30vw, 460px); opacity: 0.9; }
@media (max-width: 900px) { .part-dome.big { display: none; } }
.part-kicker { display: inline-flex; align-items: center; gap: 10px; }
.part-kicker::before { content: ""; width: 28px; height: 2px; background: var(--accent); }

/* versions: a centred stage while pinned, version buttons and a skip button */
.track-ui { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--pad) 8px; width: 100vw; }
.track-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.track-dots button { height: 32px; min-width: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-family: var(--mono); font-size: 12px; color: var(--text-2); cursor: pointer; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.track-dots button:hover { color: var(--text); border-color: var(--text-3); }
.track-dots button[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--accent-ink); }
.btn-skip { height: 44px; background: transparent; color: var(--text); flex: none; }
.btn-skip:hover { border-color: var(--accent); color: var(--accent); }
.btn-skip i { transition: transform 0.3s var(--ease); }
.btn-skip:hover i { transform: translateX(3px); }
.track-wrap.is-stage { height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 2.4vh, 28px); padding-top: 64px; }
.track-wrap.is-stage .track { padding-bottom: 0; }
.track-wrap.is-stage .vcard { width: clamp(300px, min(34vw, 66vh), 560px); }
.track-ui { display: none; }
.track-wrap.is-stage .track-ui { display: flex; }

/* V10: show all, slideshow */
.masonry button.is-extra { display: none; }
.masonry.is-all button.is-extra { display: block; }
.more-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.btn-more { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-more:hover { background: var(--brand); border-color: var(--brand); color: var(--accent-ink); }
.btn-more i { transition: transform 0.4s var(--ease); }
.btn-more[aria-expanded="true"] i { transform: rotate(45deg); }
.btn-ghost-2 { background: transparent; color: var(--text); }
.btn-ghost-2:hover { border-color: var(--accent); color: var(--accent); }

/* ribbon between the parts: drifts on its own, speeds up with the scroll */
.ribbon { overflow: hidden; border-block: 1px solid var(--line); padding: clamp(18px, 2.4vw, 30px) 0; margin-top: clamp(40px, 6vw, 90px); background: linear-gradient(90deg, var(--bg), color-mix(in srgb, var(--brand) 10%, var(--bg)) 50%, var(--bg)); }
.ribbon-track { display: flex; align-items: center; width: max-content; white-space: nowrap; }
.ribbon-track span { font-size: clamp(30px, 4.6vw, 70px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; padding: 0 0.45em; }
.ribbon-track span.o { color: transparent; -webkit-text-stroke: 1.2px var(--text-2); }
.ribbon-track i { color: var(--accent); font-size: clamp(22px, 2.6vw, 40px); }

/* closing: a slow star field, back to top */
.close { overflow: hidden; }
.close .wrap { position: relative; z-index: 1; }
.stars { position: absolute; inset: 0; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%); }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--text); opacity: 0.5; animation: twinkle 4s ease-in-out infinite; }
.stars i.g { background: var(--accent); width: 3px; height: 3px; opacity: 0.85; }
.to-top { display: flex; width: max-content; align-items: center; gap: 14px; margin: clamp(70px, 9vw, 120px) auto 0; text-decoration: none; font-weight: 500; color: var(--text-2); transition: color 0.25s; }
.to-top-ring { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 22px; color: var(--text); transition: transform 0.4s var(--ease), background 0.25s, border-color 0.25s, color 0.25s; }
.to-top:hover { color: var(--text); }
.to-top:hover .to-top-ring { transform: translateY(-4px); background: var(--brand); border-color: var(--brand); color: var(--accent-ink); }
.foot { margin-top: 48px; }

/* big numbers carry a little green at their foot */
.num b { background: linear-gradient(180deg, var(--text) 45%, color-mix(in srgb, var(--accent) 75%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* images uncover upward as they arrive (motion only) */
.js-motion .clip-in { clip-path: inset(100% 0 0 0); }

/* language switch (owner msg 1696) */
.nav .wrap { gap: 16px; }
.nav-links { margin-left: auto; }
.lang { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); flex: none; }
.lang a { font-family: var(--mono); font-size: 12px; text-decoration: none; padding: 5px 10px; border-radius: 999px; color: var(--text-2); transition: background 0.25s, color 0.25s; }
.lang a:hover { color: var(--text); }
.lang a[aria-current="true"] { background: var(--brand); color: var(--accent-ink); }
.nav:not(.is-solid) .lang { border-color: rgb(242 238 229 / 0.35); }
.nav:not(.is-solid) .lang a:not([aria-current="true"]) { color: rgb(242 238 229 / 0.8); }
/* Vietnamese: room above the masks for stacked diacritics, slightly looser display type */
:lang(vi) .w, :lang(vi) .hero h1 .line { padding-top: 0.16em; margin-top: -0.16em; }
:lang(vi) h1, :lang(vi) h2 { letter-spacing: -0.03em; line-height: 1.08; }
:lang(vi) .part h2 { line-height: 1; }
:lang(vi) .part-kicker, :lang(vi) .chat-head { letter-spacing: 0.04em; }
.loop-item .orig { display: block; margin-top: 8px; font-size: 13.5px; color: var(--text-3); font-style: italic; }
/* hide the English flash while i18n.js swaps the text (app.js marks it done; a timeout in i18n.js is the fallback) */
html:lang(vi):not(.i18n-done) main, html:lang(vi):not(.i18n-done) .nav { visibility: hidden; }
@media (max-width: 900px) { .lang { margin-left: auto; } }
:lang(vi) .hero h1 { max-width: 18ch; }
:lang(vi) .hero h1 em { white-space: nowrap; }

/* light / dark switch (owner msg 1725): a pill with sun and moon, the knob slides to the active side */
.theme-sw {
  position: relative; flex: none; width: 62px; height: 32px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--text) 6%, transparent);
  display: flex; align-items: center; justify-content: space-between; padding-inline: 8px; color: var(--text-3);
  transition: border-color 0.25s, background 0.25s;
}
.theme-sw i { position: relative; z-index: 1; font-size: 14px; transition: color 0.35s, transform 0.5s var(--ease); }
.theme-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 2px 10px var(--glow); transition: transform 0.45s var(--ease);
}
.theme-sw[aria-checked="true"] .theme-knob { transform: translateX(30px); }
.theme-sw[aria-checked="false"] .ic-sun, .theme-sw[aria-checked="true"] .ic-moon { color: var(--accent-ink); }
.theme-sw[aria-checked="true"] .ic-moon { transform: rotate(-20deg); }
.theme-sw[aria-checked="false"] .ic-sun { transform: rotate(45deg); }
.theme-sw:hover { border-color: var(--accent); }
.nav:not(.is-solid) .theme-sw { border-color: rgb(242 238 229 / 0.35); background: rgb(11 14 13 / 0.25); color: rgb(242 238 229 / 0.75); }
/* colours ease over instead of snapping when the theme changes */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, fill 0.5s ease, stroke 0.5s ease, box-shadow 0.5s ease !important;
}

/* theme change scene (owner msg 1738): night with moonrise, dawn with sunrise */
.sky-fx { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.sky-bg { position: absolute; inset: 0; }
.sky-fx.is-night .sky-bg { background: radial-gradient(120% 90% at 70% 100%, rgb(36 58 92 / 0.95), rgb(14 22 34 / 0.96) 55%, rgb(6 8 12 / 0.97)); }
.sky-fx.is-day .sky-bg { background: linear-gradient(0deg, rgb(255 196 128 / 0.95) 0%, rgb(255 226 186 / 0.94) 30%, rgb(214 232 240 / 0.93) 75%, rgb(190 218 235 / 0.92) 100%); }
.sky-stars i { position: absolute; border-radius: 50%; background: #f4f1e8; box-shadow: 0 0 6px rgb(244 241 232 / 0.8); animation: twinkle 2.4s ease-in-out infinite; }
.sky-orb { position: absolute; right: 18%; top: 16vh; width: clamp(90px, 11vw, 160px); aspect-ratio: 1; }
.sky-fx.is-day .sky-orb { right: auto; left: 22%; }
.sky-orb span { position: absolute; inset: 0; border-radius: 50%; }
.sky-fx.is-night .sky-orb span {
  background: radial-gradient(circle at 35% 32%, #fbf8ee 0 34%, #e6e1d2 60%, #cfc8b5 100%);
  box-shadow: 0 0 60px 18px rgb(240 236 220 / 0.35), 0 0 160px 60px rgb(150 180 220 / 0.18), inset -14px -10px 0 rgb(0 0 0 / 0.08);
}
.sky-fx.is-night .sky-orb span::before, .sky-fx.is-night .sky-orb span::after { content: ""; position: absolute; border-radius: 50%; background: rgb(150 140 120 / 0.25); }
.sky-fx.is-night .sky-orb span::before { width: 22%; height: 22%; left: 52%; top: 30%; }
.sky-fx.is-night .sky-orb span::after { width: 13%; height: 13%; left: 30%; top: 58%; }
.sky-fx.is-day .sky-orb span {
  background: radial-gradient(circle, #fff6d8 0 30%, #ffd27a 58%, #ffb347 100%);
  box-shadow: 0 0 80px 30px rgb(255 200 110 / 0.55), 0 0 220px 90px rgb(255 170 90 / 0.3);
}
.sky-fx.is-day .sky-orb::before {
  content: ""; position: absolute; inset: -70%; border-radius: 50%; opacity: var(--ray, 0);
  background: repeating-conic-gradient(from 0deg, rgb(255 214 140 / 0.28) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  animation: sun-spin 14s linear infinite;
}
@keyframes sun-spin { to { transform: rotate(360deg); } }
.sky-horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 26vh; }
.sky-fx.is-night .sky-horizon { background: linear-gradient(0deg, rgb(6 8 10 / 0.95), transparent); }
.sky-fx.is-day .sky-horizon { background: linear-gradient(0deg, rgb(255 170 100 / 0.55), transparent); }
/* quiet star field behind the page in dark mode */
.night-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
html.is-dark .night-sky { opacity: 0.55; }

/* the scroll walk */
.walk-card { display: block; margin-top: 32px; overflow: hidden; border-radius: 12px; }
.walk-card img { display: block; width: 100%; height: auto; transition: transform .6s ease; }
.walk-card:hover img { transform: scale(1.015); }
/* the menu is full below this width, in Vietnamese especially; the section itself is right there on the page */
@media (max-width: 1000px) { .nav-links a[href="#walk"] { display: none; } }
