/* ==========================================================================
   Ivan Balasi — Portfolio
   Layout concept: a working "proof sheet" — wide expanded type, hairline
   grids, every piece of work shown in a frame (browser chrome for web,
   print border for design, contact-sheet cell for photos).
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Color — cool proof-paper, ink, one ultramarine accent */
  --paper: #f2f3f5;
  --paper-2: #e7e9ed;
  --ink: #0f1217;
  --ink-2: #4a505c;
  --line: #cfd3da;
  --accent: #2a38e8;
  --accent-ink: #ffffff;
  --focus: #2a38e8;
  --success: #1f7a4a;
  --accent-inverse: #8e98ff; /* accent on an ink-colored band */

  /* Type */
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --t-lg: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  --t-xl: clamp(2.1rem, 1.3rem + 3.6vw, 4rem);
  --t-hero: clamp(2.9rem, 1rem + 8.4vw, 8.75rem);

  /* Space & layout */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: clamp(3.5rem, 2rem + 6vw, 7rem);
  --max: 82rem;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --header-h: 4rem;
  --radius: 2px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1014;
    --paper-2: #171a20;
    --ink: #e9ebef;
    --ink-2: #9ca3ae;
    --line: #2b3039;
    --accent: #8e98ff;
    --accent-ink: #0e1014;
    --focus: #8e98ff;
    --success: #5cc98d;
    --accent-inverse: #2a38e8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1014;
  --paper-2: #171a20;
  --ink: #e9ebef;
  --ink-2: #9ca3ae;
  --line: #2b3039;
  --accent: #8e98ff;
  --accent-ink: #0e1014;
  --focus: #8e98ff;
  --success: #5cc98d;
  --accent-inverse: #2a38e8;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paint the safe-area band above the sticky header */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--paper);
}

[hidden] { display: none !important; }

img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius);
}

::selection { background: var(--accent); color: var(--accent-ink); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + var(--s-2)); color: var(--paper); }

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) + var(--gutter-r));
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

.section { padding-block: var(--s-8); }
.section + .section { border-top: 1px solid var(--line); }
.section--tight { padding-block: var(--s-7); }

.section-head {
  display: grid;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
@media (min-width: 56rem) {
  .section-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: end;
    gap: var(--s-6);
  }
}
.section-head h2 { font-size: var(--t-xl); font-stretch: 112%; }
.section-head p { color: var(--ink-2); max-width: 46ch; }

/* Mono label — used for metadata, eyebrows, frame captions */
.label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.serif {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
}

.lede {
  font-size: var(--t-md);
  line-height: 1.5;
  max-width: 40ch;
}

