/* Tart portfolio: homepage stylesheet (shell, sections, cards, dialogs, footer).
   Load order: tokens.css → fonts.css → site.css → mini-tart/companion.css → i18n.css (shared UI) → icons.css → minidemo/frame.css.
   One calm system: warm paper, one blue used for actions and links, light chrome that never changes colour,
   sentence-case labels, token type sizes (13 px floor, 14 px in Thai). Replaces style.css, motion.css, experience.css,
   portfolio-polish.css, highlights.css, upgrades.css and demos.css on the homepage (design-notes.md, 2026-11-23 shell). */

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box}
:root{--rail:240px;--header-h:64px;--content-max:1120px;--card-radius:var(--radius-lg)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:var(--header-h)}
@media (prefers-reduced-motion:no-preference){html:not([data-motion=off]){scroll-behavior:smooth}}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font-sans);font-size:var(--fs-body);line-height:var(--lh-body);font-weight:var(--fw-body);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-optical-sizing:auto}
body.modal-open{overflow:hidden}
h1,h2,h3,p{margin:0}
h1,h2,h3,h4{font-weight:var(--fw-heading);line-height:var(--lh-heading);letter-spacing:var(--tr-heading)}
:where(main,.sidebar,.site-footer) :is(h4,h5,ul,ol,figure,dl,dd){margin:0}
:where(main,dialog) :is(h1,h2,h3){text-wrap:balance}
:where(main,dialog) p{text-wrap:pretty}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer;border:0}
button,a{-webkit-tap-highlight-color:transparent}
.anchor{position:absolute;top:0;left:0;width:1px;height:1px;pointer-events:none}

/* ---------- Buttons and links ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 22px;border:1px solid transparent;border-radius:var(--radius-pill);background:none;font-size:.9375rem;font-weight:var(--fw-ui);line-height:1.2;white-space:nowrap;text-decoration:none;transition:background-color var(--dur-2),border-color var(--dur-2),color var(--dur-2),transform var(--dur-1)}
.btn:active{transform:scale(.97)}
.btn .ico{font-size:1.05em}
.btn-primary{background:var(--accent);color:var(--on-accent)}
.btn-primary:hover{background:var(--accent-hover)}
.btn-secondary{background:var(--surface);border-color:var(--line-strong);color:var(--ink)}
.btn-secondary:hover{background:var(--surface-2);border-color:var(--line-strong)}
.btn-sm{min-height:44px;padding:0 16px;font-size:var(--fs-sm)}
.text-button,.role-project,.edu-link,.section-foot a{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0;background:none;color:var(--accent-ink);font-size:var(--fs-sm);font-weight:var(--fw-ui);text-decoration:none;white-space:nowrap}
.text-button:hover,.role-project:hover,.edu-link:hover,.section-foot a:hover{text-decoration:underline;text-underline-offset:4px}

/* ---------- Shell: desktop sidebar ---------- */
.skip{position:fixed;left:12px;top:-120px;z-index:200;padding:10px 16px;border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);box-shadow:var(--shadow-2);font-weight:var(--fw-ui)}
.skip:focus{top:12px}
.sidebar{position:fixed;inset:0 auto 0 0;z-index:30;display:flex;flex-direction:column;width:var(--rail);padding:24px 24px 20px;background:var(--bg);border-right:1px solid var(--line)}
.brand{display:inline-flex;align-items:center;align-self:flex-start;min-height:44px;border-radius:var(--radius-sm)}
.brand img{display:block;width:auto;height:30px}
.sidebar-intro{margin-top:20px;font-size:var(--fs-sm);font-weight:var(--fw-ui);line-height:var(--lh-ui);color:var(--ink)}
.sidebar-intro span{display:block;margin-top:2px;font-weight:var(--fw-body);color:var(--muted)}
.menu-toggle{display:none}
.sidebar nav{position:relative;display:flex;flex-direction:column;margin-top:36px}
.sidebar nav a{display:flex;align-items:center;min-height:44px;margin:0 -12px;padding:0 12px;border-radius:var(--radius-sm);font-size:.9375rem;color:var(--muted);transition:color var(--dur-2),background-color var(--dur-2)}
.sidebar nav a:hover{color:var(--ink);background:var(--surface-2)}
.sidebar nav a[aria-current]{color:var(--ink);font-weight:var(--fw-ui)}
.sidebar nav .nav-bar{position:absolute;left:-24px;top:0;width:2px;height:var(--nh,0px);border-radius:2px;background:var(--accent);translate:0 var(--nt,0px);transition:translate var(--dur-3) var(--ease-out),height var(--dur-3) var(--ease-out)}
.sidebar nav:not(.ready) .nav-bar,.sidebar nav.no-active .nav-bar{opacity:0}
.sidebar-bottom{display:flex;flex-direction:column;margin-top:auto;padding-top:20px;border-top:1px solid var(--line)}
.sidebar-bottom a{display:inline-flex;align-items:center;gap:6px;min-height:40px;font-size:var(--fs-sm);color:var(--ink-2)}
.sidebar-bottom a .ico{font-size:.875em;color:var(--muted)}
.sidebar-bottom a:hover{color:var(--accent-ink)}
.mobile-header-actions{display:none}

/* ---------- Shell: top bar ---------- */
/* The top bar is fixed, not sticky: html keeps scroll-padding-top for anchors and focused content, and a sticky bar's
   own controls would sit inside that padding, so each Tab stop on them scrolled the page up about half a screen. */
.page{margin-left:var(--rail);min-width:0;padding-top:var(--header-h)}
.topbar{position:fixed;top:0;left:var(--rail);right:0;z-index:20;display:flex;align-items:center;justify-content:flex-end;gap:8px;height:var(--header-h);padding:0 var(--gutter);background:rgb(247 247 245 / .92);-webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line)}
.topbar-link{display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border-radius:var(--radius-pill);font-size:var(--fs-sm);font-weight:var(--fw-ui);color:var(--ink-2)}
.topbar-link:hover{color:var(--ink);background:var(--surface-2)}
.topbar .language-switch{margin-left:8px}
.js .topbar:not(:has(.language-switch))::after{content:"";flex:none;width:92px}
.progress{position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--accent);transform:scaleX(0);transform-origin:left;pointer-events:none}

