/*
Theme Name: Arjun Portfolio
Theme URI: https://github.com/arjunar05-dot/portfolio
Author: Arjun Kumar Ravichandran
Description: Single-page portfolio: chat on the home screen, a scroll-driven 3D story, work history, a curved project carousel, chess tutoring and the Blooms & Bliss coloring book.
Version: 2.0.3
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: arjun-portfolio
*/

/* ==========================================================================
   Arjun Kumar Ravichandran — personal site, v2
   Dark and simple. One amber accent. A chat on the home screen, a 3D story
   (scene.js) and a curved project carousel. Colors are the tokens below.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #0B0C0E;
  --bg-2: #101114;
  --card: #131417;
  --card-2: #1A1B1F;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #F2F2F3;
  --text-2: rgba(235, 235, 237, .74);
  --text-3: rgba(235, 235, 237, .56);
  --accent: #F5B83D;
  --accent-2: #FFD27A;
  --accent-ink: #140E03;
  --accent-soft: rgba(245, 184, 61, .12);
  --green: #4ADE80;
  --display: "League Spartan", "Arial Narrow", system-ui, sans-serif;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r: 18px;
  --gutter: clamp(16px, 4.5vw, 72px);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 600; line-height: 1.1; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
b, strong { color: var(--text); font-weight: 600; }
img, svg { max-width: 100%; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.skip { position: absolute; left: 16px; top: -100px; z-index: 300; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 16px; }
.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }
.label { margin: 0 0 24px; font: 600 .72rem/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }

/* The 3D layer: fixed behind everything, drawn by scene.js */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; }
.lite #gl, .no-gl #gl { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; line-height: 1;
  transition: background-color .3s, border-color .3s, color .3s;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-2); background: rgba(255, 255, 255, .04); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-btn {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-size: .88rem; font-weight: 500; color: var(--text-2);
  border-bottom: 1px solid var(--line-2);
}
.text-btn:hover { color: var(--accent); border-color: var(--accent); }
.arrow-link { font-weight: 600; color: var(--accent); border-bottom: 1px solid currentColor; padding-bottom: 1px; white-space: nowrap; }
.arrow-link:hover { color: var(--accent-2); }

/* Big round button with a fill that rises on hover */
.round {
  position: relative; display: grid; place-items: center;
  width: clamp(150px, 13vw, 190px); aspect-ratio: 1; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 1rem; cursor: pointer; overflow: hidden; isolation: isolate;
}
.round::before {
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: 50%;
  background: #FFE2A6; transform: translateY(102%); transition: transform .55s var(--ease);
}
.round:hover::before { transform: translateY(0); }
.round span { position: relative; }
.magnetic { will-change: transform; transition: transform .5s var(--ease); }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0; translate: 0 28px;
  transition: opacity .9s var(--ease) var(--delay, 0s), translate .9s var(--ease) var(--delay, 0s);
}
.js .reveal.in { opacity: 1; translate: 0 0; }

/* ==========================================================================
   INTRO — the welcome card (once per visit)
   ========================================================================== */
.intro {
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  background: var(--bg); color: #E9E9EA;
  transition: opacity .8s var(--ease), visibility .8s;
}
html:not(.js) .intro, .entered .intro { display: none; }
.intro.out { opacity: 0; visibility: hidden; }
.intro-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 64px 64px; background-position: -1px -1px;
}
.intro-head { position: absolute; left: var(--gutter); top: clamp(18px, 4vh, 40px); transition: translate .9s var(--ease); }
.intro-name, .intro-role { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -.045em; line-height: .82; }
.intro-name { font-size: clamp(4.2rem, 14vw, 12rem); }
.intro-role { font-size: clamp(1.6rem, 5.6vw, 4.8rem); line-height: .92; }
.intro-mark { position: absolute; right: var(--gutter); top: clamp(22px, 4vh, 44px); width: clamp(54px, 8vw, 112px); fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }

.badge {
  position: absolute; left: 50%; top: 52%;
  width: clamp(236px, 22vw, 290px);
  padding: 14px; border-radius: 14px;
  background: rgba(18, 19, 22, .92); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .9);
  translate: -50% -50%;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s ease-out, scale .9s var(--ease), opacity .8s var(--ease);
}
.intro.out .badge { scale: 1.12; opacity: 0; }
.intro.out .intro-head { translate: 0 -40px; }
.badge-top { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 8px; height: clamp(160px, 17vw, 200px); }
.badge-vert {
  writing-mode: vertical-rl; transform: rotate(180deg); align-self: end;
  font: 700 .8rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
}
.badge-vert b { color: var(--accent); }
.badge-photo { position: relative; margin: 0; border: 1px solid rgba(255, 255, 255, .14); overflow: hidden; }
.badge-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 40%; display: block; filter: grayscale(1) contrast(1.1); }
.badge-photo::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 14px 14px;
}
.badge-star { position: absolute; right: -2px; top: 26%; font-size: 1.1rem; color: #DDD; }
.badge-mid {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14);
}
.badge-layers { width: 40px; fill: none; stroke: #DDD; stroke-width: 1.5; stroke-linejoin: round; }
.badge-count { text-align: center; line-height: 1; }
.badge-pill { display: inline-block; padding: 2px 7px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 99px; font: 700 .5rem/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; }
.badge-count b { display: block; margin: 3px 0 2px; font: 800 1.7rem/1 var(--display); color: #fff; }
.badge-cap { font: 700 .74rem/1 var(--display); letter-spacing: .3em; text-transform: uppercase; }
.badge-made p { margin: 0 0 4px; font: 800 .8rem/1 var(--display); text-transform: uppercase; color: #EEE; }
.badge-made b { color: var(--accent); }
.badge-plus { display: block; font-size: .62rem; line-height: 1.25; letter-spacing: .32em; color: #AAA; }
.badge-bot { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-top: 12px; }
.barcode { display: block; width: 100%; height: 34px; fill: #DDD; }
.badge-url { margin: 6px 0 0; font: 700 .48rem/1 var(--font); letter-spacing: .2em; text-transform: uppercase; color: #DDD; }
.badge-sign { display: grid; justify-items: center; gap: 4px; }
.badge-sign svg { width: 34px; fill: none; stroke: #DDD; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.badge-sign span { font-size: .52rem; color: #AAA; }

.enter {
  position: absolute; left: 50%; bottom: clamp(80px, 13vh, 140px); translate: -50% 0;
  width: min(360px, 80vw); padding: 14px 0;
  background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .85);
  font: 600 clamp(.95rem, 1.3vw, 1.1rem)/1 var(--display); letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; transition: color .3s, border-color .3s, opacity .5s;
}
.enter:hover, .enter:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.intro:not(.ready) .enter { opacity: .35; }
.intro-lite {
  position: absolute; left: var(--gutter); bottom: clamp(18px, 4vh, 36px);
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font: 600 .82rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: #DDD;
}
.intro-lite:hover { color: var(--accent); }
.intro-count { position: absolute; right: var(--gutter); bottom: clamp(10px, 3vh, 28px); margin: 0; font: 800 clamp(2.4rem, 5vw, 4.4rem)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   TOP BAR + MENU
   ========================================================================== */
.topbar {
  position: absolute; inset: 0 0 auto; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(18px, 3vh, 30px) var(--gutter);
}
.logo { font-weight: 600; color: var(--text); white-space: nowrap; }
.logo-c { display: inline-block; transition: rotate .6s var(--ease); }
.logo:hover .logo-c { rotate: 360deg; }
.topnav { display: flex; gap: clamp(18px, 2.4vw, 36px); }
.topnav a { position: relative; padding: 6px 0; font-weight: 500; color: var(--text); }
.topnav a::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); translate: -50% 0; scale: 0; transition: scale .3s var(--ease);
}
.topnav a:hover::after, .topnav a.active::after { scale: 1; }

/* Round menu button: floats in once the hero is gone (always on small screens) */
.menu-btn {
  position: fixed; right: var(--gutter); top: clamp(14px, 2.4vh, 24px); z-index: 70;
  display: grid; place-content: center; gap: 6px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--line-2); cursor: pointer;
  scale: 0; transition: scale .45s var(--ease), background-color .3s;
}
.menu-btn i { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .4s var(--ease); }
.past-hero .menu-btn { scale: 1; }
.menu-open .menu-btn { scale: 1; background: var(--accent); }
.menu-open .menu-btn i { background: var(--accent-ink); }
.menu-open .menu-btn i:first-of-type { transform: translateY(4px) rotate(45deg); }
.menu-open .menu-btn i:last-of-type { transform: translateY(-4px) rotate(-45deg); }

.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 65;
  width: min(480px, 100%); padding: 120px clamp(28px, 4vw, 56px) 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #15161A; border-left: 1px solid var(--line);
  box-shadow: -40px 0 80px rgba(0, 0, 0, .5);
  translate: 105% 0; visibility: hidden;
  transition: translate .7s var(--ease), visibility .7s;
}
.menu-open .menu { translate: 0 0; visibility: visible; }
.menu nav { display: grid; gap: 2px; border-top: 1px solid var(--line-2); padding-top: 28px; }
.menu nav a { font: 500 clamp(2.2rem, 5vw, 3.2rem)/1.15 var(--font); letter-spacing: -.02em; color: var(--text); transition: translate .4s var(--ease), color .3s; }
.menu nav a:hover { translate: 10px 0; color: var(--accent); }
.menu-foot { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; color: var(--text-2); font-size: .95rem; }
.menu-foot a:hover { color: var(--accent); }

/* ==========================================================================
   HERO — portrait, chat, giant name
   ========================================================================== */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: clip; }
.hero-glow {
  position: absolute; left: 50%; top: 2%;
  width: min(84vh, 72vw); aspect-ratio: 1; translate: -56% 0;
  background: radial-gradient(circle, rgba(245, 184, 61, .26), rgba(245, 184, 61, .07) 38%, transparent 64%);
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite alternate;
}
@keyframes breathe { to { opacity: .7; scale: 1.06; } }

/* lighten: the photo's black background disappears into the page, so the glow shows around the head */
.person {
  position: absolute; left: 50%; bottom: -6%; height: 108%; aspect-ratio: 768 / 1344; margin: 0;
  mix-blend-mode: lighten;
  translate: calc(-50% + var(--mx, 0) * -14px) calc(var(--my, 0) * -8px);
  transition: transform 1s var(--ease);
}
.person img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 60% 54% at 46% 50%, #000 50%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 54% at 46% 50%, #000 50%, transparent 100%);
  transform: perspective(1400px) rotateY(calc(var(--mx, 0) * 4deg)) rotateX(calc(var(--my, 0) * -2.5deg));
}

.loc {
  position: absolute; left: 0; top: 50%; z-index: 2; margin: 0;
  display: flex; align-items: center; gap: 24px;
  padding: 16px 16px 16px var(--gutter);
  border-radius: 0 999px 999px 0; background: var(--card-2);
  color: var(--text); font-weight: 500; font-size: .95rem; line-height: 1.3;
}
.globe { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #26272C; }
.globe svg { width: 28px; fill: none; stroke: var(--text); stroke-width: 1.3; }
.globe-m { transform-box: fill-box; transform-origin: center; animation: globe 4s linear infinite; }
@keyframes globe { 50% { transform: scaleX(.05); } }

.role { position: absolute; right: var(--gutter); top: 54%; z-index: 2; margin: 0; color: var(--text); font-size: clamp(1.2rem, 1.8vw, 1.75rem); line-height: 1.3; }
.role span { display: inline-block; margin-bottom: 10px; font-size: 1.2em; }

.talk { position: absolute; left: calc(50% + 10vh); top: 26vh; z-index: 3; width: min(340px, 28vw); }
.bubble {
  position: relative; min-height: 50px; padding: 13px 16px;
  border-radius: 18px 18px 18px 4px;
  background: rgba(26, 27, 31, .9); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--text); font-size: .98rem; line-height: 1.45;
  opacity: 0; translate: 0 10px; transition: opacity .5s var(--ease), translate .5s var(--ease);
}
.bubble.show { opacity: 1; translate: 0 0; }
.dots { display: none; gap: 4px; padding: 6px 0; }
.typing .dots { display: inline-flex; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 30% { translate: 0 -4px; opacity: 1; } 0%, 60%, 100% { opacity: .4; } }
.talk .ask, .talk .chips { opacity: 0; translate: 0 10px; transition: opacity .6s var(--ease) .15s, translate .6s var(--ease) .15s; }
.talk.ready .ask, .talk.ready .chips { opacity: 1; translate: 0 0; }
.talk .ask { margin-top: 10px; }

.ask {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 18px; border-radius: 999px;
  background: rgba(20, 21, 24, .86); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .3s, box-shadow .3s;
}
.ask:focus-within { border-color: rgba(245, 184, 61, .6); box-shadow: 0 0 0 4px rgba(245, 184, 61, .12); }
.ask input { flex: 1; min-width: 0; padding: 10px 0; background: none; border: 0; outline: 0; color: var(--text); font-size: .98rem; }
.ask input::placeholder { color: var(--text-3); }
.send {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; transition: background-color .25s;
}
.send:hover { background: var(--accent-2); }
.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(20, 21, 24, .7);
  color: var(--text-2); font-size: .8rem; font-weight: 600; line-height: 1.2;
  transition: color .25s, border-color .25s, background-color .25s;
}
.chip:hover { color: var(--text); border-color: rgba(245, 184, 61, .55); background: rgba(245, 184, 61, .08); }

