/* ==========================================================
   Monte v2 — one screen, glass, motion.
   Tokens first. The whole theme flips on [data-theme].
   ========================================================== */

:root {
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --hand: "Caveat", "Segoe Script", cursive;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;

  --r-tray: 26px;
  --r-pill: 999px;
  --pad: clamp(14px, 2.2vw, 34px);
  --ease: cubic-bezier(0.16, 0.84, 0.3, 1);
}

html[data-theme="dark"] {
  --bg: #07080a;
  --text: #f2eee6;
  --muted: rgba(242, 238, 230, 0.6);
  --faint: rgba(242, 238, 230, 0.38);
  --accent: #ff5c33;

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(18, 20, 24, 0.66);
  --glass-brd: rgba(255, 255, 255, 0.13);
  --glass-hi: rgba(255, 255, 255, 0.10);

  --pill-bg: rgba(255, 255, 255, 0.05);
  --pill-bg-hover: rgba(255, 255, 255, 0.11);
  --pill-brd: rgba(255, 255, 255, 0.11);

  --line: rgba(255, 255, 255, 0.09);
  --scrim: rgba(3, 4, 6, 0.55);
  --panel-bg: rgba(9, 10, 12, 0.86);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--glass-hi);
  --vignette: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(3, 4, 6, 0.72) 100%);
}

html[data-theme="light"] {
  --bg: #eeeae2;
  --text: #14140f;
  --muted: rgba(20, 20, 15, 0.62);
  --faint: rgba(20, 20, 15, 0.46);
  --accent: #cf3a13;

  --glass: rgba(255, 255, 255, 0.48);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-brd: rgba(255, 255, 255, 0.9);
  --glass-hi: rgba(255, 255, 255, 0.85);

  --pill-bg: rgba(255, 255, 255, 0.52);
  --pill-bg-hover: rgba(255, 255, 255, 0.86);
  --pill-brd: rgba(20, 20, 15, 0.1);

  --line: rgba(20, 20, 15, 0.1);
  --scrim: rgba(238, 234, 226, 0.6);
  --panel-bg: rgba(247, 245, 240, 0.9);
  --shadow: 0 22px 60px rgba(60, 48, 36, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --vignette: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(214, 206, 194, 0.6) 100%);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s ease, color 0.5s ease;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 11px;
  z-index: 300;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- background scene ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--vignette);
  transition: background 0.5s ease;
}




/* ---------- app shell: locked to one screen ---------- */

.app {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.4vw, 20px);
  padding: var(--pad);
  transition: opacity 0.5s ease, filter 0.5s ease, transform 0.7s var(--ease);
}

body[data-view="panel"] .app {
  opacity: 0.14;
  filter: blur(7px);
  transform: scale(0.982);
  pointer-events: none;
}

/* ---------- top bar ---------- */

.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  flex: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 25px);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---------- the nav pill tray ---------- */

.nav-tray {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-brd);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  max-width: 100%;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.26s, color 0.26s;
}

.nav-pill:hover { background: var(--pill-bg-hover); color: var(--text); }

.nav-pill--cv {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 92, 51, 0.35);
}
.nav-pill--cv:hover { background: var(--accent); color: #fff; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.chip--btn:hover { background: var(--pill-bg-hover); border-color: var(--accent); color: var(--text); }
.theme-glyph { font-size: 11px; line-height: 1; color: var(--accent); }

/* ---------- main split ---------- */

.main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(18px, 4vw, 64px);
  align-items: center;
  min-height: 0;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 22px);
  min-height: 0;
  padding-left: 2px;
}

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.intro-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 5.6vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.034em;
  margin: 0;
  text-wrap: balance;
}

.intro-name em { font-style: italic; color: var(--accent); }

.intro-rest {
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 25px);
  line-height: 1.42;
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--muted);
  max-width: 32ch;
}

.legal {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.legal span { color: var(--muted); }

/* ---------- the writing loop ---------- */

.writer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: clamp(190px, 25vh, 270px);
  padding-left: clamp(0px, 6vw, 110px);
}

/* Each quote carries its own voice. The block keeps a fixed height so the
   page does not jump when the voice changes mid-loop. */
.writer-line {
  position: relative;
  max-width: 26ch;
  margin: 0;
  color: var(--text);
  font-size: calc(var(--q-size, 26px) * var(--q-scale, 1));
  overflow-wrap: break-word;
}

.writer-line.q-serif-italic {
  --q-size: clamp(21px, 2.45vw, 34px);
  font-family: var(--serif);
  font-style: italic;
  line-height: 1.45;
  letter-spacing: -0.012em;
}

