/* =============================================================
   Anastasia Buialo — portfolio
   Design system + component styles.
   Two families (Futura/Jost, Suisse Intl/Switzer), two weights
   (400/500), one accent scale. Light + dark. No build step.
   ============================================================= */

/* ---------- Tokens ------------------------------------------ */
:root {
  --bg: #d6d6d2;
  --ink: #17171b;
  --big: #2b2c30;
  --body: #212226;
  --sub: #34353b;
  --mut: #3f4046;
  --acc: #4338ca;
  --acc2: #4f46e5;
  --acc3: #3730a3;
  --line: rgba(0, 0, 0, 0.14);
  --line2: rgba(0, 0, 0, 0.16);
  --line3: rgba(0, 0, 0, 0.18);
  --line4: rgba(0, 0, 0, 0.4);
  --wash: rgba(0, 0, 0, 0.02);
  --header-bg: rgba(214, 214, 210, 0.88);
  --dot: rgba(23, 23, 27, 0.45);
  --dot2: rgba(23, 23, 27, 0.38);
  --dot3: rgba(23, 23, 27, 0.3);
  --img-line: rgba(79, 70, 229, 0.28);
  --glow: rgba(67, 56, 202, 0.45);

  --font-display: 'Futura', 'Jost', sans-serif;
  --font-body: 'Suisse Intl', 'Suisse Int\'l', 'Switzer', sans-serif;
  --container: 1040px;
  --pad-x: clamp(16px, 4vw, 32px);
  --section-y: clamp(40px, 5vw, 64px);
}

body[data-theme="dark"] {
  --bg: #030712;
  --ink: #f9fafb;
  --big: #e5e7eb;
  --body: #d1d5db;
  --sub: #9ca3af;
  --mut: #9ca3af;
  --acc: #818cf8;
  --acc2: #a5b4fc;
  --acc3: #c7d2fe;
  --line: rgba(255, 255, 255, 0.12);
  --line2: rgba(255, 255, 255, 0.08);
  --line3: rgba(255, 255, 255, 0.1);
  --line4: rgba(255, 255, 255, 0.55);
  --wash: rgba(255, 255, 255, 0.02);
  --header-bg: rgba(3, 7, 18, 0.85);
  --dot: rgba(129, 140, 248, 0.55);
  --dot2: rgba(129, 140, 248, 0.45);
  --dot3: rgba(129, 140, 248, 0.35);
  --img-line: rgba(129, 140, 248, 0.25);
  --glow: rgba(129, 140, 248, 0.35);
}

/* ---------- Base -------------------------------------------- */
@font-face {
  font-family: 'Thornskull';
  src: url('assets/Thornskull-Regular.otf') format('opentype');
  font-display: swap;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 { font-family: var(--font-display); }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Prose links (case-study body copy / footers) */
.link { color: var(--acc); text-decoration: none; }
.link:hover { color: var(--acc2); }

/* Language-aware line breaking: body copy hyphenates using each block's `lang`
   (en / no); headings, labels and short display strings never hyphenate. */
/* No automatic hyphenation anywhere; wrap at spaces / explicit break points only. */
main { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: break-word; }
h1, h2, h3,
.hero-h1, .contact-h2, .case-h1, .case-value-h2, .acc-title, .block-heading,
.emphasis, .kicker, .eyebrow, .field-label, .row-label, .side-label,
.story-label, .index-name, .index-year, .nav-link, .wordmark, .seg-btn,
.tag, .overline, .caption, .meta-list, .years, .skills-text {
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* ---------- Film-grain overlay ------------------------------ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-theme="dark"]::after {
  opacity: 0.8;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Language visibility ----------------------------- */
.lang-block { display: none; }
body[data-lang="en"] .lang-en { display: block; }
body[data-lang="no"] .lang-no { display: block; }

/* ---------- Layout ------------------------------------------ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ---------- Header ------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line2);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 16px var(--pad-x);
}
.wordmark {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.nav--case { gap: 12px 20px; }
/* Panel wraps links + toggles: inline on desktop, one disclosure on mobile */
.nav-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
/* Mobile "Menu" disclosure: hidden on desktop */
.nav-menu-btn {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--sub);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-menu-btn:hover { color: var(--acc2); }
.nav-menu-btn .caret { font-size: 10px; }

@media (max-width: 640px) {
  .nav-menu-btn { display: inline-flex; }
  .nav-panel { display: none; }
  /* Full-width dropdown anchored under the header */
  .nav-panel.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--bg);
    border-bottom: 1px solid var(--line2);
    padding: 22px var(--pad-x) 26px;
  }
  .nav-panel.open .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line3);
  }
}
/* Nav items share the toggle buttons' typeface + scale (Suisse 13, no tracking) */
.nav-link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--sub);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--acc2); }

