/* ============================================================
   Editorial Swiss Minimal — variant A
   Off-white paper · near-black ink · one ultramarine accent
   Display / Text / Labels: Jost — geometric minimal gothic (Futura spirit)
   ============================================================ */

/* ---------- self-hosted type (Jost variable, latin) ---------- */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/jost.woff2') format('woff2');
}

/* ---------- design tokens ---------- */
:root {
  --paper:   #F1EDE3;
  --paper-2: #E9E3D5;
  --plate:   #FBF8F1;
  --ink:     #17150E;
  --ink-2:   #4C483B;
  --ink-3:   #6B6656;
  --line:    rgba(23, 21, 14, 0.14);
  --line-2:  rgba(23, 21, 14, 0.28);
  --accent:  #122AD6;          /* International Klein Blue spirit */
  --accent-deep: #0B1C9C;
  --ikb:     #122AD6;          /* fixed site accent for card numbers/status (plates set --accent per project) */

  --shell: 1240px;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --gap: clamp(2.4rem, 4.5vw, 4.75rem);

  --f-display: 'Jost', 'Futura', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --f-text: 'Jost', 'Futura', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --f-label: 'Jost', 'Futura', 'Avenir Next', 'Helvetica Neue', sans-serif;

  --ease: cubic-bezier(0.22, 0.68, 0.16, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-3) transparent; scrollbar-width: thin; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  line-height: 1.62;
  font-weight: 400;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* paper texture: a barely-there Swiss grid for depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--line) 0.5px, transparent 0.5px),
    linear-gradient(to bottom, var(--line) 0.5px, transparent 0.5px);
  background-size: 96px 96px;
  opacity: 0.22;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 100%);
}

/* film grain — barely-there tactility over the paper */
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.05; mix-blend-mode: multiply;
}

/* ---------- selection / focus / scrollbar ---------- */
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb {
  background: var(--ink-3); border: 3px solid var(--paper); border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-2); }

.skip {
  position: fixed; top: 0; left: 0; transform: translateY(-120%);
  background: var(--ink); color: var(--paper); padding: 0.7rem 1.1rem;
  z-index: 100; font-family: var(--f-label); font-weight: 500; font-size: 0.8rem; border-radius: 0 0 6px 0;
  transition: transform 0.2s var(--ease);
}
.skip:focus { transform: translateY(0); }

.shell { width: min(100% - var(--pad) * 2, var(--shell)); margin-inline: auto; position: relative; z-index: 1; }

/* mono kicker used across sections */
.kicker {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 0.7rem;
}
.kicker::before {
  content: ""; width: 1.9rem; height: 1px; background: var(--ink-2); display: inline-block;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(9px);
  -webkit-backdrop-filter: saturate(1.4) blur(9px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.85rem;
}
.site-header__lead { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.4rem); }

/* availability signal — green dot + tracked label (header + footer) */
.avail {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--f-label); font-weight: 500; font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
}
.avail[hidden] { display: none; }
.avail__dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0;
  background: #1F7A46;
}
/* hide the header signal before it crowds the logo + nav */
@media (max-width: 720px) { .avail--header { display: none; } }
.logo {
  font-family: var(--f-display); font-weight: 500; font-size: 1rem;
  letter-spacing: 0.14em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 0.5rem;
  line-height: 1;
}
.logo__dot { width: 0.5rem; height: 0.5rem; background: var(--accent); border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  .logo:hover .logo__dot { transform: scale(1.35); transition: transform 0.3s var(--ease); }
}
.nav { display: flex; gap: clamp(1rem, 2.5vw, 2.4rem); align-items: center; }
.nav a {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-2); position: relative; padding-block: 0.3rem;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
  .nav a:hover::after { transform: scaleX(1); }
}
@media (max-width: 560px) { .nav a:first-child { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(2rem, 4.5vw, 4rem); padding-bottom: clamp(1rem, 2.5vw, 2rem); }
.hero__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.75rem, 2vw, 1.4rem) 1rem; align-items: end;
}
.hero__kicker { grid-column: 1 / -1; margin-bottom: clamp(1.2rem, 3vw, 2.4rem); }
.hero__name {
  grid-column: 1 / -1;
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(2.4rem, 7.8vw, 7.2rem);
  line-height: 0.94; letter-spacing: -0.015em;
  text-transform: uppercase; overflow-wrap: break-word;
  will-change: transform;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.6rem);
}
.hero__role {
  grid-column: 1 / 7; align-self: start;
  font-family: var(--f-label); font-weight: 500; font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
  padding-top: 0.4rem;
}
.hero__tag {
  grid-column: 7 / -1;
  font-family: var(--f-text);
  font-size: clamp(1.1rem, 2.3vw, 1.7rem); line-height: 1.38; color: var(--ink-2);
  max-width: 34ch; text-wrap: balance;
}
.hero__scroll {
  grid-column: 1 / -1; margin-top: clamp(1rem, 2.5vw, 1.85rem);
  display: inline-flex; align-items: center; gap: 0.6rem; width: fit-content;
  font-family: var(--f-label); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2);
}
.hero__scroll .arrow {
  display: inline-block; transition: transform 0.4s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .hero__scroll:hover { color: var(--ink); }
  .hero__scroll:hover .arrow { transform: translateY(4px); }
}
@media (max-width: 720px) {
  .hero__role { grid-column: 1 / -1; margin-bottom: 0.6rem; }
  .hero__tag { grid-column: 1 / -1; }
}