.prose { max-width: 62ch; display: grid; gap: var(--s-4); }
.prose p { color: var(--ink); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 2.875rem;
  padding: 0 var(--s-5);
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 600 var(--t-sm) / 1 var(--f-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.link-arrow:hover .arrow { transform: translateX(3px); }
.arrow { display: inline-block; transition: transform 0.2s var(--ease); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  text-decoration: none;
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand span {
  font-family: var(--f-mono);
  font-weight: 500;
  font-stretch: 100%;
  font-size: var(--t-xs);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.brand:hover { color: var(--ink); }
.brand:hover span { color: var(--accent); }

.nav-list { list-style: none; display: flex; gap: var(--s-1); }
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 var(--s-3);
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
}
.nav-list a:hover { color: var(--ink); background: var(--paper-2); }
.nav-list a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }

.header-tools { display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }

.theme-toggle .theme-label { display: none; }
.theme-toggle [data-icon] { display: none; }
.theme-toggle[data-mode="system"] [data-icon="system"],
.theme-toggle[data-mode="light"] [data-icon="light"],
.theme-toggle[data-mode="dark"] [data-icon="dark"] { display: block; }

.menu-toggle { display: none; }
.menu-toggle .bar {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.menu-toggle .bars { display: grid; gap: 5px; }
.menu-toggle[aria-expanded="true"] .bar:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* Mobile navigation */
@media (max-width: 60rem) {
  .menu-toggle { display: inline-grid; }
  .site-nav {
    position: fixed;
    inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 0 0;
    z-index: 49;
    background: var(--paper);
    padding: var(--s-6) var(--gutter-r) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)) var(--gutter);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list li { border-bottom: 1px solid var(--line); }
  .nav-list a {
    width: 100%;
    min-height: 4rem;
    padding: 0;
    border-radius: 0;
    font-family: var(--f-display);
    font-stretch: 118%;
    font-weight: 700;
    font-size: var(--t-lg);
    color: var(--ink);
  }
  .nav-list a:hover,
  .nav-list a[aria-current="page"] { background: transparent; color: var(--accent); }
  body.nav-open { overflow: hidden; }
}

/* ---------- Hero (home) ---------- */
.hero { padding-block: var(--s-7) var(--s-8); }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin-bottom: var(--s-6);
}
.status-dot {
  display: inline-block;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  margin-right: var(--s-2);
  vertical-align: 0.05em;
}

.hero-title {
  font-size: var(--t-hero);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: initial;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-title .line > span { display: inline-block; }
.hero-title .serif {
  font-size: 0.82em;
  letter-spacing: -0.01em;
  color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title .line > span { animation: rise 0.9s var(--ease) both; }
  .hero-title .line:nth-child(2) > span { animation-delay: 0.08s; }
  .hero-title .line:nth-child(3) > span { animation-delay: 0.16s; }
}
@keyframes rise {
  from { transform: translateY(0.35em); opacity: 0.001; }
  to { transform: none; opacity: 1; }
}

.hero-foot {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: 1px solid var(--ink);
}
@media (min-width: 56rem) {
  .hero-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* Discipline index — the 5 practices, web listed first and weighted */
.index-list { list-style: none; border-top: 1px solid var(--line); }
.index-list li { border-bottom: 1px solid var(--line); }
.index-list a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s-3);
  padding-block: var(--s-3);
  text-decoration: none;
}
.index-list .num { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); }
.index-list .name { font-weight: 600; font-size: var(--t-md); font-stretch: 110%; }
.index-list .count { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); }
.index-list li:first-child .name { color: var(--accent); }
.index-list a:hover .name { color: var(--accent); }
.index-list a:hover .count { color: var(--ink); }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { padding-block: var(--s-7) var(--s-7); border-bottom: 1px solid var(--line); }
.page-hero .label { display: block; margin-bottom: var(--s-4); }
.page-title {
  font-size: var(--t-xl);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 0.95;
  max-width: 18ch;
}
.page-title .serif { color: var(--accent); font-size: 0.9em; }
.page-hero .lede { margin-top: var(--s-5); color: var(--ink-2); max-width: 52ch; }

/* ---------- Frames: browser chrome, print border, media slot ---------- */
.frame {
  position: relative;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: 2rem;
  padding-inline: var(--s-3);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}
.frame-bar::before {
  content: "";
  flex: none;
  width: 2.25rem;
  height: 0.5rem;
  background:
    radial-gradient(circle at 0.25rem 50%, var(--line) 0.22rem, transparent 0.24rem),
    radial-gradient(circle at 1.125rem 50%, var(--line) 0.22rem, transparent 0.24rem),
    radial-gradient(circle at 2rem 50%, var(--line) 0.22rem, transparent 0.24rem);
}
.frame-bar span { overflow: hidden; text-overflow: ellipsis; }

.media {
  position: relative;
  aspect-ratio: var(--ratio, 16 / 10);
  max-width: 100%;
  background: var(--paper-2);
  overflow: hidden;
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s var(--ease);
}
.media--contain img { object-fit: contain; object-position: center; padding: var(--s-4); }

/* Shown when an image is missing (not yet added) or for typographic tiles */
.media-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-4);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 2.5rem,
    var(--paper-2);
  color: var(--ink-2);
}
.media.is-missing img { display: none; }
.media.is-missing .media-fallback,
.media--tile .media-fallback { display: flex; }
.media-fallback .tile-mark {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(2rem, 1rem + 4vw, 3.75rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.media.is-missing .tile-mark { font-size: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem); line-height: 1; }
.media-fallback .tile-note { font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.04em; }

/* ---------- Featured work rows (home) ---------- */
.feature-list { display: grid; gap: var(--s-8); }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  align-items: center;
}
@media (min-width: 56rem) {
  .feature { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--s-7); }
  .feature:nth-child(even) .feature-media { order: 2; }
}
.feature-media { display: block; text-decoration: none; }
.feature-media:hover img { transform: scale(1.02); }
.feature-body { display: grid; gap: var(--s-4); min-width: 0; }
.feature-body h3 { font-size: var(--t-lg); font-stretch: 112%; }
.feature-body p { color: var(--ink-2); max-width: 44ch; }