/* Segmented pill toggles (lang + theme) */
.seg {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.seg--theme { border-color: var(--line4); }
.seg-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.seg-btn--theme { text-transform: lowercase; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.seg-btn[aria-pressed="true"]:hover { color: var(--bg); }

/* ---------- Sections ---------------------------------------- */
.section {
  padding: var(--section-y) 0;
  scroll-margin-top: 80px;
}
/* section--bordered no longer used as a section divider (whitespace + one dotted break instead) */
.section--bordered { border-bottom: none; }

.hero {
  padding: clamp(36px, 4.5vw, 64px) 0 var(--section-y);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 20px;
}
.section-head--wide { margin-bottom: 32px; }
.section-head h2 {
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}
.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--acc);
}
/* Every 12px uppercase-style label is one weight (Futura Medium / 500) */
.field-label, .row-label, .side-label, .story-label, .about-langlabel { font-weight: 500; }

/* ---------- Typographic helpers ----------------------------- */
.kicker {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--acc);
  margin: 0 0 24px;
}
.field-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sub);
  margin: 0 0 10px;
}
.overline {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 40px 0 16px;
}
.note {
  font-size: 14px;
  font-weight: 400;
  color: var(--mut);
  margin: 0;
  max-width: 60ch;
}
.caption {
  font-size: 14px;
  color: var(--sub);
  margin: 10px 0 0;
}
.caption .n,
.caption--mut .n { color: var(--acc); }
.caption--mut { color: var(--mut); }

/* ---------- Hero (home) ------------------------------------- */
.hero-h1 {
  font-size: clamp(40px, 5.2vw, 76px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 18ch;
  text-wrap: balance;
}
/* Norwegian string has ascender/descender collisions at the tight leading */
.lang-no .hero-h1 { line-height: 1.15; }
.hero-h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--acc2);
}
.hero-lead {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--body);
  margin: 0;
  max-width: 58ch;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 40px 64px;
  margin-top: 40px;
  align-items: start;
}

/* Meta list (hero) */
.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--sub);
}
.meta-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  border-bottom: 1px solid var(--line3);
  padding-bottom: 14px;
}
.meta-list li:last-child { border-bottom: none; padding-bottom: 0; }
.meta-list li span:last-child { color: var(--ink); }
.meta-list .nowrap { white-space: nowrap; }
.meta-list .right { text-align: right; }

/* Hero jump-nav (replaces the facts list) */
.hero-jump {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.hero-jump a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line3);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.hero-jump a:first-child { padding-top: 0; }
.hero-jump a:hover { color: var(--acc2); }
.hero-jump .jump-arrow {
  color: var(--sub);
  transition: transform 0.2s, color 0.2s;
}
.hero-jump a:hover .jump-arrow {
  color: var(--acc2);
  transform: translateX(4px);
}

/* ---------- Dither bands ------------------------------------ */
.dither {
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 7px 7px;
}
.dither--hero {
  height: 64px;
  margin-top: 36px;
  -webkit-mask-image: linear-gradient(90deg, black 0%, var(--line4) 45%, transparent 82%);
  mask-image: linear-gradient(90deg, black 0%, var(--line4) 45%, transparent 82%);
}
.dither--rule {
  height: 28px;
  margin-top: clamp(40px, 7vw, 72px);
  background-image: radial-gradient(var(--dot3) 1px, transparent 1.3px);
  -webkit-mask-image: linear-gradient(90deg, black, transparent 85%);
  mask-image: linear-gradient(90deg, black, transparent 85%);
}
.dither--contact {
  height: 72px;
  margin-bottom: 48px;
  background-image: radial-gradient(var(--dot2) 1px, transparent 1.3px);
  -webkit-mask-image: linear-gradient(0deg, black, transparent 90%);
  mask-image: linear-gradient(0deg, black, transparent 90%);
}

/* ---------- Method ------------------------------------------ */
.tagline {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.4;
  font-weight: 400;
  color: var(--big);
  margin: 0 0 clamp(36px, 5vw, 56px);
  text-wrap: pretty;
}
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 36px 32px;
}
.step-num {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--acc);
  margin: 0 0 14px;
}
.step h3 {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 10px;
}
.step p {
  font-size: 14px;
  font-weight: 400;
  color: var(--sub);
  line-height: 1.6;
  margin: 0;
}

/* ---------- Accordions -------------------------------------- */
.accordion { border-top: 1px solid var(--line3); }