/* ============================================================
   CAPABILITIES TICKER — signature strip in the hero-to-works band
   ============================================================ */
.ticker {
  position: relative; z-index: 1; overflow: hidden;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 55%, var(--paper));
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.ticker__track {
  display: flex; width: max-content;
  animation: ticker-scroll 46s linear infinite;
}
.ticker__group { display: flex; flex-shrink: 0; align-items: center; padding-block: 0.85rem; }
.ticker__item {
  font-family: var(--f-label); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
  display: inline-flex; align-items: center; padding-inline: clamp(0.9rem, 2vw, 1.6rem);
}
.ticker__item::before {
  content: ""; width: 0.34rem; height: 0.34rem; margin-right: 0.7rem; flex-shrink: 0;
  background: var(--accent); transform: rotate(45deg);
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (hover: hover) and (pointer: fine) {
  .ticker:hover .ticker__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; transform: none; }
}

/* section head */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  border-top: 1.5px solid var(--ink); padding-top: 1.1rem; margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}
.sec-head__title {
  font-family: var(--f-display); font-weight: 500; text-transform: uppercase;
  font-size: clamp(1.6rem, 3.6vw, 2.7rem); letter-spacing: 0.02em; line-height: 1.05;
}
.sec-head__meta { font-family: var(--f-label); font-weight: 500; font-size: 0.76rem; color: var(--ink-2); letter-spacing: 0.05em; }

/* ============================================================
   WORKS
   ============================================================ */
.works { padding-top: clamp(1rem, 2vw, 1.75rem); padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.filter {
  display: flex; flex-wrap: wrap; gap: 0.1rem 1.7rem;
  border-bottom: 1px solid var(--line-2); margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.filter__btn {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.6rem 0.05rem; border: 0; border-radius: 0;
  color: var(--ink-3); background: transparent; position: relative;
  transition: color 0.25s var(--ease);
}
.filter__btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .filter__btn:hover { color: var(--ink); }
}
.filter__btn.is-active { color: var(--ink); }
.filter__btn.is-active::after { transform: scaleX(1); }
.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;
}

.plates {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(3.5rem, 6vw, 5.5rem) 2rem;
}
.plate { grid-column: span 12; }
/* 2-up on the 12-col axis from 720px up — stays 2-up at large sizes for gallery-like plates */
@media (min-width: 720px) { .plate { grid-column: span 6; } }

.plate[hidden] { display: none; }
.plate__btn {
  display: block; width: 100%; text-align: left; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.plate__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }

.plate__frame { position: relative; display: block; }
/* registration-shift plate: an accent duplicate slides out on hover */
.plate__frame::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border: 1.5px solid var(--accent);
  opacity: 0; transform: translate(0, 0);
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.plate__cover {
  position: relative; display: block; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--plate);
  aspect-ratio: 3 / 2;
}
/* real screenshots sit on a warm mat with a hairline frame, like a print —
   matching the two 'contain' covers and the inset SVG art */