.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; }
.tags li {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
}

/* ---------- Practice strip (home: other disciplines) ---------- */
.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--ink);
}
@media (min-width: 40rem) { .practice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .practice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.practice {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-4) var(--s-5) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  min-width: 0;
}
@media (min-width: 40rem) {
  .practice { padding-inline: var(--s-5); border-left: 1px solid var(--line); }
  .practice:nth-child(2n + 1) { border-left: 0; padding-left: 0; }
}
@media (min-width: 64rem) {
  .practice:nth-child(2n + 1) { border-left: 1px solid var(--line); padding-left: var(--s-5); }
  .practice:first-child { border-left: 0; padding-left: 0; }
}
.practice h3 { font-size: var(--t-md); font-stretch: 115%; }
.practice p { color: var(--ink-2); font-size: var(--t-sm); }
.practice .link-arrow { justify-self: start; font-size: var(--t-sm); }
.practice:hover h3 { color: var(--accent); }

/* ---------- Numbers row ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--s-5);
  list-style: none;
}
.facts li { display: grid; gap: var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--ink); }
.facts strong {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: var(--t-xl);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.facts span { color: var(--ink-2); font-size: var(--t-sm); max-width: 28ch; }

/* ---------- Work index (work.html) ---------- */
.toolbar {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-h));
  z-index: 20;
  display: grid;
  gap: var(--s-3);
  padding-block: var(--s-4);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 56rem) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.filters { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 2.5rem;
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 var(--t-sm) / 1 var(--f-body);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .chip-count { font-family: var(--f-mono); font-size: 0.6875rem; margin-left: 0.35rem; opacity: 0.7; }

.search { position: relative; }
.search input {
  width: 100%;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0 var(--s-4) 0 2.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-sm) / 1 var(--f-body);
}
@media (min-width: 56rem) { .search input { width: 16rem; } }
.search input::placeholder { color: var(--ink-2); }
.search input:hover { border-color: var(--ink-2); }
.search input:focus-visible { outline-offset: 1px; border-color: var(--focus); }
.search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 1rem; height: 1rem;
  transform: translateY(-50%);
  color: var(--ink-2);
  pointer-events: none;
}

.result-line { padding-block: var(--s-4); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--s-7) var(--s-5);
  list-style: none;
}
.work-card { display: grid; gap: var(--s-4); align-content: start; min-width: 0; }
.work-card[hidden] { display: none !important; }
.work-card h3 { font-size: var(--t-md); font-stretch: 110%; }
.work-card .card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); }
.work-card p { color: var(--ink-2); font-size: var(--t-sm); }
.work-card .card-link { font-size: var(--t-sm); justify-self: start; }
.work-card .card-note { font-family: var(--f-mono); font-size: 0.6875rem; color: var(--ink-2); }

.empty-state {
  display: grid;
  justify-items: start;
  gap: var(--s-4);
  padding: var(--s-7) 0;
  border-top: 1px solid var(--line);
}
.empty-state h2 { font-size: var(--t-lg); font-stretch: 112%; }
.empty-state p { color: var(--ink-2); }

/* ---------- Design grid (print border frames) ---------- */
.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--s-6) var(--s-5);
  list-style: none;
}
.print { display: grid; gap: var(--s-3); min-width: 0; }
.print-open {
  display: block;
  width: 100%;
  padding: var(--s-3);
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: zoom-in;
  color: inherit;
  text-align: left;
  font: inherit;
  transition: border-color 0.2s var(--ease);
}
.print-open:hover { border-color: var(--ink); }
.print-open:hover img { transform: scale(1.015); }
.print-open .media { --ratio: 4 / 3; }
.print-open .media img { object-position: center; }
.print-caption { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.print-caption h3 { font-size: var(--t-base); font-weight: 600; font-stretch: 105%; }
.print-caption a { font-size: var(--t-sm); white-space: nowrap; }

/* ---------- Contact sheet (photography) ---------- */
.sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  padding: var(--s-2);
  background: var(--ink);
  list-style: none;
}
@media (min-width: 48rem) { .sheet { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); padding: var(--s-3); } }
.sheet li { display: grid; gap: var(--s-1); min-width: 0; }
.sheet .frame-no {
  font-family: var(--f-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--paper-2);
  opacity: 0.75;
}
.sheet .print-open { padding: 0; border: 0; background: transparent; }
.sheet .media { --ratio: 4 / 5; }
.sheet .media-fallback { background: #1b1f26; color: #aab1bc; }
.sheet .media-fallback .tile-mark { color: #e9ebef; font-size: clamp(1rem, 0.7rem + 1vw, 1.5rem); }

.service-list { list-style: none; display: grid; border-top: 1px solid var(--ink); }
@media (min-width: 48rem) { .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); } }
.service-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.service-list h3 { font-size: var(--t-md); font-stretch: 112%; }
.service-list p { color: var(--ink-2); font-size: var(--t-sm); max-width: 44ch; }