.acc-head {
  display: grid;
  grid-template-columns: minmax(24px, 6vw) minmax(0, 1fr) auto;
  gap: clamp(12px, 2vw, 24px);
  align-items: baseline;
  width: 100%;
  padding: 26px 0;
  border: none;
  border-top: 1px solid var(--line3);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s;
}
.accordion > .acc-head:first-child { border-top: none; }
.acc-head:hover { background: var(--wash); }

.acc-num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--acc);
}
.acc-title {
  display: block;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  transition: color 0.25s, transform 0.25s;
}
.acc-sub {
  display: block;
  font-size: 16px;
  color: var(--sub);
  margin: 6px 0 0;
  font-weight: 400;
}
.acc-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--sub);
}
.acc-icon {
  font-size: 22px;
  color: var(--acc);
  width: 20px;
  text-align: center;
}
.acc-head:hover .acc-title {
  color: var(--acc2);
  transform: translateX(10px);
}

.acc-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 36px 64px;
  padding: 4px 0 44px clamp(32px, 6vw, 96px);
}
.acc-panel[hidden] { display: none; }

/* Short statement of approach — kept smaller than the entry title */
.approach-lead {
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  max-width: 46ch;
}
.approach-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  margin: 18px 0 0;
  max-width: 58ch;
}

/* Calm collapsible disclosure for secondary content (skills, more projects, experience) */
.disclosure { border-top: 1px solid var(--line3); }
.disclosure > .acc-head {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 22px 0;
  border-top: none;
}
.disclosure > .acc-head .acc-title {
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 400;
}
.disclosure > .acc-head:hover { background: transparent; }
.disclosure > .acc-head:hover .acc-title { transform: none; color: var(--acc2); }
.disclosure > .acc-head .acc-icon { color: var(--acc2); }
.disclosure > .acc-panel {
  display: block;
  padding: 0 0 32px;
}
.disclosure > .acc-panel[hidden] { display: none; }
/* Panel content runs full width: label sits above, not in a narrow left column */
.disclosure > .acc-panel .row {
  display: block;
  padding: 20px 0;
}
.disclosure > .acc-panel .row-label {
  width: auto;
  margin: 0 0 12px;
}
.disclosure > .acc-panel .row-list {
  columns: 20rem;
  column-gap: 56px;
  font-size: 16px;
}
.disclosure > .acc-panel .row-list li {
  break-inside: avoid;
  margin: 0 0 12px;
}

/* Visible "How I work" block that lives in the disclosure stack */
.stack-block {
  border-top: 1px solid var(--line3);
  padding: 24px 0 8px;
}
.stack-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 16px;
}
.disclosure > .acc-panel .rows,
.disclosure > .acc-panel .index { margin-top: 0; }

.panel-body p { margin: 0; }
.panel-body .desc {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--body);
}
.panel-list {
  margin: 20px 0 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--body);
}
.panel-body .panel-cta { margin: 40px 0 0; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.tag {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--acc3);
}
.side-role {
  font-size: 16px;
  margin: 0 0 24px;
  color: var(--ink);
}
.side-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sub);
  margin: 0 0 12px;
}

/* Emphasis figures (+40%, 13, Finalist) */
.emphasis {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--acc2);
  margin: 0;
  line-height: 1;
}
.emphasis--panel { font-size: clamp(40px, 4.4vw, 60px); }
.emphasis--stat { font-size: clamp(34px, 3.8vw, 52px); }
.emphasis--word {
  font-size: clamp(26px, 2.6vw, 38px);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.emphasis-cap {
  font-size: 14px;
  color: var(--sub);
  margin: 8px 0 32px;
  font-weight: 400;
}

/* ---------- Pills ------------------------------------------- */
.pill {
  display: inline-block;
  font-size: 18px;
  color: var(--ink);
  border: 1px solid var(--line4);
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.pill:hover {
  border-color: var(--acc);
  color: var(--acc2);
  transform: translateY(-3px);
}

/* ---------- More projects / index table -------------------- */
.index { border-top: 1px solid var(--line3); }
.index-row {
  display: grid;
  grid-template-columns: minmax(min(100%, 160px), 0.85fr) minmax(min(100%, 260px), 1.5fr) 76px;
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line3);
}
/* The work (what she did) leads; the client is secondary */
.index-name { font-size: 15px; font-weight: 500; color: var(--sub); }
.index-desc { font-size: 18px; font-weight: 400; color: var(--ink); line-height: 1.45; }
.index-year {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--mut);
  white-space: nowrap;
}
/* Stack the project index on mobile so nothing forces horizontal scroll */
.block-heading {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500;
  margin: 0;
}

