/* ─────────────────────────────────────────────────────────────────
   İlker Nazcan · Portfolio
   Refactored single-file stylesheet.
   ───────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,200..900,0..100;1,9..144,200..900,0..100&family=JetBrains+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700&display=swap');

/* ─── Tokens ───────────────────────────────────────────────────── */
:root {
  /* Warm dark theme — gallery-at-night feel.
     Tokens are intentionally still named --paper / --ink so the rest of
     the stylesheet doesn't need to know we inverted; --paper just IS dark now. */
  --paper:        #1A1714;   /* page background — warm near-black */
  --paper-deep:   #110F0C;   /* image-frame placeholders, deeper recess */
  --paper-soft:   #221E1A;   /* slightly lifted surfaces */
  --ink:          #ECE4D4;   /* primary text — warm cream */
  --ink-soft:     #D6CCB6;
  --muted:        #968B7C;
  --muted-2:      #7C7264;
  --rule:         #ECE4D4;   /* hairlines — light on dark */
  --rule-soft:    #3A332A;   /* dim hairlines, borders */
  --rust:         #D9583A;   /* brighter rust accent for dark bg */
  --rust-deep:    #A53A1A;

  --container:    1600px;
  --pad-x:        1rem;
}
@media (min-width: 480px)  { :root { --pad-x: 1.5rem; } }
@media (min-width: 768px)  { :root { --pad-x: 2.5rem; } }
@media (min-width: 1024px) { :root { --pad-x: 3.5rem; } }

/* ─── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; }
html, body {
  background: var(--paper);
  color: var(--ink);
  margin: 0; padding: 0;
  overflow-x: hidden;       /* mobile safety: never let anything force horizontal scroll */
}
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.5;
  min-width: 320px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
ul, p, h1, h2, h3, h4, h5, h6, figure { margin: 0; padding: 0; }

::selection { background: var(--rust); color: var(--paper); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

/* ─── Skip link (a11y) ────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ─── Typography helpers ─────────────────────────────────────── */
.display {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.92;
}
.serif {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
  font-feature-settings: "ss01", "ss02";
}

/* ─── Layout ───────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
.hairline { height: 1px; background: var(--rule); }

.paper-grain { position: relative; isolation: isolate; }
.paper-grain::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(20, 17, 13, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.7;
  z-index: 0;
}
.paper-grain > * { position: relative; z-index: 1; }

/* ─── Animations ───────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.rise   { animation: rise 1100ms cubic-bezier(.2,.7,.2,1) both; }
.rise-1 { animation-delay:  80ms; }
.rise-2 { animation-delay: 200ms; }
.rise-3 { animation-delay: 340ms; }
.rise-4 { animation-delay: 500ms; }
.rise-5 { animation-delay: 660ms; }
.page   { animation: fade 500ms ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Top bar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(26, 23, 20, 0.78);   /* matches --paper at ~78% */
  border-bottom: 1px solid var(--rule-soft);
}
.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 56px;
}
@media (min-width: 768px) { .topbar__inner { height: 64px; gap: 1.5rem; } }

.topbar__brand {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: 15px;
  white-space: nowrap;
  transition: opacity 0.2s;
}
@media (min-width: 480px) { .topbar__brand { font-size: 16px; } }
@media (min-width: 768px) { .topbar__brand { font-size: 18px; } }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
@media (min-width: 480px) { .topbar__nav { gap: 1.25rem; } }
@media (min-width: 768px) { .topbar__nav { gap: 2.25rem; } }

.topbar__link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: opacity 0.2s;
}
@media (min-width: 480px) { .topbar__link { font-size: 11px; } }
@media (min-width: 768px) { .topbar__link { font-size: 12px; } }

.topbar__social {
  display: none;
  align-items: center;
  gap: 1rem;
}
@media (min-width: 1024px) { .topbar__social { display: flex; } }
.topbar__social a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  transition: opacity 0.2s;
}

/* Language switcher (always visible) */
.topbar__lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (min-width: 480px) { .topbar__lang { font-size: 11px; } }
.topbar__lang a {
  color: var(--muted);
  transition: opacity 0.2s, color 0.2s;
}
.topbar__lang a.is-active { color: var(--ink); }
.topbar__lang-sep {
  color: var(--rule-soft);
  user-select: none;
}

/* Hover effects only on devices with a real hover capability */
@media (hover: hover) and (pointer: fine) {
  .topbar__brand:hover { opacity: 0.7; }
  .topbar__link:hover { opacity: 0.6; }
  .topbar__social a:hover { opacity: 0.6; }
  .topbar__lang a:hover { opacity: 0.7; }
}

