/* =====================================================================
   DESIGN PLAN
   Layout: left-aligned editorial column (max 1120px) over a full-bleed
   3D scene on the home page; sub-pages open with a short header and go
   straight to content. One orchestrated load sequence per page, motion
   otherwise answers the reader's own actions.
   Color: deep petrol ground, amber signal accent, cyan for data,
   with a cool pale-slate light theme.
   Type: Bricolage Grotesque for display, IBM Plex Sans for reading,
   IBM Plex Mono for data and code.
   ===================================================================== */

:root {
  /* color — dark is the default world */
  --bg: #07141a;
  --bg-2: #0c1d24;
  --bg-3: #122831;
  --fg: #e7f0f2;
  --fg-2: #a7bcc3;
  --fg-3: #6f8891;
  --line: rgba(231, 240, 242, 0.1);
  --line-2: rgba(231, 240, 242, 0.18);
  --accent: #ffb454;
  --accent-ink: #1a1206;
  --accent-2: #5fd3e3;
  --accent-3: #9b8cff;
  --accent-4: #ff7a59;
  --glow: rgba(255, 180, 84, 0.18);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  --scrim: rgba(3, 10, 13, 0.7);
  color-scheme: dark;

  /* type */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-0: 0.8125rem;
  --fs-1: 0.9375rem;
  --fs-2: 1.0625rem;
  --fs-3: 1.25rem;
  --fs-4: 1.5rem;
  --fs-5: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --fs-6: clamp(2.25rem, 1.4rem + 3.5vw, 3.75rem);
  --fs-7: clamp(2.75rem, 1.5rem + 5.5vw, 5.5rem);

  /* layout */
  --wrap: 1120px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 220ms;
  --t-panel: 400ms;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f1f5f6;
    --bg-2: #ffffff;
    --bg-3: #e3eaec;
    --fg: #0e1c22;
    --fg-2: #41585f;
    --fg-3: #6b8188;
    --line: rgba(14, 28, 34, 0.1);
    --line-2: rgba(14, 28, 34, 0.18);
    --accent: #b9731a;
    --accent-ink: #ffffff;
    --accent-2: #157c8b;
    --accent-3: #6a5ae0;
    --accent-4: #d85a3a;
    --glow: rgba(185, 115, 26, 0.14);
    --shadow: 0 24px 60px -28px rgba(14, 28, 34, 0.35);
    --scrim: rgba(14, 28, 34, 0.45);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f1f5f6;
  --bg-2: #ffffff;
  --bg-3: #e3eaec;
  --fg: #0e1c22;
  --fg-2: #41585f;
  --fg-3: #6b8188;
  --line: rgba(14, 28, 34, 0.1);
  --line-2: rgba(14, 28, 34, 0.18);
  --accent: #b9731a;
  --accent-ink: #ffffff;
  --accent-2: #157c8b;
  --accent-3: #6a5ae0;
  --accent-4: #d85a3a;
  --glow: rgba(185, 115, 26, 0.14);
  --shadow: 0 24px 60px -28px rgba(14, 28, 34, 0.35);
  --scrim: rgba(14, 28, 34, 0.45);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100%;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--bg);
}
img, canvas, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 8px 12px; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-sm); font-weight: 600;
  transition: transform var(--t-ui) var(--ease-out);
}
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- cross-page transitions (progressive) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 120ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 200ms var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.nav-inner { view-transition-name: site-nav; }
::view-transition-old(site-nav), ::view-transition-new(site-nav) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root) { animation: 160ms ease both vt-out-rev; }
  @keyframes vt-out-rev { from { opacity: 0; } }
}

/* ---------- navigation ---------- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
  padding-block: 10px;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  max-width: var(--wrap);
  margin-inline: auto;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 2px; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
}
.brand-name { white-space: nowrap; }
/* a small CSS cube that turns, the only always-on motion in the chrome */
.cube-scene { width: 26px; height: 26px; perspective: 160px; flex: none; }
.cube {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: cube-turn 14s linear infinite;
}
.cube-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  font: 600 10px/1 var(--font-mono);
  color: var(--accent);
  backface-visibility: hidden;
}
.cube-face:nth-child(1) { transform: rotateY(0deg) translateZ(13px); }
.cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(13px); }
.cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(13px); }
.cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(13px); }
.cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(13px); }
.cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(13px); }
@keyframes cube-turn { from { transform: rotateX(-14deg) rotateY(0); } to { transform: rotateX(-14deg) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .cube { animation: none; transform: rotateX(-14deg) rotateY(32deg); } }

.nav-links {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  margin-left: auto;
}
.nav-link {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 13px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-1); font-weight: 500; color: var(--fg-2);
  transition: color var(--t-hover) ease;
}
.nav-link[aria-current="page"] { color: var(--fg); }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px;
  border-radius: 2px; background: var(--accent);
}
.nav-hover {
  position: absolute; z-index: 0; top: 0; left: 0;
  height: 36px; width: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  opacity: 0;
  transition: transform var(--t-ui) var(--ease-out), width var(--t-ui) var(--ease-out), opacity var(--t-hover) ease;
}
.nav-links[data-hovering] .nav-hover { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .nav-link:hover { color: var(--fg); } }
.nav-cta { margin-left: 4px; }
.nav-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links + .nav-right { margin-left: 6px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--radius-pill); color: var(--fg-2);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--bg-3); color: var(--fg); } }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun, .theme-toggle .moon { position: absolute; transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease; }
.theme-toggle { position: relative; }
:root[data-theme="light"] .theme-toggle .moon, :root:not([data-theme]) .theme-toggle .moon { opacity: 0; transform: rotate(-40deg) scale(0.7); }
:root[data-theme="dark"] .theme-toggle .sun { opacity: 0; transform: rotate(40deg) scale(0.7); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .sun { opacity: 0; transform: rotate(40deg) scale(0.7); }
  :root:not([data-theme]) .theme-toggle .moon { opacity: 1; transform: none; }
}
.menu-btn { display: none; }

