/* =========================================================
   WARANYU PIPORNPONG — Personal Portfolio
   Editorial system: Swiss grid × scientific journal
   ========================================================= */

/* ---------- Fonts (self-hosted, see /assets/fonts) ---------- */
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/fonts/dm-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("assets/fonts/ibm-plex-sans-thai-thai-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("assets/fonts/ibm-plex-sans-thai-thai-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("assets/fonts/ibm-plex-sans-thai-thai-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("assets/fonts/ibm-plex-sans-thai-thai-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }

/* ---------- Tokens ---------- */
:root {
  --ivory: #F4F1E9;
  --ivory-2: #EAE5D8;
  --ink: #20242C;
  --ink-2: #2B303A;
  --cobalt: #244DDB;
  --orange: #F26A38;
  --teal: #4D9B95;
  --lime: #D9F36A;
  --muted: #5B606B;
  --orange-ink: #C4461A; /* orange for text on ivory (contrast-safe) */
  --line: rgba(32, 36, 44, .16);
  --line-dark: rgba(244, 241, 233, .16);

  --f-display: "Space Grotesk", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-body: "Inter", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-ui: "DM Sans", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, monospace;

  --pad: clamp(20px, 4vw, 56px);
  --gap: clamp(16px, 2vw, 28px);
  --sec: clamp(88px, 12vw, 176px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --nav-h: 68px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html[data-lang="th"] body { line-height: 1.75; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
sub { font-size: .62em; vertical-align: -.18em; line-height: 0; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }
.dark :focus-visible, .next :focus-visible { outline-color: var(--lime); }

.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding-inline: var(--pad); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; }
html[data-lang="th"] .mono { letter-spacing: .02em; }
.hide-sm { }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: var(--ivory); padding: 10px 16px; font: 500 14px var(--f-ui); text-decoration: none; }
.skip:focus { top: 12px; }

.display {
  font-family: var(--f-display); font-weight: 600; letter-spacing: -.045em; line-height: .92;
  font-size: clamp(48px, 8.4vw, 132px); text-transform: none;
}
.display--xl { font-size: clamp(52px, 9.6vw, 156px); }
html[data-lang="th"] .display { letter-spacing: -.02em; line-height: 1.08; font-size: clamp(40px, 6.6vw, 104px); }
html[data-lang="th"] .display--xl { font-size: clamp(42px, 7.4vw, 116px); }

.dark { background: var(--ink); color: var(--ivory); }

/* ---------- Progress bar ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--cobalt); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); transition: background .35s var(--ease), border-color .35s, color .35s; border-bottom: 1px solid transparent; }
.nav.is-stuck { background: rgba(244, 241, 233, .88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom-color: var(--line); }
.nav.on-dark { color: var(--ivory); }
.nav.on-dark.is-stuck { background: rgba(32, 36, 44, .86); border-bottom-color: var(--line-dark); }
.nav.menu-open, .nav.menu-open.is-stuck { background: var(--ink); color: var(--ivory); border-bottom-color: var(--line-dark); }
.nav.on-cobalt.is-stuck { background: rgba(36, 77, 219, .9); border-bottom-color: rgba(255,255,255,.18); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.nav__mark { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.nav__mark svg { width: 34px; height: 34px; transition: transform .8s var(--ease); }
.nav__mark:hover svg { transform: rotate(120deg); }
.dot-cobalt { fill: var(--cobalt); } .dot-orange { fill: var(--orange); } .dot-teal { fill: var(--teal); }
.on-dark .dot-cobalt, .on-cobalt .dot-cobalt { fill: var(--lime); }
.nav__name { font: 600 15px/1 var(--f-display); letter-spacing: -.01em; }
.nav__links { display: flex; gap: 4px; align-items: center; }
.nav__links a { font: 500 14px/1 var(--f-ui); text-decoration: none; padding: 10px 12px; border-radius: 999px; position: relative; transition: background .25s; }
.nav__links a:hover { background: rgba(32,36,44,.07); }
.on-dark .nav__links a:hover, .on-cobalt .nav__links a:hover { background: rgba(244,241,233,.12); }
.nav__links a.is-active::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--orange); transform: translateX(-50%); }
.nav__cta { border: 1px solid currentColor; }
.nav__tools { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; border: 1px solid currentColor; border-radius: 999px; padding: 3px; }
.lang button { font: 500 12px/1 var(--f-mono); letter-spacing: .06em; padding: 7px 10px; border-radius: 999px; transition: background .25s, color .25s; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); }
.on-dark .lang button[aria-pressed="true"], .on-cobalt .lang button[aria-pressed="true"] { background: var(--ivory); color: var(--ink); }
.nav__burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; position: relative; }
.nav__burger span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; transition: transform .35s var(--ease), top .35s var(--ease); }
.nav__burger span:first-child { top: 18px; } .nav__burger span:last-child { top: 24px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-menu { position: fixed; inset: var(--nav-h) 0 0 0; background: var(--ink); color: var(--ivory); z-index: 99; overflow-y: auto; }
.mobile-menu nav { display: flex; flex-direction: column; padding-top: 24px; padding-bottom: 40px; }
.mobile-menu a { display: flex; align-items: baseline; gap: 16px; text-decoration: none; font: 600 clamp(34px, 9vw, 56px)/1.15 var(--f-display); letter-spacing: -.03em; padding: 10px 0; border-bottom: 1px solid var(--line-dark); }
.mobile-menu a i { font: 400 12px var(--f-mono); color: var(--lime); font-style: normal; }
.mobile-menu:not([hidden]) a { animation: rise .6s var(--ease) both; }
.mobile-menu a:nth-child(2) { animation-delay: .04s; } .mobile-menu a:nth-child(3) { animation-delay: .08s; } .mobile-menu a:nth-child(4) { animation-delay: .12s; } .mobile-menu a:nth-child(5) { animation-delay: .16s; } .mobile-menu a:nth-child(6) { animation-delay: .2s; } .mobile-menu a:nth-child(7) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 14px; padding: 15px 22px; border: 1px solid currentColor; border-radius: 999px; font: 500 15px/1 var(--f-ui); text-decoration: none; transition: background .3s var(--ease), color .3s, border-color .3s, transform .3s var(--ease); white-space: nowrap; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn[href="#journey"]:hover svg { transform: translateY(3px); }
.btn:hover { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.btn--solid { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); }
.btn--ghost { border-color: transparent; padding-inline: 8px; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.btn--ghost:hover { background: transparent; color: var(--cobalt); border-color: transparent; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; transition: background .25s, color .25s; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-btn:hover { background: var(--ink); color: var(--ivory); }
.link-arrow { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow:hover { color: var(--cobalt); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--f-mono); letter-spacing: .08em; padding: 6px 8px 5px; border-radius: 3px; font-style: normal; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--verified { background: rgba(77,155,149,.16); color: #23615C; }
.badge--owner { background: rgba(36,77,219,.12); color: var(--cobalt); }
.badge--pending { background: rgba(242,106,56,.15); color: #A63D16; }
.dark .badge--verified { background: rgba(77,155,149,.25); color: #9ED6D1; }
.dark .badge--owner { background: rgba(120,150,255,.18); color: #B9C8FF; }
.dark .badge--pending { background: rgba(242,106,56,.22); color: #FFB596; }

/* ---------- Section head ---------- */
.sec-head { display: flex; align-items: center; gap: 16px; padding-top: 20px; border-top: 1px solid var(--ink); margin-bottom: clamp(40px, 6vw, 88px); }
.sec-head--dark { border-top-color: var(--ivory); }
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }
.sec-head--dark .rule { background: var(--line-dark); }
.sec-head > .mono:first-child { color: var(--cobalt); font-weight: 500; }
.sec-head--dark > .mono:first-child { color: var(--lime); }
.sec-title { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: end; margin-bottom: clamp(48px, 7vw, 104px); }
.sec-title .display { grid-column: 1 / span 8; }
.sec-intro { grid-column: 9 / span 4; font-size: 17px; color: var(--muted); max-width: 42ch; }
.dark .sec-intro { color: rgba(244,241,233,.72); }
.kicker { display: block; color: var(--muted); margin-bottom: 14px; }
.dark .kicker { color: rgba(244,241,233,.6); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; min-height: calc(100svh - var(--nav-h)); padding: 24px 0 56px; overflow: hidden; margin-top: calc(var(--nav-h) * -1); padding-top: calc(var(--nav-h) + 24px); }
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gap); grid-template-areas:
  "meta meta meta meta meta meta meta meta meta meta meta meta"
  "name name name name name name name name name port port port"
  "words words words words words words words words words port port port"
  "copy copy copy copy copy copy creds creds creds creds creds creds"; }
