/* Thin rules on a cool page and one purple accent. */
:root {
  color-scheme: light;
  --ink: #15161c;
  --muted: #565a66;
  --rule: #c3c6cf;
  --page: #f4f5f7;
  --accent: #3f14ff;
  --white: #ffffff;
  --sans: "Schibsted Grotesk", Arial, sans-serif;
  --mono: "Spline Sans Mono", "Courier New", monospace;
  --gap: clamp(32px, 6vw, 96px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
}
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page {
  padding-left: max(clamp(16px, 4vw, 56px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 4vw, 56px), env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: 16px; top: -4rem; background: var(--white); padding: 8px 12px; }
.skip:focus { top: 8px; }

nav.top, footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
  padding-block: 20px;
}
nav.top { border-bottom: 1px solid var(--ink); }
nav.top .name { font-weight: 500; }
nav.top ul { display: flex; gap: 24px; }

.hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px var(--gap);
  padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--ink);
}
.hero-text { flex: 5 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
h1 {
  font-size: clamp(38px, 5vw, 72px); line-height: 1.04; font-weight: 500;
  letter-spacing: -.02em; text-wrap: balance;
}
.hero p { max-width: 34em; }
.horizons { flex: 4 1 340px; min-width: 0; }
.horizons svg { display: block; width: 100%; height: auto; font: 400 13px var(--mono); }
.horizons path { fill: none; stroke-width: 1.5; }
.horizons .axis { stroke: var(--ink); stroke-width: 1; }
.horizons .h1 { stroke: var(--ink); }
.horizons .h2 { stroke: #6b6f7c; }
.horizons .h3 { stroke: var(--accent); stroke-width: 2.5; }
.horizons text { fill: var(--ink); }
.horizons .t2 { fill: var(--muted); }
.horizons .t3 { fill: var(--accent); }
.horizons .h3 { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.6s .2s cubic-bezier(.3,.7,.2,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.mono { font: 400 14px/1.45 var(--mono); }

/* Lists */
.work article {
  display: flex; flex-wrap: wrap; gap: 12px var(--gap);
  padding-block: clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--ink);
}
.work h2, .section-title {
  font-size: clamp(26px, 2.8vw, 40px); line-height: 1.1; font-weight: 500; letter-spacing: -.012em;
}
.work h2 { flex: 5 1 380px; min-width: 0; text-wrap: balance; }
.work .info { flex: 6 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 8px; max-width: 42em; }
.work .result { font-weight: 500; color: var(--accent); }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.skills li { font: 400 13px/1 var(--mono); padding: 7px 10px; border: 1px solid var(--ink); }

.block { padding-top: clamp(40px, 6vw, 80px); }
.section-title { margin-bottom: 24px; }
.row {
  display: flex; flex-wrap: wrap; gap: 2px 24px;
  padding-block: 12px;
  border-top: 1px solid var(--rule);
}
.row > :first-child { flex: 1 1 200px; min-width: 0; line-height: 1.7; }
.row > :nth-child(2) { flex: 3 1 320px; min-width: 0; font-size: 17px; font-weight: 500; }
.row > :nth-child(3) { flex: 3 1 320px; min-width: 0; }

footer { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--ink); padding-block: 24px; }
footer a { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .horizons .h3 { animation: none; stroke-dashoffset: 0; }
}
@media (max-width: 600px) { .horizons svg { font-size: 19px; } }
/* Case study pages */
.work h2 a { text-decoration: none; }
.work h2 a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.read-more { font-weight: 500; margin-top: 6px; }

.cs-back { padding-block: 20px; border-bottom: 1px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.cs-hero { padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 56px); display: flex; flex-direction: column; gap: 24px; border-bottom: 1px solid var(--ink); }
.cs-hero h1 { max-width: 16em; }
.cs-hero .lede { font-size: clamp(18px, 1.5vw, 21px); max-width: 38em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px var(--gap); padding-block: 24px; border-bottom: 1px solid var(--ink); }
.facts dt { font: 400 14px/1.45 var(--mono); color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 500; }
.facts .skills { margin-top: 6px; }
.cs-section { display: flex; flex-wrap: wrap; gap: 12px var(--gap); padding-block: clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--ink); }
.cs-section h2 { flex: 5 1 380px; min-width: 0; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.1; font-weight: 500; letter-spacing: -.012em; }
.cs-section .body { flex: 6 1 480px; min-width: 0; max-width: 42em; display: flex; flex-direction: column; gap: 16px; }
.cs-section .body ul { display: flex; flex-direction: column; gap: 8px; }
.cs-section .body li { padding-left: 18px; position: relative; }
.cs-section .body li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; background: var(--accent); }
.cs-section .body .result { font-weight: 500; color: var(--accent); font-size: clamp(18px, 1.5vw, 21px); }
.cs-next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 32px; padding-block: clamp(32px, 4vw, 56px); }
.cs-next a { font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; letter-spacing: -.01em; }
/* Case study figures and callouts */
.cs-figure { flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cs-figure img { display: block; width: auto; max-width: min(100%, 680px); max-height: 460px; object-fit: contain; cursor: zoom-in; height: auto; border: 1px solid var(--rule); background: var(--white); }
.cs-figure figcaption { font: 400 14px/1.45 var(--mono); color: var(--muted); }
.cs-figure a { display: block; }
.cs-figure.hero-shot { padding-block: clamp(24px, 3vw, 40px) 0; border-bottom: 0; }
.figure-row { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; align-items: start; }
.figure-row.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.callout { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; font-size: clamp(19px, 1.6vw, 22px); font-weight: 500; }
.callout .label { display: block; font: 400 14px/1.45 var(--mono); color: var(--muted); font-weight: 400; margin-bottom: 4px; }
.cs-section .body ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.quote { margin: 0; border-top: 1px solid var(--rule); padding-top: 14px; }
.quote p { font-size: clamp(18px, 1.5vw, 21px); }
.quote cite { display: block; margin-top: 6px; font: 400 14px/1.45 var(--mono); font-style: normal; color: var(--muted); }
.cs-section .spacer { flex: 5 1 380px; min-width: 0; }
@media (max-width: 900px) { .cs-section .spacer { display: none; } }
.figure-row .cs-figure img { max-height: 340px; }
.figure-row.three .cs-figure img { max-height: 280px; }
.cs-figure.hero-shot img { max-width: min(100%, 860px); max-height: 600px; }

/* Enlarged image overlay */
.lightbox { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; }
.lightbox::backdrop { background: rgba(21, 22, 28, .88); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); background: var(--white); }
.lightbox-caption { color: var(--white); text-align: center; padding-inline: 16px; }
.lightbox-close {
  position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  width: 48px; height: 48px; border: 1px solid var(--white); background: var(--ink); color: var(--white);
  font: 400 30px/1 var(--sans); cursor: pointer;
}
.lightbox-close:hover { background: var(--accent); }
.lightbox-close:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }

/* Single-column case study layout, following the Figma file */
.flow { max-width: 920px; display: flex; flex-direction: column; gap: clamp(48px, 6vw, 80px); padding-block: clamp(40px, 6vw, 80px); }
.flow section, .flow-intro { display: flex; flex-direction: column; gap: 20px; }
.flow p, .flow li { font-size: clamp(17px, 1.35vw, 19px); }
.flow h1 { max-width: 16em; }
.flow .subtitle { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.2; letter-spacing: -.01em; }
.flow h2 { font-size: clamp(28px, 3vw, 44px); line-height: 1.1; font-weight: 500; letter-spacing: -.015em; padding-top: 20px; border-top: 1px solid var(--ink); }
.flow h3 { font-size: clamp(20px, 1.8vw, 24px); font-weight: 500; margin-top: 12px; }
.flow-facts { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 8px 0 0; }
.flow-facts dt { font: 400 14px/1.45 var(--mono); color: var(--muted); }
.flow-facts dd { margin: 4px 0 0; font-weight: 500; }
.flow-facts .skills { margin-top: 2px; }
.flow .hmw { font-style: italic; font-weight: 500; }
.hypothesis { text-align: center; border-block: 1px solid var(--accent); padding: 20px clamp(8px, 4vw, 48px); }
.hypothesis .label { font-weight: 500; color: var(--accent); margin-bottom: 6px; }
.squares { display: flex; flex-direction: column; gap: 10px; }
.squares li { padding-left: 20px; position: relative; }
.squares li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--accent); }
.flow .cs-figure img { max-width: 100%; max-height: 520px; }
.flow .cs-figure.centre { align-items: center; }
.flow .cs-figure.centre img { max-height: 640px; }
.figure-pair, .explorations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; align-items: start; }
.figure-pair .cs-figure img { max-height: 320px; }
.exploration-set { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exploration-set a:last-child { grid-column: 1 / -1; justify-self: center; width: 60%; }
.explorations .cs-figure img { max-height: 420px; box-shadow: 0 4px 4px rgba(21, 22, 28, .2); }
.cs-next a { font-size: clamp(17px, 1.5vw, 20px); }
