/* Case-study pages. Same tokens and rules as the homepage:
   dark only, red for actions and brand moments, off-white (--note) for anything hand-lettered.
   Shape rule: buttons and nav = full pill, cards and media = 20px, inputs = 12px. */
@font-face { font-family: 'Mona Sans'; src: url('fonts/mona-sans-latin-standard.woff2') format('woff2'); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: 'Jenny'; src: url('fonts/jenny-regular.woff') format('woff'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: oklch(0.145 0.007 30); --well: oklch(0.115 0.007 30); --surface: oklch(0.2 0.008 30); --surface-2: oklch(0.25 0.009 30);
  --sheen: linear-gradient(transparent, transparent);
  --hi: 0 0 0 0 transparent;
  --ink: oklch(0.965 0.01 85); --mute: oklch(0.76 0.01 75); --dim: oklch(0.5 0.008 60);
  --line: oklch(0.965 0.01 85 / .13);
  --hot: #e30613; --hot-hover: #f01b2a; --hot-ink: oklch(0.99 0.004 85); --hot-text: #f2303c;
  --note: var(--ink);
  --sans: 'Mona Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Jenny', 'Segoe Print', cursive;
  --pad: clamp(16px, 4vw, 48px); --max: 1280px;
  --r-card: 10px; --r-input: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::after { content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
/* Flat tonal band: a step in tone and a hairline, no glow. */
.band { --band: oklch(0.185 0.008 30); position: relative; background: var(--band); box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); }
.band::after { content: ''; position: absolute; top: 0; left: 50%; width: 100vw; margin-left: -50vw; height: 1px; pointer-events: none; background: var(--line); }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--hot); color: var(--hot-ink); }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.hand { font-family: var(--hand); font-weight: 400; font-size: 20px; line-height: 1; letter-spacing: .02em; color: var(--note); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .2s, transform .25s var(--ease); }
.btn:hover { background: var(--surface-2); } .btn:active { transform: scale(.97); }
.btn--hot { background: var(--hot); color: var(--hot-ink); border-color: transparent; } .btn--hot:hover { background: var(--hot-hover); }
.cta-xl { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; padding: clamp(18px, 2vw, 26px) clamp(36px, 6vw, 80px) clamp(16px, 1.6vw, 22px); border: 0; border-radius: 999px; background: var(--hot); color: var(--hot-ink); font: 650 clamp(24px, 2.8vw, 40px)/1 var(--sans); letter-spacing: -.035em; cursor: pointer; transition: transform .45s var(--ease), background .2s; }
.cta-xl small { font-size: 14px; font-weight: 500; letter-spacing: 0; opacity: .78; }
.cta-xl:hover { background: var(--hot-hover); transform: rotate(-1.5deg) scale(1.025); } .cta-xl:active { transform: scale(.97); }