/* ---------- Sections ---------- */
main{display:block}
.section{position:relative;padding:var(--section-y) var(--gutter)}
.section>:not(.anchor){max-width:var(--content-max);margin-inline:auto}
.section-head{margin-bottom:clamp(32px,4vw,48px)}
.section-head h2{font-size:clamp(2rem,1.6rem + 1.3vw,2.75rem);line-height:var(--lh-heading);letter-spacing:-.03em}
.section-head p{max-width:40rem;margin-top:12px;font-size:var(--fs-lead);line-height:1.55;color:var(--muted)}
:lang(th) .section-head p{line-height:var(--lh-body)}
.section-head .about-hello{color:var(--ink)}
.section-foot{display:flex;justify-content:flex-start;margin-top:clamp(28px,3vw,40px)}
.work,.about{background:var(--bg)}
.side-projects,.creator{background:var(--surface);border-block:1px solid var(--line)}
.contact{background:var(--bg)}

/* ---------- Hero ---------- */
.hero{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr);align-items:center;gap:clamp(40px,6vw,96px);max-width:calc(var(--content-max) + var(--gutter) * 2);margin:0 auto;padding:clamp(48px,7vw,104px) var(--gutter) clamp(64px,8vw,112px)}
.hero-text{min-width:0}
.hero-kicker{display:flex;align-items:center;gap:12px;font-size:var(--fs-body);font-weight:var(--fw-ui);color:var(--ink-2)}
.hero-avatar{display:none;flex:none;width:48px;height:48px;border-radius:50%;object-fit:cover;object-position:50% 28%;background:var(--surface-2)}
.hero h1{max-width:15ch;margin-top:20px;font-size:clamp(2.5rem,1.55rem + 3vw,4.25rem);line-height:1.04;letter-spacing:-.022em;text-wrap:balance}
:lang(th) .hero h1{max-width:17ch;font-size:clamp(2.25rem,1.45rem + 2.6vw,3.75rem);line-height:var(--lh-display);letter-spacing:0}
.hero-lead{max-width:36rem;margin-top:24px;font-size:var(--fs-lead);line-height:1.6;color:var(--ink-2)}
:lang(th) .hero-lead{line-height:var(--lh-body)}
.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:32px}
/* Proof points are plain facts, not controls: muted text with a small dot, no pill outline (the buttons above have one). */
.hero-proof{display:flex;flex-wrap:wrap;gap:8px 22px;margin:28px 0 0;padding:0;list-style:none}
.hero-proof li{display:flex;align-items:center;gap:8px;font-size:var(--fs-sm);line-height:1.45;color:var(--muted)}
.hero-proof li::before{content:'';flex:none;width:5px;height:5px;border-radius:50%;background:var(--subtle)}
.hero-portrait{justify-self:end;width:100%;max-width:400px;margin:0}
.hero-portrait img{display:block;width:100%;height:auto;aspect-ratio:4/5;object-fit:cover;border-radius:var(--radius-xl);background:var(--surface-2)}

/* ---------- Work: featured project cards (markup contract in design-notes.md) ---------- */
.gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(36px,4vw,56px) clamp(20px,2.6vw,32px)}
/* Cards are columns, so the open control sits at the bottom and lines up across a row. */
.project{position:relative;display:flex;flex-direction:column;min-width:0}
.project[hidden]{display:none}
.project.featured,.project.is-wide{grid-column:1/-1}
.project-cover,.side-cover{position:relative;display:block;width:100%;aspect-ratio:16/10;overflow:hidden;padding:0;border:1px solid var(--line);border-radius:var(--card-radius);background:var(--surface-2);color:inherit;text-align:left;isolation:isolate;transition:border-color var(--dur-2),box-shadow var(--dur-3) var(--ease-out)}
.project-cover>img,.side-cover>img{display:block;width:100%;height:100%;object-fit:cover;object-position:top center;transition:transform var(--dur-4) var(--ease-out)}
.project-cover:hover,.side-cover:hover{border-color:var(--line-strong);box-shadow:var(--shadow-2)}
.project-cover:hover>img,.side-cover:hover>img{transform:scale(1.015)}
.project.featured .project-cover{aspect-ratio:21/9}
/* Decorations from the old cards stay hidden: stamps, floating arrows and badges. */
.image-label,.open-circle,.side-arrow,.side-badge,.cover-label,.chrome-dots{display:none!important}
/* A readable "Concept image" label on a cover that is not a screenshot (PAO). It sits over the small chip baked into
   the image's top-right corner (about 80–97% across, 4–9% down, also when the image scales on hover), so one label shows. */
.cover-tag{position:absolute;top:2.5%;right:2%;z-index:1;display:flex;align-items:center;justify-content:center;min-width:19%;min-height:7.5%;padding:4px 12px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--surface);box-shadow:var(--shadow-1);color:var(--ink-2);font-size:var(--fs-xs);font-weight:var(--fw-ui);line-height:1.35;white-space:nowrap;pointer-events:none}
.card-info{display:flex;flex:1;flex-direction:column;padding-top:18px}
.card-info>div,.side-info{display:flex;flex:1;flex-direction:column;align-items:flex-start;min-width:0}
.card-tag,.category{display:block;font-size:var(--fs-xs);line-height:var(--lh-ui);letter-spacing:var(--tr-label);color:var(--muted)}
.card-date{display:block;margin-top:2px;font-size:var(--fs-xs);color:var(--muted)}
.card-info h3,.side-info h3{margin-top:6px;font-size:1.3125rem;line-height:1.3;letter-spacing:-.02em;transition:color var(--dur-2);overflow-wrap:anywhere}
.card-info p,.side-info p{max-width:40rem;margin-top:6px;font-size:.9375rem;line-height:1.6;color:var(--ink-2)}
.card-skills{margin-top:10px;margin-bottom:6px;font-size:var(--fs-xs);color:var(--muted)}
.project:hover .card-info h3,.side-card:hover .side-info h3{color:var(--accent-ink)}
/* One open control on every card ("View project →"), at the bottom of the text. */
.card-info .text-button,.side-info .text-button{margin-top:auto}
/* Legacy cover art (until the content agent replaces the cards): calm colours, no tilt. */
.nless-cover,.pao-cover,.togeta-cover,.research-cover,.archive-cover{background:var(--surface-2);color:var(--ink)}
.featured-title{position:absolute;top:50%;left:6%;width:36%;transform:translateY(-50%)}
.featured-title>span{display:block;font-size:clamp(1.5rem,1rem + 1.6vw,2.5rem);font-weight:var(--fw-heading);line-height:1.12;letter-spacing:-.03em}
/* The accent phrase always starts its own line, so a translation never splits it across two; Thai marks need taller lines. */
.featured-title em{display:block;font-style:normal;color:var(--accent-ink)}
:lang(th) .featured-title>span{line-height:1.3;letter-spacing:0}
.featured-title small{display:block;margin-top:16px;font-size:var(--fs-xs);color:var(--muted)}
.nless-screen{position:absolute;top:12%;left:46%;width:50%;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-2)}
.nless-screen img{display:block;width:100%;height:auto}
.nless-screen .browser-chrome{display:none}
.pao-cover{padding:clamp(20px,3vw,32px)}
.diagram-title{display:block;font-size:clamp(1.375rem,1rem + 1.1vw,2rem);font-weight:var(--fw-heading);line-height:1.15;letter-spacing:-.02em}
.workflow{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:28px}
.workflow>span{padding:14px 12px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface);font-size:var(--fs-xs)}
.workflow b{font-weight:400;color:var(--muted)}
.architecture-chips{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 16px;margin-top:20px;font-size:var(--fs-xs);color:var(--muted)}
.cover-word{position:absolute;top:24px;left:24px;font-size:1.5rem;font-weight:var(--fw-heading);letter-spacing:-.02em;color:var(--ink);z-index:1}
.togeta-screen{position:absolute;top:28%;left:8%;width:84%;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;box-shadow:var(--shadow-2)}
.togeta-screen img{display:block;width:100%;height:auto}
.project-cover.research-cover{display:flex;flex-direction:column;gap:12px;padding:20px}
.research-title{display:block;font-size:1.5rem;font-weight:var(--fw-heading);line-height:1.15;letter-spacing:-.02em}
.research-title br{display:none}
.research-title>span{margin-left:10px;font-size:var(--fs-xs);font-weight:var(--fw-body);letter-spacing:0;color:var(--muted)}
.project-cover.research-cover .research-paper-cover{display:block;flex:1;width:100%;min-height:0;object-fit:contain;border-radius:var(--radius-sm);background:var(--surface)}
.archive-cover>img{object-fit:contain;object-position:center}