/* mobile menu */
.mobile-menu {
  pointer-events: auto;
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 24px) var(--gutter);
  background: var(--bg);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform var(--t-panel) var(--ease-drawer), visibility 0s linear var(--t-panel);
}
.mobile-menu[data-open] { transform: translateY(0); visibility: visible; transition: transform var(--t-panel) var(--ease-drawer), visibility 0s; }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.mobile-menu-list { margin-top: 32px; display: grid; gap: 4px; }
.mobile-menu-list a {
  display: block; padding: 10px 0;
  font-family: var(--font-display); font-size: var(--fs-5); font-weight: 600; letter-spacing: -0.02em;
  color: var(--fg-2);
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--t-ui) ease, transform var(--t-ui) var(--ease-out), color var(--t-hover) ease;
}
.mobile-menu-list a[aria-current="page"] { color: var(--accent); }
.mobile-menu[data-open] .mobile-menu-list a { opacity: 1; transform: none; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(1) { transition-delay: 60ms; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(2) { transition-delay: 100ms; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(3) { transition-delay: 140ms; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(4) { transition-delay: 180ms; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(5) { transition-delay: 220ms; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(6) { transition-delay: 260ms; }
.mobile-menu[data-open] .mobile-menu-list a:nth-child(7) { transition-delay: 300ms; }
.mobile-menu-foot { margin-top: auto; color: var(--fg-3); font-size: var(--fs-0); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .icon-btn.menu-btn { display: grid; }
  .nav-right .nav-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu { transform: none; opacity: 0; transition: opacity 200ms ease, visibility 0s linear 200ms; }
  .mobile-menu[data-open] { opacity: 1; transition: opacity 200ms ease, visibility 0s; }
  .mobile-menu-list a { transform: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--fs-1); white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease, border-color var(--t-hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-2); color: var(--fg); }
.btn-sm { height: 36px; padding: 0 14px; font-size: var(--fs-0); }
.btn svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
  .btn-ghost:hover { border-color: var(--fg-3); background: var(--bg-2); }
}

.link-under {
  position: relative; color: var(--fg); font-weight: 500;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-size: 100% 1px; background-position: 0 100%;
  transition: background-size var(--t-hover) var(--ease-out), color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .link-under:hover { background-size: 100% 2px; color: var(--accent); }
}

/* ---------- reveal on scroll (fires once; content is visible without JS) ---------- */
.js .reveal { transition: opacity 600ms ease, transform 700ms var(--ease-out); }
.js .reveal:not([data-visible]) { opacity: 0; transform: translateY(14px); }
.js .reveal[data-delay="1"] { transition-delay: 60ms; }
.js .reveal[data-delay="2"] { transition-delay: 120ms; }
.js .reveal[data-delay="3"] { transition-delay: 180ms; }
@media (prefers-reduced-motion: reduce) { .js .reveal:not([data-visible]) { transform: none; } }

/* page-load sequence: blur-in for the opening copy */
.enter { animation: enter 700ms var(--ease-out) both; }
.enter[data-i="1"] { animation-delay: 60ms; }
.enter[data-i="2"] { animation-delay: 140ms; }
.enter[data-i="3"] { animation-delay: 220ms; }
.enter[data-i="4"] { animation-delay: 300ms; }
@keyframes enter {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .enter { animation: enter-fade 300ms ease both; }
  @keyframes enter-fade { from { opacity: 0; } }
}

/* ---------- page header (sub-pages) ---------- */
.page-head { padding-block: clamp(40px, 8vw, 88px) clamp(24px, 4vw, 40px); }
.page-kicker { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--accent); }
.page-title { font-size: var(--fs-6); font-weight: 700; letter-spacing: -0.025em; margin-top: 10px; max-width: 18ch; }
.page-lede { margin-top: 16px; max-width: 58ch; color: var(--fg-2); font-size: var(--fs-3); line-height: 1.5; }

/* ---------- sections ---------- */
.section { padding-block: clamp(48px, 8vw, 96px); border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-title { font-size: var(--fs-5); font-weight: 700; letter-spacing: -0.02em; }
.section-sub { margin-top: 8px; color: var(--fg-2); max-width: 52ch; }
.section-link { flex: none; color: var(--fg-2); font-weight: 500; font-size: var(--fs-1); transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .section-link:hover { color: var(--accent); } }
@media (max-width: 640px) { .section-head { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* ---------- home: hero ---------- */
.hero { position: relative; min-height: min(88vh, 860px); display: flex; align-items: center; padding-block: 72px 56px; overflow: clip; }
.hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  display: block; width: 100%; height: 100%;
}
.hero-canvas canvas { width: 100%; height: 100%; }
.hero-copy { position: relative; z-index: 1; max-width: 760px; }
.hero-role { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--accent); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hero-title {
  margin-top: 18px;
  font-size: var(--fs-7); font-weight: 700;
  letter-spacing: -0.035em; line-height: 0.98;
  font-variation-settings: "opsz" 96, "wdth" 92;
  max-width: 14ch;
}
.hero-lede { margin-top: 24px; font-size: var(--fs-3); line-height: 1.5; color: var(--fg-2); max-width: 54ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-foot { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 1; }
.hero-foot .wrap { display: flex; justify-content: space-between; gap: 16px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.hero-hint { display: inline-flex; align-items: center; gap: 8px; }
.hero-hint i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .hero-hint i { animation: none; } }
@media (max-width: 760px) {
  .hero { display: block; min-height: 0; padding-block: 0 64px; }
  .hero-canvas { position: relative; height: 300px; margin-bottom: 4px; }
  .hero-foot { bottom: 16px; }
  .hero-scroll { display: none; }
}

/* ---------- home: now ---------- */
.now-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; }
.now-item { border-top: 1px solid var(--line-2); padding-top: 14px; }
.now-label { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--accent-2); }
.now-text { margin-top: 8px; font-size: var(--fs-2); line-height: 1.5; }
@media (max-width: 760px) { .now-grid { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- work cards (home + portfolio) ---------- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.work-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
  transform-style: preserve-3d;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
  text-align: left; width: 100%;
}
.work-cover { aspect-ratio: 16 / 10; background: var(--bg-3); position: relative; overflow: hidden; }
.work-cover canvas { width: 100%; height: 100%; }
.work-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--bg-2) 70%, transparent), transparent 55%); pointer-events: none; }
.work-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work-kind { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); display: flex; justify-content: space-between; gap: 12px; }
.work-name { font-size: var(--fs-4); font-weight: 700; letter-spacing: -0.02em; }
.work-summary { color: var(--fg-2); font-size: var(--fs-1); line-height: 1.5; }
.work-stack { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
@media (hover: hover) and (pointer: fine) {
  .work-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
}
.tilt { will-change: transform; transition: transform 0s; }
.tilt-sheen { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.12), transparent 60%); transition: opacity var(--t-hover) ease; }
.tilt[data-tilting] .tilt-sheen { opacity: 1; }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--fg-2); background: var(--bg-3);
}