.plate__cover--shot { padding: clamp(0.9rem, 2vw, 1.4rem); }
.plate__cover--shot .cover-img {
  border: 1px solid var(--line-2); object-fit: cover; width: 100%; height: 100%;
}
.plate__cover .cover-svg {
  width: 100%; height: 100%;
  filter: saturate(0.86) sepia(0.03);
  transition: transform 0.65s var(--ease), filter 0.5s var(--ease);
}
/* hover-only clickability cue; cover stays a clean product shot at rest */
.plate__view {
  position: absolute; right: 0.7rem; bottom: 0.7rem; z-index: 2;
  font-family: var(--f-label); font-weight: 500; font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper); background: var(--ink);
  padding: 0.34rem 0.62rem; display: inline-flex; align-items: center; gap: 0.4rem;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.plate__view .ar { transition: transform 0.3s var(--ease); }
/* keyboard focus keeps the reveal; the hover twin lives in the hover media query below */
.plate__btn:focus-visible .plate__view { opacity: 1; transform: none; }
.plate__btn:focus-visible .plate__view .ar { transform: translate(2px, -2px); }
@media (hover: hover) and (pointer: fine) {
  .plate__btn:hover .plate__view { opacity: 1; transform: none; }
  .plate__btn:hover .plate__view .ar { transform: translate(2px, -2px); }
}

.plate__cap {
  display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: baseline;
  padding-top: 1rem;
}
.plate__no {
  font-family: var(--f-label); font-weight: 500; font-size: 0.82rem; color: var(--ikb);
  grid-row: 1 / 3; align-self: start; padding-top: 0.35rem;
  transition: color 0.3s var(--ease); font-variant-numeric: tabular-nums;
}
.plate__title {
  font-family: var(--f-display); font-weight: 500; font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  letter-spacing: -0.01em; line-height: 1.08;
}
.plate__title .sweep {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 100%;
  background-size: 0% 2px; padding-bottom: 2px;
  transition: background-size 0.45s var(--ease);
}
.plate__foot {
  grid-column: 2; display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 0.3rem 0.7rem; margin-top: 0.4rem;
}
.plate__cat {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; color: var(--ink-2); letter-spacing: 0.04em;
}
.plate__status {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ikb);
  display: inline-flex; align-items: center; gap: 0.42rem;
}
.plate__status-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--ikb); }

/* choreography — :focus-visible (keyboard) stays outside the media query;
   the :hover twin is gated so touch taps never leave a plate stuck "hovered" */