/* "More from university": compact archive rows (content agent fills .archive-list). */
.archive{margin-top:clamp(40px,5vw,64px)}
.archive-title{margin-bottom:8px;font-size:var(--fs-sm);font-weight:var(--fw-ui);color:var(--muted)}
.archive-list{margin:0;padding:0;list-style:none;border-top:1px solid var(--line)}
.archive-list>li{border-bottom:1px solid var(--line)}
.archive-row{display:grid;grid-template-columns:minmax(0,13rem) minmax(0,1fr) auto 20px;align-items:center;gap:6px 24px;width:calc(100% + 24px);min-height:60px;margin:0 -12px;padding:14px 12px;border-radius:var(--radius);background:none;color:inherit;text-align:left;transition:background-color var(--dur-2)}
.archive-name{font-size:1rem;font-weight:var(--fw-heading);color:var(--ink)}
.archive-desc{font-size:.9375rem;color:var(--ink-2)}
.archive-meta{font-size:var(--fs-xs);color:var(--muted);white-space:nowrap}
.archive-row>.ico{color:var(--muted);transition:transform var(--dur-2) var(--ease-out),color var(--dur-2)}
/* Hover fills only where a pointer can hover: on touch, :hover sticks after a tap and the row looked selected. */
@media (hover:hover){
  .archive-row:hover{background:var(--surface)}
  .archive-row:hover>.ico{color:var(--accent-ink);transform:translateX(2px)}
}

/* Endless / hackathon: the demo leads (the product UI opens the project and its demo), with the team's shared GitHub
   board and the team photo beside it. A light card like the rest of Work: no dark band. */
.hackathon-highlight{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:center;gap:clamp(24px,4vw,48px);padding:clamp(16px,2.2vw,24px);border:1px solid var(--line);border-radius:var(--radius-xl);background:var(--surface)}
.gallery>.hackathon-highlight{margin:0}
.hackathon-media{display:grid;gap:10px;min-width:0}
.hackathon-demo{position:relative;display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);overflow:hidden;background:#eef2f1;cursor:pointer}
.hackathon-demo img{display:block;width:100%;height:auto;aspect-ratio:1200/750;object-fit:cover;transition:transform var(--dur-3,.3s) var(--ease-out)}
.hackathon-play{position:absolute;left:14px;bottom:14px;display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px;border-radius:var(--radius-pill);background:var(--accent);color:var(--on-accent);font-size:var(--fs-sm);font-weight:var(--fw-ui);box-shadow:0 6px 18px rgb(22 24 29 / .18)}
@media (hover:hover){.hackathon-demo:hover img{transform:scale(1.015)}.hackathon-demo:hover .hackathon-play{background:var(--accent-hover)}}
.hackathon-thumbs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.hackathon-thumbs figure{margin:0;min-width:0}
.hackathon-thumbs img{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;object-position:50% 20%;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2)}
.hackathon-thumbs figcaption{margin-top:6px;font-size:var(--fs-xs);line-height:1.4;color:var(--muted)}
.hackathon-tags{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.hackathon-tags span{padding:4px 10px;border-radius:var(--radius-pill);background:var(--surface-2);font-size:var(--fs-xs);color:var(--ink-2)}
.hackathon-body h3{margin-bottom:14px;font-size:clamp(1.375rem,1.1rem + 1vw,1.875rem);line-height:1.2}
.hackathon-body p{margin-bottom:12px;font-size:.9375rem;line-height:1.65;color:var(--ink-2)}
.hackathon-body .hackathon-lead{font-size:1rem;color:var(--ink)}
.hackathon-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}

/* "See more projects": the lighter projects stay one click away. */
.archive-more{border-top:0}
.more-toggle{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin-top:16px;padding:0 18px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--surface);color:var(--ink);font:inherit;font-size:var(--fs-sm);font-weight:var(--fw-ui);cursor:pointer}
.more-toggle:hover{background:var(--surface-2)}
.more-toggle .ico{transition:transform var(--dur-2) var(--ease-out)}
.more-toggle[aria-expanded=true] .ico{transform:rotate(180deg)}
.more-toggle .less-label,.more-toggle[aria-expanded=true] .more-label{display:none}
.more-toggle[aria-expanded=true] .less-label{display:inline}
.side-more{margin-top:clamp(36px,4vw,56px)}
.more-row{margin-top:clamp(20px,2.4vw,28px)}
.more-row .more-toggle{margin-top:0}

