/*
 * iamkhayyam.xyz — shared styles
 * Loaded by index.html and every subpage.
 * Design language borrowed from chanhdai.com (dashed hairline rulers,
 * mono-forward meta, serif for names). Rate Card removed 2026-07-09.
 */

  /* ─── Tokens ─── */
  :root {
    --background: #ffffff;
    --foreground: #09090b;
    --muted:      #f4f4f5;
    --muted-fg:   #71717a;
    --border:     #e4e4e7;
    --line:       color-mix(in oklab, var(--border) 55%, var(--background));
    --card:       #ffffff;
    --accent:     #f4f4f5;
    --success:    #22c55e;
    --info:       #3b82f6;

    --font-sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Geist", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono:  ui-monospace, "SF Mono", "Geist Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --font-serif: "IBM Plex Serif", ui-serif, Georgia, "Times New Roman", serif;

    --header-h: 52px;
    --col: 640px;       /* content column width */
    --pad: 20px;
    --r: 8px;
  }
  html[data-theme="dark"] {
    --background: #09090b;
    --foreground: #fafafa;
    --muted:      #27272a;
    --muted-fg:   #9f9fa9;
    --border:     #27272a;
    --line:       color-mix(in oklab, var(--border) 80%, var(--background));
    --card:       #18181b;
    --accent:     #27272a;
  }

  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  html { scroll-padding-top: calc(var(--header-h) + 12px); }
  body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--foreground);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .15s ease, color .15s ease;
  }
  a { color: inherit; text-decoration: none; }
  a:hover { color: var(--foreground); }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
  img, svg { display: block; max-width: 100%; }
  ::selection { background: var(--foreground); color: var(--background); }

  /* ─── Layout: content column with dashed vertical rules on both sides ─── */
  .frame {
    position: relative;
    max-width: var(--col);
    margin: 0 auto;
    border-left: 1px dashed var(--line);
    border-right: 1px dashed var(--line);
    min-height: 100vh;
  }

  /* Nav sticky */
  .nav {
    position: sticky; top: 0; z-index: 30;
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px;
    background: color-mix(in oklab, var(--background) 85%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px dashed var(--line);
  }
  .nav-brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 500;
    letter-spacing: -0.01em;
  }
  .nav-brand .mark {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--foreground); color: var(--background);
    border-radius: 5px;
    font-family: var(--font-serif); font-size: 13px; font-weight: 600;
  }
  .nav-right { display: inline-flex; align-items: center; gap: 6px; }
  .icon-btn {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; color: var(--muted-fg);
  }
  .icon-btn:hover { background: var(--accent); color: var(--foreground); }
  .gh-stars {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: 11px;
    padding: 4px 8px; border: 1px dashed var(--line);
    color: var(--muted-fg);
  }

  /* GOTO jump menu — the 1998 select-nav, shown in place of links on small screens */
  .nav-goto { display: none; position: relative; }
  .nav-goto select {
    appearance: none; -webkit-appearance: none;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--foreground);
    background: transparent;
    border: 1px dashed var(--line);
    border-radius: 6px;
    padding: 4px 24px 4px 8px;
    min-width: 128px;
    cursor: pointer;
  }
  .nav-goto::before {
    content: "GOTO:";
    position: absolute; left: -44px; top: 50%; transform: translateY(-50%);
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.08em; color: var(--muted-fg);
    pointer-events: none;
  }
  .nav-goto::after {
    content: "▾";
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: var(--muted-fg);
    pointer-events: none;
  }
  /* The select IS the nav, at every size */
  .nav-goto { display: inline-flex; align-items: center; margin-left: 44px; }
  @media (max-width: 620px) {
    .gh-stars { display: none; }
  }

  /* Screen line — hairline that extends past the column to the browser edges */
  .screen-line { position: relative; }
  .screen-line::before {
    content: ""; position: absolute; top: 0; left: -100vw;
    width: 200vw; height: 1px; background: var(--line);
    z-index: -1;
  }

  /* Section — dashed rule between sections; horizontal padding matches column.
   * Vertical padding is generous so the ground-plane grid has room to
   * reveal itself as content scrolls past. */
  section, header.hero {
    position: relative;
    padding: 44px var(--pad);
    border-top: 1px dashed var(--line);
  }
  section:first-of-type, header.hero { border-top: 0; }

  /* Section headers */
  .sh {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 0 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-fg);
  }
  .sh .n {
    color: var(--muted-fg);
    padding: 1px 6px;
    border: 1px dashed var(--line);
    border-radius: 4px;
    font-size: 10px;
  }
  .sh .more {
    color: var(--muted-fg);
    font-family: var(--font-mono);
  }
  .sh .more:hover { color: var(--foreground); }

  /* ─── HERO ─── */
  .hero { padding: 28px var(--pad) 24px; text-align: center; }
  .fig {
    display: inline-block;
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--muted-fg); margin-bottom: 12px;
  }
  .avatar {
    width: 88px; height: 88px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #d4d4d8 60%, #a1a1aa);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    margin: 0 auto 16px;
    font-family: var(--font-serif); font-size: 34px; font-weight: 500;
    color: #18181b;
  }
  html[data-theme="dark"] .avatar {
    background: radial-gradient(circle at 35% 30%, #52525b, #27272a 60%, #18181b);
    color: #fafafa;
  }
  .name {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 34px; line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    flex-wrap: wrap;
  }
  .verified {
    width: 20px; height: 20px; color: var(--info); flex-shrink: 0;
  }
  .handle {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--muted-fg); margin: 0 0 12px;
  }
  .tagline { color: var(--muted-fg); font-size: 14px; margin: 0 0 12px; max-width: 44ch; margin-inline: auto; }
  .locs {
    display: inline-flex; gap: 4px;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg);
  }
  .locs span { padding: 3px 7px; border: 1px dashed var(--line); border-radius: 4px; }

  /* ─── Utility ─── */
  .mono { font-family: var(--font-mono); }
  .muted { color: var(--muted-fg); }
  .kbd {
    font-family: var(--font-mono); font-size: 10px;
    padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px;
    background: var(--background); color: var(--muted-fg);
  }

  /* ─── Overview key-value (2-column data sheet) ─── */
  .kv {
    display: grid;
    grid-template-columns: 88px 1fr 88px 1fr;
    column-gap: 24px;
    font-family: var(--font-mono);
    font-size: 12px;
  }
  .kv > div {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    color: var(--foreground);
    min-width: 0;
  }
  .kv > .k {
    color: var(--muted-fg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    white-space: nowrap;
  }
  /* clear border on the last row (4 cells) */
  .kv > div:nth-last-child(-n+4) { border-bottom: 0; }
  .kv a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
  .kv a:hover { text-decoration-color: currentColor; }

  /* Overview → Calendar dropdown tray */
  .cal-toggle { cursor: pointer; }
  .cal-chev { display: inline-block; transition: transform .25s ease; }
  .cal-toggle[aria-expanded="true"] .cal-chev { transform: rotate(180deg); }
  .cal-tray {
    display: grid; grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows .3s ease, margin-top .3s ease, visibility 0s linear .3s;
  }
  .cal-tray.open {
    grid-template-rows: 1fr; margin-top: 12px;
    visibility: visible;
    transition: grid-template-rows .3s ease, margin-top .3s ease, visibility 0s;
  }
  .cal-tray-inner { min-height: 0; overflow: hidden; }
  .cal-box {
    border: 1px dashed var(--line); border-radius: 10px;
    padding: 12px; background: var(--background);
  }
  .cal-loading, .cal-alt {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--muted-fg); margin: 0;
  }
  .cal-loading { padding: 24px 0; text-align: center; }
  .cal-alt { padding-top: 10px; text-align: right; }
  .cal-alt a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
  @media (prefers-reduced-motion: reduce) {
    .cal-tray, .cal-tray.open, .cal-chev { transition: none; }
  }

  /* ─── Header bio section ─── */
  .bio-section { margin-top: 20px; text-align: center; }
  .bio-hero {
    font-family: var(--font-serif);
    font-size: 20px; font-weight: 500;
    letter-spacing: -0.01em; line-height: 1.2;
    margin: 0 0 9px;
  }
  .bio-subhead {
    font-size: 13px; color: var(--muted-fg);
    line-height: 1.65; margin: 0 0 13px;
    max-width: 54ch; margin-inline: auto;
  }
  .bio-bullets {
    list-style: none; margin: 0 0 15px; padding: 0;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--muted-fg); text-align: left;
    display: inline-block;
  }
  .bio-bullets li { padding: 2px 0 2px 14px; position: relative; }
  .bio-bullets li::before { content: '·'; position: absolute; left: 3px; color: var(--line); }
  .bio-bullets strong { color: var(--foreground); font-weight: 600; }
  .bio-toggle {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--muted-fg); cursor: pointer;
    letter-spacing: 0.05em; display: inline-block;
  }
  .bio-toggle:hover { color: var(--foreground); }
  .bio-chev { display: inline-block; transition: transform .25s ease; }
  .bio-toggle[aria-expanded="true"] .bio-chev { transform: rotate(180deg); }
  .bio-tray {
    display: grid; grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows .3s ease, margin-top .3s ease, visibility 0s linear .3s;
  }
  .bio-tray.open {
    grid-template-rows: 1fr; margin-top: 14px;
    visibility: visible;
    transition: grid-template-rows .3s ease, margin-top .3s ease, visibility 0s;
  }
  .bio-tray-inner { min-height: 0; overflow: hidden; }
  .bio-box {
    border: 1px dashed var(--line); border-radius: 10px;
    padding: 14px 16px; background: var(--background);
    text-align: left;
  }
  .bio-group { border-bottom: 1px dashed var(--line); }
  .bio-group:last-child { border-bottom: 0; }
  .bio-acc {
    width: 100%; text-align: left; background: none; border: none;
    padding: 9px 0; cursor: pointer;
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted-fg);
    display: flex; align-items: center; justify-content: space-between;
    transition: color .15s;
  }
  .bio-acc:hover { color: var(--foreground); }
  .bio-g-chev { display: inline-block; transition: transform .25s ease; flex-shrink: 0; }
  .bio-acc[aria-expanded="false"] .bio-g-chev { transform: rotate(-90deg); }
  .bio-acc-body {
    display: grid; grid-template-rows: 1fr;
    transition: grid-template-rows .25s ease;
  }
  .bio-acc-body.closed { grid-template-rows: 0fr; }
  .bio-acc-inner { min-height: 0; overflow: hidden; }
  .bio-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 6px 0; border-bottom: 1px dashed var(--line);
  }
  .bio-item:last-child { border-bottom: 0; padding-bottom: 8px; }
  .bio-item:first-child { padding-top: 0; }
  .bio-text { flex: 1; font-size: 12px; line-height: 1.6; color: var(--foreground); }
  .bio-copy {
    flex-shrink: 0; font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.06em; color: var(--muted-fg);
    background: none; border: 1px dashed var(--line);
    border-radius: 3px; padding: 2px 6px; cursor: pointer;
    transition: color .15s, border-color .15s; white-space: nowrap;
  }
  .bio-copy:hover { color: var(--foreground); border-color: var(--foreground); }
  .bio-copy.copied { color: var(--success); border-color: var(--success); }
  @media (prefers-reduced-motion: reduce) {
    .bio-tray, .bio-tray.open, .bio-chev, .bio-copy,
    .bio-acc, .bio-g-chev, .bio-acc-body { transition: none; }
  }

  .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success); display: inline-block; vertical-align: middle;
    margin-right: 6px;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 20%, transparent);
  }

  /* ─── About / narrative ─── */
  .about { font-size: 14.5px; line-height: 1.65; }
  .about p { margin: 0 0 12px; }
  .about p:last-child { margin: 0; }
  .about-flag {
    display: block;
    font-family: var(--font-mono); font-size: 12px;
    color: var(--foreground);
    margin-bottom: 14px;
  }
  .about strong { color: var(--foreground); font-weight: 600; }

  /* Angles: HOW / WHY split panels */
  .angles {
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 20px;
    row-gap: 20px;
    margin-top: 14px;
  }
  .angle-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--muted-fg);
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    text-transform: uppercase;
  }
  .angle-body {
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    font-size: 14px;
    line-height: 1.6;
  }
  .angle-body p:first-child { margin-top: 0; }
  .angle-body p:last-child { margin-bottom: 0; }
  .angle-body em { color: var(--muted-fg); font-style: italic; }
  @media (max-width: 540px) {
    .angles { grid-template-columns: 44px 1fr; column-gap: 12px; }
  }

  /* ─── Social chips ─── */
  .socials { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border: 1px dashed var(--line);
    background: var(--card);
    font-family: var(--font-mono); font-size: 12px;
    color: var(--foreground);
    border-radius: 6px;
  }
  .chip:hover { background: var(--accent); }
  .chip svg { width: 13px; height: 13px; }

  /* ─── Featured Work grid ─── */
  .feat-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .feat {
    position: relative;
    padding: 14px;
    display: flex; flex-direction: column; gap: 6px;
    background: var(--background);
    transition: background .15s ease;
  }
  .feat + .feat { border-left: 1px dashed var(--line); }
  .feat:nth-child(n+3) { border-top: 1px dashed var(--line); }
  .feat:nth-child(n+3).feat + .feat { border-left: 1px dashed var(--line); }
  .feat:hover { background: var(--accent); }
  .feat-flag {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg); letter-spacing: 0.06em;
  }
  .feat-title { font-size: 13.5px; font-weight: 500; color: var(--foreground); line-height: 1.3; }
  .feat-org  { font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); }
  .feat-grid.bordered { border: 1px dashed var(--line); border-radius: 8px; overflow: hidden; }

  /* ─── List rows ─── */
  .list { display: flex; flex-direction: column; }
  .row {
    display: grid; grid-template-columns: 48px 1fr auto;
    gap: 12px; align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
  }
  .row:last-child { border-bottom: 0; }
  .row-year { font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); }
  .row-glyph { font-size: 13px; line-height: 1; }
  .row-title { color: var(--foreground); }
  .row-title a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
  .row-title a:hover { text-decoration-color: currentColor; }
  .row-sub { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); margin-top: 2px; }
  .row-meta {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg); text-align: right;
    padding: 2px 6px; border: 1px dashed var(--line); border-radius: 4px;
    align-self: start;
    white-space: nowrap;
  }

  /* ─── Award Tour headline stats ─── */
  .stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border: 1px dashed var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--card);
  }
  .stat {
    padding: 18px 12px 14px;
    text-align: center;
    position: relative;
  }
  .stat + .stat { border-left: 1px dashed var(--line); }
  .stat-num {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--foreground);
  }
  .stat-mult {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-fg);
    margin-right: 2px;
    vertical-align: 12px;
  }
  .stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-fg);
    margin-top: 8px;
  }
  .stat-gp    .stat-num { color: #c084fc; }
  .stat-gold  .stat-num { color: #f59e0b; }
  .stat-silver .stat-num { color: #94a3b8; }
  .stat-bronze .stat-num { color: #c2845a; }
  @media (max-width: 720px) {
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stat:nth-child(4) { border-left: 0; border-top: 1px dashed var(--line); }
    .stat:nth-child(5),
    .stat:nth-child(6) { border-top: 1px dashed var(--line); }
  }
  @media (max-width: 540px) {
    .stat-num { font-size: 32px; }
    .stat { padding: 14px 6px 12px; }
  }

  /* ─── Award row ─── */
  .award {
    display: grid; grid-template-columns: 20px 1fr auto;
    gap: 12px; align-items: baseline;
    padding: 10px 0; border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
  }
  .award:last-child { border-bottom: 0; }
  .award-mark { font-size: 14px; }
  .award-sub  { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); margin-top: 2px; }
  .award-year { font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); }
  .award-tier-label { background: var(--surface); border-radius: 4px; }
  .award-indent { padding-left: 28px; }
  .award-sub-inline { display: inline; margin-top: 0; }

  /* ─── Featured Publication Card (Token Wisdom) ─── */
  .pub-card {
    display: block;
    padding: 22px 22px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background:
      linear-gradient(180deg, var(--card), var(--background)),
      radial-gradient(circle at 15% 0%, color-mix(in oklab, var(--foreground) 6%, transparent), transparent 55%);
    background-blend-mode: normal, normal;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
  }
  .pub-card:hover {
    text-decoration: none;
    border-color: color-mix(in oklab, var(--foreground) 24%, var(--border));
    transform: translateY(-1px);
  }
  .pub-card::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(
      600px circle at var(--gx, 20%) var(--gy, 0%),
      color-mix(in oklab, var(--foreground) 8%, transparent),
      transparent 45%
    );
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
  }
  .pub-card:hover::after { opacity: 1; }
  .pub-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px;
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.14em;
    background: var(--foreground); color: var(--background);
    border-radius: 4px;
    margin-bottom: 12px;
  }
  .pub-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 32px; line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--foreground);
    margin: 0 0 6px;
  }
  .pub-lede {
    color: var(--muted-fg);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 14px;
    max-width: 52ch;
  }
  .pub-meta {
    display: flex; justify-content: space-between;
    align-items: baseline;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-fg);
  }
  .pub-meta strong { color: var(--foreground); font-weight: 600; }
  @media (max-width: 540px) {
    .pub-title { font-size: 26px; }
    .pub-card { padding: 18px 16px 14px; }
  }

  /* ─── Knowware Press showcase card ─── */
  .kw-showcase {
    display: block;
    border: 1px dashed var(--line);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s ease;
  }
  .kw-showcase:hover { border-color: color-mix(in oklab, var(--foreground) 24%, var(--border)); text-decoration: none; }
  .kw-showcase-img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px dashed var(--line);
  }
  .kw-showcase-meta {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px 12px;
  }
  .kw-showcase-name {
    font-family: var(--font-serif); font-weight: 500;
    font-size: 15px; color: var(--foreground);
    letter-spacing: -0.01em;
  }
  .kw-showcase-tag {
    font-family: var(--font-mono); font-size: 9px;
    color: var(--muted-fg); letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .kw-showcase-desc {
    font-size: 12px; line-height: 1.45;
    color: var(--muted-fg); margin-top: 4px;
    text-wrap: pretty;
  }
  .kw-showcase-domain {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg); letter-spacing: 0.04em;
    margin-top: 6px;
  }

  /* ─── Knowware Press book card ─── */
  .kw-book-card {
    display: block;
    position: relative;
    background: #0d0c0b;
    border-radius: 12px;
    overflow: hidden;
    padding: 28px 26px 22px;
    transition: transform .2s ease;
    background-image:
      radial-gradient(circle at 85% 110%, rgba(255,255,255,0.045) 0%, transparent 50%),
      radial-gradient(rgba(255,255,255,0.03) 0.6px, transparent 0.6px);
    background-size: auto, 22px 22px;
  }
  .kw-book-card:hover { text-decoration: none; transform: translateY(-2px); }
  .kw-eyebrow {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 18px;
  }
  .kw-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 6vw, 42px);
    line-height: 1.0;
    letter-spacing: -0.025em;
    font-weight: 500;
    color: #f0ede8;
    margin: 0 0 16px;
  }
  .kw-title em {
    font-style: italic;
    color: rgba(240,237,232,0.62);
  }
  .kw-lede {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255,255,255,0.45);
    max-width: 46ch;
    margin: 0 0 24px;
  }
  .kw-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px dashed rgba(255,255,255,0.12);
  }
  .kw-domain {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255,255,255,0.3);
  }
  .kw-read {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #f0ede8;
  }

  /* ─── Capabilities (2-column bento) ─── */
  .caps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px dashed var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .cap {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    padding: 14px 14px 14px 14px;
    background: var(--card);
    align-items: start;
  }
  .cap:nth-child(odd) { border-right: 1px dashed var(--line); }
  .cap:not(:nth-last-child(-n+2)) { border-bottom: 1px dashed var(--line); }
  .cap:nth-last-child(2):nth-child(odd) { border-bottom: 1px dashed var(--line); }  /* odd-count safety */
  .cap-n {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-fg);
    padding-top: 3px;
  }
  .cap-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .cap-name {
    font-size: 14.5px; font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--foreground);
  }
  .cap-sub {
    list-style: none; padding: 0; margin: 6px 0 0;
    display: flex; flex-direction: column; gap: 4px;
  }
  .cap-sub li {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--muted-fg);
    padding-left: 12px;
    position: relative;
    line-height: 1.4;
  }
  .cap-sub li::before {
    content: "→"; position: absolute; left: 0;
    color: var(--muted-fg); font-size: 10px;
  }
  @media (max-width: 540px) {
    .caps { grid-template-columns: 1fr; }
    .cap:nth-child(odd) { border-right: 0; }
    .cap { border-bottom: 1px dashed var(--line); }
    .cap:last-child { border-bottom: 0; }
  }

  /* World's Firsts detail — sub-panel below the bento */
  .wf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 10px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .wf-item {
    padding: 14px 12px 12px;
    background: var(--card);
    display: flex; flex-direction: column; gap: 6px;
    align-items: flex-start;
  }
  .wf-item + .wf-item { border-left: 1px dashed var(--line); }
  .wf-glyph {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--muted-fg);
    text-transform: uppercase;
  }
  .wf-name {
    font-size: 13px;
    line-height: 1.35;
    color: var(--foreground);
    letter-spacing: -0.005em;
  }
  @media (max-width: 540px) {
    .wf-grid { grid-template-columns: 1fr; }
    .wf-item + .wf-item { border-left: 0; border-top: 1px dashed var(--line); }
  }

  /* ─── PORTED: Work Experience component (chanhdai-style timeline) ─── */
  .xp { display: flex; flex-direction: column; }
  .xp-group {
    padding: 14px 0 12px;
    border-bottom: 1px dashed var(--line);
  }
  .xp-group:last-child { border-bottom: 0; }
  .xp-company {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px;
  }
  .xp-logo {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent);
    border: 1px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--muted-fg);
    flex-shrink: 0;
    overflow: hidden;
  }
  .xp-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.01em;
    line-height: 1.2;
  }
  .xp-current {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #0ea5e9;
    margin-left: 2px;
    box-shadow: 0 0 0 4px color-mix(in oklab, #0ea5e9 30%, transparent);
    animation: xp-ping 1.8s ease-out infinite;
  }
  @keyframes xp-ping {
    0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, #0ea5e9 30%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in oklab, #0ea5e9 12%, transparent); }
  }
  @media (prefers-reduced-motion: reduce) { .xp-current { animation: none; } }

  /* Positions list — vertical rail behind the icons */
  .xp-positions {
    list-style: none;
    margin: 0;
    padding: 0 0 0 4px;
    position: relative;
  }
  .xp-positions::before {
    content: "";
    position: absolute;
    left: 12px; top: 12px; bottom: 12px;
    width: 1px;
    background: var(--line);
  }
  .xp-position {
    position: relative;
    padding: 6px 0;
  }
  .xp-trigger {
    display: grid;
    grid-template-columns: 24px 1fr 16px;
    gap: 10px; align-items: center;
    width: 100%;
    padding: 6px 8px 6px 0;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease;
  }
  .xp-trigger:hover { background: color-mix(in oklab, var(--accent) 60%, transparent); }
  .xp-icon {
    width: 24px; height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--muted-fg);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
  }
  .xp-icon svg { width: 12px; height: 12px; }
  .xp-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    margin: 0;
    letter-spacing: -0.005em;
  }
  .xp-chevron {
    width: 14px; height: 14px;
    color: var(--muted-fg);
    transition: transform .2s ease;
  }
  .xp-position[data-open="true"] .xp-chevron { transform: rotate(180deg); }
  /* meta strip */
  .xp-meta {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0 0 44px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-fg);
    font-variant-numeric: tabular-nums;
    margin: 0;
  }
  .xp-meta dd { margin: 0; }
  .xp-sep {
    display: inline-block;
    width: 1px; height: 10px;
    background: var(--line);
  }
  .xp-dates .xp-dash { padding: 0 3px; color: var(--muted-fg); }
  /* Collapsible body */
  .xp-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease;
    padding-left: 44px;
  }
  .xp-position[data-open="true"] .xp-body { grid-template-rows: 1fr; }
  .xp-body-inner {
    overflow: hidden;
    padding-top: 8px;
    font-size: 13px;
    color: var(--foreground);
    line-height: 1.5;
  }
  .xp-body-inner p { margin: 0 0 8px; }
  .xp-body-inner p:last-child { margin: 0; }
  .xp-body-inner ul {
    list-style: none;
    padding: 0; margin: 4px 0 6px;
    display: flex; flex-direction: column; gap: 3px;
  }
  .xp-body-inner ul li {
    padding-left: 14px;
    position: relative;
    color: var(--foreground);
  }
  .xp-body-inner ul li::before {
    content: "·"; position: absolute; left: 4px;
    color: var(--muted-fg);
  }
  /* Skill chips at the bottom of an expanded body */
  .xp-skills {
    list-style: none;
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 8px 0 0 44px;
    margin: 0;
  }
  .xp-position[data-open="true"] .xp-skills { display: flex; }
  .xp-position:not([data-open="true"]) .xp-skills { display: none; }
  .xp-skills li {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border: 1px dashed var(--line);
    border-radius: 4px;
    color: var(--muted-fg);
    letter-spacing: 0.02em;
  }
  .xp-more {
    display: block;
    padding-left: 44px;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-fg);
  }
  .xp-more:hover { color: var(--foreground); }
  @media (max-width: 540px) {
    .xp-meta, .xp-body, .xp-skills, .xp-more { padding-left: 40px; }
  }

  /* ─── Job block (Experience / Education) ─── */
  .job {
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
  }
  .job:last-child { border-bottom: 0; }
  .job-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin-bottom: 4px;
  }
  .job-co { font-size: 14px; font-weight: 600; color: var(--foreground); }
  .job-when { font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); white-space: nowrap; }
  .job-role { font-size: 13.5px; color: var(--foreground); }
  .job-meta {
    display: flex; gap: 8px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--muted-fg); margin-top: 4px;
  }
  .job.current .job-co::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--success); display: inline-block; vertical-align: middle;
    margin-right: 8px;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 20%, transparent);
  }

  /* ─── Play grid (concept tiles) ─── */
  .play-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px dashed var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .play-item {
    padding: 18px 12px;
    text-align: center;
    background: var(--background);
    transition: background .2s ease;
    display: flex; flex-direction: column; gap: 4px; align-items: center;
  }
  .play-item + .play-item { border-left: 1px dashed var(--line); }
  .play-item:nth-child(3n+1) { border-left: 0; }
  .play-item:nth-child(n+4) { border-top: 1px dashed var(--line); }
  .play-item:hover { background: var(--accent); text-decoration: none; }
  .play-name {
    font-family: var(--font-serif); font-weight: 500;
    font-size: 15px; color: var(--foreground);
    letter-spacing: -0.01em;
  }
  .play-tag {
    font-family: var(--font-mono); font-size: 9px;
    color: var(--muted-fg); letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .play-glyph {
    font-family: var(--font-mono); font-size: 14px;
    color: var(--muted-fg);
    margin-bottom: 2px;
  }
  .play-desc {
    font-size: 12px; line-height: 1.45;
    color: var(--muted-fg);
    margin-top: 4px;
    text-wrap: pretty;
  }
  .play-domain {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg); letter-spacing: 0.04em;
    margin-top: auto; padding-top: 8px;
  }
  .play-peek {
    position: fixed; top: 0; left: 0; z-index: 50;
    width: 320px;
    padding: 4px;
    background: var(--background);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 32px -8px rgb(0 0 0 / .35);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
  }
  .play-peek.on { opacity: 1; }
  .play-peek img {
    display: block; width: 100%; height: auto;
    border-radius: 5px;
  }
  @media (hover: none), (pointer: coarse) { .play-peek { display: none; } }
  .play-grid--1 { grid-template-columns: 1fr; }
  .play-grid--1 .play-item {
    border-left: 0;
    text-align: left;
    align-items: flex-start;
    padding: 22px 20px 18px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    column-gap: 14px;
  }
  .play-grid--1 .play-glyph { align-self: center; font-size: 22px; }
  .play-grid--1 .play-name  { font-size: 17px; align-self: center; }
  .play-grid--1 .play-tag   { width: 100%; margin-left: 36px; }
  .play-grid--1 .play-desc  { width: 100%; margin-left: 0; margin-top: 10px; max-width: 56ch; font-size: 13px; }
  .play-grid--1 .play-domain { width: 100%; margin-left: 0; }
  .play-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .play-grid--2 .play-item:nth-child(n+3) { border-top: 0; }
  @media (max-width: 540px) {
    .play-grid { grid-template-columns: repeat(2, 1fr); }
    .play-item:nth-child(3n+1) { border-left: 1px dashed var(--line); }
    .play-item:nth-child(2n+1) { border-left: 0; }
    .play-item:nth-child(n+3) { border-top: 1px dashed var(--line); }
  }

  /* ─── Learn (2-column: Near Misses / Research) ─── */
  .learn-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    border: 1px dashed var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .learn-col {
    padding: 16px;
    background: var(--card);
    display: flex; flex-direction: column; gap: 10px;
  }
  .learn-col + .learn-col { border-left: 1px dashed var(--line); }
  .learn-head {
    display: flex; align-items: baseline; justify-content: space-between;
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--muted-fg);
    text-transform: uppercase;
  }
  .learn-head .sig { color: var(--foreground); font-size: 12px; }
  .learn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .learn-list li {
    font-size: 13px; color: var(--foreground);
    padding-left: 14px; position: relative;
    line-height: 1.4;
  }
  .learn-list li::before {
    content: "→"; position: absolute; left: 0; top: 0;
    color: var(--muted-fg); font-family: var(--font-mono); font-size: 11px;
  }
  .learn-list .learn-sub {
    display: block;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg);
    margin-top: 2px; letter-spacing: 0.04em;
  }
  @media (max-width: 540px) {
    .learn-grid { grid-template-columns: 1fr; }
    .learn-col + .learn-col { border-left: 0; border-top: 1px dashed var(--line); }
  }

  /* ─── DAOs ─── */
  .dao-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px dashed var(--line); border-radius: 8px; overflow: hidden;
  }
  .dao {
    padding: 14px 10px;
    text-align: center;
    background: var(--background);
    transition: background .15s ease;
  }
  .dao + .dao { border-left: 1px dashed var(--line); }
  .dao:nth-child(n+4) { border-top: 1px dashed var(--line); }
  .dao:nth-child(3n+1) { border-left: 0; }
  .dao:hover { background: var(--accent); }
  .dao-emoji { font-size: 20px; margin-bottom: 4px; }
  .dao-name { font-size: 12px; color: var(--foreground); font-weight: 500; }
  .dao-role { font-family: var(--font-mono); font-size: 10px; color: var(--muted-fg); }

  /* ─── Contact block ─── */
  .contact-p { font-size: 15px; margin: 0 0 14px; }
  .contact-p strong { font-weight: 600; }
  .ctas { display: flex; flex-wrap: wrap; gap: 8px; }
  .cta {
    padding: 10px 14px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 500;
    border: 1px solid var(--foreground);
    background: var(--foreground); color: var(--background);
    border-radius: 6px;
    appearance: none; cursor: pointer;
  }
  .cta:hover { background: transparent; color: var(--foreground); }
  .cta.secondary { background: transparent; color: var(--foreground); }
  .cta.secondary:hover { background: var(--accent); }

  /* ─── Signature footer (big wordmark) ─── */
  .signature {
    position: relative;
    padding: 40px 0 24px;
    border-top: 1px dashed var(--line);
    text-align: center;
    overflow: hidden;
  }
  .signature-word {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 0.9;
    font-size: clamp(60px, 18vw, 140px);
    color: transparent;
    -webkit-text-stroke: 1px var(--muted-fg);
    background: linear-gradient(180deg, transparent 0%, transparent 40%, color-mix(in oklab, var(--foreground) 6%, transparent) 100%);
    -webkit-background-clip: text; background-clip: text;
    user-select: none;
    display: block;
  }
  /* Contact + footer merged — section stretches to full viewport width */
  .contact-shader {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-top: 0;
    /* Break out of the 640px frame horizontally, but keep text inside the column
     * via matching padding. Section itself becomes 100vw wide → shader canvas
     * fills the full viewport as background. min() keeps the margins ≤0 when
     * the viewport is narrower than the frame (phones), where 320px - 50vw
     * would go positive and crush the section. */
    margin-left:  calc(min(320px, 50vw) - 50vw);
    margin-right: calc(min(320px, 50vw) - 50vw);
    padding: 44px max(20px, calc(50vw - 320px)) 72px;
  }
  .contact-shader > .signature-shader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: transparent;
    z-index: 0;
    pointer-events: none;
    opacity: 0.52;
    /* 0% at top, ~50% at "Book a call" (~36% down), full at 65%, fade at bottom */
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 32%,
      #000 72%,
      #000 86%,
      transparent 100%
    );
            mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 32%,
      #000 72%,
      #000 86%,
      transparent 100%
    );
  }
  /* Thin edge feather — hides the section boundary at very top and bottom */
  .contact-shader::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      var(--background) 0%,
      transparent 14%,
      transparent 86%,
      var(--background) 100%
    );
    z-index: 1;
    pointer-events: none;
  }
  .contact-shader > *:not(canvas) { position: relative; z-index: 2; }
  /* Section headers on the shader read stronger */
  .contact-shader .sh { color: var(--foreground); }
  .contact-shader .contact-p { color: var(--foreground); }
  /* Secondary CTAs need backdrop over the animated shader */
  .contact-shader .cta.secondary {
    background: color-mix(in oklab, var(--background) 55%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .contact-shader .cta.secondary:hover {
    background: color-mix(in oklab, var(--foreground) 8%, var(--background));
  }
  .contact-meta {
    margin-top: 32px;
    padding-top: 14px;
    border-top: 1px dashed color-mix(in oklab, var(--line) 60%, transparent);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-fg);
    text-align: center;
    text-shadow: 0 1px 3px color-mix(in oklab, var(--background) 70%, transparent);
  }
  .contact-meta a {
    color: var(--foreground);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--foreground) 40%, transparent);
    text-underline-offset: 3px;
  }
  .contact-meta a:hover { text-decoration-color: currentColor; }
  html:not([data-theme="dark"]) .signature-shader { filter: invert(1) contrast(0.92); }
  .signature-meta {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--muted-fg);
    margin-top: 8px;
  }
  .signature-meta a { color: var(--foreground); }

  /* ─── ASCII Wordmark (replaces the Apple Hello signature) ─── */
  .hello-wrap {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    width: 100%;
  }
  .ascii-wordmark {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: clamp(5px, 1.15vw, 12px);
    line-height: 1.05;
    letter-spacing: 0;
    font-style: italic;
    margin: 0;
    padding: 0;
    white-space: pre;
    overflow-x: auto;
    max-width: 100%;
    text-align: left;
    display: inline-block;
    /* Fluid gradient painted into the glyphs */
    background: linear-gradient(
      110deg,
      var(--foreground) 20%,
      color-mix(in oklab, var(--info) 60%, var(--foreground)) 40%,
      color-mix(in oklab, #a855f7 60%, var(--foreground)) 55%,
      color-mix(in oklab, var(--info) 60%, var(--foreground)) 70%,
      var(--foreground) 90%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    /* Left-to-right reveal on load, then infinite fluid flow */
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 var(--wm-reveal, 100%), transparent var(--wm-reveal, 100%));
            mask-image: linear-gradient(90deg, #000 0%, #000 var(--wm-reveal, 100%), transparent var(--wm-reveal, 100%));
    animation: wordmark-reveal 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.25s forwards,
               fluid-flow 8s ease-in-out infinite;
    --wm-reveal: 0%;
  }
  .ascii-wordmark .ascii-line { display: block; }
  .ascii-wordmark .ascii-gap { height: 0.35em; }
  @property --wm-reveal { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
  @keyframes wordmark-reveal { to { --wm-reveal: 100%; } }
  /* Fallback for browsers without @property — mask-position swap */
  @supports not (background: paint(dummy)) {
    .ascii-wordmark {
      -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
              mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
      -webkit-mask-size: 200% 100%;
              mask-size: 200% 100%;
      -webkit-mask-position: 100% 0;
              mask-position: 100% 0;
      animation: wordmark-slide 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.25s forwards;
    }
    @keyframes wordmark-slide { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
  }
  .hello-caption {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg); letter-spacing: 0.14em;
    opacity: 0;
    animation: hello-fade 0.6s ease 2s forwards;
  }
  @keyframes hello-fade { to { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .ascii-wordmark { animation: none; --wm-reveal: 100%; -webkit-mask-image: none; mask-image: none; }
    .hello-caption { animation: none; opacity: 1; }
  }

  /* ─── PORTED: Glow Card Grid ─── */
  .glow-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .glow-card {
    position: relative;
    padding: 14px;
    display: flex; flex-direction: column; gap: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    overflow: hidden;
    transition: border-color .2s ease;
    isolation: isolate;
  }
  .glow-card::before {
    content: "";
    position: absolute; inset: -1px;
    border-radius: inherit;
    background: radial-gradient(
      360px circle at var(--gx, 50%) var(--gy, 50%),
      color-mix(in oklab, var(--foreground) 14%, transparent),
      transparent 40%
    );
    opacity: 0;
    transition: opacity .3s ease;
    z-index: -1;
    pointer-events: none;
  }
  .glow-card:hover { border-color: color-mix(in oklab, var(--foreground) 20%, var(--border)); text-decoration: none; }
  .glow-card:hover::before { opacity: 1; }
  .glow-card .g-flag { font-family: var(--font-mono); font-size: 10px; color: var(--muted-fg); letter-spacing: 0.06em; }
  .glow-card .g-title { font-size: 13.5px; font-weight: 500; color: var(--foreground); line-height: 1.3; }
  .glow-card .g-org { font-family: var(--font-mono); font-size: 11px; color: var(--muted-fg); }

  /* ─── PORTED: Logos Carousel (dual-direction marquee) ─── */
  .marquee-wrap {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  .marquee {
    display: flex;
    width: max-content;
    gap: 40px;
    animation: marquee-slide 32s linear infinite;
  }
  .marquee.reverse { animation-direction: reverse; animation-duration: 40s; }
  .marquee:hover { animation-play-state: paused; }
  @keyframes marquee-slide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
  .logo-item {
    display: inline-flex; align-items: center;
    height: 30px; padding: 0 4px;
    font-family: var(--font-serif); font-weight: 500;
    font-size: 15px; color: var(--muted-fg);
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: color .2s ease;
  }
  .logo-item:hover { color: var(--foreground); }
  .logo-item .lo-mark {
    font-family: var(--font-mono); font-size: 9px;
    padding: 2px 5px; border: 1px dashed var(--line);
    border-radius: 3px;
    color: var(--muted-fg);
    margin-right: 8px; letter-spacing: 0.08em;
  }
  /* Denser roster variant for the big list */
  .marquee.roster { gap: 28px; animation-duration: 80s; }
  .marquee.roster.reverse { animation-duration: 95s; }
  /* Third row — forward like A but a different speed and a phase offset
   * (negative delay) so it never marches in lockstep with A. */
  .marquee.roster.offset { animation-duration: 68s; animation-delay: -34s; }
  .roster-meta {
    display: flex; justify-content: space-between;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg); margin-top: 10px;
    letter-spacing: 0.06em; text-transform: uppercase;
  }

  /* ─── PORTED: Testimonials Marquee ─── */
  .testi-marquee {
    display: flex;
    width: max-content;
    gap: 12px;
    animation: marquee-slide 45s linear infinite;
  }
  .testi-marquee.reverse { animation-direction: reverse; animation-duration: 55s; }
  .testi-wrap { padding: 0; }
  .testi-wrap:hover .testi-marquee { animation-play-state: paused; }
  .testi {
    flex-shrink: 0;
    width: 300px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    display: flex; flex-direction: column; gap: 10px;
  }
  .testi-quote { font-size: 13px; line-height: 1.5; color: var(--foreground); margin: 0; }
  .testi-attr { display: flex; align-items: center; gap: 8px; }
  .testi-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent); color: var(--foreground);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    border: 1px solid var(--border);
    flex-shrink: 0;
  }
  .testi-meta { display: flex; flex-direction: column; min-width: 0; }
  .testi-name { font-size: 12px; font-weight: 500; color: var(--foreground); }
  .testi-role { font-family: var(--font-mono); font-size: 10px; color: var(--muted-fg); }

  /* ─── PORTED: GitHub Contributions ─── */
  .gh-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    padding: 14px;
  }
  .gh-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 10px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--muted-fg);
  }
  .gh-head strong { color: var(--foreground); font-weight: 600; }
  .gh-head a { color: var(--muted-fg); }
  .gh-head a:hover { color: var(--foreground); }
  .gh-chart-wrap {
    overflow-x: auto; overflow-y: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  }
  /* Month labels — same 53-column track as the grid so labels align
   * to the week where each month starts. */
  .gh-months {
    display: grid;
    grid-template-columns: repeat(53, 10px);
    gap: 3px;
    width: max-content;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.02em;
    color: var(--muted-fg);
  }
  .gh-months span {
    grid-row: 1;
    white-space: nowrap;
    overflow: visible;
  }

  /* Year labels — same column track, below the grid. */
  .gh-years {
    display: grid;
    grid-template-columns: repeat(53, 10px);
    gap: 3px;
    width: max-content;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--muted-fg);
  }
  .gh-years span {
    grid-row: 1;
    white-space: nowrap;
    overflow: visible;
  }

  /* Contribution grid — 53 columns × 7 rows, filled column-major.
   * Cells use the shared .cell / .cell.l1..l4 classes below. */
  .gh-grid {
    display: grid;
    grid-template-columns: repeat(53, 10px);
    grid-template-rows: repeat(7, 10px);
    grid-auto-flow: column;
    gap: 3px;
    padding: 4px 0;
    width: max-content;
  }
  /* Shared cell styles (used by .gh-grid AND .gh-legend) */
  .cell {
    width: 10px; height: 10px; border-radius: 2px;
    background: color-mix(in oklab, var(--foreground) 6%, var(--background));
    border: 1px solid var(--border);
    display: inline-block;
  }
  .cell.l1 { background: color-mix(in oklab, var(--foreground) 20%, var(--background)); border-color: transparent; }
  .cell.l2 { background: color-mix(in oklab, var(--foreground) 42%, var(--background)); border-color: transparent; }
  .cell.l3 { background: color-mix(in oklab, var(--foreground) 66%, var(--background)); border-color: transparent; }
  .cell.l4 { background: var(--foreground); border-color: transparent; }
  /* Commit wave-in + end glint (grid only — legend cells stay static).
   * --d / --s stagger delays are set inline per cell by github-graph.js. */
  .gh-grid .cell {
    opacity: 0;
    animation:
      gh-pop 0.35s cubic-bezier(0.2, 0.7, 0.3, 1.2) var(--d, 0ms) forwards,
      gh-glint 0.8s ease-out var(--s, 1200ms) 1;
  }
  @keyframes gh-pop {
    from { opacity: 0; transform: scale(0.3); }
    to   { opacity: 1; transform: scale(1); }
  }
  @keyframes gh-glint {
    0%   { filter: brightness(1); }
    35%  { filter: brightness(2.1); }
    100% { filter: brightness(1); }
  }
  @media (prefers-reduced-motion: reduce) {
    .gh-grid .cell { opacity: 1; animation: none; }
  }
  .gh-legend {
    display: flex; align-items: center; gap: 6px;
    justify-content: flex-end;
    margin-top: 8px;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--muted-fg);
  }

  /* ─── PORTED: Spinning Circular Text ─── */
  .spinner-wrap {
    position: absolute; top: 20px; right: 20px;
    width: 96px; height: 96px;
    pointer-events: auto;
    z-index: 2;
  }
  .spinner-svg { width: 100%; height: 100%; animation: spinner-rotate 18s linear infinite; }
  .spinner-svg text {
    font-family: var(--font-mono);
    font-size: 8.4px;
    letter-spacing: 0.14em;
    fill: var(--muted-fg);
    text-transform: uppercase;
  }
  .spinner-core {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--foreground);
    pointer-events: none;
  }
  @keyframes spinner-rotate { to { transform: rotate(360deg); } }
  .spinner-wrap:hover .spinner-svg { animation-play-state: paused; }
  @media (prefers-reduced-motion: reduce) { .spinner-svg { animation: none; } }
  @media (max-width: 540px) { .spinner-wrap { width: 74px; height: 74px; top: 12px; right: 12px; } }

  /* ─── PORTED: Fluid Gradient Text ─── */
  .fluid {
    background: linear-gradient(
      110deg,
      var(--foreground) 20%,
      color-mix(in oklab, var(--info) 60%, var(--foreground)) 40%,
      color-mix(in oklab, #a855f7 60%, var(--foreground)) 55%,
      color-mix(in oklab, var(--info) 60%, var(--foreground)) 70%,
      var(--foreground) 90%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: fluid-flow 8s ease-in-out infinite;
  }
  @keyframes fluid-flow {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
  }
  @media (prefers-reduced-motion: reduce) { .fluid { animation: none; } }

  /* ─── PORTED: Shimmering Text ─── */
  .shimmer {
    position: relative;
    color: var(--foreground);
    background: linear-gradient(
      110deg,
      currentColor 40%,
      color-mix(in oklab, var(--foreground) 30%, transparent) 50%,
      currentColor 60%
    );
    background-size: 220% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer-sweep 3.6s ease-in-out infinite;
  }
  @keyframes shimmer-sweep {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
  }
  @media (prefers-reduced-motion: reduce) { .shimmer { animation: none; -webkit-text-fill-color: currentColor; } }

  /* ─── Upgraded testi avatars (real images) ─── */
  .testi-avatar-img {
    width: 26px; height: 26px; border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--accent);
    flex-shrink: 0;
  }

  /* ─── PORTED: Dot Grid Spotlight (ambient bg for hero) ─── */
  .dotgrid {
    position: absolute; inset: 0;
    z-index: -1;
    background-image:
      radial-gradient(color-mix(in oklab, var(--foreground) 18%, transparent) 1px, transparent 1px);
    background-size: 16px 16px;
    background-position: 0 0;
    -webkit-mask-image: radial-gradient(
      circle at var(--sx, 50%) var(--sy, 40%),
      #000 0, #000 20%, transparent 60%
    );
            mask-image: radial-gradient(
      circle at var(--sx, 50%) var(--sy, 40%),
      #000 0, #000 20%, transparent 60%
    );
    transition: -webkit-mask-image .4s ease, mask-image .4s ease;
    opacity: 0.55;
    pointer-events: none;
  }
  .hero { position: relative; overflow: hidden; }

  /* ─── Small screens ─── */
  @media (max-width: 540px) {
    .feat-grid { grid-template-columns: 1fr; }
    .feat + .feat { border-left: 0; border-top: 1px dashed var(--line); }
    .feat:nth-child(n+3) { border-top: 1px dashed var(--line); }
    .dao-grid { grid-template-columns: repeat(2, 1fr); }
    .dao:nth-child(3n+1) { border-left: 1px dashed var(--line); }
    .dao:nth-child(2n+1) { border-left: 0; }
    .dao:nth-child(n+3) { border-top: 1px dashed var(--line); }
    .kv { grid-template-columns: 90px 1fr; column-gap: 0; }
    /* undo desktop's last-4 clear, then clear only actual last row (2 cells) */
    .kv > div:nth-last-child(-n+4) { border-bottom: 1px dashed var(--line); }
    .kv > div:nth-last-child(-n+2) { border-bottom: 0; }
    .row { grid-template-columns: 40px 1fr auto; }
    /* Experience rows carry long date·location chips — give them their own line */
    #experience .row { grid-template-columns: 40px 1fr; }
    #experience .row-meta { grid-column: 2; justify-self: start; }
    .name { font-size: 28px; }
  }

/* ═══════════════════════════════════════════════════════════════════════
 * SHARP SHADERS — nano-detail passes for architectural feel
 * (registration marks, dot grid, ruler ticks, machined-edge shine)
 * ═════════════════════════════════════════════════════════════════════ */

/* ─── 1. Corner registration marks ────────────────────────────────────
 * L-shaped brackets at all 4 corners. Uses ::before + ::after where
 * each covers 2 diagonal corners via 4 layered linear-gradients. */
.reg { position: relative; }
.reg::before,
.reg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}
.reg::before {
  /* Covers top-left + bottom-right corners */
  background:
    linear-gradient(currentColor, currentColor) top    left  / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) top    left  / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) bottom right / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) bottom right / 1px 6px no-repeat;
  color: color-mix(in oklab, var(--muted-fg) 55%, transparent);
}
.reg::after {
  /* Covers top-right + bottom-left corners */
  background:
    linear-gradient(currentColor, currentColor) top    right / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) top    right / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) bottom left  / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) bottom left  / 1px 6px no-repeat;
  color: color-mix(in oklab, var(--muted-fg) 55%, transparent);
}

