/* Hyde Park v2: the shared shell. Tokens, type, header, menu and the ending every page shares.
   Motion (reveals, grain, blur, page changes) lives in /assets/motion/ and loads before this file.
   Pages add their own CSS in /assets/v2/pages/<page>.css. Brief: notes/v2-brief.md. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-var.woff2") format("woff2-variations"), url("/assets/fonts/schibsted-var.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Ground and ink. The page's ground is --tint on body (near-black, tinted by a film on its own
     page); the router animates it between pages. Sections stay transparent so it shows through. */
  --black: #070707;
  --fg: #efede8;
  --fg-2: rgb(239 237 232 / .66);
  --fg-3: rgb(239 237 232 / .54);
  --line: rgb(239 237 232 / .14);
  --line-2: rgb(239 237 232 / .28);

  /* Space. One gutter, a 12-column grid, and a vertical rhythm in screen heights. */
  --g: clamp(16px, 2.4vw, 40px);
  --gap: clamp(12px, 1.4vw, 24px);
  --col: calc((100vw - 2 * var(--g) - 11 * var(--gap)) / 12);
  --top: clamp(68px, 7.2vw, 100px);
  --section: clamp(120px, 22vh, 260px);
  --scope: 2.39;
  /* One spacing scale. Steps 1 to 3 space things inside a block, 4 to 6 space blocks; --section spaces sections. */
  --sp-1: clamp(6px, .5vw, 8px);
  --sp-2: clamp(12px, 1.1vw, 16px);
  --sp-3: clamp(18px, 1.8vw, 28px);
  --sp-4: clamp(28px, 3vw, 48px);
  --sp-5: clamp(44px, 5vw, 80px);
  --sp-6: clamp(72px, 9vw, 150px);

  /* Type. Schibsted Grotesk only: display tight and large, body plain, labels small caps-like. */
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --t-mega: clamp(56px, 12.4vw, 236px);
  --t-display: clamp(44px, 7.6vw, 144px);
  --t-head: clamp(32px, 4.3vw, 80px);
  --t-lede: clamp(22px, 2.35vw, 40px);
  --t-title: clamp(19px, 1.6vw, 25px);
  --t-body: 17px;
  --t-small: 14px;
  --t-label: 12px;

  /* Motion. Shared names so page CSS and GSAP agree. */
  --ease: cubic-bezier(.7, 0, .18, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .9s;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); color: var(--fg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--tint, var(--black));
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: 420;
  line-height: 1.5;
  letter-spacing: -.006em;
  font-kerning: normal;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img, video, svg, canvas { display: block; max-width: 100%; }
picture { display: block; }
/* In a framed figure (a fixed ratio), the picture fills the frame, so a wider still covers it instead of leaving a band. */
figure > picture { height: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, figure, blockquote, ol, ul, dl, dd, address { margin: 0; }
ol, ul { list-style: none; padding: 0; }
address, cite { font-style: normal; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
i { font-style: normal; }
[hidden] { display: none !important; }
::selection { background: var(--fg); color: var(--black); text-shadow: none; }
img::selection, video::selection, canvas::selection { background: transparent; }

/* The scrollbar is the line: a hairline of light that thickens under the pointer. */
::-webkit-scrollbar { width: 13px; height: 13px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: rgb(239 237 232 / .5); background-clip: padding-box; border: solid transparent; border-width: 0 6px; border-radius: 0; min-height: 48px; }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: rgb(239 237 232 / .9); border-width: 0 5px; }
::-webkit-scrollbar-corner { background: transparent; }
@supports (-moz-appearance: none) { html { scrollbar-width: thin; scrollbar-color: rgb(239 237 232 / .5) transparent; } }
:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 4px; border-radius: 1px; }