/* ---------- post rows (home + blog) ---------- */
.post-list { display: grid; }
.post-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 16px 28px; align-items: baseline;
  padding-block: 22px; border-top: 1px solid var(--line);
  transition: opacity 300ms ease, transform 300ms var(--ease-out);
}
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-date { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.post-cat { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--accent-2); margin-top: 6px; display: block; }
.post-title { font-size: var(--fs-4); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.post-title a { background-image: linear-gradient(var(--fg), var(--fg)); background-repeat: no-repeat; background-size: 0 1px; background-position: 0 100%; transition: background-size 260ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .post-row:hover .post-title a { background-size: 100% 1px; } }
.post-excerpt { margin-top: 8px; color: var(--fg-2); font-size: var(--fs-1); max-width: 62ch; }
.post-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.post-read { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); white-space: nowrap; }
@media (max-width: 760px) {
  .post-row { grid-template-columns: 1fr; gap: 8px; }
  .post-cat { display: inline; margin: 0 0 0 10px; }
  .post-read { display: none; }
}

/* ---------- open source rows ---------- */
.oss-list { display: grid; gap: 14px; }
.oss-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px;
  padding: 22px 24px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) { .oss-item:hover { border-color: var(--line-2); } }
.oss-name { font-family: var(--font-mono); font-size: var(--fs-3); font-weight: 500; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oss-status { font-size: 0.7rem; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); color: var(--fg-2); font-family: var(--font-mono); }
.oss-status[data-s="Active"] { border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); color: var(--accent-2); }
.oss-status[data-s="Experimental"] { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }
.oss-tagline { margin-top: 6px; font-size: var(--fs-2); }
.oss-desc { margin-top: 8px; color: var(--fg-2); font-size: var(--fs-1); max-width: 64ch; }
.oss-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.oss-meta .lang::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lang-color, var(--accent-3)); margin-right: 7px; vertical-align: 0; }
.oss-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
.oss-stars { font-family: var(--font-display); font-size: var(--fs-5); font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.oss-stars small { display: block; font-family: var(--font-mono); font-size: var(--fs-0); font-weight: 400; color: var(--fg-3); margin-top: 4px; letter-spacing: 0; }
.oss-install { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 8px 8px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-2); overflow: hidden; }
.oss-install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.oss-links { display: flex; gap: 14px; font-size: var(--fs-0); font-weight: 500; }
@media (max-width: 640px) { .oss-item { grid-template-columns: 1fr; } .oss-side { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; } }

