/* =====================================================================
   v-kolosov.ru — premium light-minimal personal site
   Vanilla CSS, no external dependencies. System font stack keeps it
   fast and private (no third-party requests). Swap in self-hosted
   Inter later if you want extra polish.
   ===================================================================== */

/* Self-hosted Inter (variable, latin) — no external requests */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-variable.woff2") format("woff2");
}

:root {
  /* Palette — near-monochrome ink on white, one calm accent */
  --bg:        #ffffff;
  --bg-soft:   #f7f8fa;
  --ink:       #14161c;   /* headlines */
  --body:      #474d59;   /* paragraphs */
  --muted:     #878d9b;   /* meta / labels */
  --line:      #e9ebef;   /* hairlines */
  --accent:    #3a56ff;
  --accent-ink:#2840d8;   /* accent on hover */
  --accent-soft: #eef1ff; /* accent tint for chips */

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* Layout rhythm */
  --wrap: 1080px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(4.5rem, 11vw, 9rem);
  --radius: 14px;

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

/* Dark palette — applied via the toggle (data-theme) or system preference.
   Same variable names, so the whole site re-themes from here. */
:root[data-theme="dark"] {
  --bg:        #0e1014;
  --bg-soft:   #16191f;
  --ink:       #f3f5f9;
  --body:      #b4bac6;
  --muted:     #79808d;
  --line:      #262a31;
  --accent:    #7088ff;
  --accent-ink:#9aa9ff;
  --accent-soft: #1a2036;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0e1014;
    --bg-soft:   #16191f;
    --ink:       #f3f5f9;
    --body:      #b4bac6;
    --muted:     #79808d;
    --line:      #262a31;
    --accent:    #7088ff;
    --accent-ink:#9aa9ff;
    --accent-soft: #1a2036;
  }
}

html { transition: background-color 0.3s var(--ease); }

/* ── Reset / base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth; -webkit-text-size-adjust: 100%;
  /* Always reserve the scrollbar gutter so the centered layout never
     shifts left/right between tall and short pages. */
  scrollbar-gutter: stable;
}

/* Custom scrollbar — themed via variables (Firefox + WebKit) */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 999px;
  border: 3px solid var(--bg); background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted); border: 3px solid var(--bg); background-clip: padding-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  /* clip (not hidden) prevents any horizontal shift without breaking sticky */
  overflow-x: clip;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

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

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

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

.skip {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(-150%);
  top: 0.5rem; z-index: 100; background: var(--ink); color: #fff;
  padding: 0.6rem 1rem; border-radius: 8px; transition: transform 0.2s var(--ease);
}
.skip:focus { transform: translateX(-50%) translateY(0); }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; max-width: var(--wrap); margin-inline: auto;
  padding: 0.95rem var(--pad);
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--ink); }
.brand__mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  color: var(--bg); background: var(--ink); border-radius: 9px; letter-spacing: 0.02em;
}
.brand__name { font-size: 0.95rem; letter-spacing: -0.01em; }