/* ---------- Labelled rows (experience / about / story) ------ */
.rows { border-top: 1px solid var(--line3); }
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line3);
}
.row:last-child { border-bottom: none; }
.row--tight { padding: 18px 0; }
.row-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
  flex: 0 0 auto;
  width: 220px;
  max-width: 100%;
}
.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 18px;
  font-weight: 400;
  color: var(--body);
  flex: 1 1 320px;
  min-width: 0;
}
.row-list .years { color: var(--mut); white-space: nowrap; }
.skills-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--body);
  margin: 0;
  line-height: 1.7;
  text-wrap: pretty;
  flex: 1 1 320px;
  min-width: 0;
}
.skills-text .mid { color: var(--acc); padding: 0 10px; }

/* ---------- About ------------------------------------------- */
.about-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 56px;
  align-items: flex-start;
}
.about-copy { flex: 1 1 420px; max-width: 62ch; }
.about-lead {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--big);
  margin: 0;
  text-wrap: pretty;
}
.about-p2 {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--sub);
  margin: 28px 0 0;
  max-width: 60ch;
}
.about-langlabel {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sub);
  margin: 48px 0 14px;
}
.about-langs {
  font-size: 18px;
  font-weight: 400;
  color: var(--body);
  margin: 0;
}
.about-portrait { flex: 0 1 260px; min-width: 200px; }
.portrait {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.skills-block { margin-top: 48px; border-top: 1px solid var(--line3); }

/* ---------- Visual work ------------------------------------- */
.vw-intro {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--sub);
  margin: 0 0 24px;
  max-width: 52ch;
}
.vw-accordion { border-top: 1px solid var(--line3); }
.vw-accordion .acc-head { padding: 20px 0; }
.vw-accordion .acc-title { font-size: clamp(16px, 1.6vw, 22px); }
.vw-accordion .acc-sub { font-size: 13px; margin: 5px 0 0; }
.vw-accordion .acc-icon { color: var(--acc2); }
.vw-accordion .acc-head:last-of-type { border-bottom: 1px solid var(--line3); }
.vw-panel {
  display: block;
  padding: 8px 0 64px clamp(36px, 7vw, 112px);
}
.vw-panel[hidden] { display: none; }
.vw-text {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--body);
  margin: 0 0 32px;
  max-width: 62ch;
}
.vw-text--ref { margin: 0 0 20px; }

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  align-items: stretch;
}
.specimen { display: flex; flex-direction: column; }
.specimen-box {
  flex: 1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glow);
  border-radius: 4px;
  font-family: 'Thornskull', var(--font-display);
  font-size: clamp(36px, 4vw, 56px);
  color: var(--ink);
}
.img-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  max-width: 560px;
}
.side-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 14px;
  max-width: 900px;
}
.side-block { margin-top: clamp(48px, 7vw, 80px); }
.side-copy {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--body);
  margin: 0 0 28px;
  max-width: 62ch;
}
.footnote {
  font-size: 14px;
  color: var(--mut);
  margin: 40px 0 0;
  max-width: 62ch;
}

/* ---------- Images ------------------------------------------ */
.img {
  width: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--img-line);
  display: block;
}
.img--full { width: 100%; height: auto; object-fit: initial; }
.img--auto { height: auto; }
.h-130 { height: 130px; }
.h-140 { height: 140px; }
.h-180 { height: 180px; }
.h-200 { height: 200px; }
.h-260 { height: 260px; }
.h-300 { height: 300px; }
.pos-top { object-position: top; }
.pos-left { object-position: left; }
.pos-lefttop { object-position: left top; }
.grayscale { filter: grayscale(1); }
.mw-420 { max-width: 420px; }

/* ---------- Contact ----------------------------------------- */
.contact {
  position: relative;
  padding: clamp(32px, 5vw, 56px) 0 40px;
  scroll-margin-top: 80px;
}
.contact-kicker { margin-bottom: 28px; }
.contact-h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--acc2);
  margin: 0;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
}
.email-control {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line4);
  border-radius: 999px;
  overflow: hidden;
}
.email-link {
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 14px 22px 14px 28px;
  transition: color 0.2s, background 0.2s;
}
.email-link:hover { color: var(--acc2); background: var(--wash); }
.email-divider { width: 1px; background: var(--line4); }
.copy-btn {
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 14px 22px;
  transition: color 0.2s, background 0.2s;
}
.copy-btn:hover { color: var(--acc2); background: var(--wash); }

.footer-credits {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line2);
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--mut);
  flex-wrap: wrap;
}

/* ============================================================
   Case pages
   ============================================================ */