.hero__meta { grid-area: meta; display: flex; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: clamp(28px, 4vw, 56px); }
.hero__name { grid-area: name; font-family: var(--f-display); font-weight: 700; font-size: clamp(54px, 11.4vw, 184px); line-height: .84; letter-spacing: -.055em; align-self: start; }
.hero__name .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__name .line:nth-child(2) { color: var(--cobalt); }
.hero__name .split { display: inline-block; }
.hero__name .ch { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.hero.is-ready .hero__name .ch { transform: none; }
.hero__thai { display: block; font: 500 clamp(18px, 2vw, 26px)/1.3 "IBM Plex Sans Thai", sans-serif; letter-spacing: 0; color: var(--muted); margin-top: 18px; opacity: 0; transition: opacity 1s .9s; }
.hero.is-ready .hero__thai { opacity: 1; }


.hero__words { grid-area: words; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0 clamp(14px, 2.2vw, 36px); margin: clamp(28px, 4vw, 52px) 0 clamp(28px, 4vw, 48px); }
.word { position: relative; font: 600 clamp(22px, 3.3vw, 52px)/1 var(--f-display); letter-spacing: -.035em; color: rgba(32,36,44,.26); transition: color .6s var(--ease); }
.word i { position: absolute; top: -18px; left: 2px; font-style: normal; font-size: 10.5px; color: var(--muted); }
.word.is-on { color: var(--ink); }
.word.is-on span { background: linear-gradient(var(--lime), var(--lime)) 0 88% / 100% .28em no-repeat; }

.hero__copy { grid-area: copy; }
.lead { font: 400 clamp(20px, 1.9vw, 27px)/1.38 var(--f-body); letter-spacing: -.012em; max-width: 30ch; margin-bottom: 30px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero__creds { grid-area: creds; align-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--gap); border-top: 1px solid var(--ink); }
.hero__creds li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; line-height: 1.45; }
.hero__creds b { color: var(--cobalt); font-weight: 500; min-width: 44px; }
.hero__scroll { position: absolute; right: var(--pad); bottom: -40px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); }
.hero__scroll i { width: 1px; height: 28px; background: currentColor; transform-origin: top; animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }


/* ---------- Hero motion reel ---------- */
.hero__reel { grid-area: port; align-self: start; margin-top: 6px; }
.reel { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; height: clamp(360px, 36vw, 520px); overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); }
.reel__col { overflow: hidden; }
.reel__track { display: flex; flex-direction: column; gap: 8px; animation: reelUp 46s linear infinite; will-change: transform; }
.reel__col:nth-child(3) .reel__track { animation-duration: 54s; animation-delay: -18s; }
.reel__col--down .reel__track { animation-name: reelDown; animation-duration: 50s; }
.reel:hover .reel__track, .reel:focus-within .reel__track, .reel.is-paused .reel__track { animation-play-state: paused; }
@keyframes reelUp { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 4px)); } }
@keyframes reelDown { from { transform: translateY(calc(-50% - 4px)); } to { transform: translateY(0); } }
.reel__item { position: relative; display: block; width: 100%; aspect-ratio: 5 / 6; overflow: hidden; background: var(--ivory-2); cursor: zoom-in; padding: 0; }
.reel__item img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.02); transition: filter .5s var(--ease), transform .6s var(--ease); }
.reel__item:hover img, .reel__item:focus-visible img { filter: saturate(1.1); transform: scale(1.05); }
.reel__cap { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 5px 7px; background: rgba(32,36,44,.86); color: var(--ivory); font-size: 9.5px; line-height: 1.3; letter-spacing: .04em; text-transform: none; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.reel__item:hover .reel__cap, .reel__item:focus-visible .reel__cap { opacity: 1; transform: none; }
.hero__reel figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 1024px) {
  .reel { height: 420px; }
}
@media (max-width: 760px) {
  .hero__reel { max-width: none; margin-top: 36px; }
  .reel { height: 340px; gap: 6px; }
  .reel__track { gap: 6px; }
  .reel__cap { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reel__track { animation: none !important; }
}

/* =========================================================
   MANIFESTO
   ========================================================= */
.manifesto { padding: var(--sec) 0; }
.manifesto__quote p { font: 500 clamp(36px, 5.6vw, 92px)/1.02 var(--f-display); letter-spacing: -.04em; max-width: 17ch; }
html[data-lang="th"] .manifesto__quote p { letter-spacing: -.01em; line-height: 1.2; font-size: clamp(30px, 4.4vw, 70px); max-width: 20ch; }
.manifesto__quote em { font-style: normal; color: var(--lime); }
.manifesto__trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin: clamp(56px, 8vw, 120px) 0 clamp(48px, 6vw, 88px); }
.manifesto__trio > div { border-top: 1px solid var(--line-dark); padding-top: 18px; }
.manifesto__trio i { font-style: normal; color: var(--lime); display: block; margin-bottom: 18px; }
.manifesto__trio p { font: 400 clamp(20px, 2vw, 28px)/1.25 var(--f-display); letter-spacing: -.02em; color: rgba(244,241,233,.62); }
.manifesto__trio b { font-weight: 500; color: var(--ivory); }
.manifesto__story { max-width: 62ch; margin-left: auto; font-size: clamp(17px, 1.4vw, 20px); color: rgba(244,241,233,.78); padding-left: 24px; border-left: 2px solid var(--orange); }

/* =========================================================
   JOURNEY
   ========================================================= */
