/* ─────────── reset ─────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body, ol, ul, dl, dd, dt, p, h1, h2, h3, h4 { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ─────────── tokens ─────────── */
:root {
  --bg:        #FFFFFF;
  --bg-band:   #F2F2F2;
  --bg-band-2: #EBEBEB;
  --ink:       #1A1A1A;
  --ink-soft:  #2E2E2E;
  --muted:     #6B6B6B;
  --rule:      #DADADA;
  --rule-soft: #E8E8E8;
  --accent:    #1A1A1A;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;

  --shell-max: 1240px;
  --pad-x:     clamp(20px, 5vw, 56px);
  --section-y: clamp(80px, 11vw, 140px);
}

/* ─────────── base ─────────── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color .18s ease, opacity .18s ease, transform .18s ease;
}

.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ─────────── nav ─────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 18px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-light { font-weight: 300; color: #B4B4B4; }
.logo-bold  { font-weight: 800; color: var(--ink); }

.nav-links {
  display: flex; gap: clamp(14px, 2.4vw, 36px);
}
.nav-links a {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--ink);
  padding: 6px 0;
  position: relative;
  letter-spacing: -0.005em;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: center;
  transition: transform .22s ease;
}
.nav-links a.is-active::after,
.nav-links a:hover::after { transform: scaleX(1); }

@media (max-width: 720px) {
  .nav-links { gap: 16px; font-size: 0.95rem; }
  .nav-links a { font-size: 0.95rem; }
  .nav-links a:nth-child(4) { display: none; }
}
@media (max-width: 520px) {
  .nav-links a:nth-child(3) { display: none; }
}

/* ─────────── section heads (centered) ─────────── */
.section-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  text-align: center;
  margin: 0 auto;
}
.section-deck {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  color: var(--muted);
  text-align: center;
  max-width: 50rem;
  margin: 28px auto 0;
}

/* ─────────── hero ─────────── */
.hero {
  background: var(--bg-band);
  padding: clamp(72px, 11vw, 160px) 0 clamp(80px, 11vw, 140px);
  text-align: center;
}
.hero-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
}
.kicker {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.hero-tagline {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.4vw, 3.6rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink);
  max-width: 60rem;
}
.hero-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--muted);
  max-width: 44rem;
  margin: 8px auto 0;
}

.cta-row {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-top: 28px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 500;
  padding: 14px 30px;
  border-radius: 10px;
  letter-spacing: -0.005em;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  border: 1.5px solid transparent;
  min-width: 180px;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }

.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn-outline:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }

/* ─────────── socials ─────────── */
.socials {
  display: flex; gap: 28px; justify-content: center;
  margin-top: 36px;
  color: var(--ink);
}
.socials a {
  display: inline-flex;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  opacity: 0.88;
  transition: opacity .18s ease, transform .18s ease;
}
.socials a:hover { opacity: 1; transform: translateY(-2px); }
.socials svg { display: block; }

/* ─────────── portfolio ─────────── */
.portfolio {
  background: var(--bg-band-2);
  padding: var(--section-y) 0;
}

.filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
  margin: 48px 0 56px;
}
.chip {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 10px 22px;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--ink);
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (max-width: 800px)  { .tiles { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 520px)  { .tiles { grid-template-columns: 1fr; gap: 16px; } }

.tile {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  border-radius: 8px;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 8px 24px -16px rgba(0,0,0,0.25);
  transition: transform .35s ease, box-shadow .35s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 18px 40px -20px rgba(0,0,0,0.30);
}
.tile-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}
.tile-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1A1A1A;
  overflow: hidden;
}
.tile-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s ease, filter .35s ease;
  filter: saturate(0.92);
}
.tile:hover .tile-media img { filter: saturate(1.0); }
.tile-media.no-img::after {
  content: "screenshot pending";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
  background: linear-gradient(135deg, #2A2A2A, #1A1A1A);
}
.tile-media.no-img img { display: none; }

/* Always-visible title band + reveal-on-hover blurb/tags */
.tile-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.92) 100%);
  color: #fff;
}
.tile-blurb, .tile-tags {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .25s ease, max-height .35s ease, margin .25s ease;
  margin-top: 0;
}
.tile:hover .tile-blurb,
.tile:focus-within .tile-blurb {
  opacity: 1; max-height: 80px; margin-top: 6px;
}
.tile:hover .tile-tags,
.tile:focus-within .tile-tags {
  opacity: 1; max-height: 80px; margin-top: 10px;
}
.tile:hover .tile-media img,
.tile:focus-within .tile-media img {
  transform: scale(1.04);
}
.tile-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.tile-blurb {
  font-size: 0.92rem;
  color: #D8D8D8;
  line-height: 1.45;
  margin-bottom: 10px;
}
.tile-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.tile-tags li {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(255,255,255,0.14);
  border-radius: 3px;
  text-transform: uppercase;
}