/* ---------- Personal projects ---------- */
.side-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(36px,4vw,56px) clamp(20px,2.6vw,32px)}
.side-card{position:relative;display:flex;flex-direction:column;min-width:0}
.side-projects .side-cover{background:var(--bg)}
.side-info{padding-top:18px}
.side-info>span:not(.card-tag){display:block;font-size:var(--fs-xs);color:var(--muted)}
.card-brief{display:none}

/* ---------- About: experience rows, education, toolbox ---------- */
.about-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,300px);align-items:start;gap:clamp(40px,6vw,88px)}
.about-main{min-width:0}
.about-label{margin:0 0 4px;font-size:var(--fs-sm);font-weight:var(--fw-ui);line-height:var(--lh-ui);letter-spacing:var(--tr-label);color:var(--muted)}
.about-main .about-label:not(:first-child){margin-top:clamp(40px,5vw,56px)}
.timeline,.edu-list{border-top:1px solid var(--line)}
.timeline>article,.edu{position:relative;border-bottom:1px solid var(--line)}
.role-head{position:relative;display:grid;grid-template-columns:9.5rem minmax(0,1fr) 20px;gap:4px 24px;margin:0 -12px;padding:20px 12px;border-radius:var(--radius)}
/* The fill marks a closed row under a hovering pointer. An open row keeps no fill (it would box the head and cut the
   row in half above "What I did"), and touch screens get none (:hover sticks after a tap). The chevron still darkens. */
@media (hover:hover){
  .role:not(.is-open) .role-head:hover{background:var(--surface)}
  .role-head:hover .role-chevron{color:var(--ink)}
}
.role-date{padding-top:2px;font-size:var(--fs-sm);line-height:var(--lh-ui);color:var(--muted);font-variant-numeric:tabular-nums}
.role-main{min-width:0}
.role-main h4,.edu h4{font-size:1.125rem;line-height:1.35;letter-spacing:-.01em}
.role-toggle{display:inline;padding:0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}
.role-toggle::after{content:'';position:absolute;inset:0;border-radius:inherit}
.role-toggle:focus-visible{outline:none}
.role-head:has(.role-toggle:focus-visible){outline:var(--focus-width) solid var(--focus);outline-offset:var(--focus-offset)}
.role-org{margin-top:2px;font-size:.9375rem;color:var(--ink-2)}
.role-summary{margin-top:8px;max-width:38rem;font-size:.9375rem;line-height:1.6;color:var(--muted)}
/* The chevron (a masked, rotating icon outside the button) would paint above the row's stretched hit area: let clicks pass through. */
.role-chevron{margin-top:4px;font-size:20px;color:var(--muted);pointer-events:none;transition:transform var(--dur-3) var(--ease-out),color var(--dur-2)}
.role.is-open .role-chevron{transform:rotate(180deg)}
.role-details{padding:0 0 28px calc(9.5rem + 24px)}
.js .role:not(.is-open) .role-details{display:none}
.role.is-open .role-details{animation:role-in var(--dur-3) var(--ease-out)}
@keyframes role-in{from{opacity:0;transform:translateY(-4px)}}
.role-details h5{margin-bottom:8px;font-size:var(--fs-sm);font-weight:var(--fw-ui);line-height:var(--lh-heading);letter-spacing:var(--tr-heading);color:var(--ink)}
.role-details>ul:not(.skill-tags){margin:0;padding-left:1.1em;color:var(--ink-2);font-size:.9375rem;line-height:1.65}
.role-details>ul:not(.skill-tags) li+li{margin-top:6px}
.role-details li::marker{color:var(--subtle)}
.skill-tags{display:flex;flex-wrap:wrap;gap:6px;margin:16px 0 0;padding:0;list-style:none}
.skill-tags li{padding:4px 10px;border-radius:var(--radius-pill);background:var(--surface-2);font-size:var(--fs-xs);line-height:1.5;color:var(--ink-2)}
.role-details .role-project{margin-top:12px}
.edu{display:grid;grid-template-columns:9.5rem minmax(0,1fr);gap:4px 24px;padding:20px 0}
.edu-link{margin-top:4px}
.toolbox{position:sticky;top:calc(var(--header-h) + 24px);padding:24px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface)}
.toolbox .about-label{margin-bottom:16px}
.tool-group+.tool-group{margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}
.tool-group h4{font-size:1rem;line-height:1.35}
.tool-group p{margin-top:4px;font-size:var(--fs-sm);line-height:1.55;color:var(--muted)}
.tool-group .skill-tags{margin-top:12px}
.toolbox .edu-link{margin-top:16px}
/* The card follows the reader only where all of it fits below the header (it is about 780 px tall); on shorter
   screens it scrolls with the page, so its last lines are never held out of view. */
@media (max-height:880px){.toolbox{position:static}}

/* ---------- Creator ---------- */
.creator-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(16px,2vw,24px)}
.creator-clip{display:flex;flex-direction:column;min-width:0}
.creator-clip video{display:block;width:100%;height:auto;aspect-ratio:9/16;object-fit:cover;border-radius:var(--radius-lg);background:var(--dark)}
.creator-clip>div{display:flex;flex:1;flex-direction:column;gap:6px;padding-top:14px}
.creator-genre{font-size:var(--fs-xs);color:var(--muted)}
.creator-clip h3{font-size:1.0625rem;line-height:1.35;letter-spacing:-.01em}
.creator-clip p{flex:1;font-size:var(--fs-sm);line-height:1.55;color:var(--ink-2)}
/* One line of text, not a flex row: when a label wraps, ↗ follows its last words instead of sitting at the column's
   edge. The markup keeps the tail (the @handle or the series name) and ↗ in one no-wrap span, so a handle never breaks
   inside and ↗ never sits alone on a line; break-word is only the last resort for the words before it. */
.creator-clip a{display:block;min-height:44px;padding-block:11px;font-size:var(--fs-sm);font-weight:var(--fw-ui);line-height:var(--lh-ui);color:var(--accent-ink);overflow-wrap:break-word}
.creator-clip a .ico{margin-left:.15em}
.creator-handle,.link-tail{white-space:nowrap}
.creator-clip a:hover{text-decoration:underline;text-underline-offset:4px}