.writer-line.q-mono {
  --q-size: clamp(11.5px, 1.05vw, 14px);
  font-family: var(--mono);
  text-transform: uppercase;
  line-height: 1.95;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.writer-line.q-hand {
  --q-size: clamp(26px, 3.1vw, 42px);
  font-family: var(--hand);
  line-height: 1.3;
  letter-spacing: 0.004em;
}

.writer-line.q-caps {
  --q-size: clamp(15px, 1.55vw, 21px);
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1.72;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.writer-line.q-serif {
  --q-size: clamp(24px, 2.8vw, 38px);
  font-family: var(--serif);
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.writer-line.q-display {
  --q-size: clamp(22px, 2.5vw, 35px);
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: -0.014em;
}

.writer-line.q-sans {
  --q-size: clamp(18px, 1.95vw, 26px);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.52;
  letter-spacing: -0.015em;
}

.writer-line.q-script {
  --q-size: clamp(25px, 3vw, 40px);
  font-family: var(--script);
  line-height: 1.48;
  letter-spacing: 0.008em;
}

.nib {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.98em;
  height: 1.4em;
  color: var(--accent);
  transition: opacity 0.3s ease;
  will-change: transform;
}

.nib svg { width: 100%; height: 100%; display: block; }

.nib.is-typing svg { animation: nibBob 0.16s ease-in-out infinite alternate; }

@keyframes nibBob {
  from { transform: translate(0, 0); }
  to { transform: translate(-1px, -1.6px); }
}

/* ---------- footer signature ---------- */

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding-bottom: 2px;
}

.foot::before {
  content: "";
  width: 1px;
  height: clamp(10px, 1.6vw, 20px);
  background: linear-gradient(to bottom, transparent, var(--accent));
  opacity: 0.7;
}

.signature {
  font-family: var(--script);
  font-size: clamp(42px, 6.4vw, 96px);
  line-height: 0.95;
  color: var(--text);
  opacity: 0.94;
  letter-spacing: 0.01em;
  padding-right: 0.08em;
}

/* ---------- full-screen panel ---------- */

.panel { position: fixed; inset: 0; z-index: 50; }
.panel[hidden] { display: none; }

.panel-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel-bg);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(22px) scale(0.994);
  transition: opacity 0.45s ease, transform 0.72s var(--ease);
}

body[data-view="panel"] .panel-card { opacity: 1; transform: none; }

/* the dialog is focused programmatically for screen readers;
   a ring around the whole surface is noise, not a focus cue */
.panel-card:focus,
.panel-card:focus-visible { outline: none; }

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 10px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  transition: background 0.28s, color 0.28s, border-color 0.28s;
}
.pill-btn:hover { background: var(--pill-bg-hover); color: var(--text); border-color: var(--accent); }

.panel-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-nav { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  transition: background 0.28s, color 0.28s, border-color 0.28s;
}
.icon-btn:hover:not(:disabled) { background: var(--pill-bg-hover); color: var(--text); border-color: var(--accent); }
.icon-btn:disabled { opacity: 0.28; cursor: default; }
.icon-btn--close { margin-left: 8px; font-size: 11px; }

.panel-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--pill-brd) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 8px; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--pill-brd); border-radius: 99px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }

.panel-body {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  padding: clamp(14px, 1.7vw, 26px) clamp(20px, 4.6vw, 72px) clamp(60px, 8vw, 120px);
}

.p-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.p-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 68px);
  line-height: 1;
  letter-spacing: -0.028em;
  margin: 14px 0 0;
  max-width: 22ch;
}

.p-lead {
  margin: 18px 0 0;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.65;
  color: var(--muted);
  max-width: 62ch;
}

.p-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }

.p-chips span {
  font-family: var(--mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  border-radius: var(--r-pill);
  padding: 6px 11px;
}

.p-prose { margin-top: 22px; max-width: 66ch; }

.p-prose p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}

.p-h3 {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
  font-weight: 400;
  margin: 34px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.p-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.p-link:hover { background: var(--accent); color: #fff; }

/* a project can offer a live link and a downloadable file at once */
.p-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.p-actions .p-link { margin-top: 0; }

/* project detail: reading column + sticky meta rail */

.pd-grid {
  display: grid;
  grid-template-columns: minmax(0, 640px) 280px;
  justify-content: start;
  gap: clamp(28px, 5vw, 72px);
  margin-top: 34px;
  align-items: start;
}

.pd-main { min-width: 0; }
.pd-side { position: sticky; top: 8px; }
.pd-side .info { margin-top: 0; }
.pd-side .info-row:first-child { border-top: 1px solid var(--line); }


/* ---------- card grids ---------- */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(210px, 20vw, 280px), 1fr));
  gap: clamp(16px, 2vw, 30px);
}