.skip {
  position: fixed; left: var(--g); top: var(--g); z-index: 200;
  padding: 12px 16px; background: var(--fg); color: var(--black); font-weight: 600;
  transform: translateY(-300%);
}
.skip:focus { transform: none; }
.noscript { position: relative; z-index: 95; margin: 0; padding: 12px var(--g); background: var(--fg); color: var(--black); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ——— Type ——— */
.t-mega, .t-display, .t-head { font-weight: 600; text-wrap: balance; font-variant-numeric: lining-nums; }
.t-mega { font-size: var(--t-mega); line-height: .86; letter-spacing: -.056em; font-weight: 620; }
.t-display { font-size: var(--t-display); line-height: .9; letter-spacing: -.05em; }
.t-head { font-size: var(--t-head); line-height: .98; letter-spacing: -.04em; font-weight: 580; }
.t-lede { font-size: var(--t-lede); line-height: 1.16; letter-spacing: -.024em; font-weight: 480; text-wrap: pretty; }
.t-title { font-size: var(--t-title); line-height: 1.2; letter-spacing: -.018em; font-weight: 560; text-wrap: pretty; }
.t-body { font-size: var(--t-body); line-height: 1.55; text-wrap: pretty; }
.t-small { font-size: var(--t-small); line-height: 1.45; }
.t-label, .label {
  font-size: var(--t-label); line-height: 1.25; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
/* Tabular figures only where numbers must hold still: in this face they also widen the comma. */
.t-num, time[data-clock] { font-variant-numeric: tabular-nums lining-nums; }
.fg-2 { color: var(--fg-2); }
.fg-3 { color: var(--fg-3); }
/* A run of labels, separated by a thin rule rather than a bullet. */
.label-run { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 0; }
.label-run > * + *::before { content: ""; display: inline-block; width: 1.4em; height: 1px; margin: 0 .8em; vertical-align: middle; background: var(--line-2); }

/* A link that underlines from the left, the way the rule draws. */
.u {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .7s var(--ease);
  padding-bottom: 2px;
}
.u:hover, .u:focus-visible, .u[aria-current] { background-size: 100% 1px; }
/* "More" links: a label and an arrow that steps forward. */
.more { display: inline-flex; align-items: center; gap: .7em; min-height: 44px; font-size: 15px; font-weight: 560; letter-spacing: -.005em; }
.more i { display: inline-block; transition: transform .6s var(--ease); }
.more:hover i, .more:focus-visible i { transform: translateX(6px); }

/* ——— Sections: every section opens the same way ———
   A hairline across the page draws, then the heading rises, at one size (--t-head). A count, a place or a link sits
   at the right end of the line rather than above the heading, so the heading is always the first thing read and a
   reader always sees where one section stops and the next starts. Markup: scripts/v2/templates/site/sec.html.j2. */
.sec {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  column-gap: var(--sp-4); padding-top: var(--sp-3); margin-bottom: var(--sp-5);
}
.sec__rule { position: absolute; inset: 0 0 auto; height: 1px; background: var(--line-2); }
.wrap.sec > .sec__rule { left: var(--g); right: var(--g); }
.sec__title { grid-column: 1; max-width: 17em; }
.sec__side { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); padding-top: .3em; text-align: right; }
.sec__side .more { min-height: 0; }
.sec__meta { color: var(--fg-3); white-space: nowrap; }
.sec__lede { grid-column: 1; max-width: 30ch; margin-top: var(--sp-3); color: var(--fg-2); }
@media (max-width: 860px) {
  .sec { grid-template-columns: minmax(0, 1fr); }
  .sec__side { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-2); padding-top: 0; text-align: left; }
}
/* A wall of logos: one mark per cell on hairlines, in the page's ink. */
.wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.wall__cell {
  display: grid; place-items: center; aspect-ratio: 1.3;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background-color .6s var(--ease-out);
}
.wall__cell img {
  width: min(calc(var(--w) * 1.22), 74%); height: auto;
  filter: brightness(0) invert(.94); opacity: .78; transition: opacity .6s var(--ease-out), transform .9s var(--ease-out);
}
.wall__cell:hover { background-color: rgb(239 237 232 / .035); }
.wall__cell:hover img { opacity: 1; transform: scale(1.04); }
@media (max-width: 860px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall__cell img { width: min(calc(var(--w) * .66), 74%); }
}

/* ——— Layout helpers ——— */
.wrap { padding-inline: var(--g); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.scope { aspect-ratio: 2.39; overflow: hidden; }
.cover { width: 100%; height: 100%; object-fit: cover; }

/* ——— Header ——— */
.top {
  position: fixed; inset: 0 0 auto; z-index: 90;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--g);
  pointer-events: none;
  transition: transform .7s var(--ease), opacity .5s var(--ease-out);
}
.top > * { pointer-events: auto; }
.top::before {
  content: ""; position: absolute; inset: 0 0 -40%; z-index: -1; pointer-events: none;
  background: linear-gradient(rgb(7 7 7 / .55), rgb(7 7 7 / .2) 55%, rgb(7 7 7 / 0));
  opacity: var(--shade, 1); transition: opacity .6s var(--ease-out);
}
/* Over the page, the header gets a ground: solid behind the logo and nav, so no line of text reads through
   them, then a short fade. */
