@font-face { font-family: 'Young Serif'; src: url('/fonts/young-serif.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Onest'; src: url('/fonts/onest.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

  :root {
    --bg-1: #E6EDEF; --bg-2: #CFDCE1; --ink: #1C2430; --ink-2: #536070; --accent: #2D46D8; --card: #FBFCFC; --rule: #D3DCE1; --ride-fill: #26375F; --ride-alt: rgba(38, 55, 95, .05); --ride-on: #E9B23A; --ride-card: #EEF3F5; --ink-on-mustard: #1C2430;
    --g1: #3DAA62; --g2: #F2C430; --g3: #F08A2C; --g4: #D93A2E; --g5: #23262C; --kom: #D7263D;
  }
  :root[data-theme="dark"] { --bg-1: #121831; --bg-2: #1C2445; --ink: #E7EBF3; --ink-2: #9AA5BC; --accent: #9DAEFF; --card: #1B2340; --rule: #2C3658; --ride-fill: #8FA6E8; --ride-alt: rgba(255, 255, 255, .04); --ride-on: #E9B23A; --ride-card: #222B4C; --g5: #E9ECF1; }
  * { box-sizing: border-box; }
  body { margin: 0; min-height: 100vh; color: var(--ink); font: 400 1.0625rem/1.6 'Onest', system-ui, sans-serif;
    background: radial-gradient(1200px 700px at 70% 40%, var(--bg-1), var(--bg-2)); transition: background 600ms, color 600ms; }
  a { color: var(--accent); text-underline-offset: .18em; }
  .page { max-width: 1360px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 48px) 48px; display: grid; gap: 8px 40px; align-items: center; }
  @media (min-width: 1000px) { .page { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); min-height: 100vh; } }
  .intro h1 { font: 400 clamp(2.6rem, 5vw, 3.8rem)/1 'Young Serif', serif; margin: 0 0 10px; letter-spacing: -0.01em; }
  .intro .role { font: 400 1.5rem/1.2 'Young Serif', serif; color: var(--accent); margin: 0 0 18px; }
  .intro p { margin: 0 0 14px; max-width: 30em; }
  .intro .creds { font-size: 1.0625rem; }
  .hint { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
  .hint i { width: 10px; height: 10px; border-radius: 50%; background: #F2B631; box-shadow: 0 0 0 4px rgba(242,182,49,.3); animation: pulse 1.8s infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(242,182,49,0); } }

  .room-wrap { position: relative; }
  svg.room { display: block; width: 100%; height: auto; max-height: 92vh; overflow: visible; }
  .obj { cursor: pointer; outline: none; transition: filter 160ms; }
  .obj:hover, .obj:focus-visible { filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 8px rgba(255, 205, 80, .95)); }
  .tip { position: absolute; pointer-events: none; background: #1C2430; color: #fff; font: 600 .8125rem 'Onest'; padding: 5px 10px; border-radius: 999px; translate: -50% -130%; white-space: nowrap; opacity: 0; transition: opacity 120ms; z-index: 3; }
  .tip.show { opacity: 1; }
  .steam { animation: steam 3.2s ease-in-out infinite; opacity: 0; }
  .steam.b { animation-delay: 1.6s; }
  @keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .55; } 100% { opacity: 0; transform: translateY(-14px); } }
  .screen-img { transition: opacity 450ms; }
  @media (prefers-reduced-motion: reduce) { .steam, .hint i { animation: none; } }

  .things { grid-column: 1 / -1; margin-top: 4px; }
  .things h2 { font: 600 .9375rem 'Onest'; color: var(--ink-2); margin: 0 0 8px; }
  .things ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .things button, .things a { font: 500 .9375rem 'Onest'; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
  .things button:hover, .things a:hover { border-color: var(--accent); }
  @media (min-width: 1000px) { .things { grid-column: 2; } }

  dialog.sheet { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(540px, 100vw); max-width: 100vw; border: 0; padding: 0; background: var(--card); color: var(--ink); box-shadow: -24px 0 60px rgba(10, 16, 30, .3); }
  dialog.sheet[open] { animation: slide 280ms cubic-bezier(.2,.8,.2,1); }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
  dialog.sheet::backdrop { background: rgba(14, 20, 36, .35); }
  @media (max-width: 640px) {
    dialog.sheet { margin: auto 0 0 0; width: 100vw; height: auto; max-height: 86vh; border-radius: 18px 18px 0 0; }
    dialog.sheet[open] { animation: rise 280ms cubic-bezier(.2,.8,.2,1); }
    @keyframes rise { from { transform: translateY(40px); opacity: 0; } }
  }
  .sheet header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 12px; background: var(--card); border-bottom: 1px solid var(--rule); z-index: 2; }
  .sheet header h2 { margin: 0; font: 400 1.6rem 'Young Serif', serif; }
  .sheet .x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); font-size: 1.3rem; cursor: pointer; }
  .sheet .body { padding: 20px 22px 32px; }
  .sheet .body p { margin: 0 0 12px; }
  .sheet img { max-width: 100%; height: auto; display: block; border-radius: 10px; }
  .shots { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 0 0 16px; align-items: start; }
  .shots.round img { border-radius: 50%; background: #111; }
  .shots.three { grid-template-columns: 1fr 1fr 1fr; }
  .btn { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--ink); color: var(--card); text-decoration: none; font-weight: 600; margin: 4px 8px 0 0; }

  .cert { position: relative; background: #FFFDF6; color: #2A2620; border: 1px solid #D9CFB6; outline: 6px double #C8B88E; outline-offset: -14px; padding: 34px 44px 44px; margin: 0 0 18px; text-align: center; border-radius: 4px; }
  .cert .crest { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; color: #fff; font: 400 1.2rem 'Young Serif'; background: var(--crest, #1F3B73); }
  .cert .inst { font: 600 .8125rem 'Onest'; letter-spacing: .06em; color: #6E6556; margin: 0 0 6px; font-variant: small-caps; }
  .cert h3 { font: 400 1.6rem/1.15 'Young Serif', serif; margin: 0 0 8px; }
  .cert .sub { margin: 0 0 6px !important; font-weight: 600; }
  .cert .note { font-size: .9rem; color: #6E6556; margin: 0 !important; }
  .seal { position: absolute; right: 22px; bottom: 20px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #F3D27A, #C9962E); box-shadow: inset 0 0 0 4px rgba(255,255,255,.25); }
  .seal::before, .seal::after { content: ''; position: absolute; top: 24px; width: 10px; height: 16px; background: #B4282E; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); z-index: -1; }
  .seal::before { left: 5px; rotate: 18deg; } .seal::after { right: 5px; rotate: -18deg; }
  .honours { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
  .honours li { padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, transparent); }

  .papers { padding-left: 1.4rem; margin: 0; } .papers li { margin-bottom: 14px; }
  .p-title a { font-weight: 600; }
  .p-extra { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 4px; font-size: .9063rem; color: var(--ink-2); }
  .cites { font-variant-numeric: tabular-nums; }
  .bib { flex-basis: 100%; }
  .bib summary { cursor: pointer; width: max-content; color: var(--accent); }
  .bib pre { margin: 8px 0 4px; padding: 10px 12px; max-height: 12rem; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: .8125rem; line-height: 1.45; background: var(--ride-card); border-radius: 8px; color: var(--ink); }
  .cite-total { color: var(--ink-2); margin: 0 0 12px; }
  .gh { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
  .gh h3 { margin: 0 0 6px; }
  .gh-lede, .gh-meta { margin: 0 0 10px; }
  .gh-meta { color: var(--ink-2); font-size: .9375rem; }
  .gh-scroll { overflow-x: auto; padding-bottom: 4px; }
  .gh-graph { display: block; width: 100%; min-width: 480px; height: auto; }
  .gh-graph text { font-size: 12px; fill: var(--ink-2); }
  .gh-graph rect { fill: color-mix(in srgb, var(--accent) 6%, var(--rule)); }
  .gh-graph .l1 { fill: color-mix(in srgb, var(--accent) 30%, var(--card)); }
  .gh-graph .l2 { fill: color-mix(in srgb, var(--accent) 55%, var(--card)); }
  .gh-graph .l3 { fill: color-mix(in srgb, var(--accent) 78%, var(--card)); }
  .gh-graph .l4 { fill: var(--accent); }
  .proj { border-top: 1px solid var(--rule); padding: 10px 0; }
  .proj summary { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; cursor: pointer; list-style: none; }
  .proj summary::-webkit-details-marker { display: none; }
  .proj summary::after { content: '+'; font-size: 1.3rem; color: var(--ink-2); }
  .proj[open] summary::after { content: '−'; }
  .proj summary img { width: 96px; height: 64px; object-fit: cover; object-position: top; border-radius: 8px; }
  .proj summary b { display: block; } .proj summary small { color: var(--ink-2); }
  .proj .more { padding: 10px 0 4px 110px; font-size: .9688rem; }
  @media (max-width: 480px) { .proj .more { padding-left: 0; } }

  dialog.sheet.sheet-ride { width: min(1060px, 100vw); }
  .ride-lede { color: var(--ink-2); max-width: 44em; }
  .ride-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 4px 0 18px; background: var(--rule); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
  .ride-stats div { background: var(--card); padding: 10px 14px; }
  .ride-stats dt { font-size: .78rem; color: var(--ink-2); font-weight: 600; }
  .ride-stats dd { margin: 0; font: 400 1.6rem/1.15 'Young Serif', serif; }
  .ride-stats dd.small { font: 600 .95rem/1.3 'Onest'; padding-top: 4px; }
  @media (max-width: 640px) { .ride-stats { grid-template-columns: 1fr 1fr; } }
  .ride-readout { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; min-height: 128px; padding: 14px; border-radius: 14px; background: var(--ride-card); }
  .ro-img { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--rule); }
  .ro-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 0; }
  .ro-img.empty { display: grid; place-items: center; background: repeating-linear-gradient(135deg, transparent 0 8px, var(--rule) 8px 9px), var(--card); }
  .ro-img.empty::after { content: 'No screenshot'; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
  .ro-img.empty img { display: none; }
  .ro-meta { margin: 0 0 2px !important; font-size: .82rem; font-weight: 700; color: var(--accent); }
  .ro-title { margin: 0 0 4px; font: 400 1.45rem/1.2 'Young Serif', serif; }
  .ro-sum { margin: 0 0 6px !important; color: var(--ink-2); font-size: .95rem; }
  .ro-link { margin: 0 !important; font-weight: 700; font-size: .9rem; }
  @media (max-width: 640px) { .ride-readout { grid-template-columns: 96px 1fr; gap: 12px; align-items: start; } .ro-img { aspect-ratio: 1; } .ro-title { font-size: 1.15rem; } }
  .ride-scroll { overflow-x: auto; margin: 10px -22px 0; padding: 0 22px; }
  .ride { display: block; width: 100%; min-width: 760px; height: auto; touch-action: pan-y; user-select: none; }
  .ride .band { fill: transparent; } .ride .band.alt { fill: var(--ride-alt); }
  .ride .road { fill: var(--ride-fill); }
  .ride .seg { fill: var(--ride-fill); transition: fill 160ms; }
  .ride .seg.on { fill: var(--ride-on); }
  .ride .ridge { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
  .ride .base { stroke: var(--ink); stroke-width: 2; }
  .ride .tick line { stroke: var(--ink-2); }
  .ride .tick text { font: 600 12px 'Onest'; fill: var(--ink-2); text-anchor: middle; }
  .ride .badge line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 2 2; }
  .ride .badge circle { fill: var(--card); stroke: var(--ride-fill); stroke-width: 2.4; transition: r 140ms; }
  .ride .badge text { font: 800 9.5px 'Onest'; fill: var(--ride-fill); text-anchor: middle; pointer-events: none; }
  .ride .badge.hc circle { fill: var(--ride-fill); } .ride .badge.hc text { fill: var(--ride-on); }
  .ride .badge.on circle { r: 13; stroke: var(--ride-on); fill: var(--ride-on); } .ride .badge.on text { fill: var(--ink-on-mustard); }
  .ride .flag line { stroke: var(--ink); stroke-width: 1.6; }
  .ride .flag path { fill: var(--accent); }
  .ride .flag text { font: 700 11.5px 'Onest'; fill: #fff; }
  .ride .now circle { fill: var(--ride-on); stroke: var(--ink); stroke-width: 2; }
  .ride .now text { font: 800 12px 'Onest'; fill: var(--accent); text-anchor: middle; }
  .ride .cursor { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; pointer-events: none; }
  .ride .cursor-dot { fill: var(--ride-on); stroke: var(--ink); stroke-width: 2; pointer-events: none; }
  .ride .hit { fill: transparent; cursor: ew-resize; outline: none; }
  .ride .hit:focus-visible { stroke: var(--accent); stroke-width: 2; }
  .ride-hint { font-size: .82rem; color: var(--ink-2); margin-top: 4px !important; }
  .climbs-h { font: 400 1.2rem 'Young Serif', serif; margin: 22px 0 8px; }
  .climb-list { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 24px; }
  .climb-list li { break-inside: avoid; }
  .climb-list button { width: 100%; display: grid; grid-template-columns: 3rem 1fr auto; gap: 10px; align-items: baseline; text-align: left; padding: 7px 8px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--ink); font: 400 .95rem 'Onest'; cursor: pointer; border-radius: 6px; }
  .climb-list button:hover, .climb-list button.on { background: var(--ride-card); }
  .climb-list .y { color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .climb-list .c { font-size: .78rem; font-weight: 700; color: var(--ink-2); }
  .ride-foot { margin-top: 20px !important; color: var(--ink-2); }

  :root { color-scheme: light; } :root[data-theme="dark"] { color-scheme: dark; }
  h1, h2, h3 { text-wrap: balance; } p { text-wrap: pretty; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  /* Room objects show focus with their gold glow; an outline would box the whole drawing */
  .obj:focus, .obj:focus-visible, .ride .hit:focus-visible { outline: none; }
  .sheet header h2:focus { outline: none; }
  .intro-text p { margin: 0 0 14px; max-width: 30em; }

  /* Project panels */
  .p-meta { margin: 0 0 12px !important; font-size: .875rem; font-weight: 700; color: var(--accent); }
  .lead { font-size: 1.125rem; line-height: 1.5; }
  .prose { color: var(--ink-2); }
  .prose p { margin: 0 0 12px; } .prose ul { padding-left: 1.2rem; margin: 0 0 12px; } .prose li { margin-bottom: 6px; }
  .tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 14px; }
  .tags li { font-size: .8125rem; padding: 3px 10px; border-radius: 999px; background: var(--ride-card); color: var(--ink-2); }
  .links { margin: 4px 0 0 !important; }
  .shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; align-items: start; }
  .shots[data-count="1"] { grid-template-columns: 1fr; }
  .shots.round { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shots.round[data-count="4"], .shots.round[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots .shot { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
  .shots .shot:first-child:not(.f-phone):not(.f-watch) { grid-column: 1 / -1; }
  .shots img { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -14px rgba(10,16,30,.45); }
  .shots .f-watch img { border-radius: 50%; background: #111; }
  .shots .f-phone { max-width: 210px; justify-self: center; }
  .shots .f-phone img { border-radius: 18px; border: 6px solid #1C2430; }
  .shots .f-watch { max-width: 170px; justify-self: center; }
  .shots .f-photo img { border: 8px solid #fff; border-radius: 2px; }
  .draft-badge { background: var(--ink); color: var(--card); padding: 1px 8px; border-radius: 4px; font-size: .75rem; margin-left: 6px; }
  .proj .no-img { width: 96px; height: 64px; border-radius: 8px; background: repeating-linear-gradient(135deg, transparent 0 8px, var(--rule) 8px 9px), var(--card); }
  .text-link { background: none; border: 0; padding: 0; color: var(--accent); font: 600 .9375rem 'Onest'; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
  .ro-link button { font-size: .9rem; }

  /* Lightbox */
  .lightbox { border: 0; padding: 0; background: transparent; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; }
  .lightbox[open] { display: grid; place-items: center; }
  .lightbox::backdrop { background: rgba(8, 12, 24, .88); }
  .lightbox img { max-width: min(94vw, 1800px); max-height: 88vh; border-radius: 8px; }
  .lightbox button { position: fixed; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.75rem; line-height: 1; cursor: pointer; }
  .lightbox button:hover { background: rgba(255,255,255,.26); }
  .lb-close { top: 16px; right: 16px; } .lb-prev { left: 16px; top: 50%; translate: 0 -50%; } .lb-next { right: 16px; top: 50%; translate: 0 -50%; }
  .lightbox[data-single] .lb-prev, .lightbox[data-single] .lb-next { display: none; }

  /* Footer */
  .bottom { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 28px; display: flex; justify-content: space-between; gap: 16px; font-size: .875rem; color: var(--ink-2); }
  .bottom p { margin: 0; } .bottom a { color: var(--ink-2); }
  .link-btn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; }

  /* Sign-in and 404 */
  .signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
  .signin form, .signin > div { width: 100%; max-width: 26rem; }
  .signin h1 { font: 400 clamp(2.2rem, 6vw, 3rem)/1.05 'Young Serif', serif; margin: 0 0 12px; }
  .signin p { color: var(--ink-2); }
  .signin label { display: grid; gap: 6px; font-weight: 600; margin-bottom: 16px; }
  .signin input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
  .signin button { font: 600 1rem 'Onest'; padding: 11px 20px; border: 0; border-radius: 999px; background: var(--ink); color: var(--card); cursor: pointer; margin-bottom: 16px; }
  .form-error { color: #C8323C !important; font-weight: 600; }

  /* Corkboard */
  .notes { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
  .note { padding: 18px 18px 16px; color: #2A2620; box-shadow: 0 1px 1px rgba(0,0,0,.1), 0 12px 20px -14px rgba(10,16,30,.6); position: relative; rotate: -1.2deg; }
  .note:nth-child(even) { rotate: 1.4deg; }
  .note::before { content: ''; position: absolute; top: 7px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #C8323C; box-shadow: 0 2px 2px rgba(0,0,0,.25); }
  .note.n0 { background: #FFE27A; } .note.n1 { background: #9FD8C4; } .note.n2 { background: #F6B3C2; } .note.n3 { background: #A9C8F5; }
  .note h3 { margin: 4px 0 6px; font: 400 1.15rem 'Young Serif', serif; }
  .note p { margin: 0 !important; font-size: .95rem; line-height: 1.45; }
  .note a { color: #1F3B73; }
  .notes-date { font-size: .82rem; color: var(--ink-2); }

  /* Baseball card */
  .bb-card { margin: 0 0 16px; }
  .bb-front { position: relative; padding: 20px 22px 18px; margin: 0 0 16px; border-radius: 12px; color: #fff; overflow: hidden;
    background: linear-gradient(160deg, #22305E 0 62%, #C8323C 62% 66%, #22305E 66%); box-shadow: inset 0 0 0 4px #E9B530, inset 0 0 0 6px #22305E; }
  .bb-num { position: absolute; right: 18px; top: 4px; font: 400 4.2rem/1 'Young Serif', serif; color: #E9B530; opacity: .9; }
  .bb-name { margin: 0 !important; font: 400 1.6rem/1.1 'Young Serif', serif; max-width: 75%; }
  .bb-team { margin: 4px 0 0 !important; font-weight: 600; color: #DCE3F4; }
  .bb-scroll { overflow-x: auto; margin: 0 0 8px; }
  .bb-stats { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .bb-stats th, .bb-stats td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--rule); }
  .bb-stats thead th { font-size: .75rem; color: var(--ink-2); font-weight: 700; }
  .bb-stats th[scope="row"], .bb-stats td.t, .bb-stats thead th:nth-child(-n+2) { text-align: left; }
  .bb-stats td.t small { display: block; color: var(--ink-2); font-size: .75rem; }
  .bb-stats tfoot th, .bb-stats tfoot td { font-weight: 700; border-bottom: 0; }
  .bb-src { font-size: .875rem; }
  .bb-proj { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
  .bb-proj img { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
  .bb-proj h3 { margin: 0 0 4px; font: 400 1.2rem 'Young Serif', serif; }
  .bb-proj p { font-size: .95rem; }
  button.btn { border: 0; font: 600 1rem 'Onest'; cursor: pointer; }

  /* Terminal: drops down from the top, like a game console */
  .bottom kbd { font: 600 .8rem ui-monospace, monospace; padding: 0 5px; border: 1px solid var(--rule); border-radius: 4px; margin-left: 4px; }
  @media (hover: none) { .bottom kbd { display: none; } }
  dialog.term { margin: 0 auto auto; padding: 0; border: 0; width: min(980px, 100vw); max-width: 100vw; background: transparent; color: #DCE6F5; }
  dialog.term[open] { animation: drop 220ms cubic-bezier(.2,.8,.2,1); }
  @keyframes drop { from { transform: translateY(-30px); opacity: 0; } }
  dialog.term::backdrop { background: rgba(8, 12, 24, .35); }
  .term-win { height: min(62vh, 560px); display: grid; grid-template-rows: auto 1fr auto; background: rgba(15, 21, 48, .97); border-radius: 0 0 14px 14px; box-shadow: 0 24px 60px rgba(5, 8, 20, .5); font: 400 .9375rem/1.55 ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; }
  @media (max-width: 640px) { .term-win { height: 70vh; font-size: .8125rem; } }
  .term-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 16px; font-size: .8rem; color: #8E9BC0; border-bottom: 1px solid #263058; }
  .term-x { background: none; border: 0; color: #8E9BC0; font-size: 1.3rem; cursor: pointer; width: 32px; height: 32px; border-radius: 6px; }
  .term-x:hover { background: #263058; color: #fff; }
  .term-out { overflow-y: auto; padding: 12px 16px 4px; overscroll-behavior: contain; }
  .term-out .ln { white-space: pre-wrap; word-break: break-word; min-height: 1.55em; }
  .term-out .ln.wide { white-space: pre; word-break: normal; overflow-x: auto; line-height: 1.25; }
  .term-out .sqs { display: grid; gap: 2px; padding: 4px 0; width: max-content; }
  .term-out .sqs div { display: flex; gap: 2px; align-items: center; }
  .term-out .sqs .day { width: 3.4ch; font-size: .75rem; line-height: 1; color: #8E9BC0; }
  .term-out .sqs i { width: 9px; height: 9px; border-radius: 2px; }
  .term-out .g0 { background: #232B52; } .term-out .g1 { background: #34479C; } .term-out .g2 { background: #4F68DA; } .term-out .g3 { background: #8EA2FF; } .term-out .g4 { background: #D6DEFF; }
  .term-out .dim { color: #8E9BC0; } .term-out .hl { color: #E9B530; } .term-out .err { color: #FF8A80; }
  .term-out .art { color: #7FA8FF; }
  .term-out a { color: #9DD4FF; }
  .term-out .ps, .term-line .ps { color: #E9B530; }
  .term-act { background: none; border: 1px solid #3A4778; color: #DCE6F5; font: inherit; padding: 0 8px; margin-top: 4px; border-radius: 5px; cursor: pointer; }
  .term-act:hover { border-color: #E9B530; }
  .term-line { display: flex; gap: .6em; padding: 4px 16px 12px; }
  .term-line input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font: inherit; caret-color: #E9B530; padding: 0; }
  .term-line input:focus-visible { outline: none; }

  /* Games */
  dialog.game { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: transparent; color: #fff; }
  dialog.game::backdrop { background: rgba(8, 12, 24, .9); }
  dialog.game[open] { display: grid; place-items: center; }
  .game-box { position: relative; width: min(1100px, 100vw); display: grid; gap: 10px; padding: 12px; }
  .game-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .game-head h2 { margin: 0; font: 400 1.5rem 'Young Serif', serif; }
  .game-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; cursor: pointer; flex: none; }
  .game-x:hover { background: rgba(255,255,255,.26); }
  .game-box canvas { display: block; width: 100%; height: auto; border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; background: #22305E; }
  .game-help { margin: 0; font-size: .9rem; color: #B8C3DE; }
  .game-help kbd { font: 600 .8rem ui-monospace, monospace; padding: 0 5px; border: 1px solid #56618A; border-radius: 4px; }
  .game-pad { display: none; gap: 10px; }
  .game-pad button { flex: 1; padding: 18px 0; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: #fff; font: 700 1rem 'Onest'; touch-action: manipulation; }
  .game-pad button:active, .game-pad button.on { background: #E9B530; color: #1C2430; }
  @media (hover: none) { .game-pad { display: flex; } }
  .game-box canvas:focus { outline: none; }
  .bb-stats th, .bb-stats td { padding: 6px 6px; }
  .game-help.touch { display: none; }
  @media (hover: none) { .game-help.touch { display: block; } .game-help.keys { display: none; } }
  @media (max-width: 640px) { .term-out .nf .art { display: none; } .term-out .nf:empty, .term-out .nf:has(.art + span:empty) { display: none; } }
  .game-tools { display: flex; gap: 8px; align-items: center; }
  .game-mute { height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(255,255,255,.14); color: #fff; font: 600 .875rem 'Onest'; cursor: pointer; }
  .game-mute:hover { background: rgba(255,255,255,.26); }

  /* Seasonal touches in the room */
  .bat { animation: bat 2.4s ease-in-out infinite; }
  @keyframes bat { 50% { transform: translate(var(--bx, 6px), -3px); } }
  .bat path { animation: flap .35s steps(2) infinite; transform-origin: center; transform-box: fill-box; }
  @keyframes flap { 50% { transform: scaleY(.45); } }
  .burst { animation: burst 3.2s ease-out infinite; transform-box: fill-box; transform-origin: center; opacity: 0; }
  @keyframes burst { 0% { transform: scale(.1); opacity: 0; } 8% { opacity: 1; } 45% { transform: scale(1.15); opacity: 0; } 100% { opacity: 0; } }
  .snow { animation: snow 4s linear infinite; }
  @keyframes snow { to { transform: translate(6px, 124px); } }
  .bulb { animation: twinkle 1.8s ease-in-out infinite; }
  @keyframes twinkle { 50% { opacity: .35; } }
  @media (prefers-reduced-motion: reduce) { .bat, .bat path, .snow, .bulb { animation: none; } .burst { animation: none; opacity: 1; } }
  .game-help .text-link { color: #9DD4FF; font-size: inherit; }