/* ─── Mast (hero) ─────────────────────────────────────────────── */
.mast {
  padding-top: 3rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 768px)  { .mast { padding-top: 6rem; padding-bottom: 4rem; } }
@media (min-width: 1024px) { .mast { padding-top: 7rem; } }

.mast__intro { max-width: 48rem; }
.mast__intro-1 {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(18px, 1.9vw, 28px);
  line-height: 1.35;
  color: var(--ink);
  text-wrap: pretty;
}
.mast__intro-2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.4;
  color: var(--ink-soft);
  margin-top: 0.75rem;
  text-wrap: pretty;
}

.mast__name {
  margin-top: 2.5rem;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.86;
  font-size: clamp(48px, 13.5vw, 240px);
}
@media (min-width: 768px) { .mast__name { margin-top: 5rem; } }
.mast__name-line { display: block; }
.mast__name-line--indent { padding-left: 0.16em; }
.mast__dot { color: var(--rust); }

.mast__bio-wrap {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
@media (min-width: 768px) { .mast__bio-wrap { margin-top: 5rem; gap: 2rem; } }
.mast__bio {
  grid-column: span 12;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.55;
  color: var(--ink);
  text-wrap: pretty;
}
@media (min-width: 768px) { .mast__bio { grid-column: 3 / span 7; } }

/* ─── Image break ─────────────────────────────────────────────── */
.imgbreak {
  margin-top: 2rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) { .imgbreak { margin-top: 3rem; margin-bottom: 2rem; } }
.imgbreak__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: var(--paper-deep);
}
.imgbreak__frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ─── Experience header ───────────────────────────────────────── */
.exp-header { padding-top: 4rem; }
@media (min-width: 768px) { .exp-header { padding-top: 8rem; } }
.exp-header__title {
  margin-top: 1.5rem;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(40px, 7vw, 120px);
}
@media (min-width: 768px) { .exp-header__title { margin-top: 2.5rem; } }

.subhead {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(24px, 3vw, 44px);
  line-height: 1;
}

/* ─── Projects ────────────────────────────────────────────────── */
.projects { margin-top: 2.5rem; }
@media (min-width: 768px) { .projects { margin-top: 5rem; } }

.projects__intro-wrap {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
@media (min-width: 768px) { .projects__intro-wrap { margin-top: 2rem; gap: 2rem; } }

.projects__intro {
  grid-column: span 12;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(15px, 1.3vw, 20px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}
@media (min-width: 768px) { .projects__intro { grid-column: span 9; } }

.projects__list { margin-top: 2.5rem; }
@media (min-width: 768px) { .projects__list { margin-top: 5rem; } }

/* ─── Project tile (home) ─────────────────────────────────────── */
.tile {
  display: block;
  border-top: 1px solid var(--rule-soft);
  padding-top: 2rem;
  padding-bottom: 3.5rem;
  cursor: pointer;
}
@media (min-width: 768px) {
  .tile { padding-top: 2.5rem; padding-bottom: 5rem; }
}
.tile__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (min-width: 768px) { .tile__grid { gap: 2rem; } }

.tile__meta { grid-column: span 12; }
.tile__media { grid-column: span 12; }

@media (min-width: 768px) {
  .tile:nth-child(odd)  .tile__meta  { grid-column: 1 / span 3;  order: 1; }
  .tile:nth-child(odd)  .tile__media { grid-column: 4 / span 9;  order: 2; }
  .tile:nth-child(even) .tile__meta  { grid-column: 10 / span 3; order: 2; }
  .tile:nth-child(even) .tile__media { grid-column: 1 / span 9;  order: 1; }
}

.tile__meta-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
}
@media (min-width: 768px) {
  .tile__meta-list { flex-direction: column; gap: 0.85rem; }
}
.tile__meta-list > * { min-width: 0; }

.tile__meta-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-2);
}
@media (min-width: 768px) { .tile__meta-key { font-size: 10px; } }

.tile__meta-val-serif {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: 14px;
  margin-top: 0.25rem;
}
@media (min-width: 768px) { .tile__meta-val-serif { font-size: 15px; } }

.tile__meta-val-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  word-break: break-word;
}
@media (min-width: 768px) { .tile__meta-val-mono { font-size: 12px; } }

.tile__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--paper-deep);
}
.tile__frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter 700ms ease, transform 1200ms cubic-bezier(.2,.7,.2,1);
}

