/* Layout: type-led and dark. The homepage is an index: an oversized sentence, then project
   titles set as large as the screen allows, alternating a heavy grotesk with a light serif.
   Small lettered notes carry the detail. No cards, no bands. One accent, used sparingly. */
:root {
  --ground: #10100f;
  --text: #f1eee7;
  --dim: #a09d95;        /* small notes and labels */
  --rule: #33322f;
  --accent: #e8a33d;     /* the orange from the old site's headline */
  --plate: #eef0f3;
  --paper: #ebe6da;      /* the one light panel */
  --ink: #171614;      /* behind the light design boards */
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  /* Type system: five sizes, two typefaces, four styles (sans 400 and 800, serif 300 and 400). Nothing outside it. */
  --t-small: 13px;                        /* section headers (uppercase), tags, nav, labels, notes, captions */
  --t-body: 17px;                         /* all running text, quotes, company names */
  --t-head: clamp(24px, 3.1vw, 40px);     /* the About story; sub-heads inside a case study */
  --t-title: clamp(32px, 6.1vw, 84px);    /* project titles, case study title, the closing line */
  --t-hero: clamp(38px, 7.6vw, 104px);    /* the opening sentence only */
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--sans); font-size: var(--t-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ground); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { background: var(--text); color: var(--ground); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
h1, h2, h3, p, dl, dd, figure, blockquote, ol, ul { margin: 0; padding: 0; }
.wrap { max-width: 1320px; margin-inline: auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }

.note { font-size: var(--t-small); line-height: 1.45; color: var(--dim); }
.note b { color: var(--text); font-weight: 800; }
.key { font-size: var(--t-small); letter-spacing: 0.06em; color: var(--dim); display: block; margin-bottom: 10px; }
.serif { font-family: var(--serif); font-weight: 300; letter-spacing: -0.015em; }
.heavy { font-family: var(--sans); font-weight: 800; letter-spacing: -0.035em; }

/* Nav: always visible, always the same four words */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--ground); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; padding-block: 16px; }
.top a { text-decoration: none; font-size: var(--t-small); }
.top a:hover { background: none; color: inherit; text-decoration: underline; }
.top .me { font-weight: 800; }
.top nav { display: flex; gap: 22px; flex-wrap: wrap; }
.top nav a[aria-current] { text-decoration: underline; }