/* Nav */
.nav { position: fixed; z-index: 40; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 12px; max-width: calc(100vw - 32px); background: oklch(0.2 0.008 30 / .82); border: 1px solid var(--line); border-radius: 999px; -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.nav__brand { display: flex; align-items: center; gap: 9px; margin-right: 10px; white-space: nowrap; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.nav__brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.nav__links a { padding: 10px 12px; border-radius: 999px; color: var(--mute); text-decoration: none; font-size: 15px; transition: color .2s, background .2s; }
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }
.nav .btn { margin-left: 6px; height: 40px; }
@media (max-width: 640px) { .nav__links { display: none; } .nav { gap: 8px; } }
@media (max-width: 380px) { .nav__brand span { display: none; } }

/* Hero */
.chero { padding-top: clamp(120px, 14vw, 180px); padding-bottom: clamp(36px, 5vw, 64px); }
.chero__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: clamp(20px, 3vw, 36px); color: var(--mute); font-size: 15px; text-decoration: none; transition: color .2s; }
.chero__back:hover { color: var(--ink); }
.ctitle { font-size: clamp(40px, 7vw, 96px); font-weight: 650; line-height: 1; letter-spacing: -.045em; }
.csum { margin-top: 20px; max-width: 30ch; color: var(--mute); font-size: clamp(19px, 1.9vw, 26px); line-height: 1.3; letter-spacing: -.01em; }
.cmeta { margin-top: clamp(28px, 4vw, 48px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; max-width: 900px; }
.cmeta div { padding-top: 14px; border-top: 1px solid var(--line); }
.cmeta dt { color: var(--mute); font-size: 14px; }
.cmeta dd { margin-top: 4px; font-size: 17px; font-weight: 500; line-height: 1.35; }
.cmeta .hand { display: block; margin-top: 10px; rotate: -2deg; transform-origin: left center; }
.cmeta a { text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .2s; } .cmeta a:hover { border-color: var(--hot); }
@media (max-width: 760px) { .cmeta { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

.shot { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--sheen), var(--surface); box-shadow: var(--hi), 0 18px 36px -24px rgba(0, 0, 0, .6); }
.shot img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.ccover { max-width: var(--max); margin: 0 auto; }
.shot video { display: block; width: 100%; height: auto; }
.shot video:not([loop]) { cursor: pointer; }
.vcap { margin-top: 14px; max-width: 70ch; color: var(--mute); font-size: 15px; }

/* Sections */
.csec { padding-block: clamp(64px, 8vw, 120px); }
.csec__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.h2 { font-size: clamp(28px, 3.3vw, 46px); font-weight: 600; line-height: 1.04; letter-spacing: -.035em; max-width: 22ch; }
.prose p { max-width: 56ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--ink); }
.prose p + p { margin-top: 1.1em; color: var(--mute); }
@media (max-width: 860px) { .csec__grid { grid-template-columns: minmax(0, 1fr); } }

/* Skill stack: the same eight skills as the homepage. Used ones say what they did. */
.stack { margin-top: clamp(32px, 4vw, 56px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sk { display: flex; flex-direction: column; gap: 8px; min-height: 148px; padding: 18px 18px 20px; border-radius: var(--r-card); border: 1px dashed rgba(243, 242, 239, .12); color: var(--dim); }
.sk b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.sk p { font-size: 15px; line-height: 1.45; }
.sk--on { border: 1px solid rgba(243, 242, 239, .14); background: var(--sheen), var(--surface-2); box-shadow: var(--hi); color: var(--mute); }
.sk--on b { color: var(--ink); }
.built { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.built > span:first-child { margin-right: 6px; color: var(--mute); font-size: 15px; }
.chip { padding: 6px 14px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; }
@media (max-width: 1000px) { .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stack { grid-template-columns: minmax(0, 1fr); } .sk { min-height: 0; } }

/* Result */
.bigline { max-width: 20ch; font-size: clamp(32px, 4.8vw, 68px); font-weight: 650; line-height: 1.04; letter-spacing: -.045em; text-wrap: balance; }
.facts { margin-top: clamp(32px, 4vw, 56px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.facts li { padding-top: 16px; border-top: 1px solid var(--line); }
.facts b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.facts p { margin-top: 6px; color: var(--mute); font-size: 16px; line-height: 1.5; }
.rnote { margin-top: 28px; max-width: 60ch; color: var(--mute); font-size: 17px; }
@media (max-width: 760px) { .facts { grid-template-columns: minmax(0, 1fr); } }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 760px) { .gallery { grid-template-columns: minmax(0, 1fr); } }

/* Follow a booking (medical practice case): steps on the left, the system on the right */
.bk { background: var(--sheen), var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(20px, 3vw, 36px); box-shadow: var(--hi), 0 18px 36px -24px rgba(0, 0, 0, .6); }
.bk__head p { margin-top: 10px; max-width: 60ch; color: var(--mute); font-size: 17px; }
.bk__body { margin-top: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.bk-steps { display: grid; gap: 4px; }
.bk-step > button { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; transition: background .25s; }
.bk-step > button:hover { background: rgba(243, 242, 239, .04); }
.bk-step__t { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; color: var(--mute); transition: color .25s; }
.bk-step__who { flex-shrink: 0; font-size: 13.5px; color: var(--dim); transition: color .25s; }
.bk-step__d { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.bk-step__d p { overflow: hidden; padding: 0 14px; color: var(--mute); font-size: 15.5px; line-height: 1.5; }
.bk-step.is-on > button { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--hot); }
.bk-step.is-on .bk-step__t { color: var(--ink); } .bk-step.is-on .bk-step__who { color: var(--mute); }
.bk-step.is-on .bk-step__d { grid-template-rows: 1fr; }
.bk-step.is-on .bk-step__d p { padding: 8px 14px 10px; }
.bk__fig { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.bk__fig svg { display: block; width: 100%; min-width: 660px; height: auto; font-family: var(--sans); }
.bk .col { font-size: 13px; fill: var(--dim); }
.bk .node rect { fill: var(--surface-2); stroke: rgba(243, 242, 239, .14); stroke-width: 1; transition: stroke .3s, fill .3s; }
.bk .node.ext rect { stroke-dasharray: 5 4; }
.bk .node.on rect { stroke: rgba(243, 242, 239, .8); fill: #2a2725; }
.bk .node .t { font-size: 15px; font-weight: 600; fill: var(--ink); letter-spacing: -.01em; }
.bk .node .s { font-size: 12px; fill: var(--mute); }
.bk .node.db .s.li { fill: var(--ink); opacity: .7; }
.bk .edge { fill: none; stroke: rgba(243, 242, 239, .13); stroke-width: 1.5; marker-end: url(#bk-ah); transition: stroke .3s; }
.bk .edge.on { stroke: var(--hot); stroke-width: 2; stroke-dasharray: 7 6; marker-end: url(#bk-ah-on); animation: bkflow .9s linear infinite; }
.bk .edge.rev { marker-end: none; marker-start: url(#bk-ah); }
.bk .edge.rev.on { marker-start: url(#bk-ah-on); animation-direction: reverse; }
@keyframes bkflow { to { stroke-dashoffset: -26; } }
@media (max-width: 960px) { .bk__body { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .bk .edge.on { animation: none; } .bk-step__d { transition: none; } }

/* Next case study + closing call */
.next { display: block; padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); text-decoration: none; }
.next span { color: var(--mute); font-size: 15px; }
.next b { display: block; margin-top: 6px; font-size: clamp(32px, 5.4vw, 76px); font-weight: 650; line-height: 1; letter-spacing: -.045em; transition: transform .5s var(--ease); }
.next:hover b { transform: translateX(10px); }
.close { text-align: center; padding-block: clamp(56px, 7vw, 100px); }
.close__panel { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--sheen), var(--surface); box-shadow: var(--hi), 0 18px 36px -24px rgba(0, 0, 0, .6); padding: clamp(56px, 8vw, 110px) var(--pad); }
.chero { position: relative; }
.close h2 { margin-inline: auto; max-width: 18ch; font-size: clamp(34px, 4.8vw, 68px); font-weight: 700; line-height: 1; letter-spacing: -.05em; }
.close__row { margin-top: clamp(28px, 4vw, 44px); display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px 40px; border-top: 1px solid var(--line); color: var(--mute); font-size: 15px; }
.foot a { text-decoration: none; } .foot a:hover { color: var(--ink); }

/* Reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.is-open { display: flex; }
.modal__bg { position: absolute; inset: 0; background: rgba(5, 5, 6, .8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal__panel { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 32px; background: var(--sheen), var(--surface); box-shadow: var(--hi); border: 1px solid var(--line); border-radius: var(--r-card); }
.modal__x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.modal h2 { font-size: 34px; font-weight: 650; letter-spacing: -.03em; }
.modal__mail { margin-top: 4px; color: var(--mute); font-size: 16px; }
.field { display: grid; gap: 8px; margin-top: 18px; }
.field label { font-size: 15px; font-weight: 500; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-input); border: 1px solid rgba(243, 242, 239, .16); background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--sans); }
.field input::placeholder, .field textarea::placeholder { color: #85847f; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--hot); box-shadow: 0 0 0 3px rgba(227, 6, 19, .25); }
.modal form .btn { margin-top: 24px; width: 100%; height: 50px; font-size: 16px; }

/* Voice: a condensed grotesque for display, normal width for reading. */
.ctitle, .h2, .bigline, .next b, .close h2, .cta-xl, .sk b, .facts b, .modal h2 { font-stretch: 84%; letter-spacing: -.015em; }
.ctitle { font-size: clamp(48px, 9vw, 140px); font-weight: 800; line-height: .94; }
.bigline { font-weight: 800; line-height: .98; }
.csum { max-width: 32ch; }

/* Closing: no container, one huge line on the grid, the action beside it. */
.close { text-align: left; }
.close__panel { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: end; gap: clamp(28px, 5vw, 80px); overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; padding: clamp(16px, 3vw, 40px) 0 0; }
.close h2 { margin: 0; max-width: 18ch; font-size: clamp(32px, 4.6vw, 68px); font-weight: 800; line-height: 1; }
.close__row { margin-top: 0; justify-content: flex-start; }
@media (max-width: 860px) { .close__panel { grid-template-columns: minmax(0, 1fr); } }

/* Primary button: tighter pill, readable sub-label (normal width, full contrast). */
.cta-xl { gap: 7px; padding: clamp(20px, 2vw, 26px) clamp(34px, 4vw, 52px) clamp(18px, 1.8vw, 22px); }
.cta-xl small { font-stretch: 100%; font-weight: 500; font-size: 14.5px; letter-spacing: .005em; opacity: 1; }

/* Legal pages and footer links */
.foot__links { display: flex; gap: 24px; flex-wrap: wrap; }
.ltitle { font-size: clamp(40px, 7vw, 100px); }
.legal { max-width: 68ch; padding-bottom: clamp(40px, 6vw, 80px); }
.legal h2 { margin: 2.2em 0 .5em; font-size: 24px; font-weight: 650; font-stretch: 84%; letter-spacing: -.01em; line-height: 1.15; max-width: none; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--mute); font-size: 17px; line-height: 1.6; }
.legal p { margin: 0 0 1em; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal ul { margin: 0 0 1em; padding-left: 1.2em; list-style: disc; }
.legal li { margin-bottom: .4em; }
.legal a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: text-decoration-color .2s; }
.legal a:hover { text-decoration-color: var(--hot); }
.tablewrap { overflow-x: auto; margin: 1.2em 0; }
.ltable { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 16px; }
.ltable th, .ltable td { padding: 13px 16px 13px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--line); color: var(--mute); line-height: 1.5; }
.ltable th { color: var(--ink); font-weight: 600; }
.ltable td:first-child { color: var(--ink); width: 46%; }
@media (max-width: 600px) {
  .ltable { min-width: 0; }
  .ltable thead { display: none; }
  .ltable tr { display: block; padding: 14px 0; border-top: 1px solid var(--line); }
  .ltable td { display: block; padding: 0; border: 0; }
  .ltable td:first-child { width: auto; margin-bottom: 4px; }
}
