/* ============================================================
   Ayyan Hashmi — Portfolio
   Editorial index + per-project scene transformation + auto-demo
   ============================================================ */

:root {
  --paper: #e9e3d6;
  --ink: #1c1a16;
  --ink-soft-op: #575247;
  --ink-faint: #8f8977;
  --rule: #cfc7b5;
  --grid: rgba(28, 26, 22, 0.045);
  --grid-strong: rgba(28, 26, 22, 0.075);
  --accent: #a9552a;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 780px;
}

/* per-project accent for list text */
body[data-project="vex"]      { --accent: #2f6f6b; }
body[data-project="hourglass"]{ --accent: #b6612f; }
body[data-project="arcline"]  { --accent: #3f6fd4; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body { height: 100%; }
body {
  font-family: var(--mono);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  overflow: hidden;                 /* the canvas scales to fit — no page scroll */
  background-color: var(--paper);   /* letterbox fill around the canvas */
}

/* ============================================================
   Fixed design canvas (2560×1270) — scaled to fit any viewport.
   The whole composition lives here so it looks identical on every
   screen, just larger or smaller. Scale is set by main.js (--fit).
   ============================================================ */
#canvas {
  position: absolute;
  top: 50%; left: 50%;
  width: 2560px; height: 1270px;
  transform: translate(-50%, -50%) scale(var(--fit, 1));
  transform-origin: center center;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px;
  transition: background-color 0.6s var(--ease);
}
#canvas::before {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,250,240,0.5), transparent 55%),
    radial-gradient(100% 90% at 50% 120%, rgba(28,26,22,0.06), transparent 55%);
}

/* ============================================================
   Nerve connectors
   ============================================================ */
#nerves {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none; overflow: visible;   /* under the scene images */
  opacity: 0.5;   /* keep the fibers subtle */
}
#nerves path { fill: none; stroke-linecap: round; filter: drop-shadow(0 0 3px currentColor); }
#nerves circle { filter: drop-shadow(0 0 3px currentColor); }

/* ============================================================
   Scene stage — full-screen per-project transformation
   ============================================================ */
