/* ============================================
   Carlos Yajie Fetizanan — portfolio
   The sitting: Leonardo paints Carlos in his Florence workshop, and the
   camera walks a full circle round the studio as you scroll. The rest of the
   page borrows the room's palette: warm paper, umber, red chalk and gold leaf.
   ============================================ */

/* ---------- Palette ----------
   Day: the studio by window light. Night: the same room by candle. */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --paper: #f3ece1;
  --paper-2: #faf6ef;
  --ink: #211a14;
  --ink-soft: #4a3f34;
  --muted: #6f6355;
  --line: rgba(33, 26, 20, 0.14);
  --line-strong: rgba(33, 26, 20, 0.32);
  --accent: #9c3f22;          /* red chalk */
  --gold: #b08a3e;
  --dark: #1a140f;            /* the candlelit scenes */
  --on-dark: #f1e7d7;
  --on-dark-muted: rgba(241, 231, 215, 0.7);
  --on-dark-line: rgba(241, 231, 215, 0.16);
  --error: #b23e28;
  --ok: #2f7a45;
  --glass: rgba(243, 236, 225, 0.84);
  --panel-2: #fbf8f2;
  --shadow: 0 30px 70px rgba(50, 30, 10, 0.28);
  --grain: 0.06;
  --grain-filter: invert(1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15110d;
  --paper-2: #1c1712;
  --ink: #f1e7d7;
  --ink-soft: #d4c7b3;
  --muted: #a99a85;
  --line: rgba(241, 231, 215, 0.13);
  --line-strong: rgba(241, 231, 215, 0.3);
  --accent: #e08b62;
  --gold: #d6b06a;
  --dark: #0d0a07;
  --error: #f19a87;
  --ok: #a9d6b0;
  --glass: rgba(21, 17, 13, 0.84);
  --panel-2: #1d1813;
  --shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  --grain: 0.05;
  --grain-filter: none;
}

:root {
  /* Renaissance roman for type, Roman capitals for labels, one brush for accents */
  --display: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --body: "EB Garamond", "Garamond", Georgia, serif;
  --caps: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --brush: "Kaushan Script", "Brush Script MT", cursive;
  --rail: 5.5rem;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --max: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.15rem;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: var(--grain);
  filter: var(--grain-filter, none);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
  text-decoration: none;
}
.skip-link:focus { transform: none; }
main, .site-foot { position: relative; z-index: 1; }
/* on wide screens content keeps clear of the rail */
@media (min-width: 761px) {
  .wrap { padding-left: max(var(--gutter), calc(var(--rail) + 1.75rem)); }
  .site-foot { padding-left: calc(var(--rail) + 1.75rem) !important; }
  .site-nav { transition: transform 0.6s var(--ease), box-shadow 0.6s ease; }
  .site-nav.is-tucked { transform: translateX(-100%); border-right-color: transparent; }
  .site-nav:not(.is-tucked) { box-shadow: 8px 0 30px rgba(40, 25, 10, 0.06); }
  /* folded away, the seal stays behind in the corner as a handle */
  .site-nav .seal { transition: transform 0.6s var(--ease), rotate 0.6s var(--ease); }
  .site-nav.is-tucked .seal { transform: translateX(calc(var(--rail) - 0.6rem)) scale(0.92); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.14), 0 6px 16px rgba(60, 20, 5, 0.35); }
  .site-nav.is-tucked nav, .site-nav.is-tucked .rail-tools { opacity: 0; }
  .site-nav nav, .site-nav .rail-tools { transition: opacity 0.4s ease; }
}