/* ---------- Media page: video & podcast ---------- */
.video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: var(--ink);
  overflow: hidden;
}
.video-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: pointer;
  color: #fff;
}
.video-poster .media { position: absolute; inset: 0; aspect-ratio: auto; }
.video-poster .media img { object-position: center; opacity: 0.85; transition: opacity 0.3s var(--ease), transform 0.6s var(--ease); }
.video-poster:hover .media img { opacity: 1; transform: scale(1.02); }
.play {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5) var(--s-3) var(--s-3);
  border-radius: 999px;
  background: #ffffff;
  color: #0f1217;
  font: 600 var(--t-sm) / 1 var(--f-body);
}
.play svg { width: 2rem; height: 2rem; }
.video-poster:hover .play { background: var(--accent); color: var(--accent-ink); }
.video-poster:focus-visible { outline-offset: -4px; }
.video-poster .media-fallback { color: #aab1bc; background: #1b1f26; }
.video-poster .media-fallback .tile-mark { color: #e9ebef; }

.split {
  display: grid;
  gap: var(--s-6);
}
@media (min-width: 56rem) {
  .split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
  .split--reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
}
.split > * { min-width: 0; }
.split h3 { font-size: var(--t-lg); font-stretch: 112%; }

.episode-list { list-style: none; border-top: 1px solid var(--ink); }
.episode {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .episode { grid-template-columns: 8rem minmax(0, 1fr) auto; gap: var(--s-5); align-items: baseline; }
}
.episode time { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.episode h4 { font-size: var(--t-base); font-weight: 600; font-stretch: 105%; line-height: 1.35; }
.episode h4 a { text-decoration: none; }
.episode h4 a:hover { text-decoration: underline; }
.episode p { color: var(--ink-2); font-size: var(--t-sm); margin-top: var(--s-2); max-width: 60ch; }
.episode .label { white-space: nowrap; }

.cover { max-width: 16rem; }
.cover .media { --ratio: 1 / 1; border: 1px solid var(--line); }

/* ---------- About ---------- */
.portrait { width: 100%; max-width: 24rem; }
.portrait .media { --ratio: 4 / 5; }
.timeline { list-style: none; border-top: 1px solid var(--ink); }
.timeline li {
  display: grid;
  gap: var(--s-1);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 40rem) {
  .timeline li { grid-template-columns: 9rem minmax(0, 1fr); gap: var(--s-5); }
}
.timeline .when { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); padding-top: 0.25rem; }
.timeline h3 { font-size: var(--t-base); font-weight: 600; font-stretch: 105%; line-height: 1.35; }
.timeline p { color: var(--ink-2); font-size: var(--t-sm); }

.toolkit { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) { .toolkit { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.toolkit h3 { font-size: var(--t-sm); margin-bottom: var(--s-3); }
.toolkit ul { list-style: none; display: grid; gap: var(--s-1); color: var(--ink-2); font-size: var(--t-sm); }

/* ---------- Contact band ---------- */
.contact-band { background: var(--ink); color: var(--paper); }
.contact-band .wrap { padding-block: var(--s-8); display: grid; gap: var(--s-6); }
.contact-band h2 {
  font-size: var(--t-xl);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 0.95;
  max-width: 16ch;
}
.contact-band h2 .serif { color: var(--accent-inverse); }
.contact-band .label { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }
.contact-band p { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); max-width: 46ch; }
.contact-links { list-style: none; display: grid; border-top: 1px solid color-mix(in srgb, var(--paper) 25%, var(--ink)); }
@media (min-width: 48rem) { .contact-links { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); } }
.contact-links a,
.contact-links .contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  min-height: 3.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 25%, var(--ink));
  text-decoration: none;
  font-weight: 600;
  font-size: var(--t-md);
  font-stretch: 110%;
}
.contact-links a:hover { color: var(--accent-inverse); }
.contact-links .handle { font-family: var(--f-mono); font-weight: 400; font-size: var(--t-xs); font-stretch: 100%; color: color-mix(in srgb, var(--paper) 70%, var(--ink)); overflow: hidden; text-overflow: ellipsis; }
.contact-band .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.contact-band .btn:hover { background: var(--accent-inverse); color: var(--ink); border-color: var(--accent-inverse); }
.copy-status { font-family: var(--f-mono); font-size: var(--t-xs); min-height: 1.2em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: grid;
  gap: var(--s-5);
  padding-block: var(--s-6) calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 48rem) {
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--t-sm); }
.footer-links a { text-decoration: none; color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.site-footer small { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e9ebef;
}
.lightbox::backdrop { background: rgba(8, 10, 13, 0.94); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox-top,
.lightbox-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  padding: calc(var(--s-3) + env(safe-area-inset-top, 0px)) var(--gutter-r) var(--s-3) var(--gutter);
}
.lightbox-bottom { padding: var(--s-3) var(--gutter-r) calc(var(--s-4) + env(safe-area-inset-bottom, 0px)) var(--gutter); }
.lightbox figure { margin: 0; display: grid; place-items: center; min-height: 0; padding-inline: var(--gutter); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-caption { font-size: var(--t-sm); min-width: 0; }
.lightbox .lb-caption a { color: #e9ebef; }
.lightbox .lb-count { font-family: var(--f-mono); font-size: var(--t-xs); color: #aab1bc; }
.lightbox .icon-btn { color: #e9ebef; border-color: rgba(233, 235, 239, 0.3); }
.lightbox .icon-btn:hover { border-color: #e9ebef; }
.lightbox .icon-btn:focus-visible { outline-color: #8e98ff; }
.lb-nav { display: flex; gap: var(--s-2); }

/* ---------- Utilities ---------- */
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.stack { display: grid; gap: var(--s-4); }
.stack-lg { display: grid; gap: var(--s-6); }
.muted { color: var(--ink-2); }

@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;
  }
}

/* ---------- More videos grid (media.html) ---------- */
.video-more { display: grid; gap: var(--s-4); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--s-6) var(--s-5);
  list-style: none;
}
.video-card { display: grid; gap: var(--s-3); min-width: 0; }
.video-caption { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.video-caption h4 { font-size: var(--t-base); font-weight: 600; font-stretch: 105%; line-height: 1.3; }
.video-caption a { font-size: var(--t-sm); white-space: nowrap; }
.play--sm { padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2); }
.play--sm svg { width: 1.5rem; height: 1.5rem; }
.video-card .media-fallback .tile-mark { display: none; } /* title is in the caption */
.video-poster .media-fallback { text-align: left; }

/* ---------- Second podcast + audio players (media.html) ---------- */
.podcast-block { display: grid; gap: var(--s-6); padding-top: var(--s-7); border-top: 1px solid var(--line); }
.episode p.audio-missing { margin: 0; }
.episode--audio .stack { gap: var(--s-3); }
.audio { width: 100%; max-width: 32rem; height: 2.5rem; }
.audio:focus-visible { outline-offset: 2px; }

/* Contact sheet crops: centre frames, with a few faces nudged toward the top */
.sheet .media img { object-position: center; }
.sheet .media img.pos-20 { object-position: center 20%; }
.sheet .media img.pos-30 { object-position: center 30%; }
.sheet .media img.pos-35 { object-position: center 35%; }
.sheet .media img.pos-40 { object-position: center 40%; }

/* Wider frame for screenshots that shouldn't be cropped (e.g. chatbot open on the right) */
.media--wide { --ratio: 2912 / 1604; }

/* Archived site screenshot (media.html) */
.site-shot { margin: 0; display: grid; gap: var(--s-3); max-width: 52rem; }
.media--archive { --ratio: 1600 / 1056; }

/* ---------- Case study (case-rutgers.html) ---------- */
.case-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--s-4) var(--s-5);
  margin: var(--s-6) 0 0;
}
.case-facts div { display: grid; gap: var(--s-1); padding-top: var(--s-3); border-top: 1px solid var(--ink); }
.case-facts dd { margin: 0; font-weight: 600; font-stretch: 105%; }
.page-hero .label a { color: inherit; }
.page-hero .label a:hover { color: var(--accent); }

.process { list-style: none; border-top: 1px solid var(--ink); }
.process li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: var(--s-4);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--line);
}
.process .step-no { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--accent); padding-top: 0.3rem; }
.process h3 { font-size: var(--t-base); font-weight: 600; font-stretch: 105%; line-height: 1.35; }
.process p { color: var(--ink-2); font-size: var(--t-sm); }
.case-gallery .print-open .media { --ratio: 16 / 10; }
.case-gallery .print-open .media img { object-position: top center; }
.case-facts div,
.service-list li { align-content: start; }