.journey { padding: var(--sec) 0; }
.method { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: clamp(36px, 5vw, 64px); }
.method__label { color: var(--muted); }
.method__steps { display: flex; flex-wrap: wrap; gap: 6px; counter-reset: m; }
.method__steps li { counter-increment: m; display: flex; align-items: center; gap: 8px; font: 500 14px/1 var(--f-ui); padding: 9px 14px 9px 10px; border-radius: 999px; border: 1px solid var(--line); transition: background .4s var(--ease), color .4s, border-color .4s; }
.method__steps li::before { content: "0" counter(m); font: 400 10px var(--f-mono); color: var(--muted); }
.method__steps li.is-lead { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.method__steps li.is-lead::before { color: var(--lime); }

.timeline__track { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-bottom: clamp(32px, 4vw, 56px); }
.timeline__track::before, .timeline__track::after { content: ""; position: absolute; left: 0; right: 0; top: 23px; height: 2px; background: var(--line); }
.timeline__track::after { background: var(--chapter, var(--cobalt)); right: auto; width: var(--fill, 0%); transition: width .8s var(--ease), background .5s; }
.tab { position: relative; z-index: 1; text-align: left; padding: 0 12px 0 0; display: grid; gap: 10px; }
.tab__node { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink); background: var(--ivory); display: grid; place-items: center; font: 500 12px var(--f-mono); transition: background .4s var(--ease), color .4s, transform .4s var(--ease), border-color .4s; }
.tab__label { font: 600 clamp(14px, 1.3vw, 18px)/1.15 var(--f-display); letter-spacing: -.01em; color: var(--muted); transition: color .3s; }
.tab__label small { display: block; font: 400 10.5px/1.4 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.tab:hover .tab__node { transform: scale(1.08); }
.tab.is-past .tab__node { background: var(--ink); color: var(--ivory); }
.tab[aria-selected="true"] .tab__node { background: var(--chapter, var(--cobalt)); border-color: var(--chapter, var(--cobalt)); color: var(--ch-ink, #fff); transform: scale(1.12); }
.tab[aria-selected="true"] .tab__label { color: var(--ink); }

.timeline__panel { min-height: 520px; }
.chapter { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); animation: chapterIn .7s var(--ease) both; }
@keyframes chapterIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.chapter__num { grid-column: 1 / span 4; position: relative; }
.chapter__num b { display: block; font: 700 clamp(120px, 19vw, 300px)/.78 var(--f-display); letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.chapter__num b span { color: var(--chapter); -webkit-text-stroke: 0; }
.chapter__fig { margin-top: 28px; aspect-ratio: 1; max-width: 280px; background: var(--ivory-2); border-radius: 2px; padding: 14px; color: var(--ink); }
.chapter__fig svg { width: 100%; height: 100%; }
.chapter__body { grid-column: 6 / span 7; }
.chapter__body .kicker { color: var(--chapter-text, var(--cobalt)); font-weight: 500; }
.chapter__title { font: 600 clamp(38px, 5vw, 76px)/.95 var(--f-display); letter-spacing: -.045em; margin-bottom: 8px; }
html[data-lang="th"] .chapter__title { letter-spacing: -.01em; line-height: 1.1; }
.chapter__sub { font: 400 18px var(--f-display); color: var(--muted); margin-bottom: 28px; }
.chapter__text { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.55; max-width: 52ch; margin-bottom: 32px; }
.chapter__keys { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chapter__keys li { font: 400 13.5px/1 var(--f-ui); padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); }
.chapter__carry { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 22px 0 0; border-top: 1px solid var(--ink); }
.chapter__carry .mono { color: var(--muted); padding-top: 4px; }
.chapter__carry p { font: 500 clamp(18px, 1.6vw, 22px)/1.35 var(--f-display); letter-spacing: -.015em; }
.timeline__nav { display: flex; align-items: center; gap: 16px; justify-content: flex-end; margin-top: 40px; }

/* =========================================================
   RESEARCH
   ========================================================= */
.research { padding: var(--sec) 0; background: var(--ivory-2); }
.research__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); margin-bottom: clamp(56px, 7vw, 96px); }
.thesis { grid-column: 1 / span 9; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ink); color: var(--ivory); }
.thesis__fig { position: relative; padding: 24px; border-right: 1px solid var(--line-dark); min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.thesis__fig svg { width: 100%; height: auto; }
.fig-note { position: absolute; left: 24px; bottom: 18px; font-size: 10px; color: rgba(244,241,233,.5); }
.thesis__body { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; }
.thesis__body .kicker { color: var(--lime); }
.thesis h3 { font: 600 clamp(24px, 2.4vw, 36px)/1.08 var(--f-display); letter-spacing: -.03em; margin-bottom: 16px; }
.thai-sub { font: 400 14px/1.7 "IBM Plex Sans Thai", sans-serif; color: rgba(244,241,233,.6); margin-bottom: 28px; }
.thesis__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.thesis .link-arrow:hover { color: var(--lime); }
.areas { grid-column: 10 / span 3; align-self: end; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font: 500 13px/1 var(--f-ui); padding: 10px 13px; border-radius: 999px; background: var(--ivory); border: 1px solid var(--line); transition: background .25s, color .25s; }
.tags li:hover { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }

.pubs__head, .pub__row { display: grid; grid-template-columns: 64px 1fr 92px 176px 48px; gap: 16px; align-items: center; }
.pubs__head { padding: 0 0 12px; border-bottom: 1px solid var(--ink); color: var(--muted); }
.pub { border-bottom: 1px solid var(--line); }
.pub__row { width: 100%; text-align: left; padding: 26px 0; transition: background .25s; }
.pub__row:hover { background: rgba(255,255,255,.4); }
.pub__no { font: 500 13px var(--f-mono); color: var(--cobalt); padding-left: 4px; }
.pub__title { font: 500 clamp(17px, 1.55vw, 22px)/1.3 var(--f-display); letter-spacing: -.015em; }
.pub__title small { display: block; font: 400 12.5px/1.4 var(--f-body); color: var(--muted); margin-top: 6px; letter-spacing: 0; }
.pub__year { font: 500 14px var(--f-mono); }
.pub__toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ink); position: relative; justify-self: end; transition: background .25s, transform .4s var(--ease); }
.pub__toggle::before, .pub__toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.pub__toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .35s var(--ease); }
.pub__row[aria-expanded="true"] .pub__toggle { background: var(--ink); color: var(--ivory); }
.pub__row[aria-expanded="true"] .pub__toggle::after { transform: translate(-50%, -50%) rotate(0); }
.pub__detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.pub__detail > div { overflow: hidden; }
.pub.is-open .pub__detail { grid-template-rows: 1fr; }
.pub__inner { display: grid; grid-template-columns: 64px 1.3fr minmax(0, 340px); grid-template-rows: auto 1fr; align-items: start; gap: 20px 32px; padding: 0 0 36px; }
.pub__inner dl { grid-column: 2; align-content: start; display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; font-size: 15px; }
.pub__inner dt { color: var(--muted); }
.pub__inner dd a { color: var(--cobalt); word-break: break-all; }
.pub__summary { grid-column: 2; font-size: 16px; color: var(--ink); max-width: 60ch; }
.pub__fig { grid-column: 3; grid-row: 1 / span 2; background: var(--ivory); border: 1px solid var(--line); padding: 14px; }
.pub__fig svg { width: 100%; height: auto; }
.pub__fig .mono { display: block; margin-top: 8px; font-size: 10px; color: var(--muted); }
.pubs__note { margin-top: 20px; color: var(--muted); max-width: 80ch; text-transform: none; letter-spacing: .01em; }

/* =========================================================
   SPEAKING
   ========================================================= */