/* Roman-capital caption above headings */
.kicker {
  font-family: var(--caps);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.kicker span { color: var(--muted); margin-left: 0.6rem; }

/* the brushed words */
.hero-title em, .scene h2 em, .closeup-line em, .note .motto {
  font-family: var(--brush);
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
  font-size: 0.82em;
  letter-spacing: 0;
  display: inline-block;
  rotate: -3deg;
  translate: 0 -0.04em;
}
.brush-line { display: block; width: min(16rem, 60%); height: 0.9rem; margin: 0.35rem 0 0 -0.2rem; overflow: visible; }
.brush-line path { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.85; transition: stroke-dashoffset 1.4s var(--ease) 0.4s; }
.fx .brush-line[data-reveal] { opacity: 1; transform: none; }
.brush-line.is-in path, :root:not(.fx) .brush-line path { stroke-dashoffset: 0; }

/* ---------- Nav: a rail down the left edge, like a sketchbook's spine ---------- */
.site-nav {
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 0 1.25rem;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
}
.seal, .menu-seal {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  font-family: var(--caps);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: #f6e3d3;
  text-decoration: none;
  /* a wax seal: an uneven disc of red with a pressed rim */
  background: radial-gradient(circle at 35% 30%, #c4553a, #8a2a16 70%);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.14), inset 0 0 0 6px rgba(255, 255, 255, 0.08), 0 3px 8px rgba(60, 20, 5, 0.3);
  border-radius: 52% 48% 50% 50% / 50% 52% 48% 50%;
  transition: rotate 0.6s var(--ease);
}
.seal:hover { rotate: -12deg; }
.menu-seal { display: none; border: none; cursor: pointer; }
.site-nav nav { margin: auto 0; }
.site-nav ul { display: flex; flex-direction: column; gap: 1.6rem; align-items: center; }
.site-nav nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-nav nav a b { font-family: var(--caps); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.1em; }
.site-nav nav a span {
  writing-mode: vertical-rl;
  rotate: 180deg;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1;
}
.site-nav nav a:hover, .site-nav nav a.is-active { color: var(--ink); }
/* the active folio gets a dab of red chalk beside it */
.site-nav nav a::after {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 50%;
  width: 0.35rem;
  height: 70%;
  translate: 0 -50%;
  border-radius: 40% 60% 50% 50%;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.6s var(--ease);
}
.site-nav nav a.is-active::after { transform: scaleY(1); }
.rail-tools { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.nav-ask {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.nav-ask svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-ask:hover { border-color: var(--accent); color: var(--accent); }
.nav-ask-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; overflow: visible; transition: transform 0.9s var(--ease); }
.tt-core, .tt-cut, .tt-rays line { transform-box: fill-box; transform-origin: center; transition: transform 0.7s var(--ease), opacity 0.4s ease; }
.tt-rays { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.tt-core { transform: scale(1.45); }
.tt-rays line { transform: scale(0); opacity: 0; }
[data-theme="light"] .tt-core { transform: scale(1); }
[data-theme="light"] .tt-cut { transform: translate(9px, -9px); }
[data-theme="light"] .tt-rays line { transform: scale(1); opacity: 1; }
[data-theme="light"] .theme-toggle svg { transform: rotate(90deg); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-family: var(--caps);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: var(--fx, 50%);
  top: var(--fy, 50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  translate: -50% -50%;
  background: var(--accent);
  transition: width 0.6s var(--ease), height 0.6s var(--ease);
}
.btn:hover::before { width: 30rem; height: 30rem; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { color: #fff8ee; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: #fff8ee; }

.round-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.round-btn:hover { border-color: currentColor; }
.round-btn svg, .project-go, .ask-form svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.magnetic { transition: transform 0.6s var(--ease); will-change: transform; }

/* =========================================================
   THE SITTING
   ========================================================= */
.sitting { position: relative; height: 640vh; height: 640svh; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--paper);
}

/* the room goes dark around the footage once it leaves the wall (shows on phones, where it's letterboxed) */
.stage::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--dark); opacity: var(--shade, 0); pointer-events: none; }

/* the footage: a tilted painting at first, the whole stage once you scroll */
.film {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 20%;
  width: 46vw;
  height: 26vw;
  rotate: var(--film-r, -3.5deg);
  background: #2a2018;
  /* a mat and a thin gilt edge, shed as it grows */
  box-shadow:
    0 0 0 calc(var(--frame, 1) * 10px) var(--paper-2),
    0 0 0 calc(var(--frame, 1) * 12px) var(--gold),
    0 40px 80px rgba(50, 30, 10, calc(0.35 * var(--frame, 1)));
  overflow: hidden;
}
.film canvas, .film-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film canvas { opacity: 0; transition: opacity 0.6s ease; }
.film.is-ready canvas { opacity: 1; }
.film-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--shade, 0);
  background:
    linear-gradient(180deg, rgba(15, 10, 5, 0.45) 0%, transparent 22%, transparent 60%, rgba(15, 10, 5, 0.7) 100%);
}

.hero-copy {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  top: calc(env(safe-area-inset-top, 0px) + 14vh);
  left: calc(var(--rail) + var(--gutter));
  max-width: min(34rem, 38vw);
  opacity: var(--copy-o, 1);
  transform: translateY(var(--copy-y, 0px));
}
.hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.2rem, 6.6vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.1em; }
.hero-title .line > span { display: block; }
.hero-title .line:nth-child(2) { padding-left: 0.8em; }
.hero-sub { max-width: 28rem; color: var(--ink-soft); margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.plaque {
  position: absolute;
  z-index: 3;
  right: calc(var(--gutter) + 1rem);
  bottom: 9vh;
  color: var(--muted);
  font-size: 0.85rem;
  opacity: var(--copy-o, 1);
}
.plaque em { font-family: var(--display); font-size: 1.15rem; color: var(--ink); }

.intro .hero-title .line > span { animation: rise 1.4s var(--ease) both; }
.intro .hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
.intro .film { animation: hang 1.6s var(--ease) 0.15s both; }
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes hang { from { opacity: 0; translate: 0 4vh; } to { opacity: 1; translate: 0 0; } }

/* notes about Carlos that unfold over the footage */
.notes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.note {
  position: absolute;
  width: min(22rem, 34vw);
  padding: 1.4rem 1.5rem 1.5rem;
  color: #2a2018;
  /* aged paper, darker at the corners */
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(160, 110, 50, 0.16), transparent 55%),
    radial-gradient(120% 90% at 100% 100%, rgba(140, 90, 40, 0.2), transparent 55%),
    #f4e9d4;
  box-shadow: 0 30px 60px rgba(10, 5, 0, 0.45), inset 0 0 0 1px rgba(120, 80, 30, 0.18);
  opacity: 0;
  rotate: var(--rot, -2deg);
  clip-path: inset(0 0 100% 0);
  transform: translateY(14px);
  transition: clip-path 0.9s var(--ease), opacity 0.5s ease, transform 0.9s var(--ease);
}
.note.is-on { opacity: 1; clip-path: inset(0 0 0 0); transform: none; }
.note h3 { font-family: var(--caps); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9c3f22; margin-bottom: 0.7rem; display: flex; align-items: baseline; gap: 0.7rem; }
.note h3 b { font-weight: 600; font-size: 1.1rem; letter-spacing: 0.06em; }
.note p { font-family: var(--display); font-size: 1.3rem; line-height: 1.35; }
.note .motto { font-size: 2.1rem; line-height: 1.1; color: #9c3f22; }
.note.n1 { left: calc(var(--rail) + var(--gutter) * 0.6); top: 14vh; --rot: -2.2deg; }
.note.n2 { right: calc(var(--gutter) * 0.8); top: 18vh; --rot: 1.8deg; }
.note.n3 { left: calc(var(--rail) + var(--gutter) * 0.6); bottom: 16vh; --rot: 1.4deg; }
.note.n4 { right: calc(var(--gutter) * 0.8); bottom: 18vh; --rot: -1.6deg; }
.note.n5 { left: 50%; bottom: 9vh; margin-left: -11rem; --rot: -1deg; text-align: center; }
.note.n5 h3 { justify-content: center; }

.orbit {
  position: absolute;
  z-index: 4;
  right: var(--gutter);
  bottom: 10vh;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #f6ecdc;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  opacity: var(--orbit-o, 0);
}
.orbit svg { width: 2.6rem; height: 2.6rem; }
.orbit circle { fill: none; stroke: rgba(246, 236, 220, 0.4); stroke-width: 1; }
.orbit .orbit-dot { fill: #f0c98d; stroke: none; }
.orbit span { min-width: 3ch; }

.scroll-cue {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: 4vh;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  opacity: var(--cue-o, 1);
}
.scroll-cue i { position: relative; width: 1px; height: 2rem; background: var(--line-strong); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--accent); animation: drip 2s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }
.handoff { position: absolute; inset: 0; z-index: 6; background: var(--paper); opacity: var(--handoff, 0); pointer-events: none; }

/* =========================================================
   SCENES
   ========================================================= */
.scene { position: relative; padding: clamp(7rem, 12vw, 10rem) 0; }
.wrap { position: relative; z-index: 2; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.paper { background: var(--paper); color: var(--ink); }
.dark {
  background: var(--dark);
  color: var(--on-dark);
  --ink: var(--on-dark);
  --ink-soft: var(--on-dark-muted);
  --muted: var(--on-dark-muted);
  --line: var(--on-dark-line);
  --line-strong: rgba(241, 231, 215, 0.34);
  --accent: #e8a27c;
  --paper: var(--dark);
  --error: #f6a891;
  --ok: #b9e3c0;
}

.section-head { margin-bottom: 3.5rem; }
.section-head.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end; }
.section-head p:not(.kicker) { color: var(--muted); max-width: 30rem; }
.scene h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.8vw, 5.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.scene h3 { font-family: var(--display); font-weight: 400; font-style: italic; font-size: 1.3rem; color: var(--accent); margin: 0 0 1rem; }

/* ---------- Work ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.5rem; }
.filters button {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.filters button:hover { color: var(--ink); border-color: var(--line-strong); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters .count { margin-left: 0.45rem; opacity: 0.6; font-variant-numeric: tabular-nums; }

.projects { border-bottom: 1px solid var(--line); }
.project { border-top: 1px solid var(--line); }
.project[hidden] { display: none; }
.project a {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 10rem 1.5rem;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 0.5rem;
  text-decoration: none;
}
.project a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--sx, 30%) var(--sy, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.project a:hover::before, .project a:focus-visible::before { opacity: 1; }
.project-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 2.8vw, 2.25rem); line-height: 1.1; transition: transform 0.7s var(--ease), color 0.4s ease; }
.project a:hover .project-title, .project a:focus-visible .project-title { transform: translateX(1rem); font-style: italic; color: var(--accent); }
.project-desc { color: var(--muted); font-size: 0.95rem; }
.project-cat { color: var(--muted); font-size: 0.88rem; }
.project-go { justify-self: end; color: var(--muted); transition: transform 0.7s var(--ease), color 0.4s ease; }
.project a:hover .project-go { transform: rotate(45deg); color: var(--accent); }
.project a:focus-visible { outline-offset: -1px; }
.projects.is-filtered .project:not([hidden]) { animation: row-in 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(18px); } }
.projects-more { margin-top: 2.25rem; }
.projects-more a { color: var(--accent); text-underline-offset: 0.3em; text-decoration-thickness: 1px; }

/* ---------- About ---------- */
.about { overflow: clip; }
.about .wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.about-body { grid-column: 2; }
.about-lead { font-family: var(--display); font-size: clamp(1.4rem, 2.3vw, 1.95rem); line-height: 1.38; margin: 1.5rem 0 4rem; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem; }
.plain-list li { padding: 0.9rem 0; border-top: 1px solid var(--line); font-size: 0.96rem; }
.plain-list li:last-child { border-bottom: 1px solid var(--line); }
.services strong { display: block; font-weight: 500; color: var(--ink); }
.services li { color: var(--muted); }
.creds a { text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.creds a:hover { color: var(--accent); }
.meters { margin-bottom: 3rem; }
.meters li { display: grid; grid-template-columns: 7.5rem 1fr 2.6rem; align-items: center; gap: 1rem; padding: 0.6rem 0; font-size: 0.95rem; }
.meter { position: relative; height: 1px; background: var(--line-strong); }
.meter::after {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 3px;
  width: calc(var(--v) * 1%);
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform-origin: left;
  transform: scaleX(var(--fill, 1));
  transition: transform 1.6s var(--ease);
}
.meters:not(.is-shown) { --fill: 0; }
.meter-num { text-align: right; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* ---------- The close-up interlude ---------- */
.closeup { position: relative; height: 280vh; height: 280svh; background: var(--dark); }
.closeup-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.closeup-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.closeup-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 6, 2, 0.6), transparent 45%), linear-gradient(0deg, rgba(10, 6, 2, 0.55), transparent 35%); pointer-events: none; }
.closeup-line {
  position: absolute;
  left: var(--gutter);
  bottom: 14vh;
  max-width: 14ch;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6.4vw, 6.4rem);
  line-height: 1;
  color: #f6ecdc;
  opacity: var(--line-o, 0);
  transform: translateY(var(--line-y, 24px));
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}
.closeup-line em { color: #f0b48a; }
.closeup-note { position: absolute; right: var(--gutter); bottom: 6vh; font-family: var(--caps); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(246, 236, 220, 0.7); opacity: var(--line-o, 0); }

/* =========================================================
   THE STUDIO: memory lane
   ========================================================= */
.studio-scene { position: relative; background: var(--paper); padding: clamp(6rem, 10vw, 8rem) 0 4rem; }
.studio-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; }
.studio-head p:not(.kicker), .chamber-head p { color: var(--muted); max-width: 32rem; }
.studio-scene h2, .chamber h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 5.8vw, 5.2rem); line-height: 1; letter-spacing: -0.02em; }
.studio-scene h2 em, .chamber h2 em { font-family: var(--brush); font-style: normal; color: var(--accent); font-size: 0.82em; display: inline-block; rotate: -3deg; }