/* ---------- Site map (case study IA) ---------- */
.ia { border-top: 1px solid var(--ink); padding-top: var(--s-4); font-size: var(--t-sm); }
.ia ul { list-style: none; margin: 0; padding: 0; }
.ia-top { display: grid; gap: var(--s-2); }
.ia-node {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-stretch: 105%;
  background: var(--paper);
}
.ia-node--open { border-color: var(--ink); display: grid; gap: var(--s-3); }
.ia-roles { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ia-role {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--t-xs);
  font-weight: 600;
}
.ia-shared { display: grid; gap: var(--s-2); padding: var(--s-3); background: var(--paper-2); border-radius: var(--radius); font-weight: 400; }
.ia-sub { display: grid; gap: var(--s-1); }
.ia-sub .ia-sub { margin: var(--s-1) 0 0 var(--s-2); padding-left: var(--s-3); border-left: 1px solid var(--line); color: var(--ink-2); }
.print-caption .label { white-space: nowrap; flex: none; }

/* Clickable screenshot inside a browser frame (opens the lightbox) */
.frame-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; color: inherit; font: inherit; }
.frame-open:hover img { transform: scale(1.015); }
.frame-open:focus-visible { outline-offset: -3px; }
.lightbox.is-tall figure { overflow-y: auto; place-items: start center; padding-block: var(--s-2); }
.lightbox.is-tall img { max-height: none; width: min(100%, 64rem); }