/* ---------- Contact ---------- */
.contact-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.contact-card{position:relative;display:flex;flex-direction:column;min-width:0;padding:24px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);transition:border-color var(--dur-2),box-shadow var(--dur-3) var(--ease-out),transform var(--dur-3) var(--ease-out)}
.contact-card-top{display:flex;align-items:center;gap:12px;font-size:var(--fs-sm);font-weight:var(--fw-ui);color:var(--muted)}
.contact-icon{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:var(--radius);background:var(--accent-soft);color:var(--accent-ink);font-size:20px}
.contact-card h3{margin-top:20px;font-size:1.25rem;line-height:1.4;letter-spacing:-.01em;overflow-wrap:anywhere}
.contact-card h3 a:hover{color:var(--accent-ink)}
.contact-card>p{margin-top:6px;font-size:var(--fs-sm);line-height:1.55;color:var(--muted)}
.contact-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto;padding-top:20px}
.contact-actions [hidden]{display:none}
.contact-actions:not(:has(>:not([hidden]))){display:none}
.reveal-trigger{display:inline-flex;align-items:center;gap:8px;padding:0;border:0;background:none;color:var(--accent-ink);font:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}
.reveal-trigger::before{content:'';flex:none;width:1em;height:1em;background:currentColor;-webkit-mask:var(--ico-eye) center/contain no-repeat;mask:var(--ico-eye) center/contain no-repeat}
.reveal-trigger::after{content:'';position:absolute;inset:0;z-index:1;border-radius:inherit}
.reveal-trigger:focus-visible{outline:none}
.contact-card:has(.reveal-trigger){cursor:pointer}
.contact-card:has(.reveal-trigger:hover){border-color:var(--accent-soft-2);box-shadow:var(--shadow-2);transform:translateY(-1px)}
.contact-card:has(.reveal-trigger:focus-visible){outline:var(--focus-width) solid var(--focus);outline-offset:var(--focus-offset)}
.contact-card [data-reveal-value] a{color:var(--ink)}
.contact-profiles{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 24px;margin-top:32px;padding-top:20px;border-top:1px solid var(--line);font-size:var(--fs-sm);color:var(--muted)}
.contact-profiles>div{display:flex;flex-wrap:wrap;gap:0 24px}
.contact-profiles a{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-weight:var(--fw-ui);color:var(--ink)}
.contact-profiles a .ico{color:var(--muted)}
.contact-profiles a:hover{color:var(--accent-ink)}

/* ---------- Footer ---------- */
.site-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 24px;padding:28px var(--gutter) 56px;border-top:1px solid var(--line);font-size:var(--fs-sm);color:var(--muted)}
.footer-brand{display:flex;align-items:center;gap:12px}
.footer-brand img{display:block;width:28px;height:28px}
.footer-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px 20px}
.footer-actions>button,.footer-actions>a{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0;background:none;font-size:var(--fs-sm);color:var(--ink-2)}
.footer-actions>button:hover,.footer-actions>a:hover{color:var(--accent-ink)}
.destroy-launch .ico{font-size:1.05em}
.destroy-launch[aria-busy=true]{cursor:progress;opacity:.7}
.motion-toggle em{min-width:1.5em;font-style:normal;text-align:left}
.motion-toggle i{position:relative;display:inline-block;width:26px;height:14px;border:1px solid currentColor;border-radius:8px}
.motion-toggle i::after{content:'';position:absolute;top:2px;left:2px;width:8px;height:8px;border-radius:50%;background:currentColor;transition:translate var(--dur-2) var(--ease-out)}
.motion-toggle[aria-pressed=true] i::after{translate:12px 0}

/* ---------- Reveal on scroll (short, once, off with reduced motion) ---------- */
.js .reveal{opacity:0;transform:translateY(12px);transition:opacity var(--dur-4) var(--ease-out) var(--d,0ms),transform var(--dur-4) var(--ease-out) var(--d,0ms)}
.js .reveal.visible{opacity:1;transform:none}
html[data-motion=off] .reveal,html.destroy-mode .reveal{opacity:1;transform:none}

/* ---------- Dialogs (project details, image lightbox) ---------- */
dialog{width:min(92vw,1000px);max-width:1000px;max-height:min(90dvh,980px);padding:0;border:0;border-radius:var(--radius-lg);background:var(--surface);color:var(--ink);box-shadow:var(--shadow-3)}
#project-dialog{scroll-padding-top:72px}
/* The dialog scrolls under its sticky toolbar, so its scroll padding keeps focused content clear of it. The toolbar's own
   controls sit inside that padding: measure them 72 px lower, so focusing Close never scrolls the dialog. */