/* placeholder badge */
.todo {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.14em;
  background: #F7D34A;
  color: #1A1A1A;
  padding: 2px 6px;
  border-radius: 2px;
  vertical-align: 2px;
  margin-left: 8px;
  font-weight: 700;
}
.tile.is-placeholder .tile-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(247,211,74,0.18) 0 14px, transparent 14px 28px);
  z-index: 1;
  pointer-events: none;
}

.tile.is-hidden {
  display: none;
}

/* ─────────── articles ─────────── */
.articles {
  background: var(--bg);
  padding: var(--section-y) 0;
}
.article-list {
  display: flex; flex-direction: column;
  max-width: 1000px;
  margin: 64px auto 0;
  gap: 0;
}
.article {
  border-top: 1px solid var(--rule);
  padding: 40px 0;
}
.article:last-child {
  border-bottom: 1px solid var(--rule);
}
.article-link {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 44px;
  align-items: center;
}
.article-link:hover .article-media img { transform: scale(1.03); }
.article-link:hover .article-title { color: #000; }
.article-link:hover .read-link { gap: 12px; }
.article-media {
  position: relative;
  background: var(--bg-band);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
}
.article-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.article-media.no-img::after {
  content: "image pending";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-media.no-img img { display: none; }

.article-body {
  display: flex; flex-direction: column; gap: 10px;
}
.article-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.35rem, 1.9vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.article-meta {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.article-excerpt {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 38rem;
}
.read-link {
  display: inline-flex; align-items: center;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  gap: 8px;
  transition: gap .2s ease;
}

@media (max-width: 760px) {
  .article-link { grid-template-columns: 1fr; gap: 18px; }
}

/* ─────────── about ─────────── */
.about {
  background: var(--bg-band);
  padding: var(--section-y) 0;
  text-align: center;
}
.about-shell { max-width: 980px; }

.about .quote {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--muted);
  margin: 32px auto 0;
  max-width: 38rem;
  font-style: italic;
}

.profile {
  display: flex; flex-direction: column; align-items: center;
  margin: 64px auto 36px;
  gap: 18px;
}
.avatar {
  width: clamp(180px, 22vw, 240px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-band-2);
  border: 4px solid #fff;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.no-img::after {
  content: "photo pending";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.avatar.no-img img { display: none; }

.profile-name {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin-top: 4px;
}
.profile-subtitle {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--muted);
}

.bio {
  max-width: 50rem;
  margin: 36px auto 0;
  text-align: left;
}
.bio p {
  font-family: var(--font-sans);
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.bio p + p { margin-top: 22px; }
.bio strong { color: var(--ink); font-weight: 600; }
.bio-aside {
  margin-top: 32px !important;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
  font-style: normal !important;
}

/* ─────────── technologies section ─────────── */
.technologies {
  background: var(--bg);
  padding: var(--section-y) 0;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 56px auto 0;
}
@media (max-width: 1000px) { .tech-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; } }
@media (max-width: 640px)  { .tech-grid { grid-template-columns: 1fr; gap: 18px; } }

.tech-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 26px 28px 24px;
  text-align: left;
  display: flex; flex-direction: column;
  gap: 14px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tech-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 18px 36px -22px rgba(0,0,0,0.18);
}

.tech-card header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.tech-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.tech-label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.tech-years {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  white-space: nowrap;
}

.tech-blurb {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.tech-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.tech-pills li {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  padding: 4px 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--bg);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.tech-pills li.bold {
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-band);
  border-color: var(--ink);
}
.tech-card:hover .tech-pills li.bold {
  background: var(--ink);
  color: #fff;
}

/* tech stats row */
.tech-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 56px auto 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
@media (max-width: 720px) {
  .tech-stats { grid-template-columns: repeat(2, 1fr); }
  .tech-stats .tech-stat:nth-child(2) { border-right: 0; }
  .tech-stats .tech-stat:nth-child(3),
  .tech-stats .tech-stat:nth-child(4) { border-top: 1px solid var(--rule); }
}
.tech-stat {
  padding: 26px 18px;
  text-align: center;
  border-right: 1px solid var(--rule);
}
.tech-stat:last-child { border-right: 0; }
.tech-stat .value {
  display: block;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.05;
}
.tech-stat .label {
  display: block;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tech-aside {
  max-width: 56rem;
  margin: 48px auto 0;
  padding: 22px 28px;
  background: var(--bg-band);
  border-left: 3px solid var(--ink);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.tech-aside strong { color: var(--ink); font-weight: 600; }

/* ─────────── contact ─────────── */
.contact {
  background: var(--bg);
  padding: var(--section-y) 0;
  text-align: center;
}
.contact-deck {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
  margin: 32px auto 8px;
}
.contact-email {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 18px 0 36px;
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.contact-email:hover { border-bottom-color: var(--ink); }

/* ─────────── footer ─────────── */
.foot {
  background: var(--bg-band-2);
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.foot-shell {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.92rem;
  color: var(--muted);
}
.foot a { color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.foot a:hover { border-bottom-color: var(--ink); }

@media (max-width: 560px) {
  .foot-shell { flex-direction: column; gap: 10px; }
}

/* ─────────── motion ─────────── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ─────────── modal ─────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,10,15,0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdrop-in .35s ease forwards;
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(1080px, 100%);
  max-height: calc(100vh - 64px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06),
    0 40px 80px -20px rgba(0,0,0,0.45);
  animation: panel-in .42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes backdrop-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: background .18s ease, transform .18s ease;
}
.modal-close:hover { background: #fff; transform: scale(1.05); }

.modal-media {
  position: relative;
  background: var(--ink);
  min-height: 280px;
}
.modal-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.modal-content {
  padding: clamp(28px, 3.4vw, 48px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 64px);
}
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.modal-meta-row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-dot { color: var(--rule); }
.modal-role { color: var(--accent); }

.modal-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
}

.modal-summary {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.075rem;
  line-height: 1.55;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.modal-body {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 12px;
}
.modal-body p { margin: 0; }
.modal-body strong { color: var(--ink); font-weight: 600; }
.modal-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  background: var(--bg-band);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}

.modal-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 6px 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.modal-metrics:empty { display: none; }
.modal-metrics li {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--rule);
}
.modal-metrics li:last-child { border-right: 0; }
.modal-metric-value {
  display: block;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
}
.modal-metric-label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-section {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 4px;
}
.modal-section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.modal-tags li {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg);
}

.modal-links {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 8px;
}
.modal-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: background .18s ease, color .18s ease;
}
.modal-links a:hover { background: var(--ink); color: #fff; }
.modal-links a.is-primary {
  background: var(--ink);
  color: #fff;
}
.modal-links a.is-primary:hover { background: #000; }

@media (max-width: 820px) {
  .modal-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 40px);
  }
  .modal-media { aspect-ratio: 16 / 10; min-height: 0; max-height: 32vh; }
  .modal-content { max-height: none; }
  .modal-metrics { grid-template-columns: repeat(2, 1fr); }
  .modal-metrics li:nth-child(2) { border-right: 0; }
  .modal-metrics li:nth-child(3) { border-right: 0; grid-column: 1 / -1; border-top: 1px solid var(--rule); }
}

body.modal-open { overflow: hidden; }

/* selection */
::selection { background: #F7D34A; color: var(--ink); }