.copy-btn { position: relative; height: 30px; padding: 0 10px; border-radius: 6px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-2); background: var(--bg-3); border: 1px solid var(--line); transition: transform var(--t-press) var(--ease-out), color var(--t-hover) ease, border-color var(--t-hover) ease; white-space: nowrap; }
.copy-btn:active { transform: scale(0.95); }
.copy-btn[data-done] { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 40px 48px; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
.footer-big { font-family: var(--font-display); font-size: var(--fs-5); font-weight: 700; letter-spacing: -0.025em; max-width: 18ch; }
.footer-email svg { width: 18px; height: 18px; flex: none; }
.footer-email { margin-top: 14px; display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); color: var(--fg-2); }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; align-content: start; font-size: var(--fs-1); }
.footer-links a { color: var(--fg-2); transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover { color: var(--fg); } }
.footer-note { grid-column: 1 / -1; margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

.page-end { padding-bottom: clamp(48px, 8vw, 96px); }
.stats-band { padding-bottom: clamp(40px, 6vw, 64px); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--fg); color: var(--bg); font-size: var(--fs-1); font-weight: 500;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform 320ms var(--ease-drawer), opacity 200ms ease;
  pointer-events: none;
}
.toast[data-show] { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .toast { transform: translate(-50%, 0); } }

/* =====================================================================
   BLOG
   ===================================================================== */
.progress { position: fixed; left: 0; top: env(safe-area-inset-top, 0px); z-index: 55; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; transition: opacity 200ms ease; }
.progress[data-on] { opacity: 1; }

.filters { display: grid; gap: 16px; margin-bottom: 8px; }
.filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--bg-2); border: 1px solid var(--line); isolation: isolate; }
.seg-btn { position: relative; z-index: 1; height: 34px; padding: 0 14px; border-radius: var(--radius-pill); font-size: var(--fs-1); font-weight: 500; color: var(--fg-2); white-space: nowrap; transition: color var(--t-hover) ease; }
.seg-btn[aria-pressed="true"] { color: transparent; }
.seg-btn .seg-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg-3); margin-left: 6px; }
/* the clip-path copy: identical buttons styled active, clipped to the active one */
.seg-copy { position: absolute; inset: 3px; z-index: 2; display: flex; pointer-events: none; border-radius: var(--radius-pill); background: var(--fg); color: var(--bg); clip-path: inset(0 100% 0 0 round 999px); transition: clip-path var(--t-ui) var(--ease-out); }
.seg-copy .seg-btn { color: inherit; }
.seg-copy .seg-btn .seg-count { color: inherit; opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .seg-copy { transition: none; } }
.seg-wrap { max-width: 100%; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
.filters > * { min-width: 0; }
.seg-wrap::-webkit-scrollbar { display: none; }

.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--bg-2); min-width: 240px; flex: 1; max-width: 360px; transition: border-color var(--t-hover) ease; }
.search:focus-within { border-color: var(--accent-2); }
.search svg { width: 16px; height: 16px; color: var(--fg-3); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: var(--fs-1); }
.search input::placeholder { color: var(--fg-3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 11px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-2); background: transparent; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease, border-color var(--t-hover) ease; }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]) { border-color: var(--fg-3); color: var(--fg); } }
.chips-label { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); margin-right: 4px; align-self: center; }
.chip-clear { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-3); align-self: center; margin-left: 4px; transition: color var(--t-hover) ease; }
.chip-clear:hover { color: var(--fg); }

