/* Portfolio V4 — "engine viewport" design system. Dark is the default theme. */

@font-face {
  font-family: "V4 Sans";
  src: url("fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "V4 Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "V4 Thai";
  src: url("fonts/noto-sans-thai-thai.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-raised: #0c0e11;
  --surface: #111317;
  --surface-2: #171a1f;
  --surface-3: #1f232a;
  --line: rgb(255 255 255 / .08);
  --line-strong: rgb(255 255 255 / .16);
  --text: #f3f4f6;
  --text-2: #c8ccd3;
  --muted: #9198a2;
  --faint: #6f7680;
  --accent: #ff7a1a;
  --accent-strong: #ff8f3d;
  --accent-ink: #140900;
  --accent-text: #ff9a52;
  --accent-soft: rgb(255 122 26 / .13);
  --ai: #b39dff;
  --ai-soft: rgb(179 157 255 / .12);
  --ok: #4ade80;
  --axis-x: #ff5468;
  --axis-y: #6ee787;
  --axis-z: #5aa8ff;
  --viewport-ink: #ffffff;
  --grid-line: rgb(255 255 255 / .045);
  --shadow: 0 30px 80px -24px rgb(0 0 0 / .7);
  --shade: rgb(8 9 11 / .72);
  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 12px;
  --page: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --font-sans: "V4 Sans", "V4 Thai", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "V4 Mono", "V4 Thai", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ef;
  --bg-raised: #eeece7;
  --surface: #ffffff;
  --surface-2: #f6f5f2;
  --surface-3: #ebe9e4;
  --line: rgb(13 14 16 / .09);
  --line-strong: rgb(13 14 16 / .17);
  --text: #0d0e10;
  --text-2: #30343a;
  --muted: #5a5f67;
  --faint: #7d828a;
  --accent: #f26b0f;
  --accent-strong: #e15f06;
  --accent-ink: #140900;
  --accent-text: #b04700;
  --accent-soft: rgb(242 107 15 / .12);
  --ai: #6a4de0;
  --ai-soft: rgb(106 77 224 / .1);
  --ok: #16a34a;
  --axis-x: #e0243c;
  --axis-y: #1f9d4a;
  --axis-z: #1f6fe0;
  --viewport-ink: #0d0e10;
  --grid-line: rgb(13 14 16 / .05);
  --shadow: 0 30px 70px -28px rgb(20 20 30 / .35);
  --shade: rgb(244 243 239 / .74);
}

/* Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 40px);
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html[lang="th"] body { line-height: 1.75; }
body::before {
  position: fixed;
  z-index: 100;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
  content: "";
  opacity: .035;
  pointer-events: none;
}
:root[data-theme="light"] body::before { opacity: .05; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px; left: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }
.container { width: min(var(--page), calc(100% - var(--gutter) * 2)); margin-inline: auto; }

kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 22px;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--line-strong);
  color: var(--text-2);
  font: 500 11px/1 var(--font-mono);
  justify-content: center;
}
.accent { color: var(--accent); }
.accent-text { color: var(--accent-text); }

/* Header ---------------------------------------------------------------- */

.site-header { position: fixed; z-index: 60; inset: 12px 0 auto; pointer-events: none; }
.header-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
  padding: 0 10px 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  pointer-events: auto;
  transition: background .35s, border-color .35s, box-shadow .35s, backdrop-filter .35s;
}
.site-header.is-scrolled .header-bar,
html:not(.js) .header-bar,
body.menu-open .header-bar {
  border-color: var(--line);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  box-shadow: 0 12px 40px -18px rgb(0 0 0 / .55);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--ai));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; color: var(--text); }
.brand-mark .mark-top { fill: var(--accent); }
.brand-mark .mark-line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.brand:hover .brand-mark { animation: spin-mark .9s var(--ease); }
@keyframes spin-mark { 50% { transform: rotate(-12deg) scale(.92); } }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand-copy small { color: var(--muted); font: 500 11px/1.3 var(--font-mono); letter-spacing: .02em; }

