/* ═══════════════════════════════════════════════════════════
   dvphnc — layout & type after bryl-minimal (MIT, bryllim/bryl-minimal-design),
   recoloured with the original navy / blue / red palette.
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Geist Pixel';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.9.0/dist/fonts/geist-pixel/GeistPixel-Square.woff2') format('woff2');
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* light (default) */
  --bg: #ffffff;
  --bg-2: #f5f8ff;
  --ink: #003087;
  --g50: #f7f9fe;
  --g100: #eef3fc;
  --g200: rgba(0, 48, 135, 0.12);
  --g300: rgba(0, 48, 135, 0.22);
  --g400: rgba(0, 48, 135, 0.68); /* ≈4.8:1 on white, the lightest text allowed (was .56 ≈ 3.4:1) */
  --g500: rgba(0, 48, 135, 0.8);
  --accent: #0044cc;
  --accent-2: #4d9fff;
  --red: #cc0000;
  --ok: #1d7a46;
  --dot: rgba(0, 48, 135, 0.55);
  --shadow: 0 8px 22px -14px rgba(0, 32, 100, 0.28);
  --shadow-hover: 0 18px 36px -20px rgba(0, 32, 100, 0.42);

  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', monospace;
  --pixel: 'Geist Pixel', 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --side: 14rem;
  color-scheme: light;
}
html.dark {
  --bg: #001a5e;
  --bg-2: #00144a;
  --ink: #ffffff;
  --g50: rgba(255, 255, 255, 0.035);
  --g100: rgba(255, 255, 255, 0.06);
  --g200: rgba(160, 190, 255, 0.16);
  --g300: rgba(160, 190, 255, 0.28);
  --g400: rgba(200, 215, 255, 0.62);
  --g500: rgba(225, 233, 255, 0.8);
  --accent: #4d9fff;
  --accent-2: #80c0ff;
  --red: #ff4d4d;
  --ok: #5fcf8f;
  --dot: rgba(160, 200, 255, 0.42);
  /* dark: shadows nearly vanish — borders carry the edges */
  --shadow: 0 1px 2px -1px rgba(0, 6, 30, 0.35);
  --shadow-hover: 0 10px 24px -18px rgba(0, 6, 30, 0.7);
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s, color .5s;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--g300); border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* text link: underline at 25% → 100% on hover */
.tl {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 25%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s, color .2s;
}
.tl:hover { text-decoration-color: currentColor; }
/* the trailing ↗ nudges up-and-right on hover (bryl-minimal), on every link that ends in one */
a .arr { display: inline-block; transition: transform .2s var(--ease); }
a:hover .arr, a:focus-visible .arr { transform: translate(2px, -2px); }

/* micro-label register */
.micro {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--g400);
}

/* ── Sidebar (≥1024) ────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40;
  display: none; flex-direction: column;
  padding: 1.75rem 1.5rem;
  border-right: 1px solid var(--g200);
  background: var(--bg);
  transition: background-color .5s, border-color .5s;
}
.side-brand { font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: .02em; text-decoration: none; display: flex; align-items: center; min-height: 22px; }
.brand-cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.side-status { margin-top: .5rem; display: flex; align-items: center; gap: 7px; }
.side-group { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--g200); }
.side-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; text-decoration: none;
  color: var(--g400); padding: 4px 0; transition: color .2s;
}
.side-nav a::before { content: '→'; font-size: 11px; opacity: 0; width: 0; overflow: hidden; transition: opacity .2s, width .2s; }
.side-nav a:hover { color: var(--ink); }
.side-nav a.active { color: var(--ink); }
.side-nav a.active::before { opacity: 1; width: 12px; }
.side-nav .num { font-family: var(--pixel); font-size: 11px; color: var(--g400); flex-shrink: 0; width: 1.6em; } /* fixed width: "01" is narrower than "00", which nudged its label left */
.side-nav a.active .num, .side-nav a:hover .num { color: var(--g400); }
.side-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.side-links a { font-family: var(--mono); font-size: 12px; color: var(--g500); text-decoration: none; transition: color .2s; }
.side-links a:hover { color: var(--ink); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* theme: light / system / dark segmented control */
.theme-seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--g200); border-radius: 8px; }
.theme-seg button {
  width: 26px; height: 24px; border-radius: 6px; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--g400); cursor: pointer;
  transition: color .2s, background-color .2s;
}
.theme-seg button:hover { color: var(--ink); }
.theme-seg button[aria-pressed="true"] { background: var(--g100); color: var(--ink); }
.theme-seg svg { width: 14px; height: 14px; }

/* circular reveal on theme change (view transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }

/* ── Top bar (<1024) ────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 1rem;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--g200);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.menu-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--g200); background: transparent; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay-head { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.overlay nav { margin-top: 2rem; }
.overlay .side-nav a { font-size: 20px; padding: 10px 0; color: var(--g500); border-bottom: 1px solid var(--g200); }
.overlay .side-nav .num { font-size: 14px; }
.overlay-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--g200); display: flex; align-items: center; justify-content: space-between; }
.overlay-foot .theme-seg button { width: 40px; height: 34px; }
.overlay-foot .theme-seg svg { width: 16px; height: 16px; }

/* ── Main column ────────────────────────────────────────── */
.main { position: relative; }
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1rem; }
.sec { padding-top: 3.5rem; scroll-margin-top: 64px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 1.25rem; }
.sec-num { font-family: var(--pixel); font-size: 13px; color: var(--g400); letter-spacing: .02em; }
.sec-more { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--g400); text-decoration: none; transition: color .2s; }
.sec-more:hover { color: var(--ink); }
.sub-head { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--g400); margin: 1.75rem 0 .75rem; }

@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar, .overlay { display: none; }
  .main { margin-left: var(--side); }
}

/* ── Halftone motif ─────────────────────────────────────── */
.halftone {
  position: absolute; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 9px 9px;
}
.hero-dots {
  top: 0; right: 0; width: min(60%, 520px); height: 420px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 100% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 80% 70% at 100% 0%, #000 0%, transparent 70%);
  opacity: .9;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; padding-top: 3rem; }
@media (min-width: 1024px) { .hero { padding-top: 5rem; } }
.hero-grid { position: relative; display: grid; gap: 1.75rem; align-items: center; }
@media (min-width: 720px) { .hero-grid { grid-template-columns: 15rem 1fr; gap: 2.5rem; } }

/* Cut-out portrait: the backdrop is transparent in the image, so the page itself is the
   background in both themes — no frame, fill or shadow; just a soft fade where the blazer is
   cut off at the bottom. */