.room-scroll { margin-top: 3rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.room-scroll::-webkit-scrollbar { display: none; }
.room { position: relative; width: 100%; aspect-ratio: 1376 / 768; overflow: hidden; --zx: 50%; --zy: 50%; }
.room-img, .room-glow { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: var(--zx) var(--zy); transition: transform 0.9s var(--ease), filter 0.6s ease; }
.room-glow { pointer-events: none; background: linear-gradient(110deg, rgba(255, 236, 200, 0.18) 12%, transparent 40%); mix-blend-mode: screen; }
[data-theme="dark"] .room-img { filter: brightness(0.5) saturate(0.85) sepia(0.15); }
[data-theme="dark"] .room-glow {
  mix-blend-mode: screen;
  background:
    radial-gradient(14% 22% at 18% 30%, rgba(120, 150, 230, 0.25), transparent 70%),
    radial-gradient(22% 26% at 47% 62%, rgba(255, 170, 80, 0.32), transparent 70%),
    radial-gradient(18% 22% at 74% 60%, rgba(255, 170, 80, 0.22), transparent 70%);
}
/* lean in toward the selected object */
.room.is-leaning .room-img, .room.is-leaning .room-glow { transform: scale(2.3); }
.room.is-leaning .hotspot { opacity: 0; }

.hotspot {
  position: absolute;
  left: calc(var(--x) - var(--w) / 2);
  top: calc(var(--y) - var(--h) / 2);
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: none;
  border-radius: 18px;
  background: none;
  cursor: pointer;
  transition: background 0.4s ease, opacity 0.3s ease;
}
.hotspot:hover, .hotspot:focus-visible { background: radial-gradient(closest-side, rgba(255, 228, 170, 0.22), transparent); }
.hs-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.1rem;
  height: 1.1rem;
  translate: -50% -50%;
  border-radius: 50%;
  background: #f3d9a4;
  box-shadow: 0 0 0 4px rgba(156, 63, 34, 0.55), 0 0 18px 4px rgba(255, 210, 140, 0.6);
}
.hs-pin::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1.5px solid rgba(243, 217, 164, 0.9); animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
.hs-label {
  position: absolute;
  left: 50%;
  top: calc(50% - 1.4rem);
  translate: -50% -100%;
  padding: 0.55rem 0.85rem 0.6rem;
  background: #f6ecda;
  color: #2a2018;
  box-shadow: 0 14px 30px rgba(20, 10, 0, 0.3);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.5s var(--ease);
  pointer-events: none;
}
.hs-label b { display: block; font-family: var(--caps); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9c3f22; margin-bottom: 0.15rem; }
.hotspot:hover .hs-label, .hotspot:focus-visible .hs-label { opacity: 1; transform: none; }
.hs-window .hs-label { left: 100%; top: 40%; translate: 0.5rem -50%; }