.dialog-toolbar :is(a,button){scroll-margin-top:-72px;scroll-margin-bottom:72px}
dialog::backdrop{background:rgb(22 24 29 / .55)}
dialog[open]{animation:dialog-in var(--dur-3) var(--ease-out)}
dialog[open]::backdrop{animation:backdrop-in var(--dur-2) var(--ease-standard)}
@keyframes dialog-in{from{opacity:0;transform:translateY(12px) scale(.985)}}
@keyframes backdrop-in{from{opacity:0}}
.dialog-toolbar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:12px;min-height:60px;padding:10px 12px 10px 24px;background:rgb(255 255 255 / .94);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.dialog-toolbar>span{min-width:0;font-size:var(--fs-sm);color:var(--muted);overflow-wrap:anywhere}
.dialog-toolbar .btn-close,.lightbox-toolbar>div{margin-left:auto}
#dialog-content{min-width:0;padding:28px 32px 40px}
/* Low-specificity rules (:where) that never reach inside a mini demo: demos keep their own real-product styles. */
#dialog-title{margin:2px 0 12px;font-size:clamp(1.75rem,1.4rem + 1.4vw,2.5rem);line-height:var(--lh-heading);letter-spacing:-.03em;overflow-wrap:anywhere}
#dialog-content .lead{max-width:44rem;margin-bottom:24px;font-size:var(--fs-lead);line-height:1.6;color:var(--ink-2)}
:where(#dialog-content) h3:not(.minidemo-section *){font-size:1.125rem;line-height:1.35;letter-spacing:-.01em}
:where(#dialog-content) :is(p,li):not(.minidemo-section *){color:var(--ink-2)}
:where(#dialog-content) :is(p,li,figcaption,dd):not(.minidemo-section *) a:not([class]){color:var(--accent-ink);text-decoration:underline;text-underline-offset:3px}
.project-contribution{margin:20px 0 16px;padding:20px;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg)}
.project-contribution h3{margin-bottom:8px}
.project-contribution p{line-height:1.7}
.project-contribution .project-role{margin-bottom:8px;font-size:var(--fs-sm);color:var(--muted)}
.project-contribution .project-part{margin:12px 0 0;padding-left:1.15em}
.project-contribution .project-part li{margin:6px 0;line-height:1.65;color:var(--ink-2)}
:lang(th) .project-contribution .project-part li{line-height:1.8}
.case-links{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.case-links:empty{display:none}
.case-links a{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border:1px solid var(--line-strong);border-radius:var(--radius-pill);background:var(--surface);color:var(--ink);font-size:var(--fs-sm);font-weight:var(--fw-ui);overflow-wrap:anywhere;transition:background-color var(--dur-2),border-color var(--dur-2)}
.case-links a:hover{background:var(--surface-2)}
.case-links a:first-child{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.case-links a:first-child:hover{background:var(--accent-hover)}
.dialog-image{display:block;width:100%;height:auto;margin:20px 0 6px;border:1px solid var(--line);border-radius:var(--radius)}
/* A hero the demo's poster already shows (heroInDemo in app.js) steps aside once the demo is in the dialog; its one
   honest line stays, just under the demo. */
#dialog-content:has(.minidemo-section) .dialog-image[data-hero-in-demo]{display:none}
#dialog-content .demo-line{margin:0 0 16px;font-size:var(--fs-xs);line-height:1.6;color:var(--muted)}
#dialog-content .minidemo-section.in-dialog+.demo-line{margin-top:-20px}
.caption{margin-bottom:24px;font-size:var(--fs-xs);color:var(--muted)}
.project-brief{padding:24px 0;border-bottom:1px solid var(--line)}
.project-brief .project-setting{margin-bottom:24px;padding:12px 16px;border-radius:var(--radius);background:var(--accent-soft);color:var(--accent-ink);font-size:var(--fs-sm);font-weight:var(--fw-ui)}
.project-brief h3{margin:24px 0 8px}
.project-brief p,.project-brief li{font-size:1rem;line-height:1.75}
.project-brief ul{padding-left:1.2em}
.project-brief li{margin:6px 0}
/* Skill tags are pills, never a bulleted run of words, in both languages (one tag per pill, no list markers). */
.project-brief ul.skill-keywords,ul.skill-keywords{display:flex;flex-wrap:wrap;gap:6px 8px;margin:16px 0;padding:0;list-style:none}
.project-brief ul.skill-keywords>li,ul.skill-keywords>li{display:inline-flex;align-items:center;max-width:100%;margin:0;padding:4px 12px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--surface-2);color:var(--ink-2);font-size:var(--fs-xs);line-height:1.5;list-style:none;overflow-wrap:anywhere}
ul.skill-keywords>li::marker{content:none}
ul.skill-keywords>li::before{content:none}
.project-brief .evidence-note{margin-top:20px;padding:10px 14px;border-left:2px solid var(--line-strong);font-size:var(--fs-sm);color:var(--muted)}
.project-delivery,.project-context{padding:20px 0;border-top:1px solid var(--line)}
.project-delivery h3,.project-context h3{margin-bottom:8px}
.project-delivery h3:not(:first-child){margin-top:18px}
.flow-detail{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;margin:20px 0;padding:32px 20px;border-radius:var(--radius);background:var(--surface-2)}
.flow-detail span{padding:12px 16px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface);font-size:var(--fs-sm)}
.flow-detail b{font-weight:400;color:var(--muted)}
/* Each arrow travels with the step it leads to, so a wrapped row starts with "→ step" and never ends on an arrow. */
.flow-detail .flow-next{display:inline-flex;align-items:center;gap:inherit;max-width:100%;padding:0;border:0;border-radius:0;background:none}
#dialog-content .zoomable-image{cursor:zoom-in;transition:box-shadow var(--dur-3) var(--ease-out)}
/* A photo inside a link to its full-size file: the link is the one control, so it wraps the image (and its focus ring). */
#dialog-content .zoomable-link{display:block;border-radius:var(--radius)}
#dialog-content .research-detail .zoomable-link{max-width:600px;margin-inline:auto}
#dialog-content .zoomable-image:hover{box-shadow:var(--shadow-2)}
.research-detail{margin-top:12px;padding-top:28px;border-top:1px solid var(--line)}
.research-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:32px}
.research-stats>div{min-width:0;padding:16px;border-radius:var(--radius);background:var(--surface-2);overflow-wrap:anywhere}
.research-stats strong{display:block;font-size:clamp(1.625rem,1.2rem + 1.4vw,2.25rem);font-weight:var(--fw-heading);color:var(--ink)}
.research-stats span{font-size:var(--fs-xs);color:var(--muted)}
.research-detail h3{margin-bottom:8px}
.research-detail figure{margin:28px 0}
.connectivity-figure{max-width:600px;margin:0 auto 10px;background:var(--surface)}
.research-detail figcaption{text-align:center}
.research-result{padding:24px;border-radius:var(--radius);background:var(--dark);color:var(--on-dark)}
.research-result>span{font-size:var(--fs-xs);color:var(--on-dark-muted)}
.research-result>strong{display:block;margin:6px 0;font-size:clamp(2rem,1.4rem + 2.6vw,3.5rem);font-weight:var(--fw-heading);color:var(--on-dark)}
.research-result small{font-size:1.25rem;color:var(--on-dark-muted)}
#dialog-content .research-result p{max-width:36rem;font-size:var(--fs-sm);color:var(--on-dark-2)}
.research-limit{margin:16px 0 24px;font-size:var(--fs-sm)}
.version-note{margin-bottom:20px;padding:14px 16px;border-left:2px solid var(--line-strong);background:var(--surface-2);font-size:var(--fs-sm)}
.multimedia-results{margin:16px 0 28px;padding:28px;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg)}
.multimedia-results .results-kicker{font-size:var(--fs-xs);font-weight:var(--fw-ui);color:var(--muted)}
.multimedia-results h3{margin:6px 0 10px;font-size:1.5rem}
.multimedia-results h4{margin:24px 0 8px;font-size:1.125rem}
.multimedia-results .results-intro,.multimedia-results .results-reading{max-width:46rem;font-size:.9375rem;line-height:1.7}
.results-highlight{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:24px 0}
.results-highlight>div{padding:18px 20px;border-radius:var(--radius);background:var(--dark);color:var(--on-dark)}
.results-highlight strong{display:block;font-size:clamp(1.75rem,1.3rem + 1.6vw,2.5rem);font-weight:var(--fw-heading);line-height:1.1}
.results-highlight strong small{font-size:1.125rem}
.results-highlight span{display:block;margin-top:8px;font-size:var(--fs-xs);color:var(--on-dark-muted)}
.results-table-wrap,.cleanup-table-wrap{max-width:100%;margin:20px 0 12px;overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.results-scroll-hint{display:none;margin:14px 0 -8px;font-size:var(--fs-xs);color:var(--muted)}
.multimedia-results table,.cleanup-results table{width:100%;border-collapse:collapse;text-align:left;font-size:var(--fs-sm);white-space:nowrap}
.multimedia-results caption,.cleanup-results caption{padding:14px 16px 8px;text-align:left;font-weight:var(--fw-ui);color:var(--ink)}
.multimedia-results :is(th,td),.cleanup-results :is(th,td){padding:10px 16px;border-bottom:1px solid var(--line);vertical-align:top}
.multimedia-results thead th,.cleanup-results thead th{background:var(--bg);font-size:var(--fs-xs);font-weight:var(--fw-ui);color:var(--muted)}
.multimedia-results tbody tr:last-child :is(th,td){border-bottom:0}
.multimedia-results tbody th{font-weight:var(--fw-ui)}
.multimedia-results .results-caveat,.cleanup-results .cleanup-units{margin-top:16px;padding-left:12px;border-left:2px solid var(--line-strong);font-size:var(--fs-xs);line-height:1.7;color:var(--muted)}
.cleanup-results{min-width:0;margin:28px 0}
.cleanup-results table{min-width:600px}
.cleanup-results tfoot{font-weight:var(--fw-heading);background:var(--bg)}
.scenario-intro{margin:-4px 0 20px;font-size:var(--fs-sm);color:var(--muted)}
.scenario-pair{margin:16px 0;padding:18px;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg)}
.scenario-pair h4{margin:0 0 14px;font-size:1rem}
.scenario-videos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.scenario-videos figure{min-width:0;margin:0}
.scenario-videos video{width:100%;aspect-ratio:317/224;object-fit:contain;border-radius:var(--radius-sm);background:var(--dark)}
.scenario-label{display:inline-block;margin-bottom:8px;padding:2px 10px;border-radius:var(--radius-pill);background:var(--surface-2);color:var(--ink-2);font-size:var(--fs-xs);font-weight:var(--fw-ui)}
.project-media{margin:28px 0;padding-top:28px;border-top:1px solid var(--line)}
.project-media h3{margin-bottom:16px}
.project-media-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.project-media figure{min-width:0;margin:0}
.project-media img,.project-media video{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2)}
.project-media img{width:auto;max-width:100%;max-height:440px;margin-inline:auto;object-fit:contain}
.project-media figcaption,.scenario-videos figcaption{margin-top:6px;font-size:var(--fs-xs);line-height:1.5;color:var(--muted)}
.project-video{grid-column:1/-1}
.project-video video{max-height:520px}

