/* How Nous Research does Greco-Roman design - study page for Jonathan.
   Tokens first; everything below references them. Phone first. */

@font-face {
  font-family: "Oswald";
  src: url("oswald-var.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colour: one ground, one ink, one accent */
  --paper: #f3eee4;
  --paper-2: #e9e2d4;
  --ink: #1b1a17;
  --ink-2: #5a564e;
  --accent: #0000f2;
  --accent-ink: #f3eee4;
  --line: #9a948a;

  /* type */
  --font-display: "Oswald", "Arial Narrow", "Helvetica Neue", Helvetica, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);  /* 14-15px */
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);      /* 17-19px */
  --step-lead: clamp(1.3125rem, 1.1rem + 0.9vw, 1.75rem);      /* 21-28px */
  --step-statement: clamp(1.625rem, 1.2rem + 1.8vw, 2.5rem);   /* 26-40px */
  --step-head: clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem);         /* 44-88px */
  --step-display: clamp(3.5rem, 1rem + 12vw, 7rem);            /* 63-112px */
  --track-caps: 0.01em;
  --track-display: -0.005em;

  /* space */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --s7: clamp(96px, 7vw + 48px, 160px);  /* section gap */
  --gutter: clamp(24px, 4vw, 48px);
  --max: 1200px;
  --measure: 62ch;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 240ms;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.12em; }

/* type roles */
.display, h1, h2, h3, .level-name, .dial-tag {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-kerning: normal;
  hyphens: none;
}

h1 {
  font-size: var(--step-display);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: var(--track-display);
  text-wrap: balance;
  margin-left: -0.03em;
}

h2 {
  font-size: var(--step-head);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: var(--track-display);
  text-wrap: balance;
  margin-left: -0.03em;
}

h3 {
  font-size: var(--step-lead);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: var(--track-caps);
}

p { max-width: var(--measure); text-wrap: pretty; }
p + p { margin-top: 0.9em; }

.lead {
  font-size: var(--step-lead);
  line-height: 1.35;
  max-width: 34ch;
}

.statement {
  font-size: var(--step-statement);
  line-height: 1.2;
  max-width: 22ch;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.small, figcaption, dt, .caption { font-size: var(--step-small); line-height: 1.45; }
.muted { color: var(--ink-2); }

/* frame */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

section { margin-top: var(--s7); }
section > .wrap > h2 { margin-bottom: var(--s5); }

/* the one ornament: a construction line with the halo circle and crosshair ticks */
.mark {
  position: relative;
  height: 32px;
  margin-top: var(--s7);
}
.mark::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px; /* taste-skill-ignore: the construction line is the page's one ornament, pinned by the brief */
  background: var(--line);
}
.mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 32px; height: 32px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--ink); /* taste-skill-ignore: the halo circle from the David reference */
  border-radius: 50%;
  background: var(--paper);
}
.mark span {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
}
.mark + section { margin-top: var(--s6); }

/* hero: a full-bleed grid so the etching can run to the right edge on desktop */
.hero {
  padding-top: var(--s5);
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr) var(--gutter);
  row-gap: var(--s5);
}
.hero-text { grid-column: 2; display: grid; gap: var(--s4); align-content: start; }
.hero-art { grid-column: 2; }
.hero-text .lead { margin-top: var(--s2); max-width: 38ch; }
.hero-art {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--s4);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-body);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  justify-self: start;
  transition: background-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.button:hover { background: var(--accent); }
.button:active { transform: translateY(1px); }

/* takeaway + contents */
.takeaway .wrap { display: grid; gap: var(--s5); }

.contents ol {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}
.contents a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-lead);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}
.contents ol { gap: var(--s1); }
.contents a:hover { text-decoration: underline; }
.contents a:hover { color: var(--accent); }

/* 1. moves: a ledger, name beside text */
.ledger { list-style: none; padding: 0; display: grid; gap: var(--s6); }
.ledger li { display: grid; gap: var(--s3); }
.ledger h3 { max-width: 16ch; }
.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-top: var(--s2);
}
.meta dt { color: var(--ink-2); }
.meta dd { margin: var(--s1) 0 0; font-size: var(--step-small); line-height: 1.45; }

.chips {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-top: var(--s6);
}
.chips li { display: grid; gap: var(--s1); }
.chips .swatch { margin-bottom: var(--s1); }
.chips .swatch { aspect-ratio: 3 / 2; width: 100%; }
.chips .swatch.paper-chip { outline: 1px solid var(--line); outline-offset: -1px; } /* taste-skill-ignore: a measured near-white swatch on paper needs an edge to exist */
.chips dd, .chips dt { margin: 0; }
.chips strong { font-variant-numeric: tabular-nums; }
.chips + p { margin-top: var(--s5); }

/* 2. modern: a plain list of points */
.points { list-style: none; padding: 0; display: grid; gap: var(--s5); }
.points li { display: grid; gap: var(--s2); }
.points h3 { font-family: var(--font-text); text-transform: none; font-weight: 700; font-size: var(--step-body); line-height: 1.4; letter-spacing: 0; }

/* 3. the dial */
.dial-intro { display: grid; gap: var(--s4); }
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-top: var(--s5);
}
.compare figure { display: grid; gap: var(--s2); }
.compare .frame { aspect-ratio: 1 / 1; overflow: hidden; background: var(--paper-2); }
.compare img { width: 100%; height: 100%; object-fit: cover; }
.compare .is-ref img { object-position: 50% 46%; }
.compare .is-nous img { object-position: 50% 50%; }
.compare .is-nous figcaption { color: var(--accent); }