.portrait {
  position: relative; width: 100%; max-width: 15rem; aspect-ratio: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
/* blue duotone that follows the theme — two stacked copies of the SAME image, cross-faded */
.portrait .duo { position: absolute; inset: 0; transition: opacity .5s; }
.portrait .duo-light { filter: url(#duo-light) contrast(1.05); }
.portrait .duo-dark { filter: url(#duo-dark); opacity: 0; }
html.dark .portrait .duo-light { opacity: 0; }
html.dark .portrait .duo-dark { opacity: 1; }
/* phones: the portrait leads, large and centred (after bryllim.com's mobile hero) */
@media (max-width: 719px) { .portrait { max-width: 18rem; margin-inline: auto; } .portrait-ph span:first-child { font-size: 30px; } }
.portrait-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 9px 9px;
}
.portrait-ph span:first-child { font-family: var(--pixel); font-size: 44px; line-height: 1; }

.status { display: inline-flex; align-items: center; gap: 7px; margin-bottom: .9rem; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 50% { opacity: .25; } }

.hero-greet { display: block; min-height: 1.6em; margin-bottom: .35rem; }
.hero-name {
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(2.1rem, 5.4vw, 3rem); line-height: 1.05; letter-spacing: -.01em;
  min-height: 1.05em; display: flex; align-items: center; flex-wrap: wrap;
}
@media (max-width: 340px) { .hero-name { font-size: 1.85rem; } }
.hero-name .caret { display: inline-block; width: .5ch; height: .8em; margin-left: 4px; background: var(--ink); /* same as the name: navy in light, white in dark */ animation: blink 1s step-end infinite; }
.hero-handle { font-family: var(--mono); font-size: 13px; color: var(--g400); margin-top: .35rem; }
.hero-handle b { color: var(--accent); font-weight: 500; }

.bio { margin-top: 1.1rem; max-width: 34rem; font-size: 16px; line-height: 1.7; color: var(--g500); text-wrap: pretty; }
.bio + .bio { margin-top: .6rem; }
.bio strong { color: var(--ink); font-weight: 600; white-space: nowrap; } /* plain prose with bold highlights (Joana preferred this to inline pills) */
.nowrap { white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: 1px;
  padding: 1px 9px; border-radius: 999px;
  background: var(--g100); border: 1px solid var(--g200);
  color: var(--ink); font-weight: 600; font-size: 13.5px; line-height: 1.6; white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.chip.inv { background: var(--ink); color: var(--bg); border-color: transparent; }

.hero-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 1.25rem; font-family: var(--mono); font-size: 12px; color: var(--g500); }
.hero-links a:hover { color: var(--ink); }
/* intro profile links: a small line icon, the name in mono, ↗ when it leaves the site; muted, ink on hover */
.hero-links { align-items: center; gap: 8px 24px; margin-top: 1.4rem; font-size: 12.5px; line-height: 1; letter-spacing: .01em; }
.ic-link { display: inline-flex; align-items: center; gap: 7px; color: var(--g500); text-decoration: none; white-space: nowrap; transition: color .2s; }
.ic-link svg { width: 15px; height: 15px; flex-shrink: 0; display: block; stroke-width: 1.7; }
.ic-link .arr { font-size: 10px; margin-left: -2px; opacity: .8; transition: transform .25s var(--ease); }
@media (max-width: 480px) { .hero-links { gap: 8px 15px; font-size: 11.5px; } .ic-link { gap: 5px; } .ic-link svg { width: 14px; height: 14px; } } /* all four on one row at 375px */
.ic-link:hover .arr { transform: translate(2px, -2px); }
.ic-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
/* small text links: a taller invisible tap area (≈36px) without moving the layout */
.hero-links a, .sec-more, .event-name a, .contact-meta a, .foot a { padding-block: 10px; margin-block: -10px; }
.topbar .side-brand { display: inline-flex; align-items: center; min-height: 40px; }

/* hairline stat grids */
.cells { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--g200); margin-top: 2.5rem; }
@media (min-width: 640px) { .cells { grid-template-columns: repeat(3, 1fr); } }
.cell { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--g200); display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell + .cell { padding-left: 1rem; border-left: 1px solid var(--g200); }
@media (min-width: 640px) { .cell:nth-child(3n+1) { padding-left: 0; border-left: 0; } }
/* phones and tablets: highlights stack as full-width rows (so each subline fits on one line), the three stats stay in
   one row of three */
@media (max-width: 1023px) {
  .cells { grid-template-columns: repeat(3, 1fr); }
  .cell, .cell + .cell { padding: .8rem 0; border-left: 0; }
  .cell:not(.stat) { grid-column: 1 / -1; }
  .cell.stat { padding: .9rem .75rem; min-width: 0; }
  .cell.stat:nth-child(4) { padding-left: 0; }
  .cell.stat + .cell.stat { border-left: 1px solid var(--g200); }
  .cell-stat { font-size: 1.6rem; }
}
.cell-logo { min-width: 34px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cell-logo img { height: 24px; width: auto; max-width: 72px; object-fit: contain; }
/* every highlight's subline stays on one line (Joana, 24 Nov 2026); between phone and wide desktop the columns are
   narrow, so the sublines tighten a touch there to fit "ai & data science trainee" beside the U-Tokyo wordmark */
.cell:not(.stat) .micro { white-space: nowrap; }
@media (min-width: 1024px) and (max-width: 1279px) { .cell { gap: 10px; } .cell .micro { font-size: 9.5px; letter-spacing: .4px; } }
.cell-icon { width: 34px; height: 28px; flex-shrink: 0; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.cell-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cell-stat { display: block; font-family: var(--pixel); font-size: 1.9rem; line-height: 1; }
.cell.stat { flex-direction: column; align-items: flex-start; gap: 6px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(to bottom, var(--g50), var(--bg));
  border: 1px solid var(--g200); border-radius: 16px;
  padding: 1.25rem; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: box-shadow .35s var(--ease), transform .42s var(--ease), border-color .2s;
}
a.card:hover, .card.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--g300); }
.grid-2 { display: grid; gap: .9rem; }
.grid-3 { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .grid-3 { grid-template-columns: 1fr; } }

.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; border: 1px solid var(--g300);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500);
  white-space: nowrap;
}
.pill.inv { background: var(--ink); color: var(--bg); border-color: transparent; }
.pill.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

/* projects: the readable cards, stacked (after fabwaseem.com). Each item sticks 12px lower than the one before, so
   the next card slides over it and they pile up; main.js sets --s (scale) on the cards underneath as they're covered. */
.proj-cards { list-style: none; --stick: 1.5rem; }
.proj-cards > li { position: sticky; top: calc(var(--stick) + var(--i, 0) * 12px); padding-bottom: 1.1rem; }
.proj-cards > li:nth-child(2) { --i: 1; } .proj-cards > li:nth-child(3) { --i: 2; } .proj-cards > li:nth-child(4) { --i: 3; }
.proj-cards > li:nth-child(5) { --i: 4; } .proj-cards > li:nth-child(6) { --i: 5; } .proj-cards > li:nth-child(7) { --i: 6; }
.proj-cards > li:last-child { padding-bottom: 0; }
.proj-cards > li:focus-within { z-index: 2; } /* a keyboard user tabbing into a covered card brings it to the front */
.proj-cards > li:focus-within .stack-card { --s: 1 !important; }
.proj-cards .stack-card { transform-origin: 50% 0; transform: scale(var(--s, 1)); will-change: transform;
  box-shadow: 0 -10px 30px -18px rgba(0, 26, 94, .28), var(--shadow); }
.proj-cards .stack-card:hover { box-shadow: 0 -10px 30px -18px rgba(0, 26, 94, .28), var(--shadow-hover); }
@media (max-width: 1023px) { .proj-cards { --stick: calc(56px + .75rem); } } /* below the sticky topbar */
@media (prefers-reduced-motion: reduce) { .proj-cards > li { position: static; } .proj-cards .stack-card { transform: none; } }
/* covered cards turn textured (Joana, 25 Nov 2026), like the event photos: the card on top of the pile stays in
   colour; main.js adds .is-tex as the next card slides over. Then the screenshot fades to its 1-bit dither
   (<shot>-dither.png, coloured by the headshot's #duo-light / #duo-dark filters) and the colourful backdrop fades to a
   fine grain in the same two blues. Mouse hover or keyboard focus brings the colour back. */
/* the backdrop's texture is a real 1-bit dither of that project's own gradient (--tex, set inline:
   <shot>-bg-dither.png, 600x375, same recipe as the event photos), coloured by the same duotone filters */
.proj-cards .pj-shot.mock::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: #002a78 var(--tex) center / cover no-repeat; filter: url(#duo-light) contrast(1.05); transition: opacity .6s var(--ease); }
html.dark .proj-cards .pj-shot.mock::before { filter: url(#duo-dark); }
.pj-dither { position: absolute; left: 0; right: 0; bottom: 0; top: 9px; width: 100%; height: calc(100% - 9px); object-fit: cover; object-position: top center;
  opacity: 0; pointer-events: none; filter: url(#duo-light) contrast(1.05); transition: opacity .6s var(--ease); }
html.dark .pj-dither { filter: url(#duo-dark); }
.proj-cards .mock-bar { transition: filter .6s var(--ease); }
.proj-cards .stack-card.is-tex .pj-shot.mock::before, .proj-cards .stack-card.is-tex .pj-dither { opacity: 1; }
.proj-cards .stack-card.is-tex .mock-bar { filter: grayscale(1); }
.proj-cards .stack-card.is-tex:focus-within .pj-shot.mock::before, .proj-cards .stack-card.is-tex:focus-within .pj-dither { opacity: 0; }
.proj-cards .stack-card.is-tex:focus-within .mock-bar { filter: none; }
@media (hover: hover) {
  .proj-cards .stack-card.is-tex:hover .pj-shot.mock::before, .proj-cards .stack-card.is-tex:hover .pj-dither { opacity: 0; }
  .proj-cards .stack-card.is-tex:hover .mock-bar { filter: none; }
}
@media (prefers-reduced-motion: reduce) { .pj-dither, .proj-cards .pj-shot.mock::before, .proj-cards .mock-bar { transition: none; } }
/* projects opener: a 3D fan of the screenshots (after anujmagar.com.np). Shown once main.js has filled it (.is-on).
   .pf-3d gives the perspective, .pf-plane is turned away (rotateY) so the tiles read as fanned pages; main.js sets
   each tile's translateZ / rotate / rotateY from the scroll position. Clipped to the column, edges faded. */
.pf { display: none; position: relative; margin-inline: calc(50% - 50vw); height: 64vh; height: 64svh; min-height: 400px; max-height: 600px; margin-bottom: 1.5rem;
  overflow-x: hidden; overflow-x: clip; overflow-y: visible; pointer-events: none; } /* clip sideways only: the fan rises over the section above as it leaves */
.pf.is-on { display: block; }
@media (min-width: 1024px) { .pf { margin-inline: calc(50% - (100vw - var(--side)) / 2); } } /* full width of the main area, past the column, like the reference */
.pf-word { position: absolute; left: 0; right: 0; top: 62%; transform: translateY(-50%); text-align: center; pointer-events: none;
  font-family: var(--pixel); font-size: clamp(3.6rem, 15vw, 9.5rem); line-height: 1; letter-spacing: -.02em; color: var(--g200); }
.pf-3d { position: absolute; inset: 0; perspective: 1000px; perspective-origin: 50% 34%; }
.pf-plane { position: absolute; left: 47%; top: 36%; width: 0; height: 0; transform-style: preserve-3d;
  transform: translate(var(--px, 0px), var(--py, 0px)) rotateX(10deg) rotateY(52deg) rotateZ(-4deg); } /* --px/--py: the drift to the top right (main.js) */
.pf-card { --fw: 15rem; position: absolute; left: calc(var(--fw) / -2); top: calc(var(--fw) / -2); width: var(--fw); height: var(--fw);
  display: flex; align-items: center; justify-content: center; transform-origin: 50% 110%;
  will-change: transform, opacity; opacity: 0;
  /* the certification card look (Joana, 18 Nov 2026): solid page colour under the faint --g50 tint (so tiles behind
     don't show through in dark mode), hairline --g200 border, 16px corners, the soft card shadow */
  background-color: var(--bg); background-image: linear-gradient(to bottom, var(--g50), var(--bg));
  border: 1px solid var(--g200); border-radius: 16px; box-shadow: 0 10px 24px -18px rgba(0, 26, 94, .3); }
/* thin edges (Joana, 18 Nov 2026): the screenshot nearly fills the tile, so each card reads like a thin sheet */
.pf-card img { width: 94%; height: 94%; object-fit: cover; object-position: top left; border-radius: 11px; display: block;
  border: 1px solid var(--g200); }
@media (max-width: 640px) { .pf { height: 46svh; min-height: 320px; } .pf-3d { perspective: 760px; perspective-origin: 50% 30%; } .pf-plane { left: 20%; top: 30%; } .pf-word { top: 53%; } .pf-card { --fw: 11rem; border-radius: 14px; } .pf-card img { border-radius: 8px; } }
.stack-card { min-height: 11rem; background: var(--bg); background-image: linear-gradient(to bottom, var(--g50), var(--bg)); box-shadow: var(--shadow); }
.stack-card:hover { border-color: var(--g300); box-shadow: var(--shadow-hover); }
.stack-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* type sizes stay the old project-card ones: meta = pill size (9.5px mono), title 17px, sentence 13.5px */
.stack-meta { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500); }
.stack-num { font-family: var(--pixel); font-size: 11px; letter-spacing: 0; color: var(--ink); }
.stack-rule { width: 22px; height: 1px; background: var(--g300); flex-shrink: 0; }

/* project rows/cards that open a case study: the whole title links there */
.pj-title a, .stack-card .proj-title a { text-decoration: none; transition: color .2s; }
.pj-title a:hover, .stack-card .proj-title a:hover { color: var(--accent); }
/* project screenshots (homepage stack + projects.html): 16:10 frame, hairline, soft radius, full colour */
.pj-shot { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; border: 1px solid var(--g200); background: var(--g100); }
.pj-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
a.pj-shot:hover img { transform: scale(1.03); }
.pj-shot.is-empty { display: flex; align-items: center; justify-content: center;
  background-color: var(--g50); background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 9px 9px; }
.pj-shot.is-empty .micro { background: var(--bg); padding: 2px 8px; border-radius: 999px; }
/* mockup (after fabwaseem.com/projects, whose pictures are pre-rendered): the screenshot sits in a small browser
   window, tilted in 3D with a soft shadow, on a blurred gradient made from the project's own colours
   (--c1 base, --c2 / --c3 glows, --win window chrome, set inline per project). Pure CSS, so any new screenshot
   gets the frame. Hover flattens the tilt a little. */
.pj-shot.mock { border-color: transparent; perspective: 1200px;
  background-color: var(--c1);
  background-image:
    radial-gradient(60% 75% at 12% 88%, color-mix(in srgb, var(--c2) 85%, transparent), transparent 70%),
    radial-gradient(55% 70% at 92% 10%, color-mix(in srgb, var(--c3) 80%, transparent), transparent 70%),
    radial-gradient(80% 90% at 70% 100%, color-mix(in srgb, var(--c2) 35%, transparent), transparent 75%);
  display: flex; align-items: center; justify-content: center; }
.pj-shot.mock::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,.10), transparent 40%); } /* soft sheen */
.mock-win { position: relative; z-index: 1; display: block; width: 72%; border-radius: 7px; overflow: hidden; background: var(--win, #fff);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 22px 40px -14px rgba(0,0,0,.55), 0 6px 14px -6px rgba(0,0,0,.35);
  /* --rx/--ry/--rz/--ty are driven by scroll (assets/js/mock.js): tilted back as it enters, settling flatter
     as it rises, then drifting on; the defaults are the resting tilt (no JS / reduced motion) */
  transform: translateY(var(--ty, 0px)) rotateX(var(--rx, 9deg)) rotateY(var(--ry, -13deg)) rotateZ(var(--rz, 2.5deg)) scale(var(--sc, 1));
  transform-origin: 50% 50%;
  transition: transform .7s var(--ease), box-shadow .7s var(--ease); }
.mock-follow .mock-win { transition: box-shadow .7s var(--ease); } /* mock.js eases the cursor-follow tilt itself */.mock-bar { display: block; height: 9px; background: color-mix(in srgb, var(--win, #fff) 92%, #888);
  background-image: radial-gradient(circle at 7px 4.5px, #ff5f57 2px, transparent 2.4px), radial-gradient(circle at 14px 4.5px, #febc2e 2px, transparent 2.4px), radial-gradient(circle at 21px 4.5px, #28c840 2px, transparent 2.4px); }
.pj-shot.mock img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; transition: none; }
a.pj-shot.mock:hover img { transform: none; }
a.pj-shot.mock:hover .mock-win { --sc: 1.04; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 28px 50px -16px rgba(0,0,0,.6), 0 8px 18px -8px rgba(0,0,0,.35); }
@media (prefers-reduced-motion: reduce) { .pj-shot img, .mock-win { transition: none; } a.pj-shot:hover img { transform: none; } }
/* stacked card with its screenshot: text left, picture right; picture on top on phones */
.stack-card { display: grid; grid-template-columns: 1fr 15rem; gap: 1.4rem; align-items: center; }
.stack-text { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.stack-text .proj-desc { flex: 1; }
@media (max-width: 640px) {
  .stack-card { grid-template-columns: 1fr; gap: 1rem; }
  .stack-shot { order: -1; }
}

/* projects */
.proj-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.proj-title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin-top: .9rem; }
.proj-role { margin-top: 2px; }
.proj-desc { font-size: 13.5px; color: var(--g500); margin-top: .5rem; flex: 1; }
.proj-stack { margin-top: .9rem; font-family: var(--mono); font-size: 11px; color: var(--g400); }
.proj-links { display: flex; gap: 16px; margin-top: .9rem; padding-top: .3rem; border-top: 1px solid var(--g200); font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.proj-links a { text-decoration: none; color: var(--g500); display: inline-flex; align-items: center; gap: 4px; min-height: 32px; transition: color .2s; } /* 32px tall so they're easy to tap */
.proj-links .muted { display: inline-flex; align-items: center; min-height: 32px; }
.proj-links a:hover { color: var(--ink); }
.proj-links a .arr { display: inline-block; transition: transform .2s; }
.proj-links a:hover .arr { transform: translate(2px, -2px); }
.proj-links .muted { color: var(--g400); }

/* ── Timeline (experience) ─────────────────────────────── */
.rows { list-style: none; border-top: 1px solid var(--g200); }
.row { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--g200); }
.row-year { font-family: var(--pixel); font-size: 14px; color: var(--g400); padding-top: 1px; white-space: nowrap; }
.row-title { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.row-org { font-size: 13px; color: var(--g500); }
.row-note { font-size: 13px; color: var(--g400); margin-top: .25rem; }
/* one row per organisation: the org is .row-title, each position is a .row-role line under it */
.row-role { font-size: 13px; line-height: 1.5; color: var(--g500); }
.row-role b { font-weight: 500; color: var(--ink); }
.row-role + .row-role { margin-top: .2rem; }
.row-side { display: flex; align-items: center; gap: 12px; }
.row-logo { width: 34px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.row-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.row-logo img[src*="utokyo"] { max-width: none; width: 40px; } /* wordmark: let it run a little wider than the square marks */
.row-logo.wide img, .row-logo.wide .logo-svg { max-width: none; width: 40px; height: auto; } /* wordmarks (Oracle, IBM) on certifications.html */
.row-logo .logo-svg { display: block; color: var(--ink); }
/* certifications.html: list / stack switch (two pills, the active one filled with ink) */
.view-switch { display: inline-flex; gap: 4px; padding: 3px; margin: .9rem 0 1.5rem; border: 1px solid var(--g200); border-radius: 999px; }
.view-switch button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500); transition: background .2s, color .2s; }
.view-switch button svg { width: 14px; height: 14px; }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.view-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cert-view[hidden] { display: none; }
/* stack view: square cert cards (the homepage's first layout): three to a row, two on phones */
#view-stack .cert-grid { margin: .25rem 0 2.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
@media (max-width: 639px) { #view-stack .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#view-stack .cert { min-width: 0; overflow-wrap: anywhere; }
#view-stack .cert-logo { max-width: 100%; }
#view-stack .cert-logo img { height: 26px; width: auto; max-width: 100%; }
#view-stack .cert-logo.wide img { height: 18px; }
#view-stack .cert-logo.pair img { height: 15px; max-width: 46%; }
.row-icon { color: var(--ink); }
@media (max-width: 719px) { .row { grid-template-columns: 4rem 1fr; gap: .6rem; } .row-side { gap: 10px; } } /* 4rem fits "2021-22" on one line */

/* Experience, framed like bryllim.com: year · role · organisation (right-aligned), hairline rows, faint hover tint.
   Scroll timeline on top: a thin line down the left fills with ink as you scroll through the list, and each row's
   small square marker, year and role go from muted to full strength when the row reaches 55% down the screen.
   Without JS or under reduced motion (.tl-on is never added) everything shows fully lit. Muted text stays at
   --g400 / --g500, so nothing is ever unreadable or hidden. */
.rows.timeline { position: relative; --tl: 1; }
.rows.timeline::before, .rows.timeline::after { content: ''; position: absolute; left: 4px; top: 0; width: 1px; pointer-events: none; }
.rows.timeline::before { bottom: 0; background: var(--g200); }
.rows.timeline::after { height: calc(var(--tl) * 100%); background: var(--ink); }
.rows.timeline .row { position: relative; padding-left: 24px; grid-template-columns: 4.5rem 1fr auto; align-items: baseline; transition: background-color .2s; }
.rows.timeline .row::before { content: ''; position: absolute; left: 0; top: calc(.95rem + 6px); width: 9px; height: 9px; border-radius: 2px; box-sizing: border-box;
  border: 1px solid var(--ink); background: var(--ink); box-shadow: 0 0 0 3px var(--bg); transition: background-color .35s var(--ease), border-color .35s var(--ease); }
.rows.timeline .row-org { text-align: right; }
.row-then { font-weight: 400; color: var(--g500); }
.rows.timeline .row-year { color: var(--ink); }
.rows.timeline .row-year, .rows.timeline .row-title { transition: color .35s var(--ease); }
.tl-on .row:not(.lit)::before { background: var(--bg); border-color: var(--g300); }
.tl-on .row:not(.lit) .row-year { color: var(--g400); }
.tl-on .row:not(.lit) .row-title { color: var(--g500); }
@media (hover: hover) { .rows.timeline .row:hover { background: var(--g50); } } /* bryl's faint hover tint */
/* phones: the organisation drops under the role (bryl's col-span-12) */
@media (max-width: 719px) { .rows.timeline .row { grid-template-columns: 4rem 1fr; row-gap: .15rem; } .rows.timeline .row-org { grid-column: 2; text-align: left; } }

/* ── Globe (retained) ───────────────────────────────────── */
#globe-section { display: flex; justify-content: center; padding: .5rem 0 1rem; }
#globe-container { position: relative; width: 460px; height: 460px; max-width: 100%; cursor: grab; user-select: none; touch-action: pan-y; }
#globe-container:active { cursor: grabbing; }
#globe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#globe-icons { position: absolute; inset: 0; pointer-events: none; }
.skill-icon { position: absolute; display: flex; flex-direction: column; align-items: center; pointer-events: all; cursor: pointer; transform: translate(-50%, -50%); }
/* icons are monochrome in the theme ink at rest, and show their own brand colour on hover */
.skill-icon .icon-badge { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; color: #fff; opacity: .38; transition: color .22s, opacity .22s, filter .22s; }
html:not(.dark) .skill-icon .icon-badge { color: var(--ink); opacity: .55; }
.skill-icon .icon-badge svg { width: 32px; height: 32px; transition: transform .22s; }
.skill-icon.hot .icon-badge { color: var(--brand, var(--accent)); opacity: 1; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--brand, #4d9fff) 55%, transparent)); }
html:not(.dark) .skill-icon.hot .icon-badge { color: var(--ink); } /* light brand colours (e.g. JS yellow) vanish on white — keep ink, glow in brand colour */
.skill-icon.hot .icon-badge svg { transform: scale(1.22); }
.skill-icon.hot .icon-label { opacity: 1; }
.skill-icon .icon-label { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #fff; white-space: nowrap; background: rgba(0, 10, 40, .9); padding: 3px 9px; border-radius: 6px; border: 1px solid rgba(77, 159, 255, .3); margin-top: 4px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.skill-icon:hover .icon-label { opacity: 1; }
.skill-icon.behind { opacity: .12 !important; filter: blur(1.5px) !important; pointer-events: none; }
@media (max-width: 600px) { #globe-container { width: 320px; height: 320px; } .skill-icon .icon-badge { width: 34px; height: 34px; } .skill-icon .icon-badge svg { width: 24px; height: 24px; } }

.stack-list { display: grid; gap: 0; border-top: 1px solid var(--g200); }
.stack-row { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--g200); align-items: baseline; }
.stack-row p { font-size: 13.5px; color: var(--g500); }

/* ── Certifications ─────────────────────────────────────── */
.cert { align-items: center; text-align: center; padding: 1.4rem 1rem 1.1rem; }
.cert-logo { height: 34px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.cert-logo img { height: 100%; width: auto; max-width: 110px; object-fit: contain; }
.cert-logo.wide img { height: 22px; } /* wordmarks sit smaller so they carry the same weight as square marks */
.cert-logo .logo-svg { height: 22px; width: auto; aspect-ratio: 24 / 9.4; color: var(--ink); }
.cert-name { font-size: 14px; font-weight: 600; line-height: 1.35; margin-top: .9rem; letter-spacing: -.01em; }
.cert-issuer { margin-top: .35rem; }
.cert-meta { margin-top: .2rem; font-family: var(--mono); font-size: 10.5px; color: var(--g400); }
.cert-verify { margin-top: auto; padding-top: .9rem; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500); transition: color .2s; }
a.cert:hover .cert-verify { color: var(--accent); }
.cert .pill { margin-top: .6rem; }
/* phones: compact, left-aligned cards (logo · verify on top, then name, issuer, date) instead of tall centred ones */
@media (max-width: 639px) {
  .cert {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo verify" "name name" "issuer issuer" "meta meta";
    align-items: center; text-align: left; padding: .95rem 1.1rem 1rem;
  }
  .cert-logo { grid-area: logo; height: 20px; justify-content: flex-start; gap: 10px; }
  .cert-logo.wide img, .cert-logo .logo-svg { height: 14px; }
  .cert-name { grid-area: name; margin-top: .7rem; }
  .cert-issuer { grid-area: issuer; margin-top: .3rem; }
  .cert-meta { grid-area: meta; }
  .cert-verify { grid-area: verify; margin-top: 0; padding-top: 0; }
}
/* certifications.html stack view: keep the tall centred square card on phones too (after the compact rule above) */
#view-stack .cert { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.2rem 1rem; }
#view-stack .cert-logo { height: 30px; justify-content: center; }
#view-stack .cert-logo .logo-svg { height: 18px; }
#view-stack .cert-name { margin-top: .9rem; }
#view-stack .cert-verify { margin-top: 0; padding-top: .9rem; }
@media (max-width: 639px) {
  #view-stack .cert-grid { gap: .6rem; }
  #view-stack .cert { padding: .8rem .6rem; }
  #view-stack .cert-logo { height: 22px; }
  #view-stack .cert-logo img { height: 22px; }
  #view-stack .cert-logo.wide img, #view-stack .cert-logo .logo-svg { height: 14px; }
  #view-stack .cert-logo.pair img { height: 12px; }
  #view-stack .cert-name { font-size: 12.5px; margin-top: .6rem; }
  #view-stack .cert-meta { font-size: 9.5px; }
  #view-stack .cert-verify { padding-top: .6rem; font-size: 9px; }
}

/* Certification deck (after bryllim.com's projects deck): every certification and training card in one fanned deck.
   Slot 0 is the front card; 1/2 tilt out left/right behind it, 3/4 fan out further, 5/6 peek over the top.
   main.js swaps a back card with the front on click or keyboard focus and sizes the deck to its tallest card. */
.cert-fan { position: relative; height: 18rem; margin-top: .5rem; }
.cert-fan { touch-action: pan-y; } /* vertical page scroll stays native; sideways drags are swipes (main.js) */
.fan-card { position: absolute; left: 50%; top: 58px; width: min(15rem, 46%); min-height: 12.5rem;
  background-color: var(--bg); background-image: linear-gradient(to bottom, var(--g50), var(--bg)); /* solid, so back cards don't show through */
  /* --dx / --dr: the finger drag on the front card while swiping (main.js), 0 otherwise */
  transform: translateX(-50%) translateX(var(--dx, 0px)) rotate(var(--dr, 0deg)) var(--fan, none); transform-origin: 50% 90%;
  transition: transform .55s var(--ease), box-shadow .35s var(--ease), border-color .2s; }
.fan-card.is-drag { transition: box-shadow .35s var(--ease), border-color .2s; }
.fan-card { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
/* --fan is added to the centring translateX(-50%) */
.fan-card[data-slot="0"] { --fan: translateY(0) rotate(0deg); z-index: 7; }
.fan-card[data-slot="1"] { --fan: translateX(-42%) translateY(8px) rotate(-7deg) scale(.93); z-index: 6; }
.fan-card[data-slot="2"] { --fan: translateX(42%) translateY(8px) rotate(7deg) scale(.93); z-index: 5; }
.fan-card[data-slot="3"] { --fan: translateX(-82%) translateY(22px) rotate(-13deg) scale(.86); z-index: 4; }
.fan-card[data-slot="4"] { --fan: translateX(82%) translateY(22px) rotate(13deg) scale(.86); z-index: 3; }
.fan-card[data-slot="5"] { --fan: translateX(-14%) translateY(-34px) rotate(-3deg) scale(.88); z-index: 2; }
.fan-card[data-slot="6"] { --fan: translateX(14%) translateY(-46px) rotate(3deg) scale(.84); z-index: 1; }
/* 7/8 (added 24 Nov 2026, Vjal + DICT): peek out between the wide pair and the top pair, furthest back */
.fan-card[data-slot="7"] { --fan: translateX(-60%) translateY(-14px) rotate(-10deg) scale(.82); z-index: 0; }
.fan-card[data-slot="8"] { --fan: translateX(60%) translateY(-14px) rotate(10deg) scale(.82); z-index: 0; }
.cert-fan:hover .fan-card[data-slot="7"] { --fan: translateX(-70%) translateY(-20px) rotate(-12deg) scale(.82); }
.cert-fan:hover .fan-card[data-slot="8"] { --fan: translateX(70%) translateY(-20px) rotate(12deg) scale(.82); }
.fan-card:not([data-slot="0"]) { cursor: pointer; }
.cert-fan:hover .fan-card[data-slot="1"] { --fan: translateX(-48%) translateY(5px) rotate(-9deg) scale(.93); }
.cert-fan:hover .fan-card[data-slot="2"] { --fan: translateX(48%) translateY(5px) rotate(9deg) scale(.93); }
.cert-fan:hover .fan-card[data-slot="3"] { --fan: translateX(-92%) translateY(20px) rotate(-16deg) scale(.86); }
.cert-fan:hover .fan-card[data-slot="4"] { --fan: translateX(92%) translateY(20px) rotate(16deg) scale(.86); }
.cert-fan:hover .fan-card[data-slot="5"] { --fan: translateX(-16%) translateY(-42px) rotate(-4deg) scale(.88); }
.cert-fan:hover .fan-card[data-slot="6"] { --fan: translateX(16%) translateY(-54px) rotate(4deg) scale(.84); }
.fan-card:not([data-slot="0"]) .cert-verify { opacity: 0; } /* only the front card says verify */
a.fan-card:hover { transform: translateX(-50%) translateX(var(--dx, 0px)) rotate(var(--dr, 0deg)) var(--fan, none); } /* no 2px lift: the fan moves instead */
.fan-card[data-slot="0"]:hover { --fan: translateY(-3px); }
.fan-count { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
@media (max-width: 767px) {
  .fan-card { width: 78%; min-height: 0; top: 44px; }
  .fan-card[data-slot="1"] { --fan: translateX(-8%) translateY(8px) rotate(-4deg) scale(.95); }
  .fan-card[data-slot="2"] { --fan: translateX(8%) translateY(8px) rotate(4deg) scale(.95); }
  .fan-card[data-slot="3"] { --fan: translateX(-12%) translateY(16px) rotate(-7deg) scale(.9); }
  .fan-card[data-slot="4"] { --fan: translateX(12%) translateY(16px) rotate(7deg) scale(.9); }
  .fan-card[data-slot="5"] { --fan: translateX(-4%) translateY(-22px) rotate(-2deg) scale(.92); }
  .fan-card[data-slot="6"] { --fan: translateX(4%) translateY(-32px) rotate(2deg) scale(.88); }
  .cert-fan:hover .fan-card[data-slot="1"] { --fan: translateX(-9%) translateY(8px) rotate(-5deg) scale(.95); }
  .cert-fan:hover .fan-card[data-slot="2"] { --fan: translateX(9%) translateY(8px) rotate(5deg) scale(.95); }
  .cert-fan:hover .fan-card[data-slot="3"] { --fan: translateX(-12%) translateY(16px) rotate(-8deg) scale(.9); }
  .cert-fan:hover .fan-card[data-slot="4"] { --fan: translateX(12%) translateY(16px) rotate(8deg) scale(.9); }
  .cert-fan:hover .fan-card[data-slot="5"] { --fan: translateX(-4%) translateY(-24px) rotate(-2deg) scale(.92); }
  .cert-fan:hover .fan-card[data-slot="6"] { --fan: translateX(4%) translateY(-34px) rotate(2deg) scale(.88); }
  .fan-card[data-slot="7"] { --fan: translateX(-10%) translateY(-10px) rotate(-6deg) scale(.86); }
  .fan-card[data-slot="8"] { --fan: translateX(10%) translateY(-10px) rotate(6deg) scale(.86); }
  .cert-fan:hover .fan-card[data-slot="7"] { --fan: translateX(-11%) translateY(-12px) rotate(-7deg) scale(.86); }
  .cert-fan:hover .fan-card[data-slot="8"] { --fan: translateX(11%) translateY(-12px) rotate(7deg) scale(.86); }
}
@media (prefers-reduced-motion: reduce) { .fan-card { transition: none; } }

.events { list-style: none; border-top: 1px solid var(--g200); }
.event { display: grid; grid-template-columns: 5rem 34px 1fr auto; gap: 14px; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--g200); }
.event-date { font-family: var(--mono); font-size: 11px; color: var(--g400); }
.event-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.event-name a { text-decoration: none; transition: color .2s; }
.event-name a:hover { color: var(--accent); }
.event-org { font-size: 12px; color: var(--g400); }
@media (max-width: 640px) {
  .event { grid-template-columns: 34px 1fr; grid-template-areas: "logo date" "logo main" "logo kind"; column-gap: 12px; row-gap: 3px; }
  .event .row-logo { grid-area: logo; align-self: start; }
  .event-date { grid-area: date; }
  .event-main { grid-area: main; }
  .event .pill { grid-area: kind; justify-self: start; }
}

/* ── Notes (SyberVault) ─────────────────────────────────── */
.notes { list-style: none; border-top: 1px solid var(--g200); }
.note a { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 14px; align-items: baseline; padding: .85rem 0; border-bottom: 1px solid var(--g200); text-decoration: none; transition: padding-left .3s var(--ease); }
.note a:hover { padding-left: 6px; }
.note-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--g400); }
.note-tag.t { color: var(--red); }
.note-title { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.note-desc { font-size: 13px; color: var(--g500); }
.note .arr { font-family: var(--mono); font-size: 12px; color: var(--g400); transition: transform .2s, color .2s; }
.note a:hover .arr { transform: translate(2px, -2px); color: var(--ink); }
/* phones: one compact line per note — tag · title (truncated) · arrow, descriptions hidden */
@media (max-width: 560px) {
  .note a { grid-template-columns: 4.25rem minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: .75rem 0; }
  .note a > div { min-width: 0; }
  .note-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .note-desc { display: none; }
}

/* ── Contact ────────────────────────────────────────────── */
.contact-card { padding: 1.5rem; }
.contact-lead { font-size: 15.5px; color: var(--g500); max-width: 32rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.1rem; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 8px;
  font-family: var(--mono); font-size: 12px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--g200); background: transparent; color: var(--ink);
  transition: background-color .2s, border-color .2s, opacity .2s;
}
.btn:hover { border-color: var(--g300); background: var(--g50); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.primary:hover { opacity: .88; background: var(--ink); }
.btn .arr { margin-left: -3px; }
/* phones: primary action full width, the other two share the next row evenly */
@media (max-width: 519px) {
  .contact-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .contact-actions .btn { justify-content: center; }
  .contact-actions .btn.primary { grid-column: 1 / -1; }
}
.contact-meta { display: grid; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--g200); font-family: var(--mono); font-size: 12px; color: var(--g500); }
@media (min-width: 640px) { .contact-meta { grid-template-columns: repeat(3, auto); justify-content: start; gap: 1.5rem; } }
.contact-meta a:hover { color: var(--ink); }

footer.foot { position: relative; margin-top: 5rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--g200); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ── Featured events: photo cards → story pages ── */
.event-feature { margin-bottom: 1.25rem; }
.event-card { padding: 0; overflow: hidden; }
.event-cover { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--g100); border-bottom: 1px solid var(--g200); }
.event-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
a.event-card:hover .event-cover img { transform: scale(1.04); }
/* slideshow: photos stacked, the .is-on one fades in over 1s; dots show which photo is up */
.event-cover[data-slides] img { position: absolute; inset: 0; opacity: 0; transition: opacity 1s var(--ease), transform .5s var(--ease); }
.event-cover[data-slides] img.is-on { opacity: 1; }
.slide-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 1; display: none; justify-content: center; gap: 5px; pointer-events: none; }
.slide-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgb(255 255 255 / .5); box-shadow: 0 0 0 1px rgb(0 0 0 / .15); transition: background-color .3s, width .3s var(--ease); }
.slide-dots i.is-on { width: 14px; border-radius: 3px; background: #fff; }
/* ── Events strip (after rolex-esto.vercel.app "Events & Gatherings") ──
   A horizontal strip of cards that drifts left to right on its own (main.js), with edge fades, ‹ › buttons and a
   "view all" grid. Each card photo is its own slideshow with a counter. Certificates sit on a pale card (.is-doc). */
.ev-controls { display: flex; gap: 6px; margin-bottom: .9rem; }
.ev-btn { min-width: 36px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--g200); background: transparent; color: var(--ink); font-family: var(--mono); font-size: 12px; cursor: pointer; transition: border-color .2s, background-color .2s; }
.ev-btn:hover { border-color: var(--g300); background: var(--g50); }
.ev-btn.ev-all { margin-left: auto; letter-spacing: 1px; text-transform: uppercase; font-size: 10.5px; }
.ev-btn.ev-all[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.ev-strip { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-inline: -4px; padding: 4px 4px 14px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
.ev-strip::-webkit-scrollbar { display: none; }
.ev-strip.is-dragging { cursor: grabbing; user-select: none; }
.ev-strip.is-dragging a, .ev-strip.is-dragging button { pointer-events: none; }
.ev-track { display: flex; gap: 14px; width: max-content; }
.ev-card { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; border: 1px solid var(--g200); border-radius: 16px; overflow: hidden; background: var(--g50); box-shadow: var(--shadow); transition: box-shadow .35s var(--ease), border-color .2s; }
.ev-card:hover { box-shadow: var(--shadow-hover); border-color: var(--g300); }
@media (max-width: 519px) { .ev-card { width: min(300px, 78vw); } }
.ev-photo { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--g100); border-bottom: 1px solid var(--g200); }
/* each slide holds two images: the textured 1-bit dither (made like the headshot, 600×375 = 2× the card, shown
   smoothly scaled so the grain stays fine) and the colour photo on top, hidden until hover / focus / centred */
.ev-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s var(--ease); }
.ev-slide.is-on { opacity: 1; }
.ev-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-slide .ev-color { opacity: 0; transition: opacity .6s var(--ease); }
/* the dither is coloured by the headshot's own SVG filters (#duo-light / #duo-dark in index.html), so the grain and
   the blues match the profile photo exactly. Hover (mouse only), keyboard focus or .is-color (the card a finger is
   touching on touch screens, main.js) fades the real colour photo in over it; untouched cards stay textured. */
.ev-slide .ev-dither { filter: url(#duo-light) contrast(1.05); }
html.dark .ev-slide .ev-dither { filter: url(#duo-dark); }
.ev-card:focus-visible .ev-color, .ev-card:has(:focus-visible) .ev-color, .ev-card.is-color .ev-color { opacity: 1; }
@media (hover: hover) { .ev-card:hover .ev-color { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ev-slide, .ev-slide .ev-color { transition: none; } }
.ev-count { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 2px 7px; border-radius: 6px; background: rgb(0 0 0 / .55); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .5px; } /* on the photo, so fixed colours */
.ev-body { flex: 1; display: flex; flex-direction: column; gap: .4rem; padding: .95rem 1.05rem 1rem; }
.ev-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--g400); }
.ev-title { font-size: 15px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; }
.ev-title a { text-decoration: none; }
.ev-title a:hover { color: var(--accent); }
.ev-desc { font-size: 13px; line-height: 1.55; color: var(--g500); }
.ev-foot { margin-top: auto; padding-top: .55rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--g200); }
.ev-foot .event-cert { padding-block: 8px; margin-block: -8px; }
.ev-more { margin-left: auto; padding-block: 8px; margin-block: -8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500); text-decoration: none; }
.ev-more:hover { color: var(--ink); }
.ev-more .arr { display: inline-block; transition: transform .2s; }
.ev-more:hover .arr { transform: translateX(3px); }
/* "view all": the strip becomes a wrapped grid of the real cards (clones hidden) and stops drifting */
#events.ev-grid .ev-strip { overflow: visible; -webkit-mask-image: none; mask-image: none; }
#events.ev-grid .ev-track { width: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
#events.ev-grid .ev-card { width: auto; }
#events.ev-grid .ev-card[data-clone] { display: none; }
#events.ev-grid [data-ev="prev"], #events.ev-grid [data-ev="next"] { visibility: hidden; }

.slides-on .slide-dots { display: flex; } /* only once main.js runs the slideshow (not under reduced motion); white because they sit on photos */
.event-cover-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 9px 9px; }
.event-card-body { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.15rem 1.1rem; }
.event-card-title { font-size: 16px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.event-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: .35rem; }
.event-card-more { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500); }
/* "‹ certificate ›" on events that issued one (same register as the cert cards' ‹ verify ›) */
.event-cert { display: inline-block; padding: 0; background: none; border: 0; cursor: pointer; text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--g500); text-decoration: none; transition: color .2s; }
.event-main .event-cert { padding-block: 8px; margin: calc(.3rem - 8px) 0 -8px; } /* .3rem gap above, with a bigger tap area that doesn't change the layout */
a.event-cert:hover, a.event-card:hover .event-cert { color: var(--accent); }
.event-card-more .arr { display: inline-block; transition: transform .2s; }
a.event-card:hover .event-card-more { color: var(--ink); }
a.event-card:hover .event-card-more .arr { transform: translateX(3px); }

/* ── Logos in ink (after bryllim.com: no tiles, single-colour marks) ── */
.ink-flood { flood-color: var(--ink); }
img.logo { filter: url(#ink); opacity: .85; transition: opacity .2s; }
img.logo-seal { filter: url(#ink-line); opacity: .9; }
a.card:hover img.logo, .event:hover img.logo, .row:hover img.logo { opacity: 1; }

/* ── Halftone through the page (after bryllim.com) ── */
/* a dotted strip opens every numbered section, fading in and out at the edges */
.sec { position: relative; padding-top: 2.25rem; }
.sec::before {
  content: ''; display: block; height: 26px; margin-bottom: 1.6rem; opacity: .55;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 13px 13px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 30%, #000 70%, transparent);
}
/* every other section: a small round cluster blooming out of the divider's right end (clear of headings and links) */
.sec:nth-of-type(odd)::after {
  content: ''; position: absolute; right: 2%; top: -10px; width: 112px; height: 112px; pointer-events: none; opacity: .5; z-index: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
          mask-image: radial-gradient(circle, #000 30%, transparent 70%);
}
.sec-head { position: relative; z-index: 1; }
/* second hero field, fading in from the bottom-left */
.hero-dots-bl {
  left: -1rem; bottom: -2rem; width: min(55%, 420px); height: 260px; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 0% 100%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 80% 80% at 0% 100%, #000 0%, transparent 70%);
}
/* dotted band above the footer */
footer.foot::before {
  content: ''; position: absolute; left: 0; right: 0; top: -44px; height: 30px; opacity: .55; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 13px 13px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 25%, #000 75%, transparent);
}

/* ── Toast ─────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); z-index: 90; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 12px; padding: 8px 14px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Entrance motion ────────────────────────────────────── */
.js .enter { opacity: 0; transform: translateY(12px); }
.js.ready .enter { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 50ms); }

/* ── Boot screen (retained) ─────────────────────────────── */
#boot-screen { position: fixed; inset: 0; z-index: 99999; background: #001a5e; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--mono); overflow: hidden; transition: opacity .6s ease; }
#boot-screen::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 70% at 20% 20%, rgba(0,48,135,.9) 0%, transparent 65%), radial-gradient(ellipse 60% 60% at 80% 80%, rgba(0,31,107,.8) 0%, transparent 65%); }
#boot-screen.fade-out { opacity: 0; pointer-events: none; }
#tetris-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; }
#tetris-board { display: grid; grid-template-columns: repeat(23, 22px); grid-template-rows: repeat(7, 22px); gap: 3px; }
@media (max-width: 580px) { #tetris-board { grid-template-columns: repeat(23, 13px); grid-template-rows: repeat(7, 13px); gap: 2px; } }
.t-cell { border-radius: 3px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.04); transition: background .1s, box-shadow .1s; }
.t-cell.drop-ghost { background: rgba(77,159,255,.22) !important; border-color: rgba(77,159,255,.38) !important; }
.t-cell.filled { background: #4d9fff; border-color: rgba(77,159,255,.55); box-shadow: 0 0 7px rgba(77,159,255,.5); }
.t-cell.filled-alt { background: #80c0ff; border-color: rgba(128,192,255,.55); box-shadow: 0 0 7px rgba(128,192,255,.45); }
.t-cell.filled-deep { background: #2255dd; border-color: rgba(34,85,221,.55); box-shadow: 0 0 7px rgba(34,85,221,.5); }
.t-cell.land-flash { background: #fff !important; border-color: #fff !important; box-shadow: 0 0 20px rgba(255,255,255,.9) !important; transition: background .04s, box-shadow .04s !important; }
#boot-tagline { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,0); transition: color .7s; }
#boot-tagline.show { color: rgba(255,255,255,.4); }

/* photo viewer: bryl-minimal modal recipe, ink at 30% + strong blur, panel fades and scales 95% → 100% over 200ms */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem;
  background: color-mix(in srgb, var(--ink) 30%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transition: opacity .2s var(--ease); }
html.dark .lightbox { background: rgb(0 0 0 / .45); }
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-img { max-width: 100%; max-height: 100%; border-radius: 16px; box-shadow: 0 40px 90px -20px rgb(0 0 0 / .35); transform: scale(.95); transition: transform .2s var(--ease); }
.lightbox.open .lb-img { transform: none; }
.lb-btn { position: absolute; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--g300); background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 16px; cursor: pointer; transition: border-color .2s; }
.lb-btn:hover { border-color: var(--ink); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1.1rem; left: 0; right: 0; text-align: center; color: var(--ink); } /* ink, so it stays readable on the tinted overlay in light mode */
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: .7rem; transform: none; } }

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .enter { opacity: 1; transform: none; }
}

/* bigger tap area on title links (inline padding grows the hit area without moving the layout) */
.ev-title a, .stack-card .proj-title a, .pj-title a { padding-block: 6px; }