.room-legend { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin-top: 1.75rem; list-style: none; }
.room-legend button { display: inline-flex; align-items: baseline; gap: 0.6rem; padding: 0.35rem 0; border: none; border-bottom: 1px solid var(--line-strong); background: none; font-family: var(--display); font-size: 1.25rem; cursor: pointer; transition: border-color 0.3s ease, color 0.3s ease; }
.room-legend button b { font-family: var(--caps); font-weight: 500; font-size: 0.75rem; color: var(--accent); }
.room-legend button span { font-style: italic; color: var(--muted); font-size: 1rem; }
.room-legend button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Chambers ---------- */
.chamber {
  position: fixed;
  inset: 0;
  z-index: 65;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.7s var(--ease);
}
.chamber.is-open { opacity: 1; transform: none; }
.chamber[hidden] { display: none; }
.chamber-open body { overflow: hidden; }
/* the rail, seal and page buttons step aside while a chamber is open */
.chamber-open .site-nav, .chamber-open .to-top, .chamber-open .progress-bar { visibility: hidden; }
.chamber-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.chamber-bar .kicker { margin: 0; }
.chamber-back { padding: 0.5rem 0; border: none; background: none; font-family: var(--display); font-size: 1.15rem; font-style: italic; cursor: pointer; color: var(--ink); }
.chamber-back:hover { color: var(--accent); }
.chamber-body { padding-top: 4rem; padding-bottom: 6rem; }
.chamber .wrap { padding-left: var(--gutter); }
.chamber-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; margin-bottom: 3rem; }

/* the ledger: every repository, live from GitHub */
.ledger { margin-top: 5rem; }
.ledger-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.ledger-head h3 { font-family: var(--caps); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.ledger-head a { font-style: italic; color: var(--muted); }
.repos { list-style: none; padding: 0; columns: 2 22rem; column-gap: 3rem; }
.repo { break-inside: avoid; border-top: 1px solid var(--line); animation: row-in 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.repo a { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.2rem 0.5rem; padding: 0.9rem 0.25rem; text-decoration: none; }
.repo-no { font-family: var(--caps); font-size: 0.75rem; color: var(--muted); padding-top: 0.35rem; }
.repo-name { display: block; font-family: var(--display); font-size: 1.35rem; line-height: 1.2; transition: color 0.3s ease; }
.repo a:hover .repo-name { color: var(--accent); font-style: italic; }
.repo-desc { display: block; color: var(--muted); font-size: 0.98rem; line-height: 1.4; margin-top: 0.15rem; }
.repo-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }
.repo-lang::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.35rem; border-radius: 50%; background: var(--dot); }
.repos-wait { color: var(--muted); font-style: italic; padding: 1rem 0; }