.stage { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.scene {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 0.75s var(--ease), visibility 0.75s;
}
.scene.on { opacity: 1; visibility: visible; }

.scene-grad { position: absolute; inset: 0; transition: opacity 0.8s var(--ease); }
.scene[data-scene="vex"] .scene-grad {
  background:
    radial-gradient(80% 70% at 85% 15%, rgba(47,111,107,0.30), transparent 60%),
    radial-gradient(70% 70% at 8% 92%, rgba(47,111,107,0.20), transparent 62%),
    radial-gradient(120% 120% at 50% 120%, rgba(20,60,58,0.16), transparent 60%);
}
.scene[data-scene="hourglass"] .scene-grad {
  background:
    radial-gradient(80% 70% at 82% 18%, rgba(200,120,50,0.30), transparent 60%),
    radial-gradient(70% 70% at 10% 90%, rgba(182,97,47,0.20), transparent 62%),
    radial-gradient(120% 120% at 50% 120%, rgba(120,60,20,0.14), transparent 60%);
}
.scene[data-scene="arcline"] .scene-grad {
  background:
    radial-gradient(80% 70% at 84% 16%, rgba(63,111,212,0.30), transparent 60%),
    radial-gradient(70% 70% at 10% 90%, rgba(63,111,212,0.18), transparent 62%),
    radial-gradient(120% 120% at 50% 120%, rgba(30,50,120,0.14), transparent 60%);
}

/* Big ghost number */
.scene-num {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  font-family: var(--serif); font-weight: 600;
  font-size: 584px; line-height: 1;
  color: rgba(28,26,22,0.05);
  transition: transform 1.1s var(--ease), opacity 0.8s;
  opacity: 0;
}
.scene.on .scene-num { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* effects layer (procedural art in the left margin) */
.scene-fx {
  position: absolute; top: 50%; left: 150px;
  transform: translateY(-50%) scale(0.86);
  width: 260px; height: 260px;
  opacity: 0; transition: opacity 0.7s var(--ease) 0.1s, transform 0.9s var(--ease) 0.1s;
}
.scene.on .scene-fx { opacity: 1; transform: translateY(-50%) scale(1); }

/* ---- VEX field ---- */
.fx-vex {
  border: 1px solid rgba(47,111,107,0.25);
  background:
    linear-gradient(rgba(47,111,107,0.10) 1px, transparent 1px) 0 0 / 100% 26px,
    linear-gradient(90deg, rgba(47,111,107,0.10) 1px, transparent 1px) 0 0 / 26px 100%;
}
.vex-path {
  position: absolute; inset: 16%;
  border: 1.5px dashed rgba(47,111,107,0.6);
  border-radius: 44% 56% 52% 48%;
  animation: spin 16s linear infinite;
}
.vex-path-2 { inset: 30%; border-style: dotted; opacity: 0.6; animation-duration: 22s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.vex-bot {
  position: absolute; top: 46%; left: 46%;
  width: 20px; height: 20px; border-radius: 4px;
  background: #2f6f6b; box-shadow: 0 0 22px rgba(47,111,107,0.9);
  animation: orbit 5s var(--ease) infinite;
}
@keyframes orbit {
  0%,100% { transform: translate(-42px,-26px) rotate(0deg); }
  50% { transform: translate(44px,30px) rotate(180deg); }
}
.vex-node { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #2f6f6b; opacity: 0.7; }
.vex-node.n1 { top: 12%; left: 16%; } .vex-node.n2 { top: 74%; left: 80%; }
.vex-node.n3 { top: 22%; left: 82%; } .vex-node.n4 { top: 80%; left: 24%; }

/* ---- Hourglass ---- */
.fx-hourglass { display: flex; align-items: center; justify-content: center; }
.hg-frame { position: relative; width: 120px; height: 190px; }
.hg-top, .hg-bottom {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 60px solid transparent; border-right: 60px solid transparent;
}
.hg-top { top: 0; border-top: 86px solid rgba(182,97,47,0.85); }
.hg-bottom { bottom: 0; border-bottom: 86px solid rgba(182,97,47,0.45); }
.hg-neck { position: absolute; top: 50%; left: 50%; width: 4px; height: 20px; background: rgba(182,97,47,0.9); transform: translate(-50%,-50%); }
.hg-grain {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 3px; border-radius: 2px; background: #b6612f;
  top: 92px; animation: fall 1.3s linear infinite;
}
.hg-grain.g2 { animation-delay: 0.45s; } .hg-grain.g3 { animation-delay: 0.9s; }
@keyframes fall {
  0% { height: 4px; opacity: 0; top: 88px; }
  30% { opacity: 1; }
  100% { height: 14px; opacity: 0; top: 150px; }
}

/* ---- ArcLine ---- */
.fx-arcline { display: flex; align-items: flex-end; justify-content: center; }
.arc {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  border: 1.5px solid rgba(75,87,176,0.6); border-bottom: none;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.arc.a1 { width: 60px; height: 46px; }
.arc.a2 { width: 120px; height: 92px; opacity: 0.55; }
.arc.a3 { width: 180px; height: 138px; opacity: 0.38; }
.arc.a4 { width: 240px; height: 184px; opacity: 0.22; }
.arc-line { position: absolute; bottom: 30px; left: 0; width: 100%; height: 1.5px; background: rgba(75,87,176,0.8); }
.scene.on .arc { animation: arcpulse 3s var(--ease) infinite; }
.arc.a2 { animation-delay: 0.2s; } .arc.a3 { animation-delay: 0.4s; } .arc.a4 { animation-delay: 0.6s; }
@keyframes arcpulse { 0%,100% { transform: translateX(-50%) scaleY(1); } 50% { transform: translateX(-50%) scaleY(1.06); } }

/* ---- Media frame (image slot, right margin) ---- */
.scene-media {
  position: absolute; top: 50%; right: 120px;
  transform: translateY(-50%) translateX(30px);
  width: 400px;
  opacity: 0; transition: opacity 0.7s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
}
.scene.on .scene-media { opacity: 1; transform: translateY(-50%) translateX(0); }
.scene.on .scene-media { pointer-events: auto; }   /* GitHub link clickable when pinned/active */
.media-frame {
  width: 280px; height: 200px; position: relative;
  border: 1px solid var(--rule);
  background: rgba(255,252,245,0.35);
  backdrop-filter: blur(2px);
  box-shadow: 0 30px 60px -30px rgba(28,26,22,0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden;
}
.media-frame.media-phone { width: 150px; height: 300px; border-radius: 22px; }

/* ---- Windowed screenshot frame (Vex) ---- */
.media-head {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 15px; color: #2f6f6b;
}
.proj-logo svg { width: 38px; height: 38px; display: block; }
.proj-logo img { width: 40px; height: 40px; border-radius: 9px; display: block; }

/* ---- Standalone logo badge (left column, nerve target) ---- */
.scene-logo {
  position: absolute; left: 150px; top: 15%;
  width: 104px; height: 104px; border-radius: 18px;
  box-shadow: 0 18px 40px -16px rgba(13,24,38,0.6), 0 0 60px -14px rgba(47,111,107,0.5);
  opacity: 0; transform: translateY(14px) scale(0.92);
  transition: opacity 0.7s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}
.scene.on .scene-logo { opacity: 1; transform: none; }
.scene-logo img { width: 100%; height: 100%; display: block; border-radius: 18px; }
.proj-name {
  display: flex; flex-direction: column;
  font-family: var(--serif); font-size: 1.1rem; line-height: 1.05; color: var(--ink);
}
.proj-name small {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 5px;
}
/* ---- Big standalone GitHub button (left side) ---- */
.scene-github {
  position: absolute; left: 150px; top: 50%;
  transform: translateY(180px);
  display: inline-flex; align-items: center; gap: 20px;
  text-decoration: none; color: #2f6f6b;
  opacity: 0; transition: opacity 0.7s var(--ease) 0.2s, transform 0.9s var(--ease) 0.2s;
}
.scene.on .scene-github { opacity: 1; pointer-events: auto; }
.gh-icon {
  flex-shrink: 0;
  width: 88px; height: 88px; border-radius: 20px;
  display: grid; place-items: center;
  border: 1px solid rgba(47,111,107,0.4);
  background: rgba(255,252,245,0.35);
  box-shadow: 0 16px 38px -16px rgba(47,111,107,0.6);
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.gh-icon svg { width: 48px; height: 48px; display: block; }
.gh-label {
  display: flex; flex-direction: column; align-items: flex-end; text-align: right;
  font-family: var(--serif); font-size: 1.3rem; color: var(--ink); line-height: 1.1;
}
.gh-label small {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 6px;
}
.scene-github:hover .gh-icon {
  transform: translateY(-3px);
  background: #2f6f6b; border-color: #2f6f6b; color: #f4f1ea;
  box-shadow: 0 18px 40px -14px rgba(47,111,107,0.8);
}

.media-frame.media-window {
  width: 400px; height: auto; padding: 0; display: block;
  background: #0c1114;
  border: 1px solid rgba(47,111,107,0.35);
  border-radius: 13px; overflow: hidden;
  backdrop-filter: none;
  box-shadow:
    0 24px 55px -20px rgba(0,0,0,0.7),
    0 0 85px -12px rgba(47,111,107,0.55);
}
.media-window .win-bar, .hg-thumb .win-bar {
  height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 13px;
  background: rgba(255,255,255,0.035); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.media-window .win-bar i, .hg-thumb .win-bar i { width: 8px; height: 8px; border-radius: 50%; background: #39454e; }
.media-window .win-bar span, .hg-thumb .win-bar span {
  margin-left: 9px; font-family: var(--mono); font-size: 0.58rem;
  letter-spacing: 0.12em; color: #7c8894;
}
.media-frame.media-window img {
  position: static; inset: auto;
  display: block; width: 100%; height: auto; object-fit: fill;
}

/* ---- Short description card (under the screenshot) ---- */
.media-desc {
  margin-top: 16px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: rgba(255, 252, 245, 0.55);
  backdrop-filter: blur(3px);
  padding: 15px 18px;
  box-shadow: 0 20px 44px -28px rgba(28, 26, 22, 0.55);
}
.desc-label {
  display: block; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px;
}
.media-desc p {
  font-family: var(--serif); font-size: 0.98rem; line-height: 1.45; color: var(--ink-soft-op);
}

/* ============================================================
   Hourglass scene — amber theming + gallery pieces
   ============================================================ */
.scene[data-scene="hourglass"] .media-head { color: #b6612f; }
.scene[data-scene="hourglass"] .media-frame.media-window {
  border-color: rgba(182,97,47,0.35);
  box-shadow: 0 24px 55px -20px rgba(0,0,0,0.7), 0 0 85px -12px rgba(182,97,47,0.5);
}
.scene[data-scene="hourglass"] .scene-logo {
  box-shadow: 0 18px 40px -16px rgba(13,24,38,0.6), 0 0 60px -14px rgba(182,97,47,0.5);
}
.hg-logo { top: 6%; }

/* wider project panel + bigger main window on the right */
.scene[data-scene="hourglass"] .scene-media { width: 640px; }
.media-frame.media-window.hg-main { width: 640px; }

/* floating pill, now on the right above the app window */
.hg-pill-r {
  width: 400px; margin: 4px 0 18px;
  filter: drop-shadow(0 16px 30px rgba(0,0,0,0.4));
}
.hg-pill-r img { width: 100%; display: block; }

/* framed thumbnails (records, auto-switch) — bigger, on the left */
.hg-thumb {
  border-radius: 12px; overflow: hidden;
  background: #0c0f18; border: 1px solid rgba(182,97,47,0.3);
  box-shadow: 0 22px 50px -22px rgba(0,0,0,0.7), 0 0 70px -16px rgba(182,97,47,0.4);
}
.hg-thumb img { display: block; width: 100%; }

.hg-records {
  position: absolute; left: 150px; top: 20%; width: 580px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.7s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}
.scene.on .hg-records { opacity: 1; transform: none; pointer-events: auto; }

.hg-auto {
  position: absolute; left: 150px; top: 49%; width: 580px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.7s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}
.scene.on .hg-auto { opacity: 1; transform: none; pointer-events: auto; }
.hg-auto-shot img { width: 100%; height: auto; display: block; aspect-ratio: 803 / 640; }
.hg-caption {
  margin-top: 14px; max-width: 580px;
  font-family: var(--serif); font-size: 1rem; line-height: 1.4; color: var(--ink-soft-op);
}

/* GitHub button inside the Hourglass panel */
.panel-git {
  display: inline-flex; align-items: center; gap: 16px;
  margin-top: 24px; text-decoration: none; color: #b6612f;
}
.pg-icon {
  width: 58px; height: 58px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(182,97,47,0.4);
  background: rgba(255,252,245,0.4);
  box-shadow: 0 12px 30px -14px rgba(182,97,47,0.6);
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
}
.pg-icon svg { width: 30px; height: 30px; display: block; }
.pg-text {
  display: flex; flex-direction: column;
  font-family: var(--serif); font-size: 1.15rem; color: var(--ink); line-height: 1.1;
}
.pg-text small {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em;
  color: var(--ink-faint); margin-top: 6px;
}
.panel-git:hover .pg-icon {
  transform: translateY(-3px) scale(1.05);
  background: #b6612f; color: #f4f1ea; border-color: #b6612f;
}

/* ============================================================
   ArcLine scene — blue theming + gallery pieces
   ============================================================ */
.scene[data-scene="arcline"] .media-head { color: #3f6fd4; }
.scene[data-scene="arcline"] .media-frame.media-window {
  border-color: rgba(63,111,212,0.35);
  box-shadow: 0 24px 55px -20px rgba(0,0,0,0.7), 0 0 85px -12px rgba(63,111,212,0.5);
}
.scene[data-scene="arcline"] .panel-git { color: #3f6fd4; }
.scene[data-scene="arcline"] .pg-icon {
  border-color: rgba(63,111,212,0.4);
  box-shadow: 0 12px 30px -14px rgba(63,111,212,0.6);
}
.scene[data-scene="arcline"] .panel-git:hover .pg-icon {
  background: #3f6fd4; color: #fff; border-color: #3f6fd4;
}

/* wider panel + bigger CRM window */
.scene[data-scene="arcline"] .scene-media { width: 660px; }
.media-frame.media-window.ac-main { width: 660px; }
.ac-main img { aspect-ratio: 1955 / 1133; }

/* logo plaque (white logo needs a dark backing) */
.scene-logo.ac-logo {
  top: 12%; width: 300px; height: auto; padding: 26px 30px;
  background: #0b1220; border: 1px solid rgba(63,111,212,0.3);
  box-shadow: 0 18px 44px -16px rgba(0,0,0,0.6), 0 0 70px -16px rgba(63,111,212,0.5);
}
.scene-logo.ac-logo img { width: 100%; height: auto; border-radius: 0; }

/* header chip (small dark backing for the header logo) */
.ac-chip {
  background: #0b1220; border-radius: 9px; padding: 6px 9px;
  display: grid; place-items: center; height: 40px;
}
.ac-chip img { width: auto; height: 26px; border-radius: 0; }

/* website thumbnail (left) */
.ac-web {
  position: absolute; left: 150px; top: 38%; width: 560px;
  border-color: rgba(63,111,212,0.32);
  box-shadow: 0 22px 50px -22px rgba(0,0,0,0.7), 0 0 70px -16px rgba(63,111,212,0.4);
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.7s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}
.scene.on .ac-web { opacity: 1; transform: none; pointer-events: auto; }
.scene.on .ac-logo { pointer-events: auto; }
.ac-web img { aspect-ratio: 1442 / 1003; }

/* Reserve image space (stable layout before pixels load, so nerves aim true) */
.media-frame.media-vex img { aspect-ratio: 814 / 777; }
.hg-main img { aspect-ratio: 1334 / 972; }
.hg-records img { aspect-ratio: 1333 / 648; }
.hg-pill-r img { aspect-ratio: 1558 / 298; }

/* soft gradient halo behind the whole media block */
.scene-media::before {
  content: ""; position: absolute; z-index: -1;
  inset: -50px -40px -60px -40px;
  background: radial-gradient(60% 55% at 60% 45%, rgba(47,111,107,0.16), transparent 72%);
  filter: blur(12px);
}
.media-frame[data-empty]::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(28,26,22,0.03) 0 10px, transparent 10px 20px);
}
.media-tag {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--rule); padding: 4px 10px; border-radius: 100px;
  position: relative; z-index: 1;
}
.media-hint { font-size: 0.72rem; color: var(--ink-faint); position: relative; z-index: 1; }
.media-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- Tags row (bottom) ---- */
.scene-tags {
  position: absolute; left: 50%; bottom: 152px; transform: translateX(-50%) translateY(14px);
  display: flex; gap: 12px; opacity: 0;
  transition: opacity 0.6s var(--ease) 0.25s, transform 0.7s var(--ease) 0.25s;
}
.scene.on .scene-tags { opacity: 1; transform: translateX(-50%) translateY(0); }
.scene-tags span {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft-op); border: 1px solid var(--rule); padding: 6px 14px; border-radius: 100px;
  background: rgba(255,252,245,0.4);
}

/* ============================================================
   Lightbox (click-to-enlarge preview)
   ============================================================ */
[data-zoom] { cursor: zoom-in; }
.lightbox[hidden] { display: none; }   /* must override the display:grid below */
.lightbox {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  padding: 5vh 5vw;
  background: rgba(12, 10, 8, 0.85);
  backdrop-filter: blur(7px);
  opacity: 0; transition: opacity 0.3s var(--ease);
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; }
.lightbox img {
  max-width: 94vw; max-height: 90vh;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 40px 110px -20px rgba(0,0,0,0.85);
  transform: scale(0.95); transition: transform 0.35s var(--ease);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: 24px; right: 30px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06); color: #f4f1ea;
  font-size: 1.1rem; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,0.14); transform: scale(1.08); }

/* ============================================================
   Framing + top bar
   ============================================================ */
.frame { position: absolute; inset: 14px; z-index: 3; border: 1px solid var(--rule); pointer-events: none; }
.frame::before, .frame::after { content: ""; position: absolute; width: 7px; height: 7px; border: 1px solid var(--ink-faint); }
.frame::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.frame::after  { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }

.topbar {
  position: relative; z-index: 4;
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 40px 0;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}

/* ============================================================
   Content
   ============================================================ */
.page { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 114px 40px 76px; }

.masthead {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: end;
  margin-bottom: 165px; padding-bottom: 40px; border-bottom: 1px solid var(--rule);
}
.name { font-family: var(--serif); font-weight: 500; font-size: 5.8rem; line-height: 0.92; letter-spacing: -0.03em; }
.intro { font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; color: var(--ink-soft-op); max-width: 34ch; padding-bottom: 6px; }

.index-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); padding-bottom: 16px; }
.hint { display: inline-flex; align-items: center; gap: 8px; }
.hint-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 1; transform: scale(1.35); } }

.works { list-style: none; border-top: 1px solid var(--ink); }
.work { border-bottom: 1px solid var(--rule); transition: background 0.4s var(--ease); }
.work.active { background: rgba(255, 252, 245, 0.45); }

.work-link { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 22px; padding: 26px 8px; text-decoration: none; color: var(--ink); position: relative; }
.work-num { font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.05em; align-self: start; padding-top: 8px; }
.work-body { display: flex; flex-direction: column; gap: 6px; }
.work-name { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.05; transition: transform 0.45s var(--ease), color 0.35s; }
.work-desc {
  font-size: 0.8rem; line-height: 1.5; color: var(--ink-faint); max-width: 52ch;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin-top 0.5s var(--ease), transform 0.45s var(--ease);
}
.work-cat { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); justify-self: end; text-align: right; align-self: start; padding-top: 8px; transition: color 0.35s; }
.work-arrow { font-size: 1.15rem; color: var(--ink-faint); opacity: 0; transform: translateX(-10px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.35s; justify-self: end; align-self: start; padding-top: 6px; }

.work.active .work-name, .work-link:hover .work-name { transform: translateX(16px); color: var(--accent); }
.work.active .work-desc, .work-link:hover .work-desc { max-height: 60px; opacity: 1; margin-top: 4px; transform: translateX(16px); }
.work.active .work-arrow, .work-link:hover .work-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }
.work.active .work-cat, .work-link:hover .work-cat { color: var(--ink-soft-op); }
.work-desc[data-placeholder] { font-style: italic; }

.foot { margin-top: 178px; padding-top: 30px; border-top: 1px solid var(--rule); }
.foot-row { display: flex; align-items: baseline; gap: 24px; padding: 9px 0; }
.foot-label { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); width: 100px; flex-shrink: 0; }
.foot-link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; transition: border-color 0.3s, color 0.3s; }
.foot-link:hover { color: var(--accent); border-color: var(--accent); }
.foot-open { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft-op); }
.foot-dot { width: 7px; height: 7px; border-radius: 50%; background: #4e8f52; box-shadow: 0 0 0 3px rgba(78,143,82,0.18); }
.foot-fine { margin-top: 30px; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--ink-faint); }

/* Reveal on load */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsiveness is handled by scaling the whole #canvas to fit
   (see main.js fitCanvas), so the composition is identical at any
   size — no per-breakpoint reflow needed.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .work-desc { max-height: 60px; opacity: 1; margin-top: 4px; }
}