.site-nav { display: flex; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 2px; margin: 0 auto; padding: 0; list-style: none; }
.nav-links a {
  position: relative;
  display: block;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.is-active,
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a.is-active::after,
.nav-links a[aria-current="page"]::after {
  position: absolute;
  left: 50%; bottom: 2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translateX(-50%);
}
.nav-extras { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch a {
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--muted);
  font: 600 12px/1.4 var(--font-sans);
  text-decoration: none;
  transition: color .2s, background .2s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { background: var(--text); color: var(--bg); }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.icon-button svg { width: 18px; height: 18px; }
.cmdk-trigger { display: inline-flex; width: auto; gap: 10px; padding: 0 8px 0 14px; color: var(--muted); font-size: 13px; }
.cmdk-trigger svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
html:not(.js) [data-palette-open],
html:not(.js) [data-theme-toggle],
html:not(.js) [data-copy] { display: none !important; }
.menu-toggle { display: none; }
.menu-icon { position: relative; width: 16px; height: 10px; }
.menu-icon::before, .menu-icon::after {
  position: absolute;
  left: 0;
  width: 16px; height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.menu-icon::before { top: 1px; }
.menu-icon::after { top: 7.4px; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 4.2px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 4.2px; transform: rotate(-45deg); }

/* Buttons and links ----------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 15px/1 var(--font-sans);
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.button svg { width: 17px; height: 17px; transition: transform .3s var(--ease); }
.button:hover svg { transform: translateX(3px); }
.button-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 34px -14px var(--accent), inset 0 1px 0 rgb(255 255 255 / .28);
}
.button-accent:hover { background: var(--accent-strong); transform: translateY(-1px); }
.button-ghost {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--text);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.button-ghost:hover { border-color: var(--muted); }
.button-sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.text-link span { display: inline-block; color: var(--accent); transition: transform .3s var(--ease); }
.text-link:hover span { transform: translateX(4px); }
.text-link::after { display: none; }
.hint-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
}
.hint-button:hover { color: var(--text); }

/* Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 88px) 0 48px;
  overflow: hidden;
  isolation: isolate;
}
.viewport-canvas { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; }
.hero-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, var(--shade) 34%, transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, transparent 22%, transparent 70%, var(--bg) 100%);
  pointer-events: none;
}
.hud { position: absolute; z-index: -1; inset: calc(var(--header-h) + 32px) var(--gutter) 22px; pointer-events: none; }
.hud > span {
  position: absolute;
  color: var(--faint);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hud > span::before { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border: 1px solid currentColor; content: ""; vertical-align: 1px; }
.hud-tl { top: 0; left: 0; }
.hud-tr { top: 0; right: 0; }
.hud-bl { bottom: 0; left: 0; }
.hud-br { right: 0; bottom: 0; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  align-items: center;
  gap: clamp(40px, 7vw, 112px);
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-2);
  font: 500 12.5px/1.2 var(--font-mono);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pulse-dot {
  position: relative;
  flex: 0 0 auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
/* The pulse ring animates only transform and opacity so it runs on the compositor without repainting. */
.pulse-dot::after,
.status[data-status="live"]::after {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ok);
  content: "";
  animation: pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0% { opacity: .55; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3.4); }
}
.hero-name {
  margin-top: 26px;
  font-size: clamp(3.1rem, 8.4vw, 8.6rem);
  font-weight: 760;
  line-height: .88;
  letter-spacing: -.058em;
}
.hero-name .line { display: block; overflow: hidden; padding: 0 .04em .14em 0; margin-bottom: -.14em; }
.hero-name .line > span { display: inline-block; animation: rise 1.15s var(--ease) both; }
.hero-name .line:nth-child(2) > span { animation-delay: .1s; }
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
.hero-role {
  margin-top: 26px;
  font-size: clamp(1.35rem, 2.5vw, 2.1rem);
  font-weight: 550;
  letter-spacing: -.025em;
  line-height: 1.15;
  animation: fade-up .9s .35s var(--ease) both;
}
.hero-build {
  margin-top: 14px;
  color: var(--muted);
  font: 500 14.5px/1.5 var(--font-mono);
  animation: fade-up .9s .45s var(--ease) both;
}
.hero-build-label::before { color: var(--accent-text); content: "> "; }
.rotator { color: var(--text); }
.rotator::after {
  display: inline-block;
  width: .55em; height: 2px;
  margin-left: 3px;
  background: var(--accent);
  content: "";
  animation: blink 1.05s steps(1) infinite;
  vertical-align: -1px;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-summary {
  max-width: 54ch;
  margin-top: 22px;
  color: var(--text-2);
  font-size: clamp(1.02rem, 1.25vw, 1.14rem);
  animation: fade-up .9s .55s var(--ease) both;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 34px; animation: fade-up .9s .65s var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero-portrait {
  justify-self: end;
  width: 100%;
  max-width: 390px;
  margin: 0;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--ease);
  animation: fade-up 1.1s .3s var(--ease) backwards;
}
.portrait-frame { position: relative; aspect-ratio: 3 / 4; outline: 1.5px solid var(--accent); outline-offset: 9px; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.portrait-frame::after {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / .45));
  content: "";
  pointer-events: none;
}
.handle {
  position: absolute;
  z-index: 1;
  width: 11px; height: 11px;
  border: 1.5px solid var(--accent);
  background: var(--bg);
}
.h-tl { top: -15px; left: -15px; }
.h-tr { top: -15px; right: -15px; }
.h-bl { bottom: -15px; left: -15px; }
.h-br { right: -15px; bottom: -15px; }
.h-tm { top: -15px; left: calc(50% - 5.5px); }
.h-bm { bottom: -15px; left: calc(50% - 5.5px); }
.portrait-tag {
  position: absolute;
  z-index: 1;
  top: -44px; left: -11px;
  padding: 5px 9px;
  border-radius: 4px 4px 4px 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 11px/1.2 var(--font-mono);
  letter-spacing: .04em;
}
.gizmo { position: absolute; z-index: 1; left: 14px; bottom: 14px; width: 66px; height: 66px; overflow: visible; }
.gizmo line { stroke-width: 2.4; stroke-linecap: round; }
.gizmo .gx { stroke: var(--axis-x); }
.gizmo .gy { stroke: var(--axis-y); }
.gizmo .gz { stroke: var(--axis-z); }
.gizmo circle.gx { fill: var(--axis-x); stroke: none; }
.gizmo circle.gy { fill: var(--axis-y); stroke: none; }
.gizmo circle.gz { fill: var(--axis-z); stroke: none; }
.gizmo text { fill: #0b0b0c; font: 700 8px var(--font-mono); text-anchor: middle; dominant-baseline: central; }
.hero-portrait figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  color: var(--muted);
  font: 500 12px/1.4 var(--font-mono);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(56px, 9vh, 104px) 0 0;
  border-top: 1px solid var(--line);
}
.hero-stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 10px; padding: 22px 20px 0 0; }
.hero-stats > div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.hero-stats dd {
  margin: 0;
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1;
}
.hero-stats dd .unit { color: var(--accent); }
.hero-stats dt { color: var(--muted); font-size: 13.5px; line-height: 1.4; }

/* Technology marquee ---------------------------------------------------- */