/* Image lightbox: the one dark viewer. */
#image-lightbox{width:min(96vw,1600px);height:min(94dvh,1050px);max-width:none;max-height:none;overflow:hidden;background:var(--dark);color:var(--on-dark)}
#image-lightbox[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
#image-lightbox::backdrop{background:rgb(10 11 14 / .86)}
.lightbox-toolbar{display:flex;align-items:center;gap:12px;min-height:60px;padding:8px 12px 8px 20px;border-bottom:1px solid var(--dark-line);background:var(--dark-2)}
.lightbox-toolbar>span{font-size:var(--fs-sm);color:var(--on-dark-muted)}
.lightbox-toolbar>div{display:flex;align-items:center;gap:8px}
.lightbox-zoom{min-height:40px;padding:0 16px;border:1px solid var(--dark-line);border-radius:var(--radius-pill);background:transparent;color:var(--on-dark);font-size:var(--fs-sm)}
.lightbox-zoom:hover{background:rgb(255 255 255 / .08)}
#image-lightbox :focus-visible{outline-color:var(--focus-on-dark)}
.lightbox-stage{display:grid;place-items:center;min-height:0;padding:20px;overflow:auto;overscroll-behavior:contain}
.lightbox-stage img{display:block;width:auto;height:auto;max-width:100%;max-height:calc(94dvh - 130px);cursor:zoom-in;box-shadow:0 24px 70px rgb(0 0 0 / .5)}
#image-lightbox.is-zoomed .lightbox-stage{display:block}
#image-lightbox.is-zoomed .lightbox-stage img{max-width:none;max-height:none;margin:auto;cursor:zoom-out}
#lightbox-caption{min-height:44px;margin:0;padding:11px 20px 13px;border-top:1px solid var(--dark-line);background:var(--dark-2);color:var(--on-dark-muted);font-size:var(--fs-sm);line-height:1.45}

/* Copy confirmation toast */
.copy-status{position:fixed;left:50%;bottom:32px;z-index:100;max-width:calc(100vw - 32px);padding:12px 18px;border-radius:var(--radius);background:var(--dark);color:var(--on-dark);box-shadow:var(--shadow-3);font-size:var(--fs-sm);transform:translateX(-50%);opacity:0;pointer-events:none;transition:opacity var(--dur-2)}
.copy-status.show{opacity:1}

/* ---------- Large screens ---------- */
@media (min-width:1600px){:root{--rail:264px}.sidebar{padding-inline:28px}.sidebar nav .nav-bar{left:-28px}}

/* ---------- Tablet ---------- */
@media (max-width:1100px){
  :root{--rail:212px}
  .sidebar{padding-inline:20px}
  .sidebar nav .nav-bar{left:-20px}
  .hero{grid-template-columns:minmax(0,1.4fr) minmax(0,.6fr)}
  .about-layout{grid-template-columns:minmax(0,1fr)}
  .toolbox{position:static}
  .creator-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .contact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .contact-email{grid-column:1/-1}
}