/* Auto-apply to card surfaces */
.glow-card,
.dao,
.gh-card,
.pub-card,
.testi,
.wf-item,
.stat,
.play-item,
.rate,
.feat {
  position: relative;
}
.glow-card::before,
.glow-card::after,
.dao::before,
.dao::after,
.gh-card::before,
.gh-card::after,
.pub-card::before,
.pub-card::after,
.testi::before,
.testi::after,
.wf-item::before,
.wf-item::after,
.stat::before,
.stat::after,
.play-item::before,
.play-item::after,
.feat::before,
.feat::after {
  pointer-events: none;
  z-index: 1;
}
/* Reg brackets on cards that don't already use both pseudos.
 * NOTE: .glow-card already uses ::before for its radial glow, and
 *       .pub-card uses ::after for its cursor gradient — those two
 *       cards intentionally skip the auto-apply and can be marked
 *       with class="reg" if needed. */
.dao::before,
.gh-card::before,
.testi::before,
.wf-item::before,
.stat::before,
.play-item::before,
.feat::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(currentColor, currentColor) top    left  / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) top    left  / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) bottom right / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) bottom right / 1px 6px no-repeat;
  color: color-mix(in oklab, var(--muted-fg) 55%, transparent);
  border-radius: inherit;
}
.dao::after,
.gh-card::after,
.testi::after,
.wf-item::after,
.stat::after,
.play-item::after,
.feat::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(currentColor, currentColor) top    right / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) top    right / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) bottom left  / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) bottom left  / 1px 6px no-repeat;
  color: color-mix(in oklab, var(--muted-fg) 55%, transparent);
  border-radius: inherit;
}