/* Links to previous portfolios (home) */
.old-portfolios { display: grid; gap: var(--s-3); margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.old-portfolios ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-7); }
.old-portfolios li { display: grid; gap: 2px; }
.old-portfolios a { font-weight: 600; text-decoration: none; }
.old-portfolios a:hover { text-decoration: underline; }
.old-portfolios .muted { font-size: var(--t-sm); }

/* Second screenshot thumbnail under a project frame (e.g. BracketBash leaderboard) */
.thumb-open {
  display: inline-flex; align-items: center; gap: var(--s-3);
  justify-self: start; padding: var(--s-1); padding-right: var(--s-3);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: 500 var(--t-sm) / 1 var(--f-body);
  cursor: zoom-in;
}
.thumb-open:hover { border-color: var(--ink); }
.thumb-open .media { width: 4.5rem; --ratio: 4 / 3; }
.thumb-open .media img { object-position: top center; }
.thumb-open .media-fallback .tile-mark { font-size: 0.8rem; }
.old-portfolios .old-site { gap: var(--s-2); }
.old-site-name { font-weight: 600; }
.old-site-shots { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-1); }
.old-portfolios li { align-content: start; }

/* Quick answers (about.html) */
.faq { display: grid; border-top: 1px solid var(--ink); }
.faq-item { display: grid; gap: var(--s-2); padding-block: var(--s-5); border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: var(--t-md); font-stretch: 110%; }
.faq-item p { color: var(--ink-2); max-width: 62ch; }

/* Core skills row above the toolkit columns (about.html) */
.core-skills { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); padding-bottom: var(--s-6); border-bottom: 1px solid var(--line); }
.core-skills .tags li { font-size: var(--t-xs); padding: 0.3rem 0.75rem; color: var(--ink); }