.result-line { margin: 20px 0 6px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.post-row[data-leaving] { opacity: 0; transform: translateY(-6px); }
.post-row[data-entering] { opacity: 0; transform: translateY(10px); }
.empty { padding: 48px 0; color: var(--fg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* article */
.article { max-width: 720px; padding-block: clamp(40px, 8vw, 88px) 64px; }
.article-back { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: var(--fs-1); font-weight: 500; transition: color var(--t-hover) ease; }
.article-back svg { width: 16px; height: 16px; transition: transform var(--t-hover) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .article-back:hover { color: var(--fg); } .article-back:hover svg { transform: translateX(-3px); } }
.article-meta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.article-meta b { color: var(--accent-2); font-weight: 400; }
.article-title { margin-top: 14px; font-size: var(--fs-6); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; }
.article-excerpt { margin-top: 20px; font-size: var(--fs-3); color: var(--fg-2); line-height: 1.5; }
.article-tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.article-body { margin-top: 40px; font-size: var(--fs-2); line-height: 1.7; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { font-size: var(--fs-4); margin-top: 2em; letter-spacing: -0.02em; }
.article-body h3 { font-size: var(--fs-3); margin-top: 1.6em; }
.article-body ul, .article-body ol { padding-left: 1.3em; display: grid; gap: 0.4em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li::marker { color: var(--accent); }
.article-body strong { font-weight: 600; color: var(--fg); }
.article-body a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote { margin: 0; padding-left: 18px; border-left: 2px solid var(--accent); color: var(--fg-2); }
.article-body code { background: var(--bg-3); padding: 0.15em 0.4em; border-radius: 5px; font-size: 0.88em; }
.article-body pre { margin: 0; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); overflow-x: auto; font-size: 0.86rem; line-height: 1.6; }
.article-body pre code { background: none; padding: 0; font-size: inherit; }
.article-nav { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.article-nav a { display: grid; gap: 6px; color: var(--fg-2); font-size: var(--fs-1); transition: color var(--t-hover) ease; }
.article-nav a:last-child { text-align: right; }
.article-nav a span { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.article-nav a b { font-weight: 600; color: var(--fg); font-family: var(--font-display); font-size: var(--fs-3); letter-spacing: -0.01em; }
@media (hover: hover) and (pointer: fine) { .article-nav a:hover b { color: var(--accent); } }
.view { transition: opacity 240ms ease, transform 300ms var(--ease-out), filter 240ms ease; }
.view[data-out] { opacity: 0; transform: translateY(8px); filter: blur(4px); }
@media (prefers-reduced-motion: reduce) { .view[data-out] { transform: none; filter: none; } }

/* =====================================================================
   CHAT
   ===================================================================== */
.chat-page { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; padding-block: clamp(32px, 5vw, 56px) 48px; }
.chat-side { position: sticky; top: calc(var(--nav-h) + 24px); }
.chat-orb { width: 100%; aspect-ratio: 1; max-width: 300px; border-radius: 50%; position: relative; }
.chat-orb canvas { width: 100%; height: 100%; }
.chat-state { margin-top: 10px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); display: flex; align-items: center; gap: 8px; }
.chat-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); transition: background-color 300ms ease; }
.chat-state[data-s="thinking"] i { background: var(--accent); }
.chat-state[data-s="speaking"] i { background: var(--accent-2); }
.chat-intro { margin-top: 18px; color: var(--fg-2); font-size: var(--fs-1); max-width: 34ch; }
.chat-disclaimer { margin-top: 14px; font-size: var(--fs-0); color: var(--fg-3); max-width: 34ch; }

.chat-main { display: flex; flex-direction: column; min-height: 62vh; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.msg { max-width: 72ch; padding: 12px 16px; border-radius: 18px; font-size: var(--fs-2); line-height: 1.55; }
.msg-bot { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.msg-bot a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.msg-enter { opacity: 1; transform: none; transition: opacity 200ms ease, transform 220ms var(--ease-out); }
@starting-style { .msg-enter { opacity: 0; transform: translateY(8px) scale(0.98); } }
.msg-time { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.6; }
.typing { display: inline-flex; gap: 5px; align-items: center; height: 20px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); animation: typing 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 150ms; }
.typing i:nth-child(3) { animation-delay: 300ms; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: typing-fade 1.1s ease-in-out infinite; } @keyframes typing-fade { 0%, 60%, 100% { opacity: 0.4; } 30% { opacity: 1; } } }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--accent-2); vertical-align: -0.15em; margin-left: 1px; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 12px; }
.suggestion { height: 34px; padding: 0 13px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); font-size: var(--fs-0); color: var(--fg-2); white-space: nowrap; transition: transform var(--t-press) var(--ease-out), border-color var(--t-hover) ease, color var(--t-hover) ease, opacity 200ms ease; }
.suggestion:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .suggestion:hover { border-color: var(--fg-3); color: var(--fg); } }
.chat-form { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 28px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); transition: border-color var(--t-hover) ease; }
.chat-form:focus-within { border-color: var(--accent-2); }
.chat-form textarea { flex: 1; min-width: 0; resize: none; background: none; border: 0; outline: 0; padding: 10px 0; max-height: 160px; font-size: var(--fs-2); line-height: 1.4; }
.chat-form textarea::placeholder { color: var(--fg-3); }
.chat-send { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; align-self: flex-end; transition: transform var(--t-press) var(--ease-out), opacity 200ms ease; }
.chat-send:active { transform: scale(0.94); }
.chat-send:disabled { opacity: 0.4; cursor: default; }
.chat-send svg { width: 18px; height: 18px; }
.chat-tools { display: flex; justify-content: flex-end; gap: 12px; padding-top: 10px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.chat-tools button { color: inherit; transition: color var(--t-hover) ease; }
.chat-tools button:hover { color: var(--fg); }
@media (max-width: 860px) {
  .chat-page { grid-template-columns: 1fr; gap: 20px; }
  .chat-side { position: static; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px 16px; align-items: center; }
  .chat-orb { max-width: 96px; grid-column: 1; grid-row: 1; }
  .chat-intro { margin-top: 0; max-width: none; grid-column: 2; grid-row: 1; }
  .chat-state { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .chat-disclaimer { grid-column: 1 / -1; grid-row: 3; margin-top: 0; max-width: none; }
}

/* =====================================================================
   PORTFOLIO
   ===================================================================== */
.project-dialog { padding: 0; border: 0; background: transparent; max-width: min(760px, calc(100vw - 32px)); width: 100%; color: var(--fg); }
.project-dialog::backdrop { background: var(--scrim); opacity: 0; transition: opacity 240ms ease; }
.project-dialog[open]::backdrop { opacity: 1; }
@starting-style { .project-dialog[open]::backdrop { opacity: 0; } }
.project-dialog[open] .dialog-card { opacity: 1; transform: none; }
.dialog-card { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); opacity: 0; transform: scale(0.96) translateY(8px); transition: opacity 220ms ease, transform 260ms var(--ease-out); }
@starting-style { .project-dialog[open] .dialog-card { opacity: 0; transform: scale(0.96) translateY(8px); } }
.dialog-cover { aspect-ratio: 21 / 9; position: relative; }
.dialog-cover canvas { width: 100%; height: 100%; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); display: grid; place-items: center; transition: transform var(--t-press) var(--ease-out); }
.dialog-close:active { transform: scale(0.94); }
.dialog-close svg { width: 16px; height: 16px; }
.dialog-body { padding: 24px 28px 28px; display: grid; gap: 18px; }
.dialog-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.dialog-title { font-size: var(--fs-5); font-weight: 700; letter-spacing: -0.025em; }
.dialog-kind { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.dialog-desc { color: var(--fg-2); line-height: 1.6; }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dialog-grid h4 { font-family: var(--font-mono); font-size: var(--fs-0); font-weight: 400; color: var(--fg-3); margin-bottom: 8px; }
.dialog-grid ul { display: grid; gap: 6px; font-size: var(--fs-1); }
.dialog-grid li { padding-left: 14px; position: relative; }
.dialog-grid li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dialog-links { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .dialog-grid { grid-template-columns: 1fr; } .dialog-body { padding: 20px; } }
@media (prefers-reduced-motion: reduce) { .dialog-card { transform: none; } @starting-style { .project-dialog[open] .dialog-card { transform: none; } } }

/* =====================================================================
   COMMUNITY
   ===================================================================== */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat { border-top: 1px solid var(--line-2); padding-top: 14px; }
.stat-value { font-family: var(--font-display); font-size: var(--fs-6); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 8px; color: var(--fg-2); font-size: var(--fs-1); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.globe-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.globe-wrap { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin-inline: auto; touch-action: pan-y; }
.globe-wrap canvas { width: 100%; height: 100%; cursor: grab; }
.globe-wrap[data-dragging] canvas { cursor: grabbing; }
.globe-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -140%); pointer-events: none; font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg); background: color-mix(in srgb, var(--bg) 80%, transparent); padding: 3px 8px; border-radius: var(--radius-pill); border: 1px solid var(--line); white-space: nowrap; opacity: 0; transition: opacity 200ms ease; }
.globe-label[data-on] { opacity: 1; }
.globe-hint { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); white-space: nowrap; }
.places { display: grid; gap: 2px; }
.place { text-align: left; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-1); }
.place:last-child { border-bottom: 1px solid var(--line); }
.place b { font-weight: 600; }
.place span { color: var(--fg-2); }
@media (max-width: 860px) { .globe-section { grid-template-columns: 1fr; } }