/* the library: certificates as books */
.bookcase-scroll { overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding-top: 1.5rem; }
.bookcase-scroll::-webkit-scrollbar { display: none; }
.bookcase {
  position: relative;
  width: 100%;
  aspect-ratio: 1376 / 768;
  background: url(../assets/studio/bookshelf.jpg) center / 100% 100% no-repeat;
  box-shadow: 0 40px 80px rgba(30, 15, 5, 0.35);
}
[data-theme="dark"] .bookcase, [data-theme="dark"] .spine { filter: brightness(0.8) saturate(0.9); }
/* the gap a book leaves when it is taken down */
.slot { position: absolute; background: linear-gradient(90deg, #0d0804, #1c120a 50%, #0d0804); opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.slot.is-empty { opacity: 1; }
/* a spine cut from the same photo, so it sits invisibly in place until lifted */
.spine {
  position: absolute;
  padding: 0;
  border: none;
  cursor: pointer;
  background-image: url(../assets/studio/bookshelf.jpg);
  background-repeat: no-repeat;
  transform-origin: bottom center;
  transition: transform 0.6s var(--ease), box-shadow 0.4s ease, filter 0.4s ease, opacity 0.4s ease;
}
.spine:hover, .spine:focus-visible { transform: translateY(-5%); filter: brightness(1.18) saturate(1.05); box-shadow: 0 0 0 1px rgba(240, 210, 140, 0.55), 0 10px 24px rgba(0, 0, 0, 0.45); z-index: 3; }
.spine.is-out { transform: translateY(-16%) rotate(-3deg); filter: brightness(1.15); box-shadow: 0 0 0 1px rgba(240, 210, 140, 0.7), -10px 26px 40px rgba(0, 0, 0, 0.55); z-index: 4; }
.spine.is-lying:hover, .spine.is-lying:focus-visible { transform: translateX(4%); }
.spine.is-lying.is-out { transform: translateX(18%) rotate(-2deg); }
.spine.is-dim { opacity: 0.35; filter: grayscale(0.6) brightness(0.7); }
/* when the index is first opened, a glint runs along the books that are mine */
.bookcase.is-hinting .spine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 236, 190, 0.55) 50%, transparent 70%) -150% 0 / 250% 100% no-repeat;
  animation: glint 1.6s var(--ease) 0.5s both;
  pointer-events: none;
}
@keyframes glint { to { background-position: 150% 0; } }
/* the Credly badge, pressed into the top of the spine like a seal */
.book-seal {
  position: absolute;
  left: 50%;
  top: 0.4rem;
  width: clamp(1.1rem, 2vw, 1.7rem);
  aspect-ratio: 1;
  translate: -50% 0;
  object-fit: contain;
  border-radius: 50%;
  background: #f4e9d4;
  padding: 1px;
  box-shadow: 0 0 0 2px rgba(230, 194, 113, 0.85), 0 2px 5px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.spine.is-lying .book-seal { left: auto; right: 0.6rem; top: 50%; translate: 0 -50%; }
.spine-tag {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.7rem);
  translate: -50% 0;
  padding: 0.35rem 0.7rem;
  background: #f6ecda;
  color: #2a2018;
  font-family: var(--display);
  font-size: 0.98rem;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.spine:hover .spine-tag, .spine:focus-visible .spine-tag { opacity: 1; }

.book-open {
  position: relative;
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  max-width: 44rem;
  margin: 3.5rem 0 0 2rem;
  padding: 2rem 2.2rem 2.2rem;
  background: var(--paper-2);
  border-left: 0.9rem solid var(--book);
  box-shadow: 0 30px 60px rgba(40, 25, 10, 0.2);
}
.book-open.is-in { animation: book-in 0.7s var(--ease) both; }
@keyframes book-in { from { opacity: 0; transform: translateY(16px) rotate(-1deg); } }
.book-badge { flex: none; width: 7.5rem; height: 7.5rem; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(40, 25, 10, 0.25)); }
.book-badge[hidden] { display: none; }
.book-text { min-width: 0; }
.book-open h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.1; margin-bottom: 0.4rem; }
.book-date { font-style: italic; color: var(--muted); margin-bottom: 0.9rem !important; }
.book-skills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1.5rem; list-style: none; padding: 0; }
.book-skills li { padding: 0.2rem 0.65rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.88rem; color: var(--ink-soft); }