.levels { list-style: none; padding: 0; display: grid; gap: var(--s7); margin-top: var(--s7); }
.levels li { display: grid; gap: var(--s4); }
.level-name {
  font-size: var(--step-head);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: var(--track-display);
  color: var(--accent);
  margin-left: -0.03em;
}
.level-text { display: grid; gap: var(--s3); }
.level-text p strong { display: block; margin-bottom: var(--s1); }
.levels figure { display: grid; gap: var(--s2); }
.levels figure a { display: block; }
.levels figcaption { color: var(--ink-2); }

/* 4. rules */
.rules .wrap { display: grid; gap: var(--s5); }
.rules .intro-text { font-weight: 500; max-width: 40ch; }
.rules .points li p + p { margin-top: 0.5em; }

/* 5. screenshots */
.shots-head { display: grid; gap: var(--s4); margin-bottom: var(--s5); }
.shots-head h2 { margin-bottom: 0; }
.shots { list-style: none; padding: 0; display: grid; gap: var(--s6); }
.shots figure { display: grid; gap: var(--s2); }
.shots a { display: block; background: var(--paper-2); }
.shots img { width: 100%; }
.shots figcaption { display: grid; gap: var(--s1); }
.dial-tag {
  color: var(--accent);
  font-weight: 500;
  font-size: var(--step-body);
  letter-spacing: var(--track-caps);
}
.shots .shows { font-size: var(--step-body); line-height: 1.45; color: var(--ink); }
.shots .num { color: var(--ink-2); }

/* limits */
.limits ul { padding-left: 1.1em; display: grid; gap: var(--s3); max-width: var(--measure); }

/* footer */
footer { margin-top: var(--s7); padding: var(--s6) 0 var(--s6); background: var(--paper-2); }
footer .wrap { display: grid; gap: var(--s5); }
footer .display { font-size: var(--step-head); font-weight: 300; line-height: 0.92; letter-spacing: var(--track-display); margin-left: -0.03em; max-width: 18ch; }
footer p.small { max-width: 60ch; }

/* lightbox (enhancement; the link itself is the fallback) */
dialog.lightbox {
  border: 0;
  padding: 0;
  margin: auto;
  background: transparent;
  max-width: min(100vw - 2 * var(--s3), 1400px);
  max-height: calc(100dvh - 2 * var(--s3));
  overflow: auto;
}
dialog.lightbox::backdrop { background: rgba(27, 26, 23, 0.88); }
dialog.lightbox img { width: 1200px; max-width: none; height: auto; } /* native size: pan to read the notes on a phone */
dialog.lightbox .close {
  position: fixed;
  top: var(--s3);
  right: var(--s3);
  min-width: 48px;
  min-height: 48px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  cursor: pointer;
  padding: 0 var(--s3);
}
dialog.lightbox .close:hover { background: var(--accent); color: var(--accent-ink); }

/* motion: one authored moment, the etching resolving on the page. Reduced motion keeps everything, drops the travel. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-art img { animation: resolve 1600ms var(--ease-out) both; }
  /* pictures and swatches rise in as they scroll into view; no script, so nothing can stay hidden */
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .compare .reveal:nth-child(2), .chips .reveal:nth-child(even) { animation-range: entry 10% entry 85%; }
  }
  .shots a img, .levels figure a img { transition: transform var(--dur) var(--ease-out); }
  .shots a:hover img, .levels figure a:hover img { transform: scale(1.01); }
}
@keyframes reveal {
  from { opacity: 0.7; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes resolve {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}

/* desktop */
@media (min-width: 900px) {
  .hero {
    padding-top: var(--s6);
    grid-template-columns: minmax(var(--gutter), 1fr) minmax(0, calc(var(--max) * 7 / 12)) minmax(0, calc(var(--max) * 5 / 12)) minmax(var(--gutter), 1fr);
    column-gap: 0;
    align-items: end;
  }
  .hero-text { grid-column: 2; align-content: end; padding-bottom: var(--s4); padding-right: var(--s6); }
  .hero-art { grid-column: 3 / -1; aspect-ratio: 1 / 1; }
  .hero-art img { object-position: 50% 50%; }

  .takeaway .wrap { grid-template-columns: 7fr 5fr; align-items: start; }

  .takeaway .what { grid-column: 1; }
  .contents { grid-column: 2; grid-row: 1 / span 2; }

  .ledger li { grid-template-columns: 4fr 8fr; gap: var(--s5); align-items: start; }
  .ledger li > div { display: grid; gap: var(--s3); }
  .meta { grid-template-columns: 1fr 1fr; max-width: var(--measure); }
  .chips { grid-template-columns: repeat(4, 1fr); }

  .points { grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s6); }

  .dial-intro { grid-template-columns: 5fr 7fr; gap: var(--s6); align-items: start; }
  .compare { gap: var(--s5); }
  .levels li { grid-template-columns: 5fr 7fr; gap: var(--s6); align-items: start; }
  .level-text { position: sticky; top: var(--s5); }

  .rules .wrap { grid-template-columns: 4fr 8fr; gap: var(--s6); align-items: start; }
  .rules h2 { grid-column: 1 / -1; }
  .rules .intro { grid-column: 1; position: sticky; top: var(--s5); }
  .rules .points { grid-column: 2; grid-template-columns: 1fr; }

  .shots-head { grid-template-columns: 7fr 5fr; gap: var(--s6); align-items: end; }
  .shots-head .lead { padding-bottom: var(--s2); }
  .shots { grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s5); }

  .limits ul { grid-template-columns: 1fr 1fr; max-width: none; gap: var(--s4) var(--s6); }
  .limits li { max-width: var(--measure); }

  footer .wrap { grid-template-columns: 7fr 5fr; align-items: end; }
  dialog.lightbox img { width: 100%; max-width: 1200px; }
}