.timeline { display: grid; gap: 0; position: relative; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.tl-year { font-family: var(--font-display); font-size: var(--fs-5); font-weight: 700; letter-spacing: -0.025em; color: var(--fg-3); padding: 24px 0 8px; }
.tl-item { display: grid; grid-template-columns: 110px 24px minmax(0, 1fr); gap: 0 16px; padding: 14px 0; position: relative; transition: opacity 240ms ease, transform 240ms var(--ease-out); }
.tl-item[data-hidden] { display: none; }
.tl-date { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); padding-top: 4px; }
.tl-dot { position: relative; display: grid; place-items: center; padding-top: 9px; }
.tl-dot::before { content: ""; position: absolute; top: 0; bottom: -14px; left: 50%; width: 1px; background: var(--line-2); }
.tl-dot i { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent-2); }
.tl-item[data-type="talk"] .tl-dot i { border-color: var(--accent); }
.tl-item[data-type="mentoring"] .tl-dot i { border-color: var(--accent-3); }
.tl-item[data-type="meetup"] .tl-dot i { border-color: var(--accent-2); }
.tl-item[data-type="workshop"] .tl-dot i { border-color: var(--accent-4); }
.tl-item:last-child .tl-dot::before { bottom: auto; height: 9px; }
.tl-type { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.tl-title { font-size: var(--fs-3); font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.tl-venue { color: var(--fg-2); font-size: var(--fs-1); margin-top: 2px; }
.tl-desc { color: var(--fg-2); font-size: var(--fs-1); margin-top: 6px; max-width: 62ch; }
@media (max-width: 640px) { .tl-item { grid-template-columns: 24px minmax(0, 1fr); } .tl-date { grid-column: 2; order: -1; } .tl-dot { grid-row: 1 / span 2; } .tl-body { grid-column: 2; } }

.heatmap { overflow-x: auto; padding-bottom: 6px; }
.heatmap-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; width: max-content; }
.heatmap-cell { width: 11px; height: 11px; border-radius: 2px; background: var(--bg-3); transition: opacity 300ms ease, transform 300ms var(--ease-out); }
.heatmap[data-animate]:not([data-visible]) .heatmap-cell { opacity: 0; transform: scale(0.6); }
.heatmap-cell[data-l="1"] { background: color-mix(in srgb, var(--accent-2) 30%, var(--bg-3)); }
.heatmap-cell[data-l="2"] { background: color-mix(in srgb, var(--accent-2) 55%, var(--bg-3)); }
.heatmap-cell[data-l="3"] { background: color-mix(in srgb, var(--accent-2) 80%, var(--bg-3)); }
.heatmap-cell[data-l="4"] { background: var(--accent-2); }
.heatmap-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.heatmap-legend { display: inline-flex; align-items: center; gap: 4px; }
.heatmap-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.affil { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.affil-item { border-top: 1px solid var(--line-2); padding-top: 14px; }
.affil-name { font-size: var(--fs-3); font-weight: 600; letter-spacing: -0.01em; }
.affil-role { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--accent-2); margin-top: 4px; }
.affil-note { margin-top: 8px; color: var(--fg-2); font-size: var(--fs-1); }
@media (max-width: 760px) { .affil { grid-template-columns: 1fr; } }

/* =====================================================================
   CONNECT
   ===================================================================== */
.connect-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; align-items: start; }
.links-list { display: grid; gap: 2px; }
.link-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 16px 16px 12px; border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.link-row:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .link-row:hover { background: var(--bg-2); border-color: var(--line); } .link-row:hover .link-arrow { transform: translate(2px, -2px); opacity: 1; } }
.link-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-3); display: grid; place-items: center; color: var(--fg); }
.link-icon svg { width: 20px; height: 20px; }
.link-label { font-weight: 600; font-size: var(--fs-2); }
.link-handle { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.link-note { color: var(--fg-2); font-size: var(--fs-1); margin-top: 2px; }
.link-arrow { color: var(--fg-3); opacity: 0.6; transition: transform var(--t-hover) var(--ease-out), opacity var(--t-hover) ease; }
.link-arrow svg { width: 18px; height: 18px; }
.email-card { padding: 24px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.email-card h3 { font-size: var(--fs-4); letter-spacing: -0.02em; }
.email-addr { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: var(--fs-2); }
.email-addr span { user-select: all; }
.availability { margin-top: 24px; display: flex; gap: 10px; align-items: flex-start; color: var(--fg-2); font-size: var(--fs-1); }
.availability i { flex: none; margin-top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.connect-aside-note { margin-top: 24px; color: var(--fg-2); font-size: var(--fs-1); line-height: 1.6; }
.connect-aside-note p + p { margin-top: 10px; }
@media (max-width: 860px) { .connect-grid { grid-template-columns: 1fr; gap: 28px; } }

/* =====================================================================
   HOME: skills + about
   ===================================================================== */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 48px; }
.about-text { font-size: var(--fs-2); line-height: 1.65; color: var(--fg-2); display: grid; gap: 1em; max-width: 62ch; }
.about-text p:first-child { color: var(--fg); font-size: var(--fs-3); line-height: 1.5; }
.skills { display: grid; gap: 20px; }
.skill-group h4 { font-family: var(--font-mono); font-size: var(--fs-0); font-weight: 400; color: var(--accent-2); margin-bottom: 10px; }
.skill-group ul { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

.ask-band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 28px 32px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.ask-band::before { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); pointer-events: none; }
.ask-band h3 { font-size: var(--fs-4); letter-spacing: -0.02em; }
.ask-band p { margin-top: 6px; color: var(--fg-2); font-size: var(--fs-1); max-width: 52ch; }
@media (max-width: 640px) { .ask-band { grid-template-columns: 1fr; padding: 22px; } }

/* =====================================================================
   VIRTUAL ME (office)
   ===================================================================== */
.floor { position: relative; margin-top: 20px; border-radius: 14px; overflow: hidden; background: #1a2129; border: 1px solid var(--line-2); aspect-ratio: 5 / 3; }
.floor canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: pan-y; }
.floor-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; font-family: var(--font-mono); }
.fl-room { position: absolute; left: 0; top: 0; pointer-events: auto; display: grid; gap: 1px; padding: 4px 8px; border-radius: 6px; background: rgba(8, 14, 18, 0.72); color: #e7f0f2; border: 1px solid rgba(231, 240, 242, 0.14); text-align: left; backdrop-filter: blur(4px); transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); will-change: transform; }
.fl-room b { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.fl-room span { font-size: 10px; color: #a7bcc3; }
.fl-room.is-small span { display: none; }
.fl-room.is-small b { font-size: 9px; }
.fl-room:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .fl-room:hover { background: rgba(8, 14, 18, 0.9); border-color: rgba(255, 180, 84, 0.6); } }
.floor-overlay[data-room]:not([data-room="all"]) .fl-room:not(:hover) { background: rgba(8, 14, 18, 0.55); }
.fl-tag { position: absolute; left: 0; top: 0; translate: -50% 0; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(8, 14, 18, 0.7); color: #5fd3e3; white-space: nowrap; }
.fl-tip { position: absolute; left: 0; top: 0; z-index: 2; display: grid; gap: 2px; padding: 6px 10px; border-radius: 8px; background: #e7f0f2; color: #07141a; font-size: 11px; max-width: 220px; opacity: 0; transition: opacity 160ms ease; white-space: normal; }
.fl-tip b { font-family: var(--font-display); font-size: 12px; }
.fl-tip span { color: #41585f; }
.fl-tip[data-on] { opacity: 1; }
.fl-status { position: absolute; right: 10px; bottom: 8px; font-size: 10px; color: #a7bcc3; background: rgba(8, 14, 18, 0.6); padding: 3px 8px; border-radius: 999px; }
.floor-live { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(8, 14, 18, 0.72); border: 1px solid rgba(95, 211, 227, 0.4); color: #5fd3e3; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; }
.floor-live i { width: 6px; height: 6px; border-radius: 50%; background: #5fd3e3; animation: ping 2s var(--ease-out) infinite; }
@media (max-width: 640px) { .floor { aspect-ratio: 4 / 3; border-radius: 10px; } }

.ticker { display: flex; align-items: stretch; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); font-family: var(--font-mono); font-size: var(--fs-0); }
.ticker-label { flex: none; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; display: flex; align-items: center; }
.ticker-vp { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-run { display: inline-flex; gap: 36px; white-space: nowrap; padding-left: 16px; animation: ticker 60s linear infinite; will-change: transform; }
.ticker-run span { color: var(--fg-2); }
.ticker-run em { font-style: normal; color: var(--fg-3); margin-right: 8px; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-run { animation: none; } }

.office-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: clamp(32px, 5vw, 56px); }
.panel-head { margin-bottom: 20px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 20px; }
.roster-compact { margin-top: 12px; }
.bot-card { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); transition: border-color var(--t-hover) ease, box-shadow 400ms ease; }
.bot-card[data-flash] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.bot-ava { width: 54px; height: 81px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-3); }
.px-avatar { width: 54px; height: 81px; image-rendering: pixelated; }
.bot-body h3 { font-size: var(--fs-2); font-weight: 600; letter-spacing: -0.01em; }
.bot-doing { margin-top: 4px; color: var(--fg-2); font-size: var(--fs-0); font-family: var(--font-mono); }
.bot-body .link-under { display: inline-block; margin-top: 8px; font-size: var(--fs-0); }
.bot-room { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.activity h2 { font-size: var(--fs-3); letter-spacing: -0.01em; margin-bottom: 12px; }
.activity ol { display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-0); line-height: 1.45; opacity: 1; transform: none; transition: opacity 220ms ease, transform 240ms var(--ease-out); }
@starting-style { .ev-enter { opacity: 0; transform: translateY(-6px); } }
.ev time { font-family: var(--font-mono); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.ev[data-kind="issue"] time { color: var(--accent); }
.ev[data-kind="pr"] time { color: var(--accent-3); }
.ev[data-kind="meeting"] time { color: var(--accent-2); }
.channels { display: grid; gap: 8px; }
.channel { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.channel p { color: var(--fg-2); font-size: var(--fs-0); }
.ch-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-3); position: relative; }
.ch-icon::after { content: ""; position: absolute; inset: 10px; border-radius: 3px; background: var(--fg-3); }
.ch-icon[data-icon="wa"]::after { background: #38d996; border-radius: 50%; }
.ch-icon[data-icon="chat"]::after { background: var(--accent-2); border-radius: 50% 50% 50% 2px; }
.ch-nums { display: grid; gap: 2px; text-align: right; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.ch-unread { color: var(--accent); }
.ch-unread[data-n="0"] { color: var(--fg-3); }
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pipe-col h4, .sub-h, .answered h4 { font-family: var(--font-mono); font-size: var(--fs-0); font-weight: 400; color: var(--accent-2); margin-bottom: 10px; }
.sub-h { margin-top: 24px; }
.pipe-col ul, .plain-list, .answered ul { display: grid; gap: 8px; font-size: var(--fs-1); }
.pipe-col li, .plain-list li, .answered li { padding: 8px 0; border-top: 1px solid var(--line); }
.muted { color: var(--fg-3); font-size: var(--fs-0); font-family: var(--font-mono); }
.answered .btn { margin-top: 16px; }
.meeting-now { padding: 16px 18px; border-radius: 12px; background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--accent-2) 50%, transparent); }
.meeting-now.is-empty { border-color: var(--line); color: var(--fg-2); }
.meeting-now b { display: block; font-family: var(--font-display); font-size: var(--fs-3); }
.meeting-now > span { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--fg-3); }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.prod { padding: 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.prod-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prod h4 { font-family: var(--font-mono); font-size: var(--fs-2); font-weight: 500; }
.prod p { color: var(--fg-2); font-size: var(--fs-1); }
.prod-links { display: flex; gap: 8px; margin-top: 4px; }
.prs { display: grid; gap: 2px; }
.prs li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: var(--fs-1); }
.pr-ref { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--accent-3); }
.pr-state { font-family: var(--font-mono); font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-2); }
.pr-state[data-s="Approved"] { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); }
.pr-state[data-s="Changes requested"] { color: var(--accent-4); border-color: color-mix(in srgb, var(--accent-4) 50%, transparent); }
.pr-state[data-s="In review"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
@media (max-width: 960px) { .office-grid { grid-template-columns: 1fr; gap: 32px; } .pipeline { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .prs li { grid-template-columns: 1fr auto; } .prs li .pr-title { grid-column: 1 / -1; } }

/* home: the office band */
.office-band { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 32px; align-items: center; }
.office-preview { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #1a2129; aspect-ratio: 5 / 3; }
.office-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.office-preview .floor-live { top: 8px; right: 8px; }
.office-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.office-band .btn { margin-top: 24px; }
@media (max-width: 860px) { .office-band { grid-template-columns: 1fr; gap: 20px; } }