/* the skills index */
.skills-index { margin-top: 4.5rem; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.skill-chip b { font-family: var(--caps); font-weight: 500; font-size: 0.7rem; color: var(--accent); }
.skill-chip:hover { border-color: var(--accent); color: var(--ink); }
.skill-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.skill-chip[aria-pressed="true"] b { color: var(--gold); }
.book-open p:not(.kicker) { color: var(--muted); margin-bottom: 1.5rem; }
.book-open .btn[hidden] { display: none; }

/* the canvas rack: paintings and drawings standing on two shelves */
.rack { display: grid; gap: 4.5rem; }
.rack-row {
  display: flex;
  align-items: flex-end;
  height: clamp(13rem, 21vw, 19rem);
  padding: 0 2rem;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  padding-top: 3rem;
  box-sizing: content-box;
  border-bottom: 1.1rem solid #6b4626;
  box-shadow: 0 1.1rem 0 -0.55rem #4a2f17, 0 2.2rem 2rem -1rem rgba(40, 20, 5, 0.35);
}
.rack-canvas {
  position: relative;
  flex: none;
  height: var(--h);
  aspect-ratio: 4 / 5;
  margin-left: -2.4rem;
  padding: 0;
  border: none;
  cursor: pointer;
  background: #d9c9a8;
  rotate: var(--lean);
  transform-origin: bottom center;
  box-shadow: 6px 0 0 #c9b48a, 7px 1px 0 rgba(0, 0, 0, 0.18), -10px 10px 24px rgba(40, 25, 10, 0.35);
  transition: transform 0.6s var(--ease), rotate 0.6s var(--ease), box-shadow 0.4s ease;
}
.rack-canvas:first-child { margin-left: 0; }
.rack-canvas img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* the weave of the canvas, faintly over every picture */
.rack-canvas::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px); }
.rack-canvas:hover, .rack-canvas:focus-visible { transform: translateY(-12%) scale(1.04); rotate: 0deg; z-index: 5; box-shadow: 6px 0 0 #c9b48a, -14px 30px 40px rgba(40, 25, 10, 0.4); }
.rack-label {
  position: absolute;
  left: 50%;
  top: 100%;
  translate: -50% 0.6rem;
  font-family: var(--caps);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.rack-canvas:hover .rack-label, .rack-canvas:focus-visible .rack-label { opacity: 1; }

/* the wall: recent posts pinned up like studies */
.pinboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: 3.5rem 2.5rem;
  padding: 3rem 2.5rem 3.5rem;
  /* rough plaster */
  background:
    radial-gradient(60% 50% at 20% 20%, rgba(255, 250, 238, 0.5), transparent 70%),
    radial-gradient(50% 60% at 85% 80%, rgba(150, 120, 80, 0.12), transparent 70%),
    #e6dccb;
  box-shadow: inset 0 0 60px rgba(90, 60, 30, 0.18);
}
[data-theme="dark"] .pinboard { background: radial-gradient(60% 50% at 30% 20%, rgba(255, 200, 130, 0.08), transparent 70%), #241c14; }
.study {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.8rem 0.8rem 1.2rem;
  border: none;
  text-align: left;
  cursor: pointer;
  color: #2a2018;
  background: #f4ead6;
  box-shadow: 0 14px 28px rgba(50, 30, 10, 0.25), inset 0 0 0 1px rgba(120, 80, 30, 0.15);
  rotate: var(--tilt, 0deg);
  transition: rotate 0.6s var(--ease), transform 0.6s var(--ease), box-shadow 0.4s ease, opacity 0.4s ease;
}
/* a red wax pin at the top */
.study::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -0.55rem;
  left: 50%;
  width: 1rem;
  height: 1rem;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e07a5a, #7a1a10);
  box-shadow: 1px 3px 4px rgba(0, 0, 0, 0.4);
}
.study-pic { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e2d2ae; margin-bottom: 0.5rem; }
/* drawn in red chalk until you reach for it */
.study-pic img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.85) saturate(1.6) hue-rotate(-18deg) contrast(1.05) brightness(1.02); mix-blend-mode: multiply; transition: filter 0.6s ease; }
.study-pic.is-missing img { display: none; }
.study-date { font-family: var(--caps); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9c3f22; }
.study-title { font-family: var(--display); font-size: 1.45rem; line-height: 1.15; }
.study-line { font-family: var(--display); font-style: italic; font-size: 1.05rem; line-height: 1.4; color: #5a4a3a; }
.study:hover, .study:focus-visible { rotate: 0deg; transform: translateY(-6px) scale(1.02); box-shadow: 0 26px 40px rgba(50, 30, 10, 0.32), inset 0 0 0 1px rgba(120, 80, 30, 0.2); }
.study:hover .study-pic img, .study:focus-visible .study-pic img { filter: none; mix-blend-mode: normal; }
.study.is-taken { opacity: 0.35; transform: translateY(10px); }

/* the post itself, read like a letter */
.letter {
  margin: 3.5rem auto 0;
  max-width: 36rem;
  padding: 1.5rem 1.5rem 1.8rem;
  background: var(--paper-2);
  box-shadow: 0 30px 60px rgba(40, 25, 10, 0.22);
  display: grid;
  gap: 1.2rem;
  justify-items: center;
}
.letter.is-in { animation: book-in 0.7s var(--ease) both; }
.letter-head { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.letter-head .kicker { margin: 0; }
.letter-frame { width: 100%; max-width: 504px; }
.letter-frame iframe { display: block; width: 100%; height: 640px; border: 0; background: #fff; }

.to-library { margin-top: 1.25rem; color: var(--muted); }
.link-btn { padding: 0; border: none; background: none; color: var(--accent); font: inherit; font-style: italic; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; cursor: pointer; }

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: none;
  background: rgba(14, 10, 7, 0.96);
  color: #f1e7d7;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox[open] { display: grid; place-items: center; animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { display: grid; justify-items: center; gap: 1rem; padding: 4.5rem 4.5rem 2rem; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 80vh; max-height: 80dvh; object-fit: contain; }
.lightbox figcaption { color: #a99a85; font-size: 0.88rem; }
.lightbox .round-btn { position: absolute; background: rgba(14, 10, 7, 0.6); border-color: rgba(241, 231, 215, 0.28); color: #f1e7d7; }
.lb-close { top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; }
.lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lb-next { right: 1rem; top: 50%; translate: 0 -50%; }

/* ---------- Contact: the far wall, by candle ---------- */
.contact { overflow: clip; }
.contact-bg { position: absolute; inset: 0; z-index: 0; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.32; filter: saturate(0.85); }
.contact-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--dark) 0%, rgba(26, 20, 15, 0.85) 45%, rgba(26, 20, 15, 0.35) 100%), linear-gradient(180deg, var(--dark), transparent 25%, transparent 75%, var(--dark)); }
[data-theme="dark"] .contact-bg::after { background: linear-gradient(90deg, var(--dark) 0%, rgba(13, 10, 7, 0.88) 45%, rgba(13, 10, 7, 0.4) 100%), linear-gradient(180deg, var(--dark), transparent 25%, transparent 75%, var(--dark)); }
.contact-body { max-width: 40rem; }
.scene .contact-title { font-size: clamp(3rem, 7.5vw, 6.5rem); line-height: 0.95; margin-bottom: 1.5rem; }
.contact-lead { color: var(--muted); margin-bottom: 3rem; }
.contact-lead a { color: var(--ink); text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.chip-btn {
  margin-left: 0.35rem;
  padding: 0.15rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 0.8rem;
  cursor: pointer;
  vertical-align: 0.1em;
}
.chip-btn:hover { border-color: currentColor; }
.chip-btn.is-done { border-color: var(--ok); color: var(--ok); }

.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1.75rem; margin-bottom: 3.5rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; border: none; padding: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .field legend { font-size: 0.88rem; color: var(--muted); }
.field legend { margin-bottom: 0.75rem; }
.field input, .field textarea {
  width: 100%;
  padding: 0.75rem 0;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  border-radius: 0;
  transition: border-color 0.3s ease;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--accent); }
.field input:focus-visible, .field textarea:focus-visible { box-shadow: 0 1px 0 0 var(--accent); }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--error); }
.field textarea::placeholder { color: var(--muted); opacity: 0.7; }
.field-error { min-height: 1.3em; color: var(--error); font-size: 0.85rem; }
.field-foot { display: flex; justify-content: space-between; gap: 1rem; }
.char-count { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.chips label:hover span { color: var(--ink); border-color: var(--line-strong); }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--dark); }
.chips input:focus-visible + span { outline: 1px solid var(--accent); outline-offset: 3px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.form-status { flex: 1 1 16rem; color: var(--muted); font-size: 0.92rem; }
.form-status.is-ok { color: var(--ok); }
.dark .btn-solid { background: var(--on-dark); color: var(--dark); }
.socials { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.socials a { font-family: var(--display); font-size: 1.15rem; text-decoration: none; border-bottom: 1px solid var(--line-strong); }

/* ---------- Footer ---------- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 2.25rem var(--gutter) calc(2.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(241, 231, 215, 0.12);
  color: rgba(241, 231, 215, 0.65);
  font-size: 0.86rem;
  background: var(--dark);
}
.site-foot a { text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.site-foot a:hover { color: #f1e7d7; }

/* ---------- Ask about Carlos ---------- */
.ask {
  position: fixed;
  z-index: 60;
  top: 1rem;
  left: calc(var(--rail) + 1rem);
  width: min(390px, calc(100vw - 2rem));
  height: min(580px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: ask-in 0.4s var(--ease);
}
.ask[hidden] { display: none; }
@keyframes ask-in { from { opacity: 0; transform: translateY(-8px); } }
.ask-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.9rem 1.25rem; border-bottom: 1px solid var(--line); }
.ask-head h2 { font-family: var(--display); font-size: 1.2rem; font-weight: 400; }
.ask-head p { font-size: 0.8rem; color: var(--muted); }
.ask-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.msg { max-width: 88%; padding: 0.65rem 0.95rem; border-radius: 14px; font-size: 0.92rem; line-height: 1.55; }
.msg.bot { align-self: flex-start; background: color-mix(in srgb, var(--ink) 6%, transparent); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg ul { list-style: disc; padding-left: 1.1rem; margin-top: 0.35rem; }
.msg a { color: var(--accent); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.msg-actions button { padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: transparent; color: var(--accent); font-size: 0.82rem; cursor: pointer; }
.msg-actions button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.ask-suggest { display: flex; gap: 0.4rem; padding: 0 1rem 0.75rem; overflow-x: auto; scrollbar-width: none; }
.ask-suggest::-webkit-scrollbar { display: none; }
.ask-suggest button { flex: none; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 0.82rem; cursor: pointer; white-space: nowrap; }
.ask-suggest button:hover { color: var(--ink); border-color: var(--line-strong); }
.ask-form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--line); }
.ask-form input { flex: 1; min-width: 0; padding: 0.7rem 0.95rem; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 0.92rem; }
.ask-form input:focus { outline: none; border-color: var(--accent); }
.ask-form button { width: 2.9rem; border-radius: 12px; border: none; background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ask-form button:disabled { opacity: 0.35; cursor: default; }

/* ---------- Cursor, progress, small effects ---------- */
/* the quill: no blending, just ink and feather */
.quill, .quill-tag { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
.has-cursor .quill, .has-cursor .quill-tag.is-on { opacity: 1; }
.has-cursor.cursor-out .quill, .has-cursor.cursor-out .quill-tag,
.has-cursor.cursor-text .quill, .has-cursor.cursor-text .quill-tag { opacity: 0; }
/* the nib sits at the pointer: the svg's tip is at (2, 38) of 40 */
.quill-pen {
  position: absolute;
  left: -2.6px;
  top: -49.4px;
  width: 52px;
  height: 52px;
  overflow: visible;
  transform-origin: 2.6px 49.4px;
  transition: transform 0.35s var(--ease);
  filter: drop-shadow(2px 4px 3px rgba(40, 25, 10, 0.4));
}
.quill .vane { fill: #e6cf9f; stroke: #2a1b10; stroke-width: 1.5; stroke-linejoin: round; }
.quill .barbs { fill: none; stroke: #6e4c2a; stroke-width: 1; stroke-linecap: round; }
.quill .shaft { fill: none; stroke: #2a1b10; stroke-width: 1.7; stroke-linecap: round; }
.quill .nib { fill: #1f150d; }
[data-theme="dark"] .quill .vane { fill: #f0e0bc; stroke: #120c07; }
[data-theme="dark"] .quill .shaft { stroke: #e8d2a6; }
.quill.is-ready .quill-pen { transform: rotate(-14deg) scale(1.08); }
.quill.is-down .quill-pen { transform: rotate(6deg) scale(0.94); }
.quill-tag {
  padding: 0.22rem 0.6rem;
  background: #f6ecda;
  color: #9c3f22;
  font-family: var(--caps);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(30, 15, 5, 0.25);
  rotate: -2deg;
}
.ink-drop {
  position: fixed;
  z-index: 299;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  pointer-events: none;
  border-radius: 46% 54% 60% 40% / 50% 42% 58% 50%;
  background: radial-gradient(circle at 40% 40%, rgba(40, 22, 10, 0.75), rgba(40, 22, 10, 0.45) 60%, transparent 72%);
  rotate: var(--r, 0deg);
  animation: ink 1.1s ease-out forwards;
}
[data-theme="dark"] .ink-drop { background: radial-gradient(circle at 40% 40%, rgba(240, 200, 140, 0.6), rgba(240, 200, 140, 0.3) 60%, transparent 72%); }
.ink-layer { position: fixed; inset: 0; z-index: 298; width: 100%; height: 100%; pointer-events: none; }
.is-inking, .is-inking * { user-select: none !important; -webkit-user-select: none !important; }
@keyframes ink { from { transform: scale(0.3); opacity: 1; } 40% { opacity: 0.85; } to { transform: scale(1.7); opacity: 0; } }
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input, .has-cursor textarea { cursor: text !important; }

.progress-bar { position: fixed; inset: 0 0 auto 0; z-index: 51; height: 2px; background: linear-gradient(90deg, var(--accent), var(--gold)); transform-origin: left; transform: scaleX(var(--progress, 0)); pointer-events: none; }
.to-top {
  position: fixed;
  z-index: 55;
  right: calc(var(--gutter) * 0.6);
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: none;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem) scale(0.9);
  transition: opacity 0.4s ease, transform 0.6s var(--ease), visibility 0s linear 0.4s;
}
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; transition: opacity 0.4s ease, transform 0.6s var(--ease); }
.to-top svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top circle { fill: none; stroke-width: 1.5; }
.to-top .track { stroke: var(--line-strong); }
.to-top .fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--progress, 0) * 100); }
.to-top .arrow { position: relative; width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transform: none; transition: transform 0.5s var(--ease); }
.to-top:hover .arrow { transform: translateY(-3px); }

.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.3; }
.roll > span, .roll::after { display: block; transition: transform 0.55s var(--ease); }
.roll::after { content: attr(data-text); position: absolute; left: 0; top: 100%; color: var(--accent); font-style: italic; }
a:hover > .roll > span, a:focus-visible > .roll > span, a:hover > .roll::after, a:focus-visible > .roll::after { transform: translateY(-100%); }

.hw { display: inline-block; white-space: nowrap; }
.hc { display: inline-block; transition: transform 0.6s var(--ease), color 0.4s ease; }
.hc:hover { transform: translateY(-0.08em) rotate(-3deg); color: var(--accent); transition-duration: 0.2s; }

.fx [data-reveal] { opacity: 0; transform: translate3d(0, 2rem, 0); transition: opacity 1s ease, transform 1.2s var(--ease); transition-delay: var(--d, 0ms); }
.fx [data-reveal="scale"] { transform: scale(0.96); }
.fx [data-reveal].is-in { opacity: 1; transform: none; }
.fx .words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.fx .words .w > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--wi, 0) * 70ms); }
.fx .words.is-in .w > span { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .note { width: min(19rem, 40vw); padding: 1.1rem 1.2rem 1.2rem; }
  .note p { font-size: 1.15rem; }
}
@media (max-width: 1000px) {
  .section-head.split, .studio-head, .chamber-head { grid-template-columns: 1fr; }
  .project a { grid-template-columns: minmax(0, 1fr) 8rem 1.5rem; row-gap: 0.35rem; }
  .project-desc { grid-column: 1 / 2; grid-row: 2; }
  .project-cat { grid-row: 1; grid-column: 2; }
  .project-go { grid-row: 1; grid-column: 3; }
  .about .wrap { grid-template-columns: 1fr; }
  .about-body { grid-column: 1; }
}
@media (max-width: 760px) {
  body { font-size: 1.05rem; }

  /* the rail folds into a wax seal that opens a full-page index */
  .site-nav { top: auto; bottom: auto; width: auto; height: auto; padding: 0; background: none; border: none; }
  .seal { display: none; }
  .menu-seal {
    display: grid;
    position: fixed;
    z-index: 3;
    left: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: 3.4rem;
    height: 3.4rem;
  }
  .menu-seal i { position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(156, 63, 34, 0.35); }
  .site-nav nav, .rail-tools { display: none; }
  .site-nav.is-open { position: fixed; inset: 0; z-index: 70; background: var(--paper-2); display: flex; flex-direction: column; justify-content: center; padding: 2rem; }
  .site-nav.is-open nav { display: block; margin: 0; }
  .site-nav.is-open ul { align-items: flex-start; gap: 1.2rem; }
  .site-nav.is-open nav a { flex-direction: row; align-items: baseline; gap: 1rem; color: var(--ink); }
  .site-nav.is-open nav a b { color: var(--accent); width: 2.6rem; }
  .site-nav.is-open nav a span { writing-mode: horizontal-tb; rotate: none; font-size: 2.6rem; font-style: normal; }
  .site-nav.is-open nav a::after { display: none; }
  .site-nav.is-open .rail-tools { display: flex; flex-direction: row; margin-top: 2.5rem; }
  .site-nav.is-open .menu-seal { left: auto; right: 1rem; top: calc(1rem + env(safe-area-inset-top, 0px)); bottom: auto; }

  .sitting { height: 520vh; height: 520svh; }
  .stage { background: var(--paper); }
  .hero-copy { top: calc(env(safe-area-inset-top, 0px) + 2.5rem); right: var(--gutter); max-width: none; }
  .hero-title { font-size: clamp(2.8rem, 14vw, 4.4rem); margin-bottom: 1rem; }
  .hero-sub { font-size: 1rem; margin-bottom: 1.25rem; }
  .btn { min-height: 2.8rem; padding: 0 1.2rem; font-size: 0.72rem; }
  .plaque { display: none; }
  .orbit { bottom: auto; top: 1.25rem; }
  .scroll-cue { left: auto; right: var(--gutter); bottom: 2.5vh; }
  /* on phones the notes sit below and above the letterboxed footage */
  .note { width: auto; left: var(--gutter) !important; right: var(--gutter) !important; margin: 0 !important; }
  .note.n1, .note.n2, .note.n5 { top: auto; bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
  .note.n3, .note.n4 { bottom: auto; top: 5vh; }
  .note p { font-size: 1.1rem; }
  .note .motto { font-size: 1.7rem; }

  .project a { grid-template-columns: minmax(0, 1fr) 1.5rem; padding: 1.4rem 0.25rem; }
  .project-desc { grid-column: 1; grid-row: 2; }
  .project-cat { grid-column: 1; grid-row: 3; font-size: 0.9rem; }
  .project-go { grid-column: 2; grid-row: 1; }
  .project a:hover .project-title { transform: translateX(0.5rem); }

  .closeup { height: 220vh; height: 220svh; }
  .closeup-line { bottom: 18vh; font-size: clamp(2.2rem, 11vw, 3.4rem); }
  /* the room is wider than a phone: swipe to look round it */
  .room { width: auto; height: 68svh; }
  .room-scroll { margin-top: 2rem; }
  .hs-label { opacity: 0.92; transform: none; font-size: 0.95rem; }
  .hs-window .hs-label { display: none; }
  .room-legend { flex-direction: column; gap: 0.5rem; }
  .rack-row { overflow-x: auto; overflow-y: visible; height: 17rem; padding: 2.5rem 1rem 0; scroll-snap-type: x proximity; scrollbar-width: none; }
  .rack-canvas { margin-left: -1.6rem; scroll-snap-align: center; }
  .bookcase { width: auto; height: 62svh; }
  .book-open { margin: 2.5rem 0 0; padding: 1.5rem 1.4rem 1.6rem; flex-direction: column; gap: 1rem; }
  .book-badge { width: 5.5rem; height: 5.5rem; }
  .pinboard { padding: 2.5rem 1.25rem; gap: 3rem; }
  .letter { padding: 1rem 0.75rem 1.4rem; }

  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .contact-form { grid-template-columns: 1fr; }

  .progress-bar { left: 0; }
  .ask { top: auto; left: 0.5rem; right: 0.5rem; bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)); width: auto; height: min(78vh, 600px); }
  .lightbox figure { padding: 4rem 0.75rem 6rem; }
  .lb-prev, .lb-next { top: auto; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); translate: none; }
  .lb-prev { left: calc(50% - 3.5rem); }
  .lb-next { right: calc(50% - 3.5rem); }
}
@media (max-width: 400px) {
  :root { --gutter: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .fx [data-reveal], .fx .words .w > span { opacity: 1; transform: none; }
}