.plate__btn:focus-visible .plate__cover .cover-svg { transform: scale(1.025); filter: saturate(1); }
.plate__btn:focus-visible .plate__frame::after { opacity: 1; transform: translate(11px, 11px); }
.plate__btn:focus-visible .plate__title .sweep { background-size: 100% 2px; }
@media (hover: hover) and (pointer: fine) {
  .plate__btn:hover .plate__cover .cover-svg { transform: scale(1.025); filter: saturate(1); }
  .plate__btn:hover .plate__frame::after { opacity: 1; transform: translate(11px, 11px); }
  .plate__btn:hover .plate__title .sweep { background-size: 100% 2px; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding-block: clamp(4rem, 9vw, 8rem); }
.about__grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.5rem, 4vw, 3rem) 1rem;
}
.about__lead {
  grid-column: 1 / -1;
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.6rem, 4.2vw, 3rem); line-height: 1.12; letter-spacing: -0.01em;
  text-wrap: balance; max-width: 20ch;
}
/* highlighter sweep — reads as emphasis, not a link */
.about__lead .em {
  color: var(--ink);
  background: linear-gradient(transparent 60%, color-mix(in srgb, var(--accent) 26%, transparent) 60%);
  padding: 0 0.06em;
}
.about__body { grid-column: 1 / 8; font-size: 1.06rem; color: var(--ink-2); max-width: 52ch; }
.about__body p + p { margin-top: 1rem; }
.about__skills { grid-column: 9 / -1; align-self: start; }
.about__skills h3, .about__why h3 {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.about__skills ul { display: flex; flex-direction: column; }
.about__skills li {
  font-family: var(--f-label); font-weight: 500; font-size: 0.86rem; color: var(--ink);
  padding: 0.5rem 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}

/* "why work with me" — same ruled language as the skills list, numbers lead */
.about__why { margin-top: clamp(1.75rem, 4vw, 2.5rem); max-width: 46ch; }
.about__why ul { display: flex; flex-direction: column; }
.about__why li {
  font-family: var(--f-label); font-weight: 500; font-size: 0.86rem; color: var(--ink);
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  display: flex; gap: 0.9rem; align-items: baseline;
}
@media (max-width: 800px) {
  .about__body { grid-column: 1 / -1; }
  .about__skills { grid-column: 1 / -1; margin-top: 1rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1.5px solid var(--ink); margin-top: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(3rem, 7vw, 6rem);
}
.footer__top { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem 1rem; align-items: start; }
.footer__cta { grid-column: 1 / 8; }
.footer__cta .kicker { margin-bottom: 0.9rem; }
.footer__cta .avail:not([hidden]) { display: flex; margin-bottom: 1.4rem; }
.footer__mail {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.55rem); letter-spacing: -0.01em; line-height: 1.2;
  display: inline-block; position: relative;
}
.footer__mail::after {
  content: ""; position: absolute; left: 0; bottom: 0.05em; height: 3px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .footer__mail:hover::after { transform: scaleX(1); }
}
.footer__right { grid-column: 9 / -1; display: flex; flex-direction: column; gap: 1.6rem; }
.footer__social { display: flex; flex-direction: column; gap: 0.2rem; }
.footer__social[hidden] { display: none; }
.footer__social a {
  font-family: var(--f-label); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.04em;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; color: var(--ink-2);
  transition: color 0.25s var(--ease), padding-left 0.3s var(--ease);
}
.footer__social a .ar { transition: transform 0.3s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .footer__social a:hover { color: var(--ink); padding-left: 0.5rem; }
  .footer__social a:hover .ar { transform: translate(3px, -3px); }
}

/* "working with me" — same ruled rows as the socials list, but plain text */
.footer__working h3 {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.9rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.footer__working ul { display: flex; flex-direction: column; }
.footer__working li {
  font-family: var(--f-label); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--ink-2);
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
}
.footer__bottom {
  margin-top: clamp(2.5rem, 6vw, 4.5rem); display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.04em;
}
@media (max-width: 720px) {
  .footer__cta, .footer__right { grid-column: 1 / -1; }
  .footer__right { margin-top: 1rem; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: clamp(0.5rem, 3vw, 2.5rem);
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--ink) 46%, transparent);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__panel {
  position: relative; z-index: 1;
  width: min(980px, 100%); max-height: min(90vh, 900px);
  background: var(--paper); border: 1.5px solid var(--ink);
  box-shadow: 22px 22px 0 -2px color-mix(in srgb, var(--accent) 90%, var(--ink));
  display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden;
  opacity: 0; transform: translateY(26px) scale(0.975);
  transition: opacity 0.5s var(--ease), transform 0.55s var(--ease);
}
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal__media {
  background: var(--plate); border-right: 1.5px solid var(--ink);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem;
}
.modal__cover { display: block; width: 100%; }
.modal__cover .cover-svg { border: 1px solid var(--line-2); width: 100%; height: auto; }
/* small caption under the modal cover (e.g. abstracted / concept visuals) */
.modal__covernote {
  font-family: var(--f-label); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.08em;
  color: var(--ink-3); text-align: center; max-width: 42ch; line-height: 1.5;
}
.modal__covernote[hidden] { display: none; }
.modal__bodywrap {
  position: relative; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  /* bound the scroller by the viewport directly: the panel only has a
     max-height (no definite height), so a grid track alone won't cap it */
  max-height: min(90vh, 900px);
}
.modal__body {
  flex: 1 1 auto; min-height: 0;
  padding: clamp(1.6rem, 3vw, 2.75rem);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
/* fade hint that the case body scrolls (toggled by main.js) */
.modal__fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2.75rem; z-index: 2;
  pointer-events: none; opacity: 0;
  background: linear-gradient(to top, var(--paper), rgba(241, 237, 227, 0)); /* rgba = --paper */
  transition: opacity 0.3s var(--ease);
}
/* seated flush in the panel's top-right corner; the ink seams on its inner
   (left/bottom) edges match the 1.5px frame so it reads as part of the frame */
.modal__close {
  position: absolute; top: 0; right: 0; z-index: 4;
  width: 3rem; height: 3rem; display: grid; place-items: center;
  color: var(--paper); background: var(--ink);
  border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.modal__close svg { width: 1.15rem; height: 1.15rem; }
@media (hover: hover) and (pointer: fine) {
  .modal__close:hover { background: var(--accent); color: var(--paper); }
}
.modal__close:focus-visible { outline: 2px solid var(--paper); outline-offset: -7px; }

.modal__kicker {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem; padding-right: 2.75rem;
}
.modal__title {
  font-family: var(--f-display); font-weight: 500; font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.01em; line-height: 1.02;
}
.modal__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem;
  font-family: var(--f-label); font-weight: 500; font-size: 0.76rem; color: var(--ink-2);
  margin-top: 0.9rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line);
}
.modal__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.22rem 0.6rem; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.68rem; border: 1px solid var(--line-2);
}
.badge__dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; }
.badge--wip { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.badge--wip .badge__dot { background: var(--accent); }
.badge--shipped { color: var(--ink-2); }
.badge--shipped .badge__dot { background: #1F7A46; }

/* one-line role label under the meta */
.modal__role {
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.05em;
  color: var(--ink-3); margin-top: 0.75rem;
}
.modal__role[hidden] { display: none; }

.modal__tagline {
  font-family: var(--f-text); font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.4; color: var(--ink); margin-top: 1.3rem;
}
/* "key details" — ruled hairline list, same feel as the about skills list */
.modal__facts { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.modal__facts li {
  font-family: var(--f-text); font-size: 0.94rem; color: var(--ink-2);
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
}
#modal-facts-sec[hidden] { display: none; }
.modal__section { margin-top: 1.6rem; }
.modal__section h3 {
  font-family: var(--f-label); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.55rem;
}
.modal__section p { color: var(--ink-2); font-size: 1.02rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--f-label); font-weight: 500; font-size: 0.76rem; color: var(--ink);
  padding: 0.4rem 0.75rem; border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--plate);
}

/* real product screenshots as covers */
.cover-img { object-fit: cover; object-position: center top; background: var(--plate); }
.cover-img--contain { object-fit: contain; padding: clamp(0.9rem, 2vw, 1.5rem); }
.modal__cover .cover-img { height: auto; max-height: min(58vh, 540px); object-fit: contain; }

/* case-panel footer: prev/next on the left, action buttons on the right */
.modal__footer {
  margin-top: 1.9rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.modal__nav { display: inline-flex; gap: 0.4rem; }
.modal__navbtn {
  font-family: var(--f-label); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); background: transparent; border: 1px solid var(--line-2); padding: 0.55rem 0.75rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.modal__navbtn .ar { transition: transform 0.3s var(--ease); }
.modal__navbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal__actions { display: inline-flex; flex-wrap: wrap; align-items: stretch; gap: 0.6rem; }

/* shared metrics so VIEW LIVE (ink) + START A PROJECT (ink outline) match heights */
.modal__live, .modal__cta {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--f-label); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.16em; text-transform: uppercase; padding: 0.8rem 1.35rem;
  border: 1px solid var(--ink);
}
.modal__live { color: var(--paper); background: var(--ink); transition: background 0.25s var(--ease); }
.modal__cta { color: var(--ink); background: transparent; transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.modal__live .ar, .modal__cta .ar { transition: transform 0.3s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .modal__live:hover { background: var(--accent); border-color: var(--accent); }
  .modal__live:hover .ar { transform: translate(2px, -2px); }
  .modal__cta:hover { background: var(--ink); color: var(--paper); }
  .modal__cta:hover .ar { transform: translate(2px, -2px); }
  .modal__navbtn:hover { color: var(--ink); border-color: var(--ink); }
}

@media (max-width: 760px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal__panel {
    grid-template-columns: 1fr; max-height: 100dvh; height: 100dvh; width: 100%;
    border: 0; box-shadow: none; transform: translateY(100%);
    grid-template-rows: auto 1fr;
  }
  .modal.is-open .modal__panel { transform: none; }
  .modal__media { border-right: 0; border-bottom: 1.5px solid var(--ink); padding: 1.5rem 1.5rem 1.25rem; }
  .modal__cover { max-width: 420px; margin-inline: auto; }
  .modal__body { padding-bottom: 3rem; }
  /* mobile uses the definite 100dvh panel + `auto 1fr` rows to bound the body */
  .modal__bodywrap { max-height: none; }
}

body.is-locked { overflow: hidden; }

/* ============================================================
   REVEAL (progressive-enhancement; hidden only when JS present)
   ============================================================ */
html.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: calc(var(--i, 0) * 75ms);
  will-change: opacity, transform;
}
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .plate.is-out {
  opacity: 0; transform: scale(0.985) translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

/* ============================================================
   PLAYFUL DETAILS — the motion layer
   ============================================================ */

/* scroll progress hairline */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90;
  background: var(--ikb); transform-origin: left; transform: scaleX(0);
  pointer-events: none;
}

/* trailing cursor dot (created only on hover+fine pointers) */
.cursor-dot {
  position: fixed; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ikb); opacity: 0.4; z-index: 95; pointer-events: none;
}