/* ---------- Phones and short landscape screens: fixed compact header + menu panel ---------- */
@media (max-width:800px),(max-width:1000px) and (max-height:500px){
  :root{--rail:0px;--header-h:60px}
  html{scroll-padding-top:var(--header-h)}
  .sidebar{inset:0 0 auto 0;width:auto;height:var(--header-h);flex-direction:row;flex-wrap:wrap;align-items:center;align-content:flex-start;padding:calc(8px + env(safe-area-inset-top,0px)) 8px 8px var(--gutter);border-right:0;border-bottom:1px solid var(--line);background:rgb(247 247 245 / .96);-webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px)}
  .brand img{height:26px}
  .sidebar-intro{display:none}
  /* The header's right end ships in index.html (menu button inside), so it paints at the right from the first frame.
     The flags arrive from i18n.js and move in with experience.js; their 82 px stay reserved until then, so the menu
     button never shifts sideways. Without JavaScript the menu cannot open (the nav shows as a row), so it hides. */
  .mobile-header-actions{display:flex;align-items:center;gap:2px;margin-left:auto}
  .js .mobile-header-actions:not(:has(.language-switch))::before{content:"";flex:none;width:82px;height:40px}
  html:not(.js) .mobile-header-actions{display:none}
  .menu-toggle{display:inline-grid;place-items:center;width:44px;height:44px;padding:0;border-radius:var(--radius-pill);background:none;color:var(--ink);font-size:22px}
  .menu-toggle:hover{background:var(--surface-2)}
  @media (hover:none){.menu-toggle:hover{background:none}}
  .sidebar nav,.sidebar-bottom{display:none}
  html:not(.js) .sidebar{position:static;height:auto}
  html:not(.js) .sidebar nav{display:flex;flex-direction:row;flex-wrap:wrap;gap:0 20px;width:100%;margin:8px 0 0}
  html:not(.js) .sidebar nav a{margin:0;padding:0}
  .sidebar.menu-open{height:auto;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;background:var(--bg);box-shadow:var(--shadow-3)}
  .sidebar.menu-open nav{display:flex;flex-direction:column;width:100%;margin:12px 0 0;padding:8px var(--gutter) 0 0;border-top:1px solid var(--line)}
  .sidebar.menu-open nav a{min-height:52px;margin:0;padding:0 12px;font-size:1.0625rem;color:var(--ink)}
  .sidebar.menu-open nav a[aria-current]{background:var(--surface-2)}
  .sidebar.menu-open .sidebar-bottom{display:flex;flex-direction:row;flex-wrap:wrap;gap:0 20px;width:100%;margin:8px 0 0;padding:12px var(--gutter) calc(12px + env(safe-area-inset-bottom,0px)) 12px}
  .sidebar.menu-open .sidebar-bottom a{min-height:44px}
  .sidebar nav .nav-bar{display:none}
  .page{margin-left:0;padding-top:var(--header-h)}
  .topbar{position:fixed;top:var(--header-h);left:0;right:0;height:2px;padding:0;border:0;background:transparent;pointer-events:none}
  .topbar>:not(.progress){display:none}
  .progress{bottom:0}
  .hero{grid-template-columns:minmax(0,1fr);gap:0;padding-top:40px;padding-bottom:64px}
  .hero-avatar{display:block}
  .hero-portrait{display:none}
  .hero h1{max-width:none;margin-top:18px}
  .hero-lead{margin-top:18px}
  .hero-actions{margin-top:28px}
  .hero-actions .btn{flex:1 1 auto}
  .hero-proof{margin-top:24px}
  .gallery,.side-gallery{grid-template-columns:minmax(0,1fr)}
  .project.featured .project-cover{aspect-ratio:16/10}
  .archive-row{grid-template-columns:minmax(0,1fr) 20px;gap:2px 12px}
  .archive-row .archive-desc,.archive-row .archive-meta{grid-column:1}
  .archive-row>.ico{grid-row:1/span 3;grid-column:2;align-self:center}
  .hackathon-highlight{grid-template-columns:minmax(0,1fr)}
  .role-head{grid-template-columns:minmax(0,1fr) 20px;gap:2px 16px;padding-block:18px}
  .role-head .role-date{grid-column:1/-1}
  .role-details{padding-left:0}
  .edu{grid-template-columns:minmax(0,1fr)}
  .contact-grid{grid-template-columns:minmax(0,1fr)}
  .contact-email{grid-column:auto}
  .contact-profiles{flex-direction:column;align-items:flex-start}
  .site-footer{flex-direction:column;align-items:flex-start;padding-bottom:104px}
  .footer-actions{gap:0 18px}
  #dialog-content{padding:22px 20px 32px}
  .dialog-toolbar{min-height:56px;padding:8px 8px 8px 16px}
  .project-contribution{padding:16px}
  .case-links a{flex:1 1 auto}
  .research-stats>div{padding:12px 10px}
  .results-highlight{gap:8px}
  .results-scroll-hint{display:block}
  .multimedia-results{padding:20px 16px}
  .scenario-videos,.project-media-grid{grid-template-columns:minmax(0,1fr)}
  .project-video{grid-column:auto}
  #image-lightbox{width:100vw;height:100dvh;max-height:none;border-radius:0}
  .lightbox-toolbar{padding:8px 8px 8px 16px}
  .lightbox-toolbar>span{display:none}
  .lightbox-stage{padding:12px}
  .lightbox-stage img{max-height:calc(100dvh - 124px)}
  .copy-status{bottom:96px}
}
/* Narrow phones: the 16:10 NLess.ai cover is too short for the headline and its small credit line (the Thai headline
   needs it from about 375 px down), so the credit steps aside (the card text below names NLess.ai) and the headline
   gets smaller. */
@media (max-width:379px){
  .featured-title small{display:none}
  .featured-title>span{font-size:1.25rem}
}
@media (max-width:560px){
  .creator-grid{gap:16px 12px}
  .creator-clip h3{font-size:1rem}
}
/* Two reel columns of about 160 px: the longest handle and its ↗ still fit on one line. Handles are Latin in both
   languages, so they may use the 13 px English floor in Thai too. Below 340 px (columns of about 140 px) the ↗ steps
   aside so the handle alone fits; the link is still marked by its colour and weight. */
@media (max-width:400px){
  .creator-clip a{font-size:var(--fs-xs)}
  .creator-handle{font-size:.8125rem}
}
@media (max-width:340px){.creator-clip a .ico{display:none}}

/* ---------- Motion off and reduced motion ---------- */
html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after{animation-duration:1ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:1ms!important;transition-delay:0s!important;scroll-behavior:auto!important}
@media (prefers-reduced-motion:reduce){
  .js .reveal{opacity:1;transform:none;transition:none}
  .project-cover>img,.side-cover>img{transition:none}
}

/* ---------- Print ---------- */
@media print{
  .sidebar,.topbar,.menu-toggle,.copy-status,.footer-actions,.mini-tart,.mini-tart-chat{display:none!important}
  .page{margin:0;padding:0}
  .js .reveal{opacity:1!important;transform:none!important;transition:none!important}
  .js .role .role-details{display:block!important}
  .side-projects,.creator{border:0}
}

/* After a dialog is closed with the mouse, focus goes back to the card without drawing the keyboard ring. */
[data-quiet-focus]:focus-visible{outline:none!important;box-shadow:none!important}