.top::after {
  content: ""; position: absolute; inset: 0 0 -46%; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--tint, #070707) 64%, color-mix(in srgb, var(--tint, #070707) 62%, transparent) 82%, transparent);
  opacity: 0; transition: opacity .5s var(--ease-out);
}
.top.is-over::after { opacity: 1; }
/* With the menu open the sheet is the ground: no shade or fade over its first item. */
.menu-open .top::before, .menu-open .top::after { opacity: 0; transition-duration: .2s; }
.top.is-hidden { transform: translateY(-110%); }
.top__logo { display: block; width: clamp(96px, 8.4vw, 132px); margin: -4px 0 0 -2px; }
.top__logo img { width: 100%; }
.top__nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 38px); }
.top__nav a { font-size: 14.5px; font-weight: 500; letter-spacing: -.004em; padding: 8px 0; }
.top__menu {
  display: none; align-items: center; gap: 10px;
  min-height: 44px; margin: -10px -10px 0 0; padding: 0 10px;
  background: none; border: 0; font-size: 14.5px; font-weight: 560;
}
.top__menu i { position: relative; width: 18px; height: 8px; }
.top__menu i::before, .top__menu i::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .5s var(--ease); }
.top__menu i::before { top: 0; }
.top__menu i::after { bottom: 0; }
.menu-open .top__menu i::before { transform: translateY(3.25px) rotate(45deg); }
.menu-open .top__menu i::after { transform: translateY(-3.25px) rotate(-45deg); }

/* ——— Menu sheet (phones) ——— */
.sheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--top) + var(--g)) var(--g) calc(var(--g) + env(safe-area-inset-bottom));
  background: var(--tint, var(--black));
  visibility: hidden; clip-path: inset(0 0 100% 0);
  transition: clip-path .8s var(--ease), visibility 0s .8s;
}
.menu-open .sheet { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path .8s var(--ease); }
.sheet__nav { display: flex; flex-direction: column; }
.sheet__nav a {
  display: block; padding: .06em 0;
  font-size: clamp(44px, 13vw, 76px); font-weight: 600; line-height: 1.02; letter-spacing: -.05em;
}
.sheet__nav a[aria-current] { color: var(--fg-2); }
.sheet__foot { display: flex; justify-content: space-between; gap: 1em; color: var(--fg-2); }

/* ——— The ending: the picture closes into the rule of the logo ——— */
/* The frame arrives whole, holds while it closes, and comes to rest as the logo. */
.end { position: relative; z-index: 1; }
.end__frame { position: relative; height: 100svh; min-height: 520px; overflow: hidden; }
.end--held { height: 175svh; }
.end--held .end__frame { position: sticky; top: 0; }
.end__screen { position: absolute; inset: 0; background: #111; opacity: 0; will-change: clip-path; }
.end__screen img, .end__screen video { width: 100%; height: 100%; object-fit: cover; }
.end__screen::after { content: ""; position: absolute; inset: 0; background: var(--fg); opacity: var(--lit, 0); }
.end__mark {
  position: absolute; left: 50%; top: 50%;
  width: var(--logo-w); transform: translate(-50%, -57.5%);
}
.end__mark img { width: 100%; }
.end__base {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 28px;
  padding: 0 var(--g) calc(var(--g) + env(safe-area-inset-bottom));
  align-items: end;
}
.end__nav { grid-column: 1 / 7; display: flex; flex-wrap: wrap; gap: 6px clamp(18px, 2vw, 34px); }
.end__nav a { font-size: 15px; font-weight: 500; padding: 8px 0; }
.end__cities { grid-column: 7 / 11; display: flex; gap: clamp(20px, 3vw, 48px); color: var(--fg-2); }
.end__cities b { display: block; font-weight: 560; color: var(--fg); }
.end__small { grid-column: 11 / 13; justify-self: end; text-align: right; color: var(--fg-3); }
:root { --logo-w: clamp(240px, 30vw, 460px); }

/* ——— Phones ——— */
@media (max-width: 860px) {
  .top__nav { display: none; }
  .top__menu { display: inline-flex; }
  .end__nav { grid-column: 1 / -1; }
  .end__cities { grid-column: 1 / -1; }
  .end__small { grid-column: 1 / -1; justify-self: start; text-align: left; }
  :root { --logo-w: min(64vw, 300px); }
}

/* Cross-document page changes when the router is off: a quick dissolve through black. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .45s var(--ease) both hp-vt-out; }
::view-transition-new(root) { animation: .6s var(--ease-out) .15s both hp-vt-in; }
@keyframes hp-vt-out { to { opacity: 0; } }
@keyframes hp-vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