.case-hero { padding: clamp(32px, 4.5vw, 60px) 0 clamp(28px, 4vw, 44px); }
.case-h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.case-summary {
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--big);
  margin: 28px 0 0;
  max-width: 46ch;
  text-wrap: pretty;
}
.case-summary--narrow { max-width: 44ch; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 24px 40px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line3);
}
.case-meta .field-label { margin-bottom: 10px; }
.case-meta p:last-child { font-size: 16px; color: var(--ink); margin: 0; }

/* Otovo hero stat strip */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line3);
}
.stat-cap {
  font-size: 14px;
  color: var(--sub);
  margin: 10px 0 0;
  max-width: 26ch;
}

/* Case "what it gave" value grid */
.case-value-h2 {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 32px;
}
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 28px 32px;
}
.value-item {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}
.value-item .n,
.list-num .n { color: var(--acc); margin-right: 10px; }

.case-section { padding: clamp(32px, 5vw, 52px) 0; border-top: 1px solid var(--line2); }
.case-section--story { padding: clamp(32px, 5vw, 52px) 0 clamp(40px, 6vw, 64px); }
.case-section--footer { padding: clamp(32px, 5vw, 48px) 0 clamp(56px, 8vw, 88px); border-top: 1px solid var(--line2); }

/* Two-part divider heading inside a case story */
.story-part {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  width: 100%;
  margin: clamp(30px, 4vw, 48px) 0 4px;
  padding-top: clamp(30px, 4vw, 48px);
  border-top: 1px solid var(--line2);
}
.story-part:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.story-part .num {
  color: var(--acc2);
  margin-right: 14px;
}
.story-part + .story-row { border-top: none; padding-top: 20px; }

/* Story rows */
.story-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  padding: 28px 0;
  border-top: 1px solid var(--line3);
}
.story-row:first-child { padding: 0 0 28px; border-top: none; }
.story-row--last { padding: 28px 0 0; }
.story-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
  flex: 0 0 auto;
  width: 200px;
  max-width: 100%;
}
.story-body {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 62ch;
}
.story-body > p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  margin: 0 0 20px;
}
.story-body > p.tight { margin: 0 0 24px; }
.story-body > p.diagnosis {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 24px;
}
.list-num {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
}
.learnings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  flex: 1 1 320px;
  min-width: 0;
  max-width: 62ch;
}

/* Blockquote / figure */
.quote {
  margin: 0 0 24px;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--acc);
}
.quote blockquote {
  font-size: 16px;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
  margin: 0;
}
.quote figcaption {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mut);
  margin-top: 12px;
}

/* Recommendation two-column rows (insight → decision) */
.rec-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line3);
}
.rec-row:first-of-type { padding: 0 0 20px; }
.rec-row:last-of-type { border-bottom: none; }
.rec-problem { font-size: 16px; line-height: 1.5; color: var(--sub); margin: 0; }
.rec-fix { font-size: 16px; line-height: 1.5; color: var(--ink); margin: 0; }
.rec-fix .arrow { color: var(--acc); margin-right: 10px; }

/* Image grids inside case bodies */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.img-grid--concept { gap: 14px; }
.img-grid--quad {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin-top: 4px;
}

@media (max-width: 540px) {
  .footer-credits { flex-direction: column; gap: 8px; }
}

/* ============================================================
   Mobile overrides — placed last so they win over base rules
   regardless of where those appear earlier in the file.
   ============================================================ */
@media (max-width: 640px) {
  /* Project index stacks */
  .index-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "desc year"
      "name name";
    column-gap: 16px;
    row-gap: 4px;
    align-items: baseline;
  }
  .index-desc { grid-area: desc; font-size: 15px; }
  .index-year { grid-area: year; text-align: right; }
  .index-name { grid-area: name; }

  /* Type scale: hero stays dominant, body steps down a grade */
  .hero-lead { font-size: 15px; line-height: 1.5; }
  .about-lead { font-size: 16px; line-height: 1.5; }
  .about-p2 { font-size: 15px; }
  .about-langs { font-size: 16px; }
  .approach-lead { font-size: 16px; }
  .approach-body { font-size: 15px; }
  .skills-text { font-size: 15px; }
  .vw-intro { font-size: 15px; }
  .vw-text { font-size: 15px; }
  .side-copy { font-size: 15px; }
  .disclosure > .acc-panel .row-list { font-size: 15px; }
  .note { font-size: 14px; }

  /* Compact About: small avatar tucked at the top, tight gap */
  .about-grid { gap: 16px; }
  .about-portrait { flex: 0 0 auto; width: 124px; min-width: 0; order: -1; }
}