.tile__caption {
  margin-top: 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
@media (min-width: 768px) { .tile__caption { margin-top: 2rem; gap: 1.5rem; } }

.tile__title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(30px, 4.6vw, 72px);
  word-break: break-word;
}
.tile__cta {
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  flex-shrink: 0;
  padding-bottom: 0.5rem;
}
@media (min-width: 768px) { .tile__cta { display: flex; } }
.tile__cta .arrow {
  display: inline-block;
  transition: transform 320ms cubic-bezier(.2,.7,.2,1);
}

@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile__frame img {
    filter: contrast(1.04) saturate(1.05);
    transform: scale(1.012);
  }
  .tile:hover .tile__cta .arrow { transform: translateX(8px); }
  .tile:hover .tile__title {
    color: var(--rust);
    transition: color 320ms cubic-bezier(.2,.7,.2,1);
  }
}

/* ─── Work experience ─────────────────────────────────────────── */
.work { margin-top: 2rem; }
@media (min-width: 768px) { .work { margin-top: 4rem; } }

.work__list { margin-top: 2rem; }
@media (min-width: 768px) { .work__list { margin-top: 3.5rem; } }

.work__row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule-soft);
}
@media (min-width: 768px) { .work__row { gap: 2rem; padding: 3rem 0; } }

.work__when { grid-column: span 12; }
.work__body { grid-column: span 12; }
@media (min-width: 768px) {
  .work__when { grid-column: span 3; }
  .work__body { grid-column: span 9; }
}

.work__dates {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}
.work__dur {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-top: 0.25rem;
  color: var(--muted-2);
}
.work__role {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.1;
}
.work__co {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-variation-settings: "SOFT" 80, "opsz" 24;
  font-size: clamp(15px, 1.3vw, 20px);
  color: var(--ink-soft);
  margin-top: 0.25rem;
}
.work__loc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 0.75rem;
}
.work__desc {
  margin-top: 1.25rem;
  max-width: 48rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) { .work__desc { margin-top: 2rem; } }
.work__desc p {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ─── Footer ──────────────────────────────────────────────────── */
.footer {
  margin-top: 5rem;
  background: var(--paper-deep);   /* slightly deeper than page bg, keeps the "footer is its own surface" feel */
  color: var(--ink);
  border-top: 1px solid var(--rule-soft);
}
@media (min-width: 768px) { .footer { margin-top: 8rem; } }

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 3rem var(--pad-x) 2rem;
}
@media (min-width: 768px) { .footer__inner { padding: 6rem var(--pad-x) 3rem; } }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
@media (min-width: 768px) { .footer__grid { gap: 2rem; } }

.footer__name-block { grid-column: span 12; }
@media (min-width: 768px) { .footer__name-block { grid-column: span 6; } }

.footer__name {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(40px, 6vw, 96px);
}
.footer__tagline {
  margin-top: 1.25rem;
  max-width: 28rem;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  color: var(--paper-deep);
  text-wrap: pretty;
}

.footer__col-email     { grid-column: span 12; }
.footer__col-elsewhere { grid-column: span 12; }
@media (min-width: 480px) {
  .footer__col-email     { grid-column: span 6; }
  .footer__col-elsewhere { grid-column: span 6; }
}
@media (min-width: 768px) {
  .footer__col-email     { grid-column: 8 / span 3; }
  .footer__col-elsewhere { grid-column: 11 / span 2; }
}

.footer__lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.75rem;
  color: var(--paper-deep);
}
.footer__email {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(18px, 1.8vw, 26px);
  color: var(--paper);
  display: inline-block;
  border-bottom: 1px solid rgba(242, 237, 227, 0.3);
  padding-bottom: 0.1em;
  word-break: break-word;
  transition: opacity 0.2s;
}
.footer__elsewhere-list { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__elsewhere-list a {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: 16px;
  color: var(--paper);
  transition: opacity 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .footer__email:hover { opacity: 0.7; }
  .footer__elsewhere-list a:hover { opacity: 0.7; }
}

.footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(242, 237, 227, 0.18);
}
@media (min-width: 768px) { .footer__bottom { margin-top: 6rem; } }
.footer__copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--paper-deep);
}

/* ─── Detail page ─────────────────────────────────────────────── */
.detail-back { padding-top: 1.5rem; }
@media (min-width: 768px) { .detail-back { padding-top: 2.5rem; } }
.detail-back a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .detail-back a:hover { opacity: 0.6; }
}