/* covers tilt toward the cursor (transform driven by main.js) */
.plate__frame { transition: transform 0.35s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .plate__frame:hover { transition: transform 0.08s linear; }
}

/* hero name — per-letter staggered entrance; the block reveal steps aside */
.hero__name .word { display: inline-block; white-space: nowrap; }
.hero__name .ch { display: inline-block; }
html.js .hero__name.reveal { opacity: 1; transform: none; transition: none; }
html.js .hero__name .ch {
  transform: translateY(112%); opacity: 0;
  transition: transform 0.75s var(--ease), opacity 0.45s ease;
  transition-delay: calc(var(--ci) * 42ms + 120ms);
}
html.js .hero__name.is-in .ch { transform: none; opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .hero__name.is-in:hover .ch {
    transform: translateY(-0.07em);
    transition: transform 0.28s var(--ease);
    transition-delay: calc(var(--ci) * 16ms);
  }
}

/* modal content — staggered rise each time a case opens */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes cover-in {
  from { opacity: 0; transform: scale(1.035); }
  to { opacity: 1; transform: none; }
}
.modal.is-open .modal__cover { animation: cover-in 0.7s var(--ease) 0.1s backwards; }
.modal.is-open .modal__body > * { animation: rise-in 0.5s var(--ease) backwards; }
.modal.is-open .modal__body > *:nth-child(1) { animation-delay: 0.10s; }
.modal.is-open .modal__body > *:nth-child(2) { animation-delay: 0.16s; }
.modal.is-open .modal__body > *:nth-child(3) { animation-delay: 0.22s; }
.modal.is-open .modal__body > *:nth-child(4) { animation-delay: 0.28s; }
.modal.is-open .modal__body > *:nth-child(5) { animation-delay: 0.34s; }
.modal.is-open .modal__body > *:nth-child(6) { animation-delay: 0.40s; }
.modal.is-open .modal__body > *:nth-child(7) { animation-delay: 0.46s; }
.modal.is-open .modal__body > *:nth-child(8) { animation-delay: 0.52s; }
.modal.is-open .modal__body > *:nth-child(9) { animation-delay: 0.58s; }
.modal.is-open .modal__body > *:nth-child(10) { animation-delay: 0.64s; }