/* Opening statement */
.open { padding-block: clamp(56px, 10vw, 140px) clamp(40px, 6vw, 80px); }
.open h1 { font-size: var(--t-hero); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.open h1 .serif { font-weight: 300; letter-spacing: -0.02em; }
.open h1 mark { background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 78% / 100% 84%; color: var(--ground); padding: 0 0.07em; }
.abc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; margin-top: clamp(40px, 6vw, 80px); max-width: 980px; }
.abc .key { display: inline-block; font-size: var(--t-small); font-weight: 400; letter-spacing: 0; line-height: 1; color: var(--ground); background: var(--text); border-radius: 3px; padding: 4px 7px; margin-bottom: 12px; }
.abc strong { font-weight: 800; color: var(--text); }
.abc p { font-size: var(--t-body); line-height: 1.5; color: #cfccc4; }

/* Work index */
.index { }
.index li { list-style: none; border-bottom: 1px solid var(--rule); }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 16px 48px; align-items: end; padding-block: clamp(22px, 3vw, 40px); text-decoration: none; }
.entry .title { font-size: var(--t-title); line-height: 1; text-wrap: balance; }
.glyph { height: 0.74em; width: auto; margin-right: 0.2em; vertical-align: -0.04em; color: var(--text); }
.entry--soon .glyph { color: inherit; }
.entry .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.entry .tag { font-size: var(--t-small); font-weight: 400; line-height: 1; color: var(--ground); background: var(--text); border: 1px solid var(--text); border-radius: 3px; padding: 3px 6px; white-space: nowrap; }
.entry--soon .tag { background: var(--dim); border-color: var(--dim); }
.entry .tag--status { background: none; color: var(--dim); }
.entry .side { padding-bottom: 0.6em; }
a.entry:hover , a.entry.is-on { background: none; color: inherit; }
a.entry:hover .go , a.entry.is-on .go { background: var(--text); color: var(--ground); text-decoration: none; }
/* Hover on a project that opens: an off-white block sweeps across the title and the door icon opens. */
.glyph { --hole: var(--ground); }
.glyph-door .leaf { fill: var(--hole); transform-box: view-box; transform-origin: 8px 12px; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
a.entry:hover .glyph-door .leaf , a.entry.is-on .glyph-door .leaf { transform: scaleX(0.38); }
a.entry .t { background-image: linear-gradient(var(--text), var(--text)); background-repeat: no-repeat; background-size: 0% 100%; transition: background-size 0.35s cubic-bezier(0.6, 0, 0.3, 1), color 0.2s ease 0.08s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
a.entry:hover .t , a.entry.is-on .t { background-size: 100% 100%; color: var(--ground); }
a.entry:hover .glyph , a.entry.is-on .glyph { color: var(--ground); --hole: var(--text); }

.entry .go .arr { display: inline-block; overflow: hidden; width: 1.05em; line-height: inherit; vertical-align: bottom; }
.entry .go .arr i { display: inline-block; font-style: normal; }
a.entry:hover .go .arr i , a.entry.is-on .go .arr i { animation: arrow-run 0.9s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
@keyframes arrow-run { 0% { transform: translateX(0); } 45% { transform: translateX(110%); } 45.01% { transform: translateX(-110%); } 100% { transform: translateX(0); } }
.entry .go { display: flex; width: fit-content; align-items: baseline; gap: 0.4em; padding: 1px 4px; margin-left: -4px; margin-top: 10px; color: var(--text); font-weight: 400; }
.entry .go .txt { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a.entry:hover .go .txt , a.entry.is-on .go .txt { text-decoration: none; }
.fig, .abc .fig { background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 55% / 100% 82%; color: var(--ground); font-weight: 800; padding: 0 0.2em; border-radius: 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; white-space: nowrap; }
.entry--soon .title { color: #6f6d67; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; padding-block: clamp(64px, 10vw, 140px) 18px; border-bottom: 1px solid var(--rule); }
.sec-head h2 { font-family: var(--sans); font-weight: 400; font-size: var(--t-small); letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.2; }
.sec-head .aside { font-size: var(--t-small); color: var(--dim); }
.open + section .sec-head { padding-top: clamp(24px, 4vw, 56px); }

/* Rows: experience */
.rows { }
.rows li { list-style: none; display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 2fr); gap: 4px 32px; padding-block: 14px; border-bottom: 1px solid var(--rule); font-size: var(--t-small); line-height: 1.5; align-items: baseline; }
.rows .yr { white-space: nowrap; color: var(--dim); font-variant-numeric: tabular-nums; }
.rows .co { font-weight: 800; font-size: var(--t-body); color: var(--text); }
.rows .what { color: var(--dim); min-width: 0; }

/* About: the one light panel, full width, so it breaks from the dark index */
.panel { margin-top: clamp(56px, 9vw, 120px); padding-block: clamp(48px, 8vw, 104px); background: var(--paper); color: var(--ink); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax); }
.panel a:hover { background: var(--ink); color: var(--paper); }
.panel .sec-head { padding-top: 0; border-color: rgba(21, 20, 18, 0.2); }
.panel .sec-head .aside { color: #6a665c; }
.about { padding-top: clamp(28px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 32px 72px; align-items: start; }
.about .lead { font-family: var(--serif); font-weight: 300; font-size: var(--t-head); line-height: 1.15; letter-spacing: -0.02em; text-wrap: pretty; }
.about .lead strong { font-family: var(--sans); font-weight: 800; letter-spacing: -0.035em; }
.about .more { display: flex; flex-direction: column; gap: 12px; font-size: var(--t-small); line-height: 1.55; color: #55514a; padding-top: 6px; }
.said { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 40px; align-items: start; margin-top: clamp(48px, 7vw, 96px); }
.panel .note { color: #6a665c; }
.said blockquote { font-family: var(--serif); font-weight: 300; font-size: var(--t-body); line-height: 1.4; }
.said figcaption { margin-top: 12px; }

/* Contact */
.end { padding-block: clamp(72px, 11vw, 150px) 40px; }
.close { font-family: var(--serif); font-weight: 300; font-size: var(--t-title); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.close strong { font-family: var(--sans); font-weight: 800; letter-spacing: -0.035em; }
.end .links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; font-size: var(--t-body); }
.end .fine { margin-top: clamp(48px, 8vw, 110px); }

/* Case study */
.cs-open { padding-block: clamp(48px, 8vw, 110px) clamp(40px, 6vw, 72px); }
.cs-open .kind { font-family: var(--sans); font-weight: 400; font-size: var(--t-small); letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 14px; }
.cs-open h1 { font-size: var(--t-title); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; margin-top: 6px; text-wrap: balance; }
.cs-abc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 2fr); gap: 28px 48px; margin-top: clamp(32px, 5vw, 56px); }
.cs-abc .a { font-family: var(--serif); font-weight: 300; font-size: var(--t-body); line-height: 1.45; }
.cs-abc .b { font-size: var(--t-body); line-height: 1.5; }
.cs-abc ul { list-style: none; font-family: var(--serif); font-size: var(--t-body); display: flex; flex-direction: column; gap: 6px; }
.cs-body { border-top: 1px solid var(--rule); padding-block: clamp(40px, 6vw, 80px); display: flex; flex-direction: column; gap: clamp(56px, 8vw, 104px); }
.cs-body section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 20px 48px; }
.cs-body h2 { font-size: var(--t-head); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.cs-body .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cs-body .col > p { font-family: var(--serif); font-weight: 400; font-size: var(--t-body); line-height: 1.55; max-width: 36em; }
.cs-body figure { margin-block: 12px 4px; }
.cs-body figure img { width: 100%; border-radius: 4px; background: var(--plate); }
.cs-body figcaption { margin-top: 10px; }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; max-width: 44em; font-size: var(--t-body); }
th, td { text-align: left; padding: 11px 20px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: var(--t-small); font-weight: 400; color: var(--dim); }
td:last-child { font-variant-numeric: tabular-nums; }
td b { font-weight: 800; }
.todo { border: 1px dashed var(--dim); color: var(--dim); border-radius: 4px; padding: 14px 16px; font-size: var(--t-body); max-width: 40em; }

@media (max-width: 760px) {
  .abc, .said, .about, .cs-abc, .cs-body section { grid-template-columns: minmax(0, 1fr); }
  .entry { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .entry .side { padding-bottom: 0; }
  .rows li { grid-template-columns: 104px minmax(0, 1fr); gap: 4px 16px; }
  .rows .what { grid-column: 2; }
  .cs-open .kind { margin-left: 0; }
}
@media (max-width: 900px) { .said { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .said { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } a.entry .t, .glyph-door .leaf { transition: none; } a.entry:hover .go .arr i, a.entry.is-on .go .arr i { animation: none; } }