.speaking { padding: var(--sec) 0; }
.speaking__hero { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: end; margin-bottom: clamp(48px, 6vw, 80px); }
.speaking__hero .display { grid-column: 1 / span 9; }
.speaking__hero .display em { font-style: normal; color: var(--orange-ink); }
.stats { grid-column: 10 / span 3; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: 11px; max-width: 16ch; }
.stats dd { font: 600 clamp(34px, 3.4vw, 52px)/1 var(--f-display); letter-spacing: -.04em; color: var(--cobalt); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 28px; color: var(--muted); }
.legend > span { display: inline-flex; gap: 10px; align-items: center; text-transform: none; letter-spacing: .01em; font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chip { font: 500 13.5px/1 var(--f-ui); padding: 11px 15px; border: 1px solid var(--line); border-radius: 999px; transition: background .25s, color .25s, border-color .25s; display: inline-flex; gap: 8px; align-items: center; }
.chip i { font: 400 10.5px var(--f-mono); font-style: normal; opacity: .6; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }

.talks { border-top: 1px solid var(--ink); }
.talk { border-bottom: 1px solid var(--line); }
.talk.is-hidden { display: none; }
.talk__row { width: 100%; text-align: left; display: grid; grid-template-columns: 220px 1fr 240px 48px; gap: 24px; align-items: center; padding: 30px 0; transition: padding .4s var(--ease); }
.talk__row:hover { padding-left: 12px; }
.talk__date { font: 600 clamp(26px, 2.6vw, 40px)/1 var(--f-display); letter-spacing: -.04em; }
.talk__date small { display: block; font: 400 11px var(--f-mono); letter-spacing: .06em; color: var(--muted); margin-top: 8px; text-transform: uppercase; }
.talk__event { font: 500 clamp(19px, 1.8vw, 26px)/1.2 var(--f-display); letter-spacing: -.02em; }
.talk__event small { display: block; font: 400 14px/1.45 var(--f-body); color: var(--muted); margin-top: 6px; letter-spacing: 0; }
.talk__meta { display: grid; gap: 8px; justify-items: start; }
.talk__meta .mono { color: var(--muted); font-size: 11px; }
.talk .pub__toggle { justify-self: end; }
.talk__row[aria-expanded="true"] .pub__toggle { background: var(--ink); color: var(--ivory); }
.talk__row[aria-expanded="true"] .pub__toggle::after { transform: translate(-50%, -50%) rotate(0); }
.talk.is-open .pub__detail { grid-template-rows: 1fr; }
.talk__inner { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 24px; padding: 0 0 40px; }
.talk__info { grid-column: 2; display: grid; grid-template-columns: 110px 1fr; gap: 12px 16px; font-size: 15.5px; align-content: start; }
.talk__info dt { color: var(--muted); }
.talk__info ul { display: flex; flex-wrap: wrap; gap: 6px; }
.talk__info ul li { font-size: 13px; padding: 6px 10px; border-radius: 999px; background: var(--ivory-2); }
.talk__info a { color: var(--cobalt); }
.talk__photos { grid-column: 3; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; aspect-ratio: 16 / 10; }
.ph { position: relative; background: var(--ivory-2); border: 1px dashed rgba(32,36,44,.3); display: flex; align-items: flex-end; padding: 10px; font: 400 10px/1.35 var(--f-mono); color: var(--muted); letter-spacing: .04em; overflow: hidden; }
.ph:first-child { grid-row: 1 / span 2; }
.ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 49.6%, rgba(32,36,44,.12) 50%, transparent 50.4%); }
.talk--slot .talk__row { cursor: default; }
.talk--slot .talk__row:hover { padding-left: 0; }
.talk--slot .talk__date { color: rgba(32,36,44,.28); }
.talk--slot .talk__event { color: var(--muted); }

/* =========================================================
   WORK / CASES
   ========================================================= */
.work { padding: var(--sec) 0; }
.flow { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 16px; color: var(--ivory); }
.flow li { display: flex; align-items: center; font-size: 11px; }
.flow li:not(:last-child)::after { content: "→"; margin: 0 8px; color: var(--lime); }
.cases { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.case { position: relative; grid-column: span 4; text-align: left; display: flex; flex-direction: column; background: var(--ink-2); border: 1px solid var(--line-dark); transition: transform .5s var(--ease), border-color .3s; overflow: hidden; }
.case:nth-child(1) { grid-column: span 7; } .case:nth-child(2) { grid-column: span 5; }
.case:hover { transform: translateY(-6px); border-color: rgba(244,241,233,.4); }
.case__vis { position: relative; aspect-ratio: 16 / 10; background: var(--case-bg, var(--cobalt)); overflow: hidden; }
.case:nth-child(1) .case__vis, .case:nth-child(2) .case__vis { aspect-ratio: auto; height: clamp(280px, 30vw, 420px); }
.case__vis svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .8s var(--ease); }
.case:hover .case__vis svg { transform: scale(1.035); }
.case__body { padding: 22px 24px 26px; display: grid; gap: 10px; flex: 1; }
.case__top { display: flex; justify-content: space-between; align-items: center; color: rgba(244,241,233,.55); }
.case__top b { color: var(--lime); font-weight: 500; }
.case__title { font: 600 clamp(24px, 2.4vw, 36px)/1 var(--f-display); letter-spacing: -.035em; }
html[data-lang="th"] .case__title { line-height: 1.15; letter-spacing: -.01em; }
.case__disc { font-size: 14.5px; color: rgba(244,241,233,.66); }
.case__open { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; font: 500 14px var(--f-ui); color: var(--ivory); }
.case__open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .35s var(--ease); }
.case:hover .case__open svg { transform: translateX(4px); }
.case__open::after { content: ""; position: absolute; inset: 0; }