.cat { margin-top: clamp(28px, 3.4vw, 52px); }
.cat:first-of-type { margin-top: clamp(22px, 2.8vw, 38px); }

.cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.cat-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(19px, 2vw, 27px);
  letter-spacing: -0.012em;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.cat-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.cat-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  font-family: var(--mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.28s, color 0.28s, border-color 0.28s;
}
.cat-all:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* project card */

.pcard {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: none;
  border: 0;
}

.pcard-plate {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 0.5s var(--ease), border-color 0.3s, background 0.3s,
    box-shadow 0.5s var(--ease);
}

.pcard:hover .pcard-plate,
.pcard:focus-visible .pcard-plate {
  transform: translateY(-4px);
  border-color: rgba(255, 92, 51, 0.5);
  background: var(--pill-bg-hover);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.75);
}

.pcard-title { transition: color 0.35s; }
.pcard:hover .pcard-title { color: var(--accent); }

.pcard-plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.pcard:hover .pcard-plate img { transform: scale(1.04); }

.pcard-num {
  font-family: var(--serif);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1;
  color: var(--faint);
  transition: color 0.4s;
}

.pcard:hover .pcard-num { color: var(--accent); }

.pcard-year {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.pcard-flag {
  position: absolute;
  left: 12px;
  top: 10px;
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: color 0.35s, border-color 0.35s;
}
.pcard:hover .pcard-flag { color: var(--accent); border-color: var(--accent); }

.pcard-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.6vw, 21px);
  letter-spacing: -0.01em;
  margin: 12px 0 0;
}

.pcard-sub {
  font-family: var(--mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 5px 0 0;
}

/* market card */

.mcard {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.mcard:hover { transform: translateY(-3px); border-color: rgba(255, 92, 51, 0.45); }

.mcard-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.mcard-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.6vw, 21px);
  letter-spacing: -0.01em;
  margin: 0;
}

.mcard-price {
  font-family: var(--mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  white-space: nowrap;
}

.mcard-detail {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--muted);
  flex: 1;
}

.mcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.mcard-format {
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.mcard-enq {
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.mcard-enq:hover { color: var(--accent); }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(30px, 5vw, 80px);
  align-items: start;
  margin-top: 0;
}

.about-main { min-width: 0; }

/* Sits under the heading now that the head lives in the left column. */
.about-prose { margin-top: clamp(20px, 2.2vw, 30px); }

/* The portrait floats: it holds its place while the words scroll past,
   with room above and below so it never kisses the header or the end. */
.about-side {
  position: sticky;
  top: clamp(8px, 1.6vh, 20px);
  align-self: start;
  padding-bottom: clamp(24px, 5vh, 64px);
}

.portrait {
  height: clamp(300px, 68vh, 660px);
  width: auto;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  margin-inline: auto;
  border-radius: 20px;
  border: 1px dashed var(--pill-brd);
  background: var(--pill-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.portrait-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 20px;
  text-align: center;
  color: var(--faint);
}

.portrait-empty svg { width: 30px; height: 30px; opacity: 0.55; }

.portrait-note {
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.7;
}

.cap-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(20px, 3vw, 48px);
  margin-top: 6px;
}

.cap {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.cap-n { font-family: var(--mono); font-size: 9px; color: var(--accent); padding-top: 3px; }
.cap-name { font-size: 14px; font-weight: 500; margin: 0; }
.cap-detail { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

.vision {
  margin: 20px 0 0;
  padding-left: 18px;
  border-left: 1px solid var(--accent);
  font-family: var(--serif);
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
  max-width: 60ch;
}

/* ---------- contacts ---------- */

.big-mail {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 46px);
  letter-spacing: -0.022em;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--accent);
  transition: color 0.3s;
}
.big-mail:hover { color: var(--accent); }

.info {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  max-width: 640px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.info-row a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--pill-brd);
  transition: color 0.25s, border-color 0.25s;
}
.info-row a:hover { color: var(--accent); border-color: var(--accent); }
.info-row dt {
  font-family: var(--mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--faint);
  padding-top: 2px;
}
.info-row dd { margin: 0; text-align: right; color: var(--text); }

.social-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 33px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--pill-brd);
  background: var(--pill-bg);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text);
  transition: background 0.28s, border-color 0.28s, transform 0.28s var(--ease);
}
.pill:hover { background: var(--pill-bg-hover); border-color: var(--accent); transform: translateY(-2px); }
.pill.is-primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- entrance choreography ---------- */

