/* The published documents' dress — Two of You, worn by a page with no script.
 *
 * Every published version links this one sheet, so a document reads as part of the
 * studio while its words stay fixed in its own file. The faces ship beside it: the
 * public host allows nothing from another origin. Colours and type echo the app's own
 * tokens (web/src/index.css) by role name; the dark theme follows the reader's system
 * setting, since a page without script has no switch to offer.
 */

@font-face {
  font-family: 'Bodoni Moda Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(bodoni-moda-opsz.woff2) format('woff2-variations');
}
@font-face {
  font-family: 'Schibsted Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(schibsted-grotesk.woff2) format('woff2-variations');
}

:root {
  color-scheme: light dark;

  --canvas: #faf7f1;
  --card: #fffdf8;
  --well: #efeae0;
  --rule: #e3ddd1;
  --ink: #15120f;
  --ink-2: #534d44;
  --ink-3: #6a645a;
  --gold: oklch(0.84 0.13 80);
  --gold-soft: oklch(0.93 0.06 85);
  --bar: color-mix(in oklab, var(--canvas) 88%, transparent);

  --bodoni: 'Bodoni Moda Variable', 'Bodoni Moda', Didot, 'Bodoni 72', 'Bodoni MT', serif;
  --sans:
    'Schibsted Grotesk Variable', 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --bar-h: 64px;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #15120f;
    --card: #1d1915;
    --well: #26211b;
    --rule: #37302a;
    --ink: #f3eee4;
    --ink-2: #c9c1b4;
    --ink-3: #a39a8c;
    --gold: oklch(0.8 0.12 80);
    --gold-soft: oklch(0.34 0.05 80);
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px / 1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
::selection {
  background: var(--gold);
  color: #15120f;
}
a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent);
  text-underline-offset: 4px;
}
a:hover {
  text-decoration-color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The top bar: the house mark, as the studio's own bar carries it. */
.doc-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  height: var(--bar-h);
  padding: 0 var(--gutter);
  background: var(--bar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.doc-top .mark {
  font: 500 15px / 1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

/* The document: its title, then its contents, then its words. From tablet width the
 * contents move into a column of their own and stay in view while the words scroll. */
.doc {
  display: grid;
  grid-template-columns: minmax(0, var(--measure));
  justify-content: center;
  gap: 0 56px;
  padding: 40px var(--gutter) 72px;
}
.doc-head {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.doc-head h1 {
  margin: 0 0 14px;
  font: 400 clamp(34px, 3.2vw + 18px, 56px) / 1.04 var(--bodoni);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.doc-meta {
  max-width: 60ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.doc-toc {
  margin: 24px 0 8px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--well);
}
.doc-toc::before {
  content: 'Contents';
  display: block;
  margin-bottom: 12px;
  color: var(--ink-2);
  font: 500 12px / 1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doc-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: section;
}
.doc-toc li {
  counter-increment: section;
}
.doc-toc a {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}
.doc-toc a::before {
  content: counter(section);
  min-width: 1.2em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.doc-toc a:hover {
  color: var(--ink);
}

.doc-body h2 {
  margin: 44px 0 12px;
  font: 400 clamp(24px, 1.6vw + 14px, 32px) / 1.12 var(--bodoni);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.doc-body h2:target {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}
.doc-body p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .doc {
    grid-template-columns: 220px minmax(0, var(--measure));
    padding-top: 64px;
  }
  .doc-head {
    grid-column: 2;
  }
  .doc-toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: calc(var(--bar-h) + 32px);
    margin: 10px 0 0;
    padding: 0;
    background: none;
  }
  .doc-body {
    grid-column: 2;
  }
  .doc-body p {
    font-size: 17px;
  }
}

/* The foot: the three documents, over the company's own name. */
.doc-foot {
  display: grid;
  gap: 16px;
  padding: 32px var(--gutter) 36px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}
.doc-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.doc-foot nav a {
  padding: 4px 0;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}
.doc-foot nav a:hover,
.doc-foot nav a[aria-current='page'] {
  color: var(--ink);
}
.doc-foot p {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
}

@media print {
  .doc-top,
  .doc-toc,
  .doc-foot nav {
    display: none;
  }
  .doc {
    display: block;
    padding: 0;
  }
}