.detail-header {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 768px) { .detail-header { padding-top: 4rem; padding-bottom: 4rem; } }
.detail-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.9;
  font-size: clamp(44px, 11vw, 188px);
  word-break: break-word;
}

.specimen { padding-bottom: 2rem; }
.specimen__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
}
@media (min-width: 480px) {
  .specimen__grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (min-width: 768px) {
  .specimen__grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 2.25rem 0; }
}
.specimen__key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.5rem;
  color: var(--muted-2);
}
.specimen__val {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: 14px;
  line-height: 1.4;
  text-wrap: pretty;
}

.detail-cover { margin-bottom: 3rem; }
@media (min-width: 768px) { .detail-cover { margin-bottom: 6rem; } }
.detail-cover__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--paper-deep);
}
.detail-cover__frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.detail-body { padding-bottom: 3rem; }
@media (min-width: 768px) { .detail-body { padding-bottom: 6rem; } }
.detail-body__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
@media (min-width: 768px) { .detail-body__grid { gap: 2rem; } }
.detail-body__col { grid-column: span 12; }
@media (min-width: 768px) { .detail-body__col { grid-column: 3 / span 9; } }
.detail-body__col p {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.6;
  text-wrap: pretty;
}
.detail-body__col p:first-child { color: var(--ink); }
.detail-body__col p:last-child  { color: var(--ink-soft); margin-top: 1.5rem; }

.detail-plates {
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 768px) { .detail-plates { padding-bottom: 8rem; gap: 5rem; } }
.detail-plates__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--paper-deep);
}
.detail-plates__frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.detail-nav { padding-bottom: 4rem; }
@media (min-width: 768px) { .detail-nav { padding-bottom: 7rem; } }
.detail-nav__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-top: 2rem;
  align-items: end;
}
@media (min-width: 480px) {
  .detail-nav__row { grid-template-columns: auto 1fr; gap: 1.5rem 2rem; }
  .detail-nav__row .detail-nav__btn--right { justify-self: end; text-align: right; }
}
.detail-nav__btn {
  text-align: left;
  display: block;
  transition: color 320ms cubic-bezier(.2,.7,.2,1);
}
.detail-nav__lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.detail-nav__title {
  margin-top: 0.5rem;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1;
}
@media (hover: hover) and (pointer: fine) {
  .detail-nav__btn:hover { color: var(--rust); }
}

/* ─── 404 page ────────────────────────────────────────────────── */
.notfound {
  min-height: calc(100vh - 56px - 1px);
  display: flex;
  align-items: center;
  padding: 4rem 0 6rem;
}
@media (min-width: 768px) { .notfound { min-height: calc(100vh - 64px - 1px); } }
.notfound__inner { max-width: 640px; }
.notfound__code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.notfound__title {
  margin-top: 1rem;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-weight: 360;
  letter-spacing: -0.035em;
  line-height: 0.92;
  font-size: clamp(44px, 9vw, 144px);
  word-break: break-word;
}
.notfound__title .mast__dot { color: var(--rust); }
.notfound__home {
  display: inline-block;
  margin-top: 2rem;
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(20px, 2vw, 28px);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.1em;
  transition: color 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .notfound__home:hover { color: var(--rust); }
}

/* ─── Print stylesheet ────────────────────────────────────────── */
@media print {
  /* Force light for print regardless of dark UI */
  :root {
    --paper: #fff; --paper-deep: #f4f4f4; --paper-soft: #fff;
    --ink: #000; --ink-soft: #222;
    --muted: #555; --muted-2: #666;
    --rule: #000; --rule-soft: #cfcfcf;
  }
  html, body { background: #fff !important; color: #000 !important; }
  .paper-grain::before { display: none !important; }
  .topbar, .detail-nav, .detail-back, .skip-link { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .mast__dot, .notfound__title .mast__dot { color: var(--rust) !important; }
  .footer {
    background: #fff !important;
    color: #000 !important;
    margin-top: 2rem !important;
    border-top: 1px solid #000;
  }
  .footer__inner { padding: 1.5rem var(--pad-x) !important; }
  .footer__name { font-size: 32px !important; }
  .footer__tagline,
  .footer__lbl,
  .footer__email,
  .footer__elsewhere-list a,
  .footer__copy { color: #000 !important; }
  .footer__bottom { margin-top: 1.5rem !important; padding-top: 0.75rem !important; }
  img { break-inside: avoid; page-break-inside: avoid; }
  section, .work__row { break-inside: avoid; page-break-inside: avoid; }
}