.tech-marquee {
  display: grid;
  gap: 12px;
  padding: 26px 0;
  border-block: 1px solid var(--line);
  background: var(--bg-raised);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee { display: flex; overflow: hidden; }
.marquee-track { display: flex; flex-shrink: 0; gap: 12px; margin: 0; padding: 0 6px; list-style: none; }
.marquee[data-marquee-ready] .marquee-track { animation: marquee var(--marquee-duration, 60s) linear infinite; }
.marquee-reverse .marquee-track { animation-direction: reverse !important; }
.tech-marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: 500 13.5px/1 var(--font-mono);
  white-space: nowrap;
}
.marquee-track li::before { width: 6px; height: 6px; border-radius: 1px; background: var(--accent); content: ""; transform: rotate(45deg); }
.marquee-track li:nth-child(3n)::before { background: var(--ai); }
.marquee-track li:nth-child(5n)::before { background: var(--axis-z); }
@keyframes marquee { to { transform: translateX(calc(-100% - 12px)); } }

/* Sections -------------------------------------------------------------- */

.section { position: relative; padding: clamp(88px, 10vw, 144px) 0; }
#contact { padding-top: 0; }
.section-alt { border-block: 1px solid var(--line); background: var(--bg-raised); }
.section-alt::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}
.section > .container { position: relative; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 48px;
  margin-bottom: clamp(44px, 6vw, 80px);
}
.section-index {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-text);
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section-index::before { width: 28px; height: 1px; background: currentColor; content: ""; }
.section-title {
  margin-top: 18px;
  font-size: clamp(2.5rem, 5.8vw, 5rem);
  font-weight: 720;
  line-height: .98;
  letter-spacing: -.048em;
}
.section-lede { max-width: 44ch; color: var(--muted); font-size: 17px; }
html[lang="th"] .section-title,
html[lang="th"] .contact-title,
html[lang="th"] .page-hero h1 { line-height: 1.18; letter-spacing: -.02em; }
html[lang="th"] .hero-role,
html[lang="th"] .case-title,
html[lang="th"] .bento-card h3 { letter-spacing: -.01em; line-height: 1.3; }

/* Reveal on scroll (only when JavaScript is available). */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Managed selected work ------------------------------------------------- */

.managed-projects-loading,
.managed-projects-unavailable {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font: 500 13px var(--font-mono);
  text-align: center;
}
.managed-projects-loading {
  border-style: solid;
  border-color: var(--line);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 220% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }
.case-list { display: grid; gap: clamp(24px, 3.5vw, 40px); }
.case {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  padding: clamp(14px, 1.6vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
  isolation: isolate;
  transition: border-color .4s;
}
.case:nth-child(even) .case-media { order: 2; }
[data-spotlight] { position: relative; isolation: isolate; }
[data-spotlight]::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 45%);
  content: "";
  opacity: 0;
  transition: opacity .45s;
  pointer-events: none;
}
[data-spotlight]:hover::before { opacity: 1; }
.case:hover { border-color: var(--line-strong); }
.case-media { position: relative; overflow: hidden; aspect-ratio: 16 / 11; border-radius: 18px; background: var(--surface-2); }
.case-media figure { margin: 0; }
.case-media > figure:first-child,
.case-media > figure:first-child img { width: 100%; height: 100%; }
.case-media img { object-fit: cover; transition: transform 1.1s var(--ease); }
.case:hover .case-media > figure:first-child img { transform: scale(1.045); }
.case-media figcaption { display: none; }
.case-media-pair > figure:nth-child(2) {
  position: absolute;
  right: 4.5%; bottom: 6%;
  width: 46%;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 12px;
  box-shadow: 0 24px 50px -16px rgb(0 0 0 / .75);
  transition: transform .8s var(--ease);
}
.case-media-pair > figure:nth-child(2) img { aspect-ratio: 16 / 10; width: 100%; }
.case:hover .case-media-pair > figure:nth-child(2) { transform: translateY(-8px) rotate(-1deg); }
.case-body { display: flex; flex-direction: column; padding: clamp(8px, 1.6vw, 22px) clamp(4px, 1vw, 14px) clamp(8px, 1.2vw, 14px); }
.case-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.case-number { color: var(--accent-text); font: 600 13px/1 var(--font-mono); letter-spacing: .08em; }
.case-meta { margin-top: 28px; color: var(--muted); font: 500 12.5px/1.4 var(--font-mono); letter-spacing: .02em; }
.case-title { margin: 12px 0 18px; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 720; line-height: 1; letter-spacing: -.045em; }
.case-title a, .product-title a { color: inherit; text-decoration: none; }
.managed-detail-link::after { position: absolute; z-index: 1; inset: 0; border-radius: inherit; content: ""; }
.case-summary { max-width: 48ch; color: var(--text-2); font-size: 16.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 0; padding: 0; list-style: none; }
.chip, .chips li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 500 12px/1.2 var(--font-mono);
}
.case-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 30px; }
.project-cta { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; font-size: 15px; }
.project-cta .cta-arrow {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  transition: transform .45s var(--ease), background .3s;
}
.project-cta .cta-arrow svg { width: 16px; height: 16px; }
.case:hover .cta-arrow, .product:hover .cta-arrow { background: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
.managed-external-link {
  position: relative;
  z-index: 2;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.managed-external-link:hover { border-color: var(--accent); color: var(--text); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 500 11.5px/1 var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status { position: relative; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); content: ""; }
.status[data-status="live"]::before { background: var(--ok); }
.status[data-status="live"]::after { inset: auto; top: calc(50% - 3.5px); left: 11px; width: 7px; height: 7px; }
.status[data-status="maintenance"]::before { background: var(--axis-z); }
.status[data-status="cancelled"]::before { background: var(--axis-x); }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); margin-top: clamp(24px, 3.5vw, 40px); }
.product {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  transition: border-color .4s, transform .5s var(--ease);
}
.product:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.product-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.product:hover .product-media img { transform: scale(1.05); }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 24px 26px 26px; }
.product-title { margin: 14px 0 10px; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
.product-body > p { color: var(--text-2); font-size: 15.5px; }
.product .case-footer { padding-top: 24px; }

/* Capabilities bento ---------------------------------------------------- */

.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: clamp(24px, 2.4vw, 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  isolation: isolate;
  transition: border-color .35s;
}
.bento-card:hover { border-color: var(--line-strong); }
.bento-wide { grid-column: span 2; }
.bento-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--accent);
}
.bento-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .6s var(--ease); }
.bento-card:hover .bento-icon svg { transform: rotate(-8deg) scale(1.08); }
.bento-card h3 { margin-top: 26px; font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 680; letter-spacing: -.03em; line-height: 1.1; }
.bento-card p { margin-top: 12px; color: var(--muted); font-size: 15.5px; }
.bento-card .chips { margin-top: auto; padding-top: 24px; }
.bento-copy { position: relative; z-index: 1; display: flex; flex: 1; flex-direction: column; max-width: 44%; }
.bento-visual {
  position: absolute;
  z-index: -1;
  top: 0; right: 0; bottom: 0;
  width: 58%;
  height: 100%;
  object-fit: cover;
  opacity: .8;
  -webkit-mask-image: linear-gradient(90deg, transparent 8%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 8%, #000 58%);
  transition: transform 1.2s var(--ease), opacity .4s;
}
.bento-card:hover .bento-visual { transform: scale(1.04); opacity: 1; }
.bento-shot {
  margin: 22px -8px -60px auto;
  width: calc(100% + 16px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform: rotate(-2deg) translateY(0);
  transition: transform .8s var(--ease);
}
.bento-card:hover .bento-shot { transform: rotate(0) translateY(-10px); }
.bento-card .bento-metric { color: var(--text); display: flex; align-items: baseline; gap: 14px; margin-top: 26px; font-size: clamp(2.6rem, 4.6vw, 3.8rem); font-weight: 760; letter-spacing: -.05em; line-height: 1; }
.bento-card .bento-metric span { color: var(--accent); font-size: .6em; }
.bento-card .bento-metric + p { margin-top: 10px; }
.bento-ai .bento-icon { color: var(--ai); }

/* Approach pipeline ----------------------------------------------------- */

.approach-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: end; gap: 32px 64px; margin-bottom: clamp(48px, 6vw, 80px); }
.approach-grid .section-head { margin: 0; }
.approach-grid .section-title { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.approach-lede { color: var(--text-2); font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.6; }
.pipeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pipeline::before {
  position: absolute;
  top: 28px; left: 28px; right: 28px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
  content: "";
}
.pipeline::after {
  position: absolute;
  top: 25px; left: 28px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px 3px var(--accent);
  content: "";
  opacity: 0;
}
.pipeline.is-running::after { animation: packet-x 7.2s linear infinite; }
@keyframes packet-x {
  0% { left: 28px; opacity: 0; }
  4% { opacity: 1; }
  96% { opacity: 1; }
  100% { left: calc(100% - 35px); opacity: 0; }
}
.step { position: relative; padding-right: 8px; }
.step-node {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1 var(--font-mono);
}
.step[data-owner="ai"] .step-node { border-color: color-mix(in srgb, var(--ai) 55%, transparent); background: var(--ai-soft); color: var(--ai); }
/* The flash is a pre-painted glow whose opacity animates, so it never repaints. */
.step-node::after {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent);
  border-radius: inherit;
  box-shadow: 0 0 0 6px var(--accent-soft), 0 0 28px -4px var(--accent);
  content: "";
  opacity: 0;
  pointer-events: none;
}
.step[data-owner="ai"] .step-node::after { border-color: var(--ai); box-shadow: 0 0 0 6px var(--ai-soft), 0 0 28px -4px var(--ai); }
.pipeline.is-running .step-node::after { animation: node-flash 7.2s linear infinite; animation-delay: calc(var(--step) * 1.27s); }
@keyframes node-flash {
  0%, 9%, 100% { opacity: 0; }
  2% { opacity: 1; }
}
.owner-badge {
  display: inline-block;
  margin-top: 20px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.step[data-owner="ai"] .owner-badge { border-color: color-mix(in srgb, var(--ai) 45%, transparent); color: var(--ai); }
.step h3 { margin-top: 12px; font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.step p { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.approach-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 52px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font-size: 15px;
}
.approach-note svg { flex: 0 0 auto; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Experience timeline --------------------------------------------------- */

.experience-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 7vw, 112px); }
.experience-intro { position: sticky; top: calc(var(--header-h) + 56px); align-self: start; }
.experience-intro .section-lede { margin-top: 22px; }
.experience-intro .hero-actions { margin-top: 30px; animation: none; }
.timeline { position: relative; margin: 0; padding: 0 0 0 36px; list-style: none; }
.timeline::before,
.timeline::after {
  position: absolute;
  top: 10px; bottom: 10px; left: 5px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}
.timeline::after {
  background: linear-gradient(180deg, var(--accent), var(--ai));
  transform: scaleY(var(--timeline-progress, 0));
  transform-origin: top;
}
html:not(.js) .timeline::after { display: none; }
.timeline-item { position: relative; padding-bottom: 48px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  position: absolute;
  z-index: 1;
  top: 6px; left: -36px;
  width: 11px; height: 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg-raised);
  content: "";
  transition: border-color .4s, background .4s;
}
.timeline-item.is-passed::before,
.timeline-item.is-current::before { border-color: var(--accent); background: var(--accent); }
.timeline-date { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 500 12.5px/1.4 var(--font-mono); letter-spacing: .06em; }
.now-badge { padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.timeline-role { margin-top: 10px; font-size: clamp(1.3rem, 2vw, 1.65rem); font-weight: 670; letter-spacing: -.025em; line-height: 1.2; }
.timeline-company { margin-top: 4px; color: var(--accent-text); font-size: 15px; font-weight: 550; }
.timeline-copy { max-width: 58ch; margin-top: 10px; color: var(--text-2); }

/* Archive teaser -------------------------------------------------------- */

.archive-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(190px, 1fr);
  gap: 16px;
}
.archive-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 20px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #101114;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}
.archive-tile img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.8) brightness(.72);
  transform: scale(1.18);
  transition: transform 1.1s var(--ease), filter .5s;
}
.archive-tile::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0) 25%, rgb(0 0 0 / .78));
  content: "";
}
.archive-tile:hover img { filter: saturate(1) brightness(.85); transform: scale(1.25); }
.archive-tile .tile-count { font-size: clamp(2.2rem, 3.6vw, 3.2rem); font-weight: 760; letter-spacing: -.05em; line-height: 1; }
.archive-tile .tile-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; }
.archive-tile .tile-label::after { color: var(--accent); content: "→"; transition: transform .3s var(--ease); }
.archive-tile:hover .tile-label::after { transform: translateX(4px); }
.tile-feature { grid-column: span 2; grid-row: span 2; }
.tile-feature .tile-count { font-size: clamp(4rem, 8vw, 7.5rem); }
.tile-all {
  grid-column: span 2;
  justify-content: space-between;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: radial-gradient(120% 140% at 100% 0%, rgb(255 122 26 / .35), transparent 55%), #111317;
}
.tile-all::after { display: none; }
.tile-all .tile-kicker { color: rgb(255 255 255 / .7); font: 500 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.tile-all strong { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.filmstrip { display: flex; margin-top: clamp(40px, 6vw, 72px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.filmstrip:empty { display: none; }
.filmstrip-track { display: flex; flex-shrink: 0; gap: 14px; padding-right: 14px; animation: marquee 90s linear infinite; }
.filmstrip img { width: 248px; aspect-ratio: 16 / 9; border-radius: 14px; object-fit: cover; opacity: .8; filter: saturate(.85); }

/* Contact --------------------------------------------------------------- */

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6.5vw, 96px);
  border: 1px solid var(--line);
  border-radius: 36px;
  background: radial-gradient(90% 120% at 100% 0%, var(--accent-soft), transparent 55%), radial-gradient(70% 90% at 0% 100%, var(--ai-soft), transparent 60%), var(--surface);
}
.contact-title { margin-top: 26px; font-size: clamp(3rem, 8.4vw, 8rem); font-weight: 760; line-height: .92; letter-spacing: -.058em; }
.contact-lede { max-width: 54ch; margin-top: 28px; color: var(--text-2); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 44px; }
.contact-email a {
  font-size: clamp(1.3rem, 3.2vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -.03em;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
  overflow-wrap: anywhere;
}
.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color .2s, color .2s;
}
.copy-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.copy-button:hover { border-color: var(--accent); color: var(--text); }
.contact-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 52px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
  list-style: none;
}
.contact-links a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 22px 24px;
  background: var(--surface);
  text-decoration: none;
  transition: background .25s;
}
.contact-links a:hover { background: var(--surface-2); }
.contact-links span { color: var(--muted); font: 500 12px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.contact-links strong { font-size: 17px; font-weight: 600; }

/* Footer ---------------------------------------------------------------- */

.site-footer { position: relative; overflow: hidden; padding: 72px 0 36px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 36px; }
.footer-brand p { max-width: 34ch; margin-top: 18px; color: var(--muted); font-size: 15px; }
.footer-clock { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--text-2); font: 500 12.5px/1 var(--font-mono); }
.footer-heading { margin-bottom: 14px; color: var(--faint); font: 500 11.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.footer-links { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--text-2); font-size: 15px; text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--accent-text); }
.footer-wordmark {
  margin: 72px 0 0;
  padding-bottom: .08em;
  background: linear-gradient(180deg, var(--line-strong), transparent 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(3.5rem, 15.5vw, 15rem);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: .9;
  white-space: nowrap;
  user-select: none;
}
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-bottom button { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; font-size: 13px; }

/* Command palette ------------------------------------------------------- */

.palette {
  width: min(660px, calc(100% - 24px));
  max-height: min(580px, calc(100dvh - 120px));
  margin: max(9vh, 60px) auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 50px 140px -30px rgb(0 0 0 / .8);
  color: var(--text);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.palette[open] { display: flex; flex-direction: column; animation: palette-in .2s var(--ease); }
.palette::backdrop { background: rgb(4 5 6 / .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette-search svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
.palette-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 17px/1.4 var(--font-sans); }
.palette-input::placeholder { color: var(--faint); }
.palette-list { flex: 1; margin: 0; padding: 8px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.palette-group { padding: 12px 12px 6px; color: var(--faint); font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 15px;
}
.palette-item[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.palette-item-icon { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--muted); font: 600 12px/1 var(--font-mono); }
.palette-item[aria-selected="true"] .palette-item-icon { border-color: var(--accent); color: var(--accent); }
.palette-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item-meta { flex: 0 0 auto; color: var(--faint); font: 500 11.5px/1 var(--font-mono); }
.palette-empty { padding: 36px 12px; color: var(--muted); text-align: center; }
.palette-footer { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--faint); font: 500 11.5px/1 var(--font-mono); }
.palette-footer span { display: inline-flex; align-items: center; gap: 6px; }

/* Toast ----------------------------------------------------------------- */

.toast {
  position: fixed;
  z-index: 120;
  left: 50%; bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity .3s, transform .3s var(--ease);
  pointer-events: none;
}
.toast::before { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); content: ""; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Wireframe debug mode (↑↑↓↓←→←→BA) -------------------------------------- */

html.wireframe body *:not(svg *):not(.toast):not(.toast *) { outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent) !important; outline-offset: -1px; }
html.wireframe img { opacity: .4; }
html.wireframe body::after {
  position: fixed;
  z-index: 110;
  top: 88px; right: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  content: "WIREFRAME · DEBUG VIEW";
  font: 600 11px/1 var(--font-mono);
  letter-spacing: .08em;
}

/* Interior pages -------------------------------------------------------- */

.page-hero { position: relative; padding: calc(var(--header-h) + 104px) 0 48px; overflow: hidden; isolation: isolate; }
.page-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 70% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 90% at 70% 0%, #000 10%, transparent 70%);
}
.page-hero h1 { margin-top: 22px; font-size: clamp(3rem, 9.5vw, 8.6rem); font-weight: 760; line-height: .9; letter-spacing: -.058em; }
.page-hero-intro { max-width: 56ch; margin-top: 26px; color: var(--text-2); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.page-hero-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 34px 0 0; padding: 0; color: var(--muted); font: 500 13px/1.3 var(--font-mono); list-style: none; }
.page-hero-stats strong { color: var(--text); font-weight: 600; }

/* Archive page ---------------------------------------------------------- */

.archive-toolbar {
  position: sticky;
  z-index: 30;
  top: calc(var(--header-h) + 22px);
  margin-bottom: 28px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}
.archive-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.search-field { position: relative; }
.search-field svg { position: absolute; top: 50%; left: 16px; width: 18px; height: 18px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search-field input {
  width: 100%;
  height: 48px;
  padding: 0 52px 0 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 15.5px;
  transition: border-color .2s, box-shadow .2s;
}
.search-field input::placeholder { color: var(--faint); }
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-field kbd { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); pointer-events: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.select-field select,
.clear-button {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
}
.select-field select { padding-right: 36px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.clear-button:disabled { opacity: .45; cursor: default; }
.category-chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 550;
  transition: border-color .2s, background .2s, color .2s;
}
.category-chip:hover { border-color: var(--line-strong); color: var(--text); }
.category-chip[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.category-chip span { color: inherit; font: 500 11.5px/1 var(--font-mono); opacity: .65; }
.archive-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 22px; color: var(--muted); font: 500 13px/1.4 var(--font-mono); }
.archive-status a { color: var(--text-2); }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.work-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform .45s var(--ease), border-color .3s, box-shadow .45s;
}
.work-card > a:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-4px); }
.work-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.work-card > a:hover .work-thumb img { transform: scale(1.06); }
.work-thumb > span {
  position: absolute;
  top: 12px; left: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgb(8 9 11 / .72);
  color: #f3f4f6;
  font: 500 11px/1.2 var(--font-mono);
  letter-spacing: .03em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.work-thumb::after {
  position: absolute;
  right: 12px; bottom: 12px;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  content: "▶";
  font-size: 13px;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .3s, transform .4s var(--ease);
}
.work-card > a:hover .work-thumb::after { opacity: 1; transform: none; }
.work-copy { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 18px 20px 22px; }
.work-copy small { color: var(--muted); font: 500 11.5px/1.4 var(--font-mono); letter-spacing: .02em; }
.work-copy h2, .work-copy h3 { font-size: 18.5px; font-weight: 650; letter-spacing: -.015em; line-height: 1.28; }
.work-copy p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 14.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.work-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.work-tags span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); font: 500 11px/1.2 var(--font-mono); }
.no-results { padding: 72px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.no-results h2 { font-size: 26px; letter-spacing: -.02em; }
.no-results p { margin-top: 8px; color: var(--muted); }
.archive-main { padding-bottom: 120px; }

/* Project detail -------------------------------------------------------- */

.detail-main { padding: calc(var(--header-h) + 72px) 0 120px; }
.detail-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 500 13px/1 var(--font-mono); text-decoration: none; }
.detail-back:hover { color: var(--text); }
.detail-loading { display: grid; place-items: center; min-height: 50vh; margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 220% 100%; color: var(--muted); font: 500 13px var(--font-mono); animation: shimmer 1.6s linear infinite; }
.detail-loading[hidden] { display: none; }
.detail-heading { margin-top: 34px; }
.detail-eyebrow { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-eyebrow span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font: 500 12px/1.2 var(--font-mono); }
.detail-eyebrow span:first-child { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); }
.detail-heading h1 { max-width: 20ch; margin-top: 22px; font-size: clamp(2.3rem, 6vw, 5.2rem); font-weight: 740; line-height: .98; letter-spacing: -.05em; }
html[lang="th"] .detail-heading h1 { line-height: 1.2; letter-spacing: -.02em; }
.detail-lead { max-width: 64ch; margin-top: 22px; color: var(--text-2); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); align-items: start; gap: 28px; margin-top: 48px; }
.detail-gallery { padding: 10px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); }
.detail-gallery:focus-visible { outline-offset: 4px; }
.detail-stage { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background: #050506; }
.detail-stage iframe { width: 100%; height: 100%; border: 0; }
.detail-stage > img { width: 100%; height: 100%; object-fit: contain; }
.detail-media-empty { color: #9198a2; font: 500 13px var(--font-mono); }
.detail-carousel-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 4px; color: var(--muted); font: 500 12.5px/1 var(--font-mono); }
.detail-carousel-bar button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-2); color: var(--text); }
.detail-carousel-bar button:hover { border-color: var(--accent); }
.detail-thumbnails { display: flex; gap: 8px; padding: 8px 4px 4px; overflow-x: auto; scroll-snap-type: x mandatory; }
.detail-thumbnail { position: relative; flex: 0 0 116px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--surface-2); scroll-snap-align: start; opacity: .62; transition: opacity .2s, border-color .2s; }
.detail-thumbnail:hover { opacity: 1; }
.detail-thumbnail.active { border-color: var(--accent); opacity: 1; }
.detail-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.detail-play-mark { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; text-shadow: 0 2px 8px rgb(0 0 0 / .6); }
.detail-aside { position: sticky; top: calc(var(--header-h) + 40px); padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); }
.detail-aside-title { color: var(--faint); font: 500 11.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.detail-meta { margin: 10px 0 0; }
.detail-meta div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-meta dt { padding-top: 2px; color: var(--muted); font: 500 11.5px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.detail-meta dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 550; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.detail-tags span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font: 500 11.5px/1.2 var(--font-mono); }
.detail-source-links { display: grid; gap: 8px; margin-top: 20px; }
.detail-source-links:empty { display: none; }
.detail-source-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: background .2s, color .2s; }
.detail-source-button:hover { background: var(--accent); color: var(--accent-ink); }
.detail-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 28px; margin-top: 80px; }
.detail-about > h2 { grid-column: 1 / -1; font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 720; letter-spacing: -.04em; }
.detail-rich-text { max-width: 72ch; color: var(--text-2); font-size: 17.5px; line-height: 1.75; }
.detail-rich-text > * + * { margin-top: 1.1em; }
.detail-rich-text h2, .detail-rich-text h3 { margin-top: 1.8em; color: var(--text); letter-spacing: -.025em; line-height: 1.2; }
.detail-rich-text h2 { font-size: 1.55em; }
.detail-rich-text h3 { font-size: 1.25em; }
.detail-rich-text ul, .detail-rich-text ol { padding-left: 1.3em; }
.detail-rich-text li + li { margin-top: .4em; }
.detail-rich-text li::marker { color: var(--accent); }
.detail-rich-text blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--text); font-size: 1.1em; }
.detail-rich-text figure { margin: 1.8em 0; }
.detail-rich-text img { border: 1px solid var(--line); border-radius: 16px; }
.detail-rich-text figcaption { margin-top: 10px; color: var(--muted); font: 500 12.5px/1.5 var(--font-mono); }
.detail-rich-text a { color: var(--accent-text); }
.detail-expandable-image { cursor: zoom-in; }
.detail-notes { position: sticky; top: calc(var(--header-h) + 40px); display: grid; align-content: start; align-self: start; gap: 14px; }
.detail-about.is-notes-only .detail-notes { position: static; }
.detail-notes article { padding: 22px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.detail-notes h3 { color: var(--accent-text); font: 500 11.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.detail-notes article[data-detail-workflow-wrap] h3 { color: var(--ai); }
.detail-notes p { margin-top: 12px; color: var(--text-2); font-size: 15.5px; }
.detail-about.is-notes-only { grid-template-columns: minmax(0, 1fr); }
.detail-about.is-notes-only .detail-notes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.detail-related { margin-top: 104px; }
.detail-related .work-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.detail-related-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.detail-related-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 720; letter-spacing: -.04em; }
.detail-error { display: grid; justify-items: start; gap: 16px; margin-top: 40px; padding: clamp(32px, 6vw, 72px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.detail-error h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.045em; }
.detail-error p { color: var(--muted); }
.detail-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: clamp(16px, 4vw, 48px); border: 0; background: rgb(4 5 6 / .94); color: #fff; }
.detail-lightbox[open] { display: grid; place-items: center; }
.detail-lightbox::backdrop { background: rgb(0 0 0 / .6); }
.detail-lightbox-figure { display: grid; justify-items: center; gap: 14px; max-width: 100%; max-height: 100%; margin: 0; }
.detail-lightbox-figure img { max-width: min(1600px, 100%); max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 10px; }
.detail-lightbox-caption { color: #c8ccd3; font: 500 13px/1.5 var(--font-mono); text-align: center; }
.detail-lightbox-close { position: fixed; top: 18px; right: 18px; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgb(255 255 255 / .25); border-radius: 50%; background: rgb(255 255 255 / .08); color: #fff; font-size: 26px; line-height: 1; }

/* Language chooser ------------------------------------------------------ */

.chooser-page { min-height: 100svh; }
.chooser { position: relative; display: grid; place-items: center; min-height: 100svh; padding: 88px var(--gutter) 64px; overflow: hidden; isolation: isolate; }
.chooser .hud { inset: 24px var(--gutter); }
.chooser .hero-shade { background: radial-gradient(ellipse 60% 70% at 62% 50%, var(--shade), transparent 78%), radial-gradient(ellipse 70% 60% at 50% 45%, var(--shade), transparent 75%), linear-gradient(180deg, var(--bg) 0%, transparent 30%); }
.chooser-card { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); align-items: center; gap: clamp(40px, 7vw, 104px); width: min(1120px, 100%); }
.chooser-card .hero-portrait { justify-self: center; max-width: 340px; }
.chooser-brand { display: flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; font: 500 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.chooser-brand .brand-mark { width: 34px; height: 34px; }
.chooser-name { margin-top: 26px; font-size: clamp(2.8rem, 6.8vw, 6.2rem); font-weight: 760; line-height: .9; letter-spacing: -.058em; }
.chooser-name .line { display: block; overflow: hidden; padding: 0 .04em .14em 0; margin-bottom: -.14em; }
.chooser-name .line > span { display: inline-block; animation: rise 1.15s var(--ease) both; }
.chooser-name .line:nth-child(2) > span { animation-delay: .1s; }
.chooser-role { margin-top: 20px; color: var(--text-2); font-size: clamp(1.1rem, 1.8vw, 1.4rem); font-weight: 500; }
.chooser-prompt { margin-top: 44px; color: var(--muted); font: 500 13px/1.5 var(--font-mono); letter-spacing: .04em; }
.chooser-prompt h1 { display: inline; font: inherit; }
.language-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.language-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  text-decoration: none;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color .25s, transform .35s var(--ease), box-shadow .35s;
}
.language-choice:hover { border-color: var(--accent); box-shadow: 0 18px 50px -24px var(--accent); transform: translateY(-3px); }
.language-choice img { flex: 0 0 auto; width: 52px; height: 35px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px var(--line-strong); }
.language-choice span { display: grid; flex: 1; gap: 2px; }
.language-choice strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.language-choice small { color: var(--muted); font-size: 13.5px; }
.language-choice kbd { flex: 0 0 auto; }
html:not(.js) .language-choice kbd { display: none; }
.chooser-note { margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.chooser-versions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.chooser-versions a { color: var(--text-2); text-decoration: none; }
.chooser-versions a:hover { color: var(--accent-text); }

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1099px) {
  .menu-toggle { display: inline-grid; }
  .cmdk-label { display: none; }
  .cmdk-trigger { width: 40px; padding: 0; justify-content: center; }
  .cmdk-trigger kbd { display: none; }
  .header-actions { margin-left: auto; }
  .site-nav {
    position: fixed;
    z-index: -1;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 28px;
    height: 100dvh;
    padding: calc(var(--header-h) + 52px) var(--gutter) 32px;
    overflow-y: auto;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; }
  html:not(.js) .site-nav { position: static; z-index: auto; height: auto; padding: 0; opacity: 1; visibility: visible; background: none; flex-direction: row; }
  html:not(.js) .nav-links { display: none; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .nav-links a { padding: 16px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: clamp(1.6rem, 6vw, 2.3rem); font-weight: 650; letter-spacing: -.03em; color: var(--text); }
  .nav-links a:hover { background: none; color: var(--accent-text); }
  .nav-links a.is-active::after, .nav-links a[aria-current="page"]::after { left: auto; right: 4px; top: 50%; width: 8px; height: 8px; transform: translateY(-50%); }
  .nav-extras { justify-content: space-between; }
  .site-header .container { width: calc(100% - 24px); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-wide { grid-column: 1 / -1; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 44px; }
  .pipeline::before, .pipeline::after { display: none; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .detail-layout, .detail-about { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { position: static; }
}

@media (max-width: 860px) {
  .hero { padding-top: calc(var(--header-h) + 64px); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-portrait { justify-self: start; max-width: 300px; margin: 44px 0 0 14px; }
  .hud-tr, .hud-bl { display: none; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-stats > div:nth-child(n + 3) { margin-top: 18px; border-top: 1px solid var(--line); }
  .section-head, .approach-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .case { grid-template-columns: minmax(0, 1fr); }
  .case:nth-child(even) .case-media { order: 0; }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .experience-layout { grid-template-columns: minmax(0, 1fr); }
  .experience-intro { position: static; }
  .archive-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(160px, auto); }
  .tile-feature { grid-row: span 1; min-height: 280px; }
  .contact-links { grid-template-columns: minmax(0, 1fr); }
  .archive-toolbar { position: static; }
  .archive-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .search-field { grid-column: 1 / -1; }
  .chooser-card { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .chooser-card .hero-portrait { justify-self: start; max-width: 200px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .brand-copy small { display: none; }
  .brand-copy strong { font-size: 14px; }
  .header-bar { gap: 8px; padding-left: 12px; }
  .hud { display: none; }
  .hero-actions .button { flex: 1 1 auto; }
  .hint-button { display: none; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento-copy { max-width: none; }
  .bento-visual { position: relative; z-index: 0; max-width: none; width: calc(100% + 56px); height: 200px; margin: 24px -28px -28px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%); mask-image: linear-gradient(180deg, transparent, #000 40%); }
  .pipeline { grid-template-columns: minmax(0, 1fr); row-gap: 0; padding-left: 0; }
  .step { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; padding: 0 0 30px; }
  .step-node { grid-row: span 3; }
  .owner-badge { justify-self: start; margin-top: 2px; }
  .step::before { position: absolute; top: 60px; bottom: 4px; left: 28px; width: 1px; background: var(--line-strong); content: ""; }
  .step:last-child::before { display: none; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-tiles { grid-template-columns: minmax(0, 1fr); }
  .tile-feature, .tile-all { grid-column: auto; }
  .language-choice-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-meta div { grid-template-columns: 84px minmax(0, 1fr); }
  .detail-thumbnail { flex-basis: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee-track, .filmstrip-track { flex-wrap: wrap; justify-content: center; }
  .marquee + .marquee { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .site-header, .viewport-canvas, .hud, .hero-shade, .tech-marquee, .filmstrip, .palette, .toast, body::before { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Pipeline step timing: the packet reaches each node about every 1.27s. */
.step:nth-child(1) { --step: 0; }
.step:nth-child(2) { --step: 1; }
.step:nth-child(3) { --step: 2; }
.step:nth-child(4) { --step: 3; }
.step:nth-child(5) { --step: 4; }
.step:nth-child(6) { --step: 5; }

@media (max-width: 1239px) {
  .cmdk-label, .site-header .brand-copy small { display: none; }
}

/* Wide hero images are letterboxed over a blurred copy instead of being cropped. */
.case-media > figure.is-wide { position: relative; overflow: hidden; }
.case-media > figure.is-wide > img.case-media-backdrop { position: absolute; inset: 0; object-fit: cover; filter: blur(30px) saturate(1.25) brightness(.62); transform: scale(1.3); }
.case-media > figure.is-wide > img:not(.case-media-backdrop) { position: relative; object-fit: contain; }
.case:hover .case-media > figure.is-wide > img.case-media-backdrop { transform: scale(1.3); }

/* Thai is never letter-spaced: wide tracking splits syllables. */
html[lang="th"] .section-index,
html[lang="th"] .footer-heading,
html[lang="th"] .detail-aside-title,
html[lang="th"] .detail-meta dt,
html[lang="th"] .detail-notes h3,
html[lang="th"] .contact-links span,
html[lang="th"] .tile-kicker,
html[lang="th"] .palette-group,
html[lang="th"] .owner-badge,
html[lang="th"] .case-meta,
html[lang="th"] .timeline-date,
html[lang="th"] .hero-stats dt { letter-spacing: 0; }

/* Lookup pages (project 404 fallback, legacy ?id= routes): without JavaScript the not-found message shows at once;
   with JavaScript it waits for the live lookup. */
html:not(.js) [data-detail-lookup] .detail-loading { display: none; }
html.js [data-detail-lookup]:not([data-detail-resolved]) .detail-error { display: none; }