/* ─── 2. Hairline dot grid — ground plane on <body> ───────────────────
 * 0.6px dots at 16×16, ~12% opacity. Sits on <body> so it fills the
 * whole viewport (past the content column into the margins). The frame
 * floats above it at ~70% alpha so the grid bleeds through subtly. */
body {
  background-image: radial-gradient(
    circle at 1px 1px,
    color-mix(in oklab, var(--foreground) 14%, transparent) 0.6px,
    transparent 1px
  );
  background-size: 16px 16px;
  background-position: 8px 8px;
  background-attachment: fixed;
  /* background-color still inherits from the earlier body rule */
}
.frame {
  background-color: color-mix(in oklab, var(--background) 70%, transparent);
}


/* ─── 3. Ruler tick marks on section rules ────────────────────────────
 * Major 3px ticks every 100px, minor 1.5px ticks every 20px. Anchored
 * to the top of each section (below its inherited dashed border-top). */
section {
  position: relative;
}
section:not(:first-of-type)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background:
    /* Major ticks — 1px wide, 3px tall, every 100px */
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 99.5px,
      color-mix(in oklab, var(--muted-fg) 70%, transparent) 99.5px,
      color-mix(in oklab, var(--muted-fg) 70%, transparent) 100.5px,
      transparent 100.5px,
      transparent 100px
    ),
    /* Minor ticks — 1px wide, 1.5px tall, every 20px */
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 19.5px,
      color-mix(in oklab, var(--muted-fg) 30%, transparent) 19.5px,
      color-mix(in oklab, var(--muted-fg) 30%, transparent) 20.5px,
      transparent 20.5px,
      transparent 20px
    );
  background-size: 100% 3px, 100% 1.5px;
  background-position: 0 1px, 0 1px;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}


/* ─── 4. Machined-edge conic shine on card hover ──────────────────────
 * 1px conic-gradient ring visible only when hovering. Uses ::after +
 * mask-composite trick to constrain the gradient to a 1px border.
 * Slow rotation via @property so the conic angle interpolates smoothly.
 * Applied only to .glow-card since that's the interactive hero surface;
 * .pub-card and DAO tiles already have their own hover treatments. */
@property --shine-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.glow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--shine-angle),
    transparent 0deg,
    transparent 60deg,
    color-mix(in oklab, var(--foreground) 50%, transparent) 90deg,
    transparent 120deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  z-index: 2;
  --shine-angle: 0deg;
  animation: shine-rot 3.4s linear infinite;
  animation-play-state: paused;
}
.glow-card:hover::after {
  opacity: 1;
  animation-play-state: running;
}
@keyframes shine-rot {
  to { --shine-angle: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .glow-card::after { animation: none; }
}