.nav__links { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-size: 0.92rem; color: var(--body); position: relative; padding-block: 0.25rem;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
/* Scroll-spy: current section highlighted */
.nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after { width: 100%; }

.nav__right { display: flex; align-items: center; gap: 1.5rem; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent;
  color: var(--body); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.18s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle:active { transform: scale(0.94); }
/* Show the icon that represents the action: dark active → sun, otherwise → moon */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 560px) {
  .brand__name { display: none; }
  .nav { padding-inline: 1.1rem; }
  .nav__right { gap: 0.85rem; }
  .nav__links { gap: 0.95rem; }
  .nav__links a { font-size: 0.86rem; }
  .theme-toggle { width: 32px; height: 32px; }
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  padding-top: clamp(4rem, 12vw, 8rem);
  /* Half of --section-y: the section below adds its own top padding, and with
     no divider line between them the doubled gap read as a hole. */
  padding-bottom: clamp(2rem, 6vw, 4rem);
  position: relative;
  overflow: hidden;
}
/* Soft, barely-there accent glow — depth without clutter */
.hero::before {
  content: ""; position: absolute; inset: -20% 30% auto -10%; height: 60vh;
  background: radial-gradient(60% 60% at 30% 30%, var(--accent-soft), transparent 70%);
  opacity: 0.8; pointer-events: none; z-index: -1;
}

.eyebrow {
  font-family: var(--mono); font-size: 0.82rem; color: var(--accent);
  letter-spacing: 0.01em; margin: 0 0 1.25rem;
}
.hero__title {
  font-size: clamp(2.5rem, 8vw, 5.75rem);
  font-weight: 700; margin-bottom: 1.5rem;
  overflow-wrap: break-word; max-width: 100%;
}
.hero__lead { font-size: clamp(1.35rem, 3.5vw, 2rem); color: var(--ink); font-weight: 500; margin: 0 0 1.25rem; }

.rotator {
  display: inline-block; vertical-align: baseline;
  color: var(--accent);
  /* Reserve the widest word (~15ch at this font). Without it the lead wraps to
     two lines only for the long words, so on narrow screens the whole page
     jolted up and down every 2.6s — and a reload landed wherever the rotation
     happened to be. ch scales with the clamped font-size, px would not. */
  min-width: 15ch;
}
.rotator__word {
  display: inline-block; white-space: nowrap;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
}
.rotator__word.is-out { animation: word-out 0.32s var(--ease) forwards; }
.rotator__word.is-in  { animation: word-in  0.42s var(--ease) forwards; }
@keyframes word-out { to { opacity: 0; transform: translateY(-0.5em); } }
@keyframes word-in  { from { opacity: 0; transform: translateY(0.6em); } to { opacity: 1; transform: translateY(0); } }

.hero__sub { max-width: 56ch; font-size: 1.075rem; margin: 0 0 2.25rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.5rem; border-radius: 999px; font-weight: 500; font-size: 0.95rem;
  border: 1px solid transparent; transition: transform 0.18s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }

/* ── Sections ──────────────────────────────────────────────────── */
.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line); }

.section__head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 650; }
.section__note { color: var(--muted); margin: 0.75rem 0 0; max-width: 50ch; }

/* ── Work cards ────────────────────────────────────────────────── */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* Year left, status pinned right — the badges then line up down the right edge
   of the grid instead of drifting with the length of each year label. */