.name { position: absolute; left: 0; right: 0; bottom: clamp(10px, 3vh, 40px); z-index: 2; overflow: hidden; pointer-events: none; }
.name-track {
  display: inline-flex; white-space: nowrap; will-change: transform;
  font: 600 min(15vw, 25svh)/1.02 var(--display); letter-spacing: -.035em; color: var(--text);
}
.name-track span { padding-right: .08em; }

/* Chat open on a wide screen: the portrait steps aside */
@media (min-width: 900px) {
  .chat-open .person { transform: translateX(-14vw); }
}

/* ==========================================================================
   STORY — the pinned 3D sequence
   ========================================================================== */
.story { position: relative; height: 560vh; }
.story-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: clip; }
/* Still picture of the pump when 3D is off (Lite version) or can't run on the device */
.story-fallback { display: none; }
.lite .story-fallback, .no-gl .story-fallback {
  display: block; position: absolute; right: var(--gutter); top: 50%; margin: 0;
  width: min(46vw, 72vh); aspect-ratio: 1; translate: 0 -54%;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent);
  mask-image: radial-gradient(closest-side, #000 72%, transparent);
}
.story-fallback img { display: block; width: 100%; height: 100%; object-fit: cover; }
.steps-hud {
  position: absolute; left: var(--gutter); top: 50%; translate: 0 -50%;
  display: grid; gap: 16px; margin: 0; padding: 0; list-style: none;
}
.steps-hud li {
  display: flex; align-items: center; gap: 12px;
  font: 600 .72rem/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  transition: color .4s;
}
.steps-hud li::before { content: ""; width: 18px; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.steps-hud li span { font-variant-numeric: tabular-nums; }
.steps-hud li.on { color: var(--accent); }
.steps-hud li.on::before { width: 40px; }
.fea-key {
  position: absolute; right: var(--gutter); bottom: 40px;
  display: grid; grid-template-columns: auto 150px auto; align-items: center; gap: 10px;
  font: 600 .66rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
  opacity: 0; transition: opacity .5s;
}
.fea-key i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2448ff, #18c4ff, #2bd96b, #ffe14a, #ff3b2f); }
.fea-key small { grid-column: 1 / -1; justify-self: end; font-size: .58rem; color: var(--text-3); }
.fea-on .fea-key { opacity: 1; }

.lines { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(60px, 13vh, 130px); pointer-events: none; }
.line { position: absolute; left: 0; bottom: 0; opacity: var(--o, 0); translate: 0 var(--y, 0px); }
.line-text {
  margin: 0; max-width: 14ch; text-wrap: balance;
  font: 600 clamp(2rem, 4.3vw, 4.3rem)/1.04 var(--display); letter-spacing: -.035em; color: var(--text);
}
.line-word .line-text { font-size: clamp(3.4rem, 8.4vw, 8.2rem); line-height: .9; text-transform: uppercase; letter-spacing: -.04em; }
.line-sub { margin: 16px 0 0; max-width: 44ch; font-size: clamp(1rem, 1.35vw, 1.2rem); color: var(--text-2); opacity: var(--so, 0); translate: 0 calc((1 - var(--so, 0)) * 12px); }
.line .w { display: inline-block; white-space: nowrap; }
.line .ch { opacity: clamp(.08, calc(var(--p, 0) * var(--n, 1) - var(--i, 0)), 1); }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { position: relative; padding-block: clamp(100px, 13vw, 180px); }
.sec-head h2 { font: 600 clamp(2.4rem, 5vw, 4.2rem)/1 var(--display); letter-spacing: -.035em; }

/* ----- About ----- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.statement { font: 500 clamp(1.6rem, 3vw, 2.6rem)/1.3 var(--font); letter-spacing: -.015em; color: var(--text); max-width: 26ch; }
.about-side { padding-top: 8px; }
.about-side p { max-width: 40ch; }
.about-side .round { margin-top: 36px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(70px, 9vw, 120px) 0 0; border-top: 1px solid var(--line-2); }
.stats > div { padding: 26px 24px 0 0; }
.stats dt { font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.stats dd { margin: 12px 0 0; font: 600 clamp(3rem, 7.5vw, 6.4rem)/1 var(--display); letter-spacing: -.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.stats dd i { font-style: normal; color: var(--accent); }

/* ----- Work list (hover shows a picture, click opens details) ----- */
.wlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.wrow { border-bottom: 1px solid var(--line-2); }
.wrow-head {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) auto 26px; align-items: center; gap: clamp(14px, 2.4vw, 32px);
  padding: clamp(26px, 4vw, 48px) clamp(4px, 2vw, 28px);
  transition: opacity .4s;
}
.wrow-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.wrow-title { font: 600 clamp(1.6rem, 3.3vw, 3rem)/1.02 var(--display); letter-spacing: -.035em; color: var(--text); transition: translate .6s var(--ease); }
.wrow-sub { color: var(--text-2); font-size: clamp(.95rem, 1.25vw, 1.1rem); }
.wrow-when { color: var(--text-3); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrow-x { position: relative; width: 22px; height: 22px; }
.wrow-x::before, .wrow-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; translate: -50% -50%; background: var(--text); transition: rotate .45s var(--ease), background-color .3s; }
.wrow-x::after { rotate: 90deg; }
.wrow.open .wrow-x::after { rotate: 0deg; }
.wrow.open .wrow-x::before, .wrow.open .wrow-x::after { background: var(--accent); }
@media (hover: hover) {
  .wlist:hover .wrow-head { opacity: .38; }
  .wlist .wrow-head:hover, .wlist .wrow.open .wrow-head { opacity: 1; }
  .wrow-head:hover .wrow-title { translate: -10px 0; }
}
.wrow-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease); }
.wrow.open .wrow-body { grid-template-rows: 1fr; }
.wrow-inner {
  min-height: 0; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 64px);
  padding-inline: clamp(4px, 2vw, 28px);
}
.wrow-inner > * { margin: 4px 0 48px; }
.wrow-text p { color: var(--text-2); }
.wrow-meta { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 18px 0 0; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ticks li { position: relative; padding-left: 22px; font-size: .98rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .8em; width: 10px; height: 2px; background: var(--accent); }
.metric { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; padding: 14px 18px; border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(245, 184, 61, .25); }
.metric b { font: 700 2rem/1 var(--display); color: var(--accent); letter-spacing: -.02em; }
.metric span { font-size: .95rem; }

.wmedia, .wgallery figure { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--card); }
.wmedia img, .wgallery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wmedia figcaption, .wgallery figcaption {
  position: absolute; left: 10px; bottom: 10px; padding: 5px 10px; border-radius: 8px;
  background: rgba(11, 12, 14, .75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text);
}
.wgallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.wgallery .g-main { grid-column: 1 / -1; aspect-ratio: 16 / 7.2; }
.wgallery figure:not(.g-main) { aspect-ratio: 3 / 2; }
.img-credit { grid-column: 1 / -1; margin: 6px 0 0; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.xray img { filter: invert(.93) hue-rotate(180deg) contrast(.95) brightness(.95); }

/* 360° spin of the Bosch injectors */
.spin { position: relative; aspect-ratio: 5 / 3; border-radius: 14px; overflow: hidden; background: #141518; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.spin.dragging { cursor: grabbing; }
.spin-img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.spin-hint { position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px; background: rgba(11, 12, 14, .7); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }

/* Picture that follows the cursor over the work list */
.follow {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: clamp(260px, 24vw, 380px); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  background: var(--card);
  translate: calc(var(--fx, -999px) - 50%) calc(var(--fy, -999px) - 50%);
  scale: 0; transition: scale .45s var(--ease);
}
.follow.on { scale: 1; }
.follow-track { position: absolute; inset: 0; transition: translate .6s var(--ease); translate: 0 calc(var(--fi, 0) * -100%); }
.follow-track img { display: block; width: 100%; height: 100%; object-fit: cover; }
.follow-track img.xray { filter: invert(.93) hue-rotate(180deg) contrast(.95) brightness(.95); }
@media (hover: none) { .follow { display: none; } }

/* ----- Projects: curved carousel ----- */
.projects { position: relative; height: 320vh; }
.proj-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: clip; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.proj-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; padding-top: clamp(84px, 12vh, 120px); }
.proj-head h2 { font: 600 clamp(2.6rem, 7vw, 6rem)/.9 var(--display); letter-spacing: -.045em; }
.proj-head sup { margin-left: 6px; font: 600 .9rem/1 var(--font); color: var(--accent); vertical-align: top; letter-spacing: 0; }
.proj-hint { margin: 0; font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.ring { position: relative; perspective: var(--P, 1100px); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.ring.dragging { cursor: grabbing; }
.pcard {
  position: absolute; left: 50%; top: 50%; width: var(--cw, 340px);
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  translate: -50% -50%; transform-origin: 50% 50%; backface-visibility: hidden;
  will-change: transform, opacity;
}
.sheet {
  position: relative; display: flex; flex-direction: column; min-height: calc(var(--cw, 340px) * 4 / 3);
  padding: 14px; border-radius: 16px; overflow: hidden;
  background-color: var(--card);
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
  transition: border-color .4s;
}
.sheet::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 11px; pointer-events: none; }
.pcard.front .sheet { border-color: rgba(245, 184, 61, .55); }
.sheet-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #0E0F12; border: 1px solid var(--line); }
.sheet-img .schem { width: 92%; }
.sheet-img.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sheet-img.book img { object-position: 50% 42%; }
.mini-board { width: 74%; border-radius: 6px; }
.sheet-title { display: block; margin: 14px 4px 0; font: 700 clamp(1.05rem, 1.4vw, 1.3rem)/1.08 var(--display); text-transform: uppercase; letter-spacing: -.01em; color: var(--text); }
.sheet-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 8px 4px 16px; font-size: .86rem; line-height: 1.45; color: var(--text-2); }
.tblock { margin-top: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; overflow: hidden; }
.tblock > span { padding: 6px; font-size: .72rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tblock > span + span { border-left: 1px solid rgba(255, 255, 255, .18); }
.tblock small { display: block; font-size: .5rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.proj-foot { display: flex; align-items: center; gap: 14px; padding-bottom: clamp(20px, 4vh, 36px); }
.pnav { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-size: 1.1rem; cursor: pointer; transition: border-color .3s, color .3s; }
.pnav:hover { border-color: var(--accent); color: var(--accent); }
.proj-now { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; color: var(--text-3); font-size: .85rem; font-variant-numeric: tabular-nums; }
.proj-now b { font: 700 1.5rem/1 var(--display); color: var(--text); }
.proj-now span { white-space: nowrap; }
.proj-now em { margin-left: 10px; font: 700 .82rem/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-bar { position: relative; flex: 1; height: 2px; min-width: 40px; background: var(--line-2); }
.proj-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; scale: var(--pp, 0) 1; }

/* Line drawings on the dark sheets */
.schem { display: block; width: 100%; height: auto; overflow: visible; }
.s-line { fill: none; stroke: #D4D4D8; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.s-an { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.s-dash { stroke-dasharray: 14 4 3 4; opacity: .7; }
.s-fill { fill: var(--accent); }
.s-t { fill: rgba(235, 235, 237, .62); font-family: var(--font); font-size: 8.5px; font-weight: 600; letter-spacing: .08em; }
.s-t.s-acc { fill: var(--accent); font-size: 10px; font-weight: 700; }
.ck-l { fill: #3A3D44; }
.ck-d { fill: #24262B; }
.mb-pc text { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", serif; font-size: 17px; text-anchor: middle; fill: #0B0C0E; stroke: #C9C9CE; stroke-width: .5px; paint-order: stroke; }
.mb-pc text.w { fill: #F4F4F5; stroke: #0B0C0E; }

/* Project details dialog */
.pdialog {
  width: min(1000px, calc(100% - 24px)); max-width: none; max-height: calc(100svh - 24px);
  margin: auto; padding: 0; border-radius: 20px; overflow: hidden;
  background: #121316; color: var(--text-2); border: 1px solid var(--line-2);
  box-shadow: 0 60px 120px -30px rgba(0, 0, 0, .95);
}
.pdialog::backdrop { background: rgba(4, 5, 6, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pdialog[open] { animation: pd-in .55s var(--ease); }
@keyframes pd-in { from { opacity: 0; translate: 0 30px; scale: .97; } }
.pd-sheet { max-height: calc(100svh - 24px); overflow: auto; padding: clamp(18px, 3vw, 40px); overscroll-behavior: contain; }
.pd-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.pd-kicker { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.pd-x { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--text); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.pd-x:hover { border-color: var(--accent); color: var(--accent); }
.pd-num { margin: 0 0 12px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.pd h3 { font: 700 clamp(1.9rem, 4.4vw, 3.4rem)/.98 var(--display); text-transform: uppercase; letter-spacing: -.035em; }
.pd-lede { margin-top: 14px; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--text); max-width: 60ch; }
.pd-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.pd-gallery figure { margin: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--card); }
.pd-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pd-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); margin-top: 28px; }
.pd-facts { margin: 0; border-top: 1px solid var(--line-2); }
.pd-facts > div { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.pd-facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.pd-facts dd { margin: 4px 0 0; color: var(--text); }

/* ----- Toolkit ----- */
.toolkit { padding-top: 0; }
.marquee { overflow: hidden; padding-block: clamp(22px, 3vw, 36px); border-block: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; align-items: center; animation: marquee 50s linear infinite; font: 600 clamp(2rem, 5vw, 4.2rem)/1 var(--display); letter-spacing: -.03em; color: var(--text); white-space: nowrap; }
.marquee-track span, .marquee-track i { margin-right: clamp(20px, 2.6vw, 40px); }
.marquee-track i { font-style: normal; font-size: .55em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 110px); margin-top: clamp(70px, 9vw, 120px); }
.rows { margin: 0; border-top: 1px solid var(--line-2); }
.rows > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.rows dt { color: var(--text); font-weight: 600; }
.rows dd { margin: 0; color: var(--text-2); font-size: .95rem; }

/* ----- Chess (the 3D knight is drawn on the left by scene.js) ----- */
.chess { position: relative; }
.chess-stage { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-block: clamp(110px, 14vh, 160px) 60px; }
.chess-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: clamp(24px, 4vw, 64px); align-items: center; }
.lite .chess-grid, .no-gl .chess-grid { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.lite .chess-space, .no-gl .chess-space { display: none; }
.serif-h { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 5.2vw, 4.6rem); line-height: 1.06; letter-spacing: -.02em; color: var(--text); }
.serif-h.small-h { font-size: clamp(2rem, 3.6vw, 3rem); }
.chess-copy .lede { margin-top: 20px; font-size: clamp(1.02rem, 1.3vw, 1.15rem); color: var(--text-2); max-width: 46ch; }
.process { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--line-2); }
.process li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--line-2); }
.pnum { padding-top: 7px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; color: var(--text-3); font-variant-numeric: tabular-nums; transition: color .4s; }
.process li.lit .pnum { color: var(--accent); }
.process h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.2; }
.process p { margin: 6px 0 0; font-size: .98rem; }

.puzzle-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(24px, 5vw, 80px); align-items: center; padding-block: 40px clamp(100px, 13vw, 170px); }
.puzzle-copy p { max-width: 44ch; }
.puzzle { padding: 22px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.board-wrap { container-type: inline-size; }
.board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); user-select: none; -webkit-user-select: none; }
.sq { all: unset; position: relative; display: grid; place-items: center; aspect-ratio: 1; cursor: pointer; line-height: 1; font-size: 34px; font-size: 9.2cqi; }
.sq.light { background: #3A3D44; }
.sq.dark { background: #24262B; }
.sq:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 1; }
.sq[data-rank]::before, .sq[data-file]::after { position: absolute; font-family: var(--font); font-size: 8px; font-weight: 700; line-height: 1; color: #C9C9CE; opacity: .5; }
.sq[data-rank]::before { content: attr(data-rank); top: 4px; left: 4px; }
.sq[data-file]::after { content: attr(data-file); bottom: 4px; right: 4px; }
.pc { position: relative; z-index: 2; display: block; pointer-events: none; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", serif; }
.pc.pw { color: #F4F4F5; text-shadow: 0 0 1px #000, 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000, 0 3px 6px rgba(0, 0, 0, .5); }
.pc.pb { color: #0B0C0E; text-shadow: 0 0 1px #C9C9CE, 1px 0 0 #8A8A93, -1px 0 0 #8A8A93, 0 1px 0 #8A8A93, 0 -1px 0 #8A8A93; }
.sq.sel { box-shadow: inset 0 0 0 4px var(--accent); }
.sq.sel .pc { transform: translateY(-2px); }
.sq.hint { outline: 3px dashed var(--accent); outline-offset: -6px; }
.sq.landed { box-shadow: inset 0 0 0 4px var(--green); }
.sq.mated { background: #8E3B33; }
.puzzle-msg { min-height: 3.2em; margin: 16px 0 8px; font-size: .95rem; line-height: 1.55; }
.puzzle-msg[data-tone="ok"] { color: var(--green); }
.puzzle-msg[data-tone="no"] { color: var(--accent); }
.puzzle-actions { display: flex; flex-wrap: wrap; gap: 20px; }

/* ----- Book ----- */
.book-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 100px); align-items: center; }
.book-photo { display: block; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; max-width: 520px; transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s ease-out; }
.book-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; transition: scale 1.2s var(--ease); }
.book-photo:hover img { scale: 1.04; }
.book-title { font: 600 clamp(2.8rem, 6vw, 5.2rem)/.95 var(--display); letter-spacing: -.04em; }
.book-sub { margin-top: 20px; max-width: 48ch; }
.book-specs { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: 12px 40px; margin: 28px 0 34px; }
.book-specs dt { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.book-specs dd { margin: 4px 0 0; color: var(--text); font-weight: 600; }

/* ----- Contact ----- */
.contact { position: relative; padding: clamp(110px, 14vw, 190px) 0 28px; background: var(--bg-2); border-top: 1px solid var(--line); }
.lwt { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 30px); }
.lwt-face { flex: none; width: clamp(64px, 7.5vw, 116px); height: clamp(64px, 7.5vw, 116px); border-radius: 50%; object-fit: cover; object-position: 46% 40%; filter: grayscale(1) contrast(1.1); }
.lwt h2 { font: 500 clamp(3rem, 8.4vw, 7.6rem)/.95 var(--font); letter-spacing: -.04em; }
.lwt-line { position: relative; height: 1px; margin: clamp(60px, 9vw, 120px) 0 clamp(90px, 11vw, 150px); background: var(--line-2); }
.round-lg { position: absolute; right: clamp(6%, 12vw, 16%); top: 50%; translate: 0 -50%; width: clamp(150px, 16vw, 220px); font-size: 1.05rem; }
.pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pill { padding: 18px 28px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); font-weight: 500; transition: background-color .3s, border-color .3s; }
.pill:hover { background: rgba(255, 255, 255, .05); border-color: var(--text-2); }
.foot-row { display: flex; flex-wrap: wrap; align-items: end; gap: 24px clamp(28px, 5vw, 72px); margin-top: clamp(90px, 11vw, 150px); }
.foot-row small { display: block; margin-bottom: 8px; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.foot-row p { margin: 0; color: var(--text); }
.foot-row p a { margin-right: 14px; }
.foot-row p a:hover { color: var(--accent); }
.foot-end { margin-left: auto; }
.fine { margin: 26px 0 0; font-size: .78rem; color: var(--text-3); }

/* ==========================================================================
   CHAT — panel + floating button
   ========================================================================== */
.chat {
  position: fixed; z-index: 80; right: 20px; top: 20px; bottom: 20px;
  width: min(420px, calc(100% - 40px));
  display: flex; flex-direction: column;
  border-radius: 22px; background: rgba(17, 18, 21, .94); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
  opacity: 0; translate: 30px 0; pointer-events: none;
  transition: opacity .45s var(--ease), translate .6s var(--ease);
}
.chat-open .chat { opacity: 1; translate: 0 0; pointer-events: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; object-position: 46% 40%; filter: grayscale(1) contrast(1.1); border: 1px solid var(--line-2); }
.chat-name { margin: 0; color: var(--text); font-weight: 700; line-height: 1.2; }
.chat-sub { margin: 0; font-size: .74rem; color: var(--text-3); }
.chat-x { margin-left: auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: none; cursor: pointer; }
.chat-x:hover { border-color: var(--accent); }
.chat-x svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.msg { max-width: 90%; font-size: .95rem; line-height: 1.55; }
.msg-me { align-self: flex-end; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.msg-bot { align-self: flex-start; display: flex; gap: 10px; }
.msg-bot .avatar { width: 28px; height: 28px; margin-top: 2px; }
.say { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); white-space: pre-line; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.act { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(245, 184, 61, .45); color: var(--accent); font-size: .78rem; font-weight: 700; }
.act:hover { background: rgba(245, 184, 61, .12); }
.ask-panel { margin: 0 12px; }
.chips-panel { padding: 0 12px 14px; }

.fab {
  position: fixed; z-index: 75; right: 20px; bottom: 20px;
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px 14px 16px;
  border-radius: 999px; border: 1px solid rgba(245, 184, 61, .5); background: rgba(17, 18, 21, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text); font-size: .85rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .8);
  opacity: 0; translate: 0 16px; pointer-events: none;
  transition: opacity .4s var(--ease), translate .4s var(--ease), border-color .3s;
}
.fab:hover { border-color: var(--accent); }
.fab-ico { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fab i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(74, 222, 128, .15); }
.fab-on .fab { opacity: 1; translate: 0 0; pointer-events: auto; }
.chat-open .fab, .menu-open .fab { opacity: 0; pointer-events: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .role { display: none; }
  .talk { width: min(320px, 34vw); }
  .wrow-head { grid-template-columns: minmax(0, 1fr) auto 26px; }
  .wrow-sub { grid-column: 1; grid-row: 2; }
  .wrow-when { grid-column: 2; grid-row: 1; }
  .wrow-x { grid-column: 3; grid-row: 1; }
}
@media (max-width: 860px) {
  .topnav { display: none; }
  .menu-btn { scale: 1; }
  .about-grid, .tool-grid, .book-feature, .chess-grid, .puzzle-row, .pd-cols, .wrow-inner { grid-template-columns: minmax(0, 1fr); }
  .wrow-inner > * { margin-bottom: 0; }
  .wrow-inner > :last-child { margin-bottom: 40px; }
  .chess-space { height: 52svh; }
  .chess-stage { padding-top: 40px; }
  .chess-copy { position: relative; }
  .chess-copy::before { content: ""; position: absolute; inset: -60px -24px -20px; z-index: -1; background: linear-gradient(transparent, var(--bg) 70px); }
  .book-photo { max-width: 420px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats > div { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line-2); }
  .stats dd { margin: 0; }
}
@media (max-width: 760px) {
  .hero { min-height: 600px; }
  .person { top: 7svh; bottom: auto; height: 72svh; }
  .loc { top: 84px; padding: 8px 10px 8px 16px; gap: 12px; font-size: .78rem; }
  .hero-glow { top: 14svh; width: 90vw; }
  .globe { width: 40px; height: 40px; }
  .globe svg { width: 20px; }
  .talk { left: 16px; right: 16px; top: auto; bottom: calc(min(22vw, 20svh) + 40px); width: auto; }
  .talk .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .talk .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .name { bottom: 14px; }
  .name-track { font-size: min(22vw, 20svh); }
  .steps-hud { top: 96px; translate: 0 0; grid-auto-flow: column; gap: 18px; }
  .lite .story-fallback, .no-gl .story-fallback { right: auto; left: 50%; top: 13vh; width: min(92vw, 50vh); translate: -50% 0; }
  .steps-hud li::before { display: none; }
  .fea-key { left: var(--gutter); right: auto; bottom: 20px; grid-template-columns: auto 110px auto; }
  .lines { bottom: 74px; }
  .chat { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: min(80svh, 660px); translate: 0 40px; }
  .fab { right: 12px; bottom: 12px; width: 56px; height: 56px; padding: 0; justify-content: center; }
  .fab i, .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fab-ico { display: block; }
  .lwt-line { margin-bottom: 110px; }
  .contact { padding-bottom: 96px; }
  .round-lg { right: 8%; }
  .pd-gallery { grid-template-columns: minmax(0, 1fr); }
  .sheet-img { aspect-ratio: 16 / 10; }
  .tblock > span { padding: 5px; font-size: .66rem; }
  .proj-foot { padding-right: 84px; }
  .proj-now em { display: none; }
  .foot-end { margin-left: 0; width: 100%; }
}

/* ==========================================================================
   MOTION, LITE AND NO-JS FALLBACKS
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Without JS the pinned sections become plain, readable blocks */
html:not(.js) .story, html:not(.js) .projects { height: auto; }
html:not(.js) .story-pin, html:not(.js) .proj-pin { position: static; height: auto; }
html:not(.js) .line { position: static; opacity: 1; margin-bottom: 40px; }
html:not(.js) .line .ch, html:not(.js) .line-sub { opacity: 1; }
html:not(.js) .lines { position: static; padding: 120px var(--gutter); }
html:not(.js) .ring { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; padding: 20px var(--gutter); perspective: none; }
html:not(.js) .pcard { position: static; translate: none; width: auto; }
html:not(.js) .wrow-body { grid-template-rows: 1fr; }

/* Lenis smooth scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }


/* Keep fixed controls below the WordPress admin bar when logged in */
.admin-bar .menu-btn { top: 46px; }
.admin-bar .chat { top: 52px; }
@media (max-width: 782px) { .admin-bar .menu-btn { top: 60px; } }