.intro > *,
.writer,
.foot,
.top { animation: rise 0.9s var(--ease) both; }

.intro > *:nth-child(1) { animation-delay: 0.10s; }
.intro > *:nth-child(2) { animation-delay: 0.18s; }
.intro > *:nth-child(3) { animation-delay: 0.26s; }
.intro > *:nth-child(4) { animation-delay: 0.34s; }
.writer { animation-delay: 0.40s; }
.foot { animation-delay: 0.44s; }
.top { animation-delay: 0.05s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.panel-body > * { animation: pIn 0.6s var(--ease) both; }
.panel-body > *:nth-child(1) { animation-delay: 0.06s; }
.panel-body > *:nth-child(2) { animation-delay: 0.12s; }
.panel-body > *:nth-child(3) { animation-delay: 0.18s; }
.panel-body > *:nth-child(4) { animation-delay: 0.24s; }
.panel-body > *:nth-child(5) { animation-delay: 0.30s; }

@keyframes pIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- polish: hover, focus and micro-motion ---------- */

/* Capability numbers light up as you read down the list. */
.cap-n { transition: color 0.35s; }
.cap:hover .cap-n { color: var(--accent); }

/* Controls settle by a hair on press instead of not responding at all. */
.p-link,
.cat-all,
.pill-btn,
.nav-pill,
.icon-btn,
.mcard-enq {
  transition: background 0.28s, color 0.28s, border-color 0.28s,
    transform 0.28s var(--ease);
}
.p-link:hover,
.cat-all:hover,
.pill-btn:hover { transform: translateY(-1px); }
.p-link:active,
.cat-all:active,
.pill-btn:active,
.nav-pill:active,
.icon-btn:active { transform: translateY(0) scale(0.98); }

/* Small links draw their underline in from the left. */
.mcard-enq {
  position: relative;
  text-decoration: none;
}
.mcard-enq::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.mcard-enq:hover::after { transform: scaleX(1); }

/* The email address lifts a touch and its rule thickens. */
.big-mail { transition: color 0.3s, transform 0.35s var(--ease); }
.big-mail:hover { transform: translateY(-2px); }

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .top {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand toggle" "nav nav";
    row-gap: 10px;
  }
  .brand { grid-area: brand; }
  .chip--btn { grid-area: toggle; justify-self: end; }
  .nav-tray { grid-area: nav; justify-self: center; flex-wrap: wrap; justify-content: center; border-radius: 20px; }
  .nav-pill { height: 29px; padding: 0 11px; font-size: 8.5px; }
}

@media (max-width: 860px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: clamp(14px, 3vw, 26px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .main::-webkit-scrollbar { display: none; }
  .intro-name { font-size: clamp(38px, 9vw, 58px); }
  .intro-rest { font-size: clamp(16px, 3.4vw, 20px); max-width: 34ch; }
  .writer { padding-left: 0; min-height: clamp(160px, 22vh, 210px); }
  .writer-line { --q-scale: 0.78; max-width: 24ch; }
  .signature { font-size: clamp(38px, 11vw, 70px); }
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: clamp(24px, 5vw, 40px); }
  .pd-grid { grid-template-columns: 1fr; }
  .pd-side { position: static; }
  .about-side { position: static; max-width: 380px; padding-bottom: 0; }
  .portrait { height: auto; width: 100%; aspect-ratio: 3 / 4; }
  .cap-list { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 40vw, 240px), 1fr)); }
  .panel-body { padding-inline: clamp(16px, 4vw, 40px); }
  .p-title { font-size: clamp(28px, 7vw, 44px); }
}

@media (max-width: 560px) {
  .nav-pill { font-size: 8px; padding: 0 9px; letter-spacing: 0.08em; }
  .nav-tray { gap: 2px; padding: 4px; }
  .brand-name { font-size: 19px; }
  .chip { padding: 0 10px; }
  .info-row { flex-direction: column; gap: 4px; }
  .info-row dd { text-align: left; }
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pcard-title { font-size: 15px; }
  .cat-head { flex-wrap: wrap; gap: 10px; }
  .cat-all { height: 28px; padding: 0 11px; }
  .panel-bar { min-height: 56px; }
  .mcard { padding: 14px; }
}

@media (max-height: 660px) {
  .writer { min-height: clamp(150px, 20vh, 190px); }
  .writer-line { --q-scale: 0.82; }
  .signature { font-size: clamp(34px, 6vw, 56px); }
  .intro-name { font-size: clamp(32px, 4.4vw, 52px); }
  .intro-rest { font-size: clamp(15px, 1.6vw, 19px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .nib.is-typing { animation: none; }
}