.case-dialog { width: min(1180px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; border: 0; background: var(--ivory); color: var(--ink); overflow: hidden; }
.case-dialog::backdrop { background: rgba(20, 23, 29, .74); backdrop-filter: blur(4px); }
.case-dialog[open] { animation: dlgIn .5s var(--ease) both; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
.case-dialog__inner { max-height: calc(100svh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.cd__hero { position: relative; background: var(--case-bg); color: var(--case-fg, #fff); display: grid; grid-template-columns: 1fr 1.15fr; min-height: 360px; }
.cd__heroText { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; gap: 14px; justify-content: flex-end; }
.cd__heroText .mono { opacity: .75; }
.cd__heroText h3 { font: 600 clamp(36px, 4.6vw, 68px)/.95 var(--f-display); letter-spacing: -.045em; }
html[data-lang="th"] .cd__heroText h3 { line-height: 1.12; letter-spacing: -.01em; }
.cd__heroText p { font-size: 17px; opacity: .85; max-width: 44ch; }
.cd__heroVis { position: relative; min-height: 300px; }
.cd__heroVis svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cd__close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; background: var(--ivory); color: var(--ink); display: grid; place-items: center; }
.cd__close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.cd__body { padding: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: 240px 1fr; gap: 40px; }
.cd__aside { position: sticky; top: 24px; align-self: start; display: grid; gap: 22px; }
.cd__aside .tags li { background: transparent; }
.cd__steps { counter-reset: s; }
.cd__step { display: grid; grid-template-columns: 56px 1fr; gap: 0 20px; padding: 26px 0; border-top: 1px solid var(--line); }
.cd__step:first-child { border-top: 1px solid var(--ink); }
.cd__step > span { font: 500 12px var(--f-mono); color: var(--cobalt); padding-top: 6px; }
.cd__step h4 { font: 600 13px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.cd__step p { font-size: 17px; max-width: 64ch; }
.cd__step ul { display: grid; gap: 6px; margin-top: 12px; }
.cd__step ul li { position: relative; padding-left: 18px; font-size: 15.5px; }
.cd__step ul li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 1.5px; background: var(--orange); }
.cd__step--impact { background: var(--ink); color: var(--ivory); padding: 28px; border: 0; margin-top: 8px; }
.cd__step--impact > span { color: var(--lime); }
.cd__evidence { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 32px; }
.cd__evidence .ph { aspect-ratio: 4 / 3; }

/* =========================================================
   RECOGNITION
   ========================================================= */
.recognition { padding: var(--sec) 0; }
.awards { border-top: 1px solid var(--ink); }
.award { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding: 36px 0; border-bottom: 1px solid var(--line); align-items: center; position: relative; }
.award__year { grid-column: 1 / span 4; font: 700 clamp(72px, 11vw, 168px)/.8 var(--f-display); letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 1.5px var(--ink); transition: color .5s var(--ease); }
.award:hover .award__year { color: var(--award, var(--cobalt)); -webkit-text-stroke-color: var(--award, var(--cobalt)); }
.award__body { grid-column: 5 / span 6; }
.award__body h3 { font: 600 clamp(24px, 2.6vw, 40px)/1.05 var(--f-display); letter-spacing: -.03em; margin-bottom: 8px; }
.award__body p { color: var(--muted); font-size: 16px; }
.award__status { grid-column: 11 / span 2; justify-self: end; }
.award--slot .award__year { -webkit-text-stroke-color: rgba(32,36,44,.22); }
.award--slot h3 { color: var(--muted); }

.learn { margin-top: clamp(56px, 7vw, 96px); display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.learn__head { grid-column: 1 / span 4; }
.learn__head h3 { font: 600 clamp(28px, 3vw, 44px)/1 var(--f-display); letter-spacing: -.035em; margin-bottom: 10px; }
.learn__head .mono { color: var(--muted); }
.learn__list { grid-column: 5 / span 8; border-top: 1px solid var(--ink); }
.learn__list li { display: grid; grid-template-columns: 70px 1fr 240px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; align-items: baseline; }
.learn__list .mono { color: var(--cobalt); }
.learn__org { color: var(--muted); font-size: 14px; }
.learn__field { grid-column: 5 / span 8; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.learn__field .mono { color: var(--muted); width: 100%; margin-bottom: 4px; }
.learn__field i { font: 500 13px/1 var(--f-ui); font-style: normal; padding: 9px 12px; border-radius: 999px; background: var(--ivory-2); }
@media (max-width: 1024px) { .learn__head, .learn__list, .learn__field { grid-column: 1 / -1; } }
@media (max-width: 760px) { .learn__list li { grid-template-columns: 52px 1fr; } .learn__org { grid-column: 2; } }

/* =========================================================
   NEXT
   ========================================================= */
.next { padding: var(--sec) 0; background: var(--cobalt); color: #fff; }
.next .sec-head .rule { background: rgba(255,255,255,.25); }
.next .display { margin-bottom: clamp(48px, 7vw, 96px); }
.next__grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.35); border-left: 1px solid rgba(255,255,255,.35); }
.next__item { position: relative; padding: 24px 22px 28px; min-height: 220px; border-right: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; transition: background .4s var(--ease), color .4s; }
.next__item:hover { background: var(--ink); }
.next__item .mono { color: var(--lime); }
.next__item h3 { font: 600 clamp(22px, 2vw, 30px)/1.05 var(--f-display); letter-spacing: -.03em; }
html[data-lang="th"] .next__item h3 { line-height: 1.2; letter-spacing: -.01em; }
.next__item p { font-size: 14.5px; opacity: .78; }
.next__item--note { background: var(--lime); color: var(--ink); }
.next__item--note:hover { background: var(--lime); }
.next__item--note .mono { color: var(--ink); }
.next__item--note h3 { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.25; }
.next__item--note a { font: 500 14px var(--f-ui); }
.next__quote { margin-top: clamp(56px, 8vw, 112px); }
.next__quote p { max-width: 24ch; }
.next__quote p { font: 500 clamp(28px, 3.6vw, 56px)/1.08 var(--f-display); letter-spacing: -.035em; }
html[data-lang="th"] .next__quote p { line-height: 1.3; letter-spacing: -.01em; }

/* =========================================================
   CONTACT + FOOTER
   ========================================================= */
.contact { padding: var(--sec) 0 0; }
.contact__name { font: 700 clamp(56px, 13vw, 220px)/.82 var(--f-display); letter-spacing: -.06em; margin-bottom: 26px; }
.contact__tag { color: var(--lime); font-size: 13px; margin-bottom: clamp(48px, 7vw, 96px); }
.contact__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding-bottom: clamp(72px, 10vw, 140px); }
.contact__lead { grid-column: 1 / span 5; font: 500 clamp(28px, 3vw, 46px)/1.08 var(--f-display); letter-spacing: -.03em; }
.contact__list { grid-column: 7 / span 6; border-top: 1px solid var(--ivory); }
.contact__list li { border-bottom: 1px solid var(--line-dark); }
.contact__list a, .contact__list div { display: grid; grid-template-columns: 150px 1fr 24px; gap: 16px; align-items: center; padding: 20px 0; text-decoration: none; transition: padding .35s var(--ease), color .3s; }
.contact__list a:hover { padding-left: 10px; color: var(--lime); }
.contact__list .mono { color: rgba(244,241,233,.55); font-size: 11px; }
.contact__list span:nth-child(2) { font: 500 clamp(17px, 1.5vw, 21px)/1.3 var(--f-display); word-break: break-word; }
.contact__list .is-placeholder span:nth-child(2) { color: rgba(244,241,233,.45); font-style: italic; font-weight: 400; }
.contact__list svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.footer { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); padding-top: 28px; padding-bottom: 36px; border-top: 1px solid var(--line-dark); font-size: 13.5px; color: rgba(244,241,233,.6); align-items: start; }
.footer__col .mono { display: block; color: var(--ivory); margin-bottom: 8px; font-size: 11px; }
.footer__col p { max-width: 42ch; }
.footer__swatches { display: flex; gap: 6px; }
.footer__swatches i { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 1px solid rgba(244,241,233,.25); }
.footer__end { justify-self: end; text-align: right; display: grid; gap: 8px; }
.footer__end a { text-decoration: none; color: var(--lime); }
.footer__end .mono { margin: 0; }


/* =========================================================
   PHOTOS (speaking, cases) + ACTIVITY + LIGHTBOX
   ========================================================= */
.photo { position: relative; display: block; padding: 0; overflow: hidden; background: var(--ivory-2); cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.photo:hover img { transform: scale(1.04); }
.talk__photos--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.talk__photos--2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.talk__photos--3 .photo:first-child { grid-row: 1 / span 2; }
.talk__photos { position: relative; }
.photo__more { position: absolute; right: 8px; bottom: 8px; background: var(--ink); color: var(--ivory); font: 500 12px var(--f-mono); padding: 6px 9px; border-radius: 999px; pointer-events: none; }
.talk__row { grid-template-columns: 220px 1fr 240px 48px; }
.talk__thumb { display: none; }
.cd__evidence .photo { aspect-ratio: 4 / 3; }

.activity { padding: var(--sec) 0; background: var(--ivory-2); }
.activity .chip { background: var(--ivory); }
.activity .chip[aria-pressed="true"] { background: var(--ink); }
.act-group { margin-top: clamp(40px, 5vw, 72px); }
.act-group:first-child { margin-top: 0; }
.act-group__head { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--ink); padding-top: 16px; margin-bottom: 24px; }
.act-group__head h3 { font: 600 clamp(24px, 2.4vw, 36px)/1.05 var(--f-display); letter-spacing: -.03em; }
html[data-lang="th"] .act-group__head h3 { letter-spacing: -.01em; line-height: 1.2; }
.act-group__head .mono { color: var(--cobalt); font-weight: 500; }
.act-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.act-card { text-align: left; display: flex; flex-direction: column; background: var(--ivory); border: 1px solid var(--line); overflow: hidden; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
button.act-card { cursor: zoom-in; }
button.act-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(32,36,44,.12); }
.act-card__img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ivory-2); }
.act-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
button.act-card:hover .act-card__img img { transform: scale(1.05); }
.act-card__img i { position: absolute; right: 10px; top: 10px; background: rgba(32,36,44,.82); color: var(--ivory); padding: 5px 8px; border-radius: 999px; font-size: 10.5px; font-style: normal; }
.act-card__body { display: grid; gap: 8px; padding: 16px 18px 20px; }
.act-card__meta { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.act-card b { font: 600 18px/1.2 var(--f-display); letter-spacing: -.015em; }
html[data-lang="th"] .act-card b { letter-spacing: 0; line-height: 1.4; }
.act-card__text { font-size: 14px; line-height: 1.5; color: var(--ink); opacity: .78; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.act-card--cred { background: var(--ivory); }
.act-card__cred { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 0; color: var(--cobalt); }
.act-card__cred svg { width: 34px; height: 34px; }
.act-card__cred .mono { color: var(--muted); }

.lightbox { width: min(1280px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; border: 0; background: var(--ink); color: var(--ivory); display: none; overflow: hidden; }
.lightbox[open] { display: grid; grid-template-columns: 1fr 340px; animation: dlgIn .45s var(--ease) both; }
.lightbox::backdrop { background: rgba(12,14,18,.86); backdrop-filter: blur(4px); }
.lightbox__stage { position: relative; background: #111317; display: grid; place-items: center; min-height: 60svh; max-height: calc(100svh - 24px); }
.lightbox__stage img { max-width: 100%; max-height: calc(100svh - 24px); object-fit: contain; }
.lightbox__nav, .lightbox__close { position: absolute; width: 48px; height: 48px; border-radius: 50%; background: rgba(244,241,233,.92); color: var(--ink); display: grid; place-items: center; }
.lightbox__nav svg, .lightbox__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lightbox__nav--prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__close { right: 14px; top: 14px; }
.lightbox__info { padding: 28px 26px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.lightbox__info > .mono:first-child { color: var(--lime); }
.lightbox__info h3 { font: 600 24px/1.15 var(--f-display); letter-spacing: -.02em; }
.lightbox__info .mono { color: rgba(244,241,233,.6); text-transform: none; letter-spacing: .02em; }
.lightbox__info p:not(.mono) { font-size: 15.5px; color: rgba(244,241,233,.85); }
.lightbox__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: auto; }
.lightbox__thumbs button { aspect-ratio: 1; overflow: hidden; opacity: .5; border: 2px solid transparent; transition: opacity .25s; }
.lightbox__thumbs button[aria-current="true"] { opacity: 1; border-color: var(--lime); }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1180px) { .act-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1024px) { .act-grid { grid-template-columns: repeat(2, 1fr); } .lightbox[open] { grid-template-columns: 1fr; } .lightbox__stage { min-height: 50svh; max-height: 64svh; } .lightbox__stage img { max-height: 64svh; } }
@media (max-width: 760px) {
  .act-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .act-card__body { padding: 12px 12px 14px; }
  .act-card b { font-size: 15px; }
  .act-card__text { display: none; }
  .talk__thumb { display: block; grid-area: thumb; width: 64px; height: 64px; object-fit: cover; }
  .talk__row { grid-template-areas: "date thumb tog" "event event event" "meta meta meta"; grid-template-columns: 1fr 64px 40px; }
}

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--ivory); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .35s var(--ease), transform .35s var(--ease), background .25s; }
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--cobalt); }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.on-dark-page .to-top { background: var(--lime); color: var(--ink); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1180px) {
  .nav__links a:not(.nav__cta) { padding: 10px 8px; font-size: 13.5px; }
  .pubs__head, .pub__row { grid-template-columns: 52px 1fr 76px 160px 40px; }
  .talk__row { grid-template-columns: 180px 1fr 200px 40px; }
  .talk__inner { grid-template-columns: 180px 1fr 1fr; }
}
@media (max-width: 1024px) {
  .nav__links { display: none; }
  .nav__burger { display: block; }
  .hero__grid { grid-template-areas:
    "meta meta meta meta meta meta meta meta meta meta meta meta"
    "name name name name name name name name name name name name"
    "words words words words words words words words words words words words"
    "copy copy copy copy copy copy copy port port port port port"
    "creds creds creds creds creds creds creds creds creds creds creds creds"; }
  .hero__creds { margin-top: 40px; }
  .sec-title .display, .sec-intro { grid-column: 1 / -1; }
  .sec-intro { max-width: 60ch; }
  .speaking__hero .display, .stats { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 0 var(--gap); }
  .stats div { flex-direction: column-reverse; align-items: flex-start; }
  .thesis { grid-column: 1 / -1; }
  .areas { grid-column: 1 / -1; }
  .chapter__num { grid-column: 1 / span 5; }
  .chapter__body { grid-column: 6 / span 7; }
  .case, .case:nth-child(1), .case:nth-child(2) { grid-column: span 6; }
  .case:nth-child(1) { grid-column: 1 / -1; }
  .next__grid { grid-template-columns: repeat(2, 1fr); }
  .award__year { grid-column: 1 / span 4; }
  .award__body { grid-column: 5 / span 8; }
  .award__status { grid-column: 5 / span 8; justify-self: start; }
  .contact__lead, .contact__list { grid-column: 1 / -1; }
  .cd__body { grid-template-columns: 1fr; }
  .cd__aside { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  :root { --nav-h: 62px; }
  .nav__name { display: none; }
  .hide-sm { display: none; }
  .hero__grid { grid-template-areas: "meta" "name" "words" "copy" "port" "creds"; grid-template-columns: 1fr; }
  .sec-head .rule, .sec-head > .mono:last-child { display: none; }
  .hero__name { font-size: clamp(46px, 15.4vw, 96px); }
  .hero__words { grid-template-columns: repeat(2, auto); gap: 26px 22px; margin-top: 44px; }
  .word { font-size: clamp(26px, 8vw, 40px); }
  .hero__creds { grid-template-columns: 1fr; }
  .hero__scroll { display: none; }
  .btn { padding: 14px 18px; }
  .manifesto__trio { grid-template-columns: 1fr; }
  .timeline__track { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tab__label { display: none; }
  .tab__node { width: 40px; height: 40px; }
  .timeline__track::before, .timeline__track::after { top: 19px; }
  .chapter { grid-template-columns: 1fr; }
  .chapter__num, .chapter__body { grid-column: 1; }
  .chapter__num { display: flex; align-items: flex-end; gap: 18px; }
  .chapter__num b { font-size: 120px; }
  .chapter__fig { width: 120px; margin: 0; }
  .timeline__panel { min-height: 0; }
  .chapter__carry { grid-template-columns: 1fr; gap: 8px; }
  .thesis { grid-template-columns: 1fr; }
  .thesis__fig { border-right: 0; border-bottom: 1px solid var(--line-dark); min-height: 0; padding-bottom: 44px; }
  .pubs__head { display: none; }
  .pub__row { grid-template-columns: 36px 1fr 36px; grid-template-areas: "no title tog" ". year tog" ". status tog"; gap: 8px 12px; }
  .pub__no { grid-area: no; align-self: start; padding-top: 4px; }
  .pub__title { grid-area: title; }
  .pub__year { grid-area: year; }
  .pub__status { grid-area: status; }
  .pub__toggle { grid-area: tog; align-self: start; }
  .pub__inner { grid-template-columns: 1fr; padding-left: 48px; }
  .pub__inner dl, .pub__summary, .pub__fig { grid-column: 1; grid-row: auto; }
  .pub__inner dl { grid-template-columns: 1fr; gap: 2px; }
  .pub__inner dd { margin-bottom: 10px; }
  .stats { grid-template-columns: 1fr; }
  .stats div { flex-direction: row; align-items: baseline; }
  .talk__row { grid-template-columns: 1fr 40px; grid-template-areas: "date tog" "event event" "meta meta"; gap: 14px; }
  .talk__date { grid-area: date; } .talk__event { grid-area: event; } .talk__meta { grid-area: meta; } .talk .pub__toggle { grid-area: tog; }
  .talk__row:hover { padding-left: 0; }
  .talk__inner { grid-template-columns: 1fr; }
  .talk__info, .talk__photos { grid-column: 1; }
  .talk__info { grid-template-columns: 1fr; gap: 2px; }
  .talk__info dd { margin-bottom: 10px; }
  .case, .case:nth-child(1), .case:nth-child(2) { grid-column: 1 / -1; }
  .case:nth-child(1) .case__vis, .case:nth-child(2) .case__vis { height: auto; aspect-ratio: 16 / 10; }
  .cd__hero { grid-template-columns: 1fr; }
  .cd__heroVis { min-height: 220px; order: -1; }
  .cd__step { grid-template-columns: 1fr; gap: 6px; }
  .cd__evidence { grid-template-columns: 1fr 1fr; }
  .next__grid { grid-template-columns: 1fr; }
  .next__item { min-height: 0; }
  .award { grid-template-columns: 1fr; gap: 14px; }
  .award__year, .award__body, .award__status { grid-column: 1; justify-self: start; }
  .contact__list a, .contact__list div { grid-template-columns: 1fr 24px; gap: 4px 12px; }
  .contact__list .mono { grid-column: 1 / -1; }
  .footer { grid-template-columns: 1fr; }
  .footer__end { justify-self: start; text-align: left; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__name .ch { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .progress, .to-top, .hero__field, .timeline__nav, .filters { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .pub__detail, .talk .pub__detail { grid-template-rows: 1fr !important; }
}