.card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-bottom: 1rem; }
.card__year { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.card__ships { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.card__ships::before { content: "\00B7"; margin-right: 0.5rem; opacity: 0.55; }
.card__status {
  display: inline-flex; align-items: center; margin-left: auto;
  font-size: 0.72rem; font-weight: 500; color: var(--body);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.6rem;
}
.card__status--live { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.card__status--live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 0.4rem;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.card__title { font-size: 1.45rem; font-weight: 650; margin-bottom: 0.3rem; }
.card__role { color: var(--accent-ink); font-weight: 500; font-size: 0.92rem; margin: 0 0 0.85rem; }
.card__desc { margin: 0 0 1.25rem; font-size: 0.98rem; }

/* margin-top: auto pins the chips to the bottom of the card, so they line up
   across a row however long the copy above them runs. */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: auto 0 0; padding: 0; }
.tags li {
  font-family: var(--mono); font-size: 0.74rem; color: var(--body);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 0.25rem 0.55rem;
}

.card__link {
  margin-top: 1.25rem; align-self: flex-start; font-weight: 500; font-size: 0.92rem; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
/* Cards without a link still reserve its row, so the chips of a card that has
   one sit at the same height as those of a card that doesn't. */
@media (min-width: 720px) {
  .card:not(:has(.card__link))::after {
    content: ""; display: block; margin-top: 1.25rem; height: calc(0.92rem * 1.65);
  }
}
.card__link span { transition: transform 0.2s var(--ease); }
.card__link:hover { color: var(--accent-ink); }
.card__link:hover span { transform: translateX(4px); }

/* ── About ─────────────────────────────────────────────────────── */
.about__grid { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .about__grid { grid-template-columns: 1fr 2fr; gap: 3rem; } }
.about__body p { margin: 0 0 1.25rem; font-size: 1.075rem; }
.about__body p:last-of-type { margin-bottom: 0; }

.about__tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.about__tools span {
  font-family: var(--mono); font-size: 0.8rem; color: var(--body);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.7rem;
}

/* ── Contact ───────────────────────────────────────────────────── */
.contact__lead { max-width: 50ch; margin: 1rem 0 1.5rem; font-size: 1.075rem; }
.contact__likes { margin: 0 0 2.5rem; }
.contact__likes-label {
  display: block; margin-bottom: 0.6rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
/* .tags pins itself to the bottom inside a card; outside one it just sits. */
.tags--inline { margin: 0; }
.contact__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.contact__list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem;
  padding: 1.1rem 0; border-top: 1px solid var(--line);
}
.contact__list li:last-child { border-bottom: 1px solid var(--line); }
.contact__label {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  min-width: 6rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.contact__value {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem); color: var(--ink); font-weight: 500;
  position: relative;
}
.contact__value::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.contact__value:hover { color: var(--accent-ink); }
.contact__value:hover::after { width: 100%; }

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 4rem); }
/* Colophon: the site is its own evidence, so the claims stay checkable. */
.footer__colophon {
  margin: 0 0 1.5rem; max-width: 62ch;
  font-size: 0.85rem; line-height: 1.6; color: var(--muted);
}
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer__copy { margin: 0; font-size: 0.85rem; color: var(--muted); }
.footer__meta { display: flex; align-items: center; gap: 1.5rem; }
.footer__cookies {
  background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem;
  color: var(--muted); cursor: pointer; transition: color 0.2s var(--ease);
}
.footer__cookies:hover { color: var(--accent-ink); }
.footer__top { font-size: 0.85rem; color: var(--body); }
.footer__top:hover { color: var(--accent-ink); }

/* ── Interactive terminal (the one tasteful flourish) ──────────── */
.terminal {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; font-family: var(--mono); margin-bottom: 2.5rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.terminal.is-focused {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.terminal__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg);
}
.terminal__bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.terminal__title { margin-left: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.terminal__body { padding: 1.1rem 1.2rem 1.2rem; font-size: 0.86rem; line-height: 1.7; cursor: text; }
/* The intro auto-types ~2s after load and the output rows would push the page
   taller — enough that a reload near the bottom lands slightly above where the
   visitor was. Reserving the rows up front (and capping a long session) keeps
   the document height steady. */
.terminal__output {
  white-space: pre-wrap; word-break: break-word; color: var(--body);
  min-height: calc(1.7em * 3); max-height: calc(1.7em * 12); overflow-y: auto;
}
@media (max-width: 560px) { .terminal__output { min-height: calc(1.7em * 5); } }
.term-row + .term-row { margin-top: 0.1rem; }
/* Soft "print-in" so output doesn't pop in abruptly */
.term-row { opacity: 0; transform: translateY(3px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.term-row.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .term-row { opacity: 1; transform: none; transition: none; }
}
.term-prompt { color: var(--accent-ink); }
.cmd { color: var(--ink); }
.terminal__output .accent { color: var(--accent-ink); }
.terminal__output a { color: var(--accent-ink); }
.terminal__output a:hover { text-decoration: underline; }
.terminal__line { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.1rem; }
.terminal__prompt { color: var(--accent-ink); white-space: nowrap; }
.terminal__input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; color: var(--ink); caret-color: var(--accent); padding: 0;
}
.terminal__hint { margin: 0.85rem 0 0; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.terminal__hint code {
  font-family: var(--mono); background: var(--bg); border: 1px solid var(--line);
  border-radius: 5px; padding: 0.05rem 0.35rem; color: var(--body);
}

/* ── 404 ───────────────────────────────────────────────────────── */
.notfound {
  min-height: 70vh; display: grid; place-items: center; text-align: center;
  position: relative; overflow: hidden; padding-block: var(--section-y);
}
.notfound::before {
  content: ""; position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 700px; height: 60vh; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent-soft), transparent 70%);
}
.notfound__inner { max-width: 52ch; }
.notfound .eyebrow { display: block; }
.notfound__code { font-size: clamp(2.3rem, 7vw, 4.25rem); font-weight: 700; margin: 0.75rem 0 1rem; }
.notfound__text { font-size: 1.075rem; margin: 0 auto 2rem; }
.notfound .hero__actions { justify-content: center; }
.notfound__mono { display: block; margin-top: 2.75rem; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.notfound__out { color: var(--body); margin-left: 0.5rem; }
.notfound__out::before { content: "↳ "; color: var(--accent); }

/* ── Cookie notice ─────────────────────────────────────────────── */
.cookie {
  position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 80;
  width: min(92vw, 380px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  box-shadow: 0 20px 45px -28px rgba(0, 0, 0, 0.45);
  font-size: 0.85rem; color: var(--body);
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.cookie.is-in { opacity: 1; transform: translateY(0); }
.cookie__text { flex: 1; line-height: 1.5; }
.cookie__text a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.cookie__actions { flex: none; display: flex; gap: 0.5rem; align-self: flex-end; }
.cookie__btn {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1.2;
  padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; font-size: 0.85rem; font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.18s var(--ease);
}
.cookie__btn--ghost:hover { border-color: var(--ink); }
.cookie__btn--ok { background: var(--ink); color: var(--bg); border-color: transparent; }
.cookie__btn--ok:hover { background: var(--accent-ink); }
.cookie__btn:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .cookie { transition: none; }
}
@media (max-width: 480px) {
  .cookie { left: 1rem; right: 1rem; width: auto; gap: 0.65rem; }
  .cookie__actions { width: 100%; }
  .cookie__btn { flex: 1; }
}

/* ── Scroll reveal ─────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Respect reduced-motion: no transforms, no rotator/pulse animation */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* Case study page (/fleet/) */
.case .section { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.case__head { padding-bottom: clamp(2rem, 5vw, 3rem); }
.case__title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; margin: 0 0 1.25rem; letter-spacing: -0.015em; }
.case__lead { font-size: 1.05rem; color: var(--body); max-width: 60ch; margin: 0; }
.case__body > * { max-width: 68ch; }   /* limit the text, not the wrap: the wrap keeps page alignment */
.case__body p { color: var(--body); margin: 0 0 1rem; }
.case__body .section__title { margin: 0 0 1.25rem; }

.backlink {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  text-decoration: none; margin-bottom: 1.5rem;
  transition: color 0.2s var(--ease);
}
.backlink:hover { color: var(--accent-ink); }

.constraints { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.85rem; }
.constraints li { color: var(--body); padding-left: 1.1rem; position: relative; }
.constraints li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
}
.constraints strong { color: var(--ink); font-weight: 600; }

.decisions { margin: 0; padding: 0; list-style: none; display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); }
.decision { border-left: 2px solid var(--line); padding-left: clamp(1rem, 3vw, 1.4rem); }
.decision__q { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); margin: 0 0 0.4rem; }
.decision__title { font-size: 1.1rem; font-weight: 650; color: var(--ink); margin: 0 0 0.65rem; }
.decision p { margin: 0 0 0.65rem; }
.decision p:last-child { margin-bottom: 0; }
.decision__cost { font-size: 0.92rem; color: var(--muted); }
.decision__cost strong { color: var(--body); font-weight: 600; }

.figures {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem; margin: 0 0 1.75rem;
}
.figures .figure__n { font-size: clamp(1.35rem, 3.5vw, 1.75rem); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.figures .figure__l { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* Work groups (SimUptime / Other work) */
.group { margin: 0 0 clamp(1.25rem, 3vw, 1.75rem); }
.group__title { font-size: 1.1rem; font-weight: 650; color: var(--ink); margin: 0 0 0.3rem; }
.group__note { color: var(--muted); font-size: 0.92rem; margin: 0; max-width: 56ch; }
/* a hairline separates the second group from the first block of cards */
.cards + .group {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
}