/* soft pulse — availability dot + in-development status dots */
@keyframes pulse-soft {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 38%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
.avail__dot { color: #1F7A46; animation: pulse-soft 2.4s ease-out infinite; }
.plate__status-dot { color: var(--ikb); animation: pulse-soft 2.4s ease-out infinite; }

/* section rules draw themselves in */
.sec-head { border-top: 0; position: relative; }
.sec-head::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 1.5px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease) 0.1s;
}
.sec-head.is-in::before, html:not(.js) .sec-head::before { transform: scaleX(1); }

/* covers unveil with an editorial curtain wipe (top → bottom) */
html.js .plate.reveal .plate__cover {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + 60ms);
}
html.js .plate.reveal.is-in .plate__cover { clip-path: inset(0); }

/* section titles slide in from the left as their rule draws */
html.js .sec-head.reveal .sec-head__title {
  opacity: 0; transform: translateX(-14px);
  transition: opacity 0.7s var(--ease) 0.15s, transform 0.7s var(--ease) 0.15s;
}
html.js .sec-head.reveal.is-in .sec-head__title { opacity: 1; transform: none; }

/* caption lifts a touch with the cover on hover */
@media (hover: hover) and (pointer: fine) {
  .plate__title { transition: transform 0.3s var(--ease); }
  .plate__btn:hover .plate__title { transform: translateY(-2px); }
}

/* ruled lists nudge on hover */
@media (hover: hover) and (pointer: fine) {
  .about__skills li, .about__why li, #footer-working li { transition: padding-left 0.25s var(--ease); }
  .about__skills li:hover, .about__why li:hover, #footer-working li:hover { padding-left: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .hero__name .ch { transform: none; opacity: 1; }
  html.js .plate.reveal .plate__cover { clip-path: inset(0); }
  html.js .sec-head.reveal .sec-head__title { opacity: 1; transform: none; }
  .cursor-dot { display: none; }
  .avail__dot, .plate__status-dot { animation: none; }
}
