/* Scenotopie — shared chrome: reset, base type, plates, nav, footer. */

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
img, svg { display: block; max-width: 100%; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

.num { font-variant-numeric: tabular-nums; }

/* ---- the plate vocabulary ----
   A plate is a flat pastel surface. Its signature is one corner sliced at
   exactly 12°: rise --cut, horizontal run --cut / tan(12°). Pick the corner
   with a modifier; alternate corners down a page so sections zigzag. */
.plate {
  --cut: var(--cut-md);
  background: var(--plate, var(--butter));
  color: var(--ink);
}
.plate--br { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut) / 0.21256) 100%, 0 100%); }
.plate--bl { clip-path: polygon(0 0, 100% 0, 100% 100%, calc(var(--cut) / 0.21256) 100%, 0 calc(100% - var(--cut))); }
.plate--tr { clip-path: polygon(0 0, calc(100% - var(--cut) / 0.21256) 0, 100% var(--cut), 100% 100%, 0 100%); }
.plate--tl { clip-path: polygon(calc(var(--cut) / 0.21256) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut)); }

/* small inline plate: tags, chips, the nav's active marker */
.chip {
  --cut: 0.45rem;
  display: inline-block;
  padding: 0.15em 0.7em;
  background: var(--plate, var(--butter));
  color: var(--ink);
  font-size: var(--text--1);
  font-weight: 500;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut) / 0.21256) 100%, 0 100%);
}
@media (hover: hover) {
  a.chip:hover { background: var(--ink); color: var(--paper); }
}
a.chip:active { background: var(--ink); color: var(--paper); }

/* ink button: the one primary action style, works on any plate */
.btn-ink {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px;
  font-weight: 600;
  text-decoration: none;
}
@media (hover: hover) {
  .btn-ink:hover { opacity: 0.85; }
}
.btn-ink:active { opacity: 0.7; }

/* ---- skip link ---- */
.skip {
  position: absolute;
  left: var(--sp-4);
  top: -3rem;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { top: var(--sp-2); }

/* ---- nav ---- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 var(--gutter);
  height: 3.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
/* the favicon motif in miniature: rose over periwinkle, split at 12° */
.brandmark {
  width: 1.05rem;
  height: 1.05rem;
  align-self: center;
  flex: none;
  background: linear-gradient(168deg, var(--rose) 0 49.5%, var(--peri) 50.5% 100%);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brandsub {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* shared baseline with the 1.5rem wordmark reads too low at this size */
  position: relative;
  top: -0.12em;
}
.site-nav nav { display: flex; gap: var(--sp-2); }
.navlink {
  --cut: 0.45rem;
  padding: 0.3em 0.85em;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
}
.navlink:hover { text-decoration: underline; text-underline-offset: 4px; }
.navlink.active {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut) / 0.21256) 100%, 0 100%);
  font-weight: 700;
}
.navlink.active[data-hue="peri"] { background: var(--peri); }
.navlink.active[data-hue="rose"] { background: var(--rose); }
.navlink.active[data-hue="mint"] { background: var(--mint); }

/* overlay variant: floats above the atlas canvas */
.site-nav--overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
}

/* ---- page scaffolding ---- */
main { display: block; }
.section { padding: var(--sp-7) var(--gutter); }
.section--tight { padding: var(--sp-6) var(--gutter); }

.hero {
  --cut: var(--cut-md);
  padding: var(--sp-6) var(--gutter) calc(var(--sp-4) + var(--cut));
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-1);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.hero .lede {
  margin-top: var(--sp-5);
  font-size: var(--text-1);
  max-width: 52ch;
}
/* hero split: title (and subtitle) left, the page's action bottom right */
.hero-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-3);
  margin-bottom: 0.5rem;
}
.hero .subtitle {
  margin-top: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-3);
  color: var(--ink);
}
.hero .subtitle:empty { display: none; }
.btn-light {
  display: inline-block;
  font-size: var(--text--1);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  padding: 8px 16px;
  background: none;
}
@media (hover: hover) {
  .btn-light:hover { background: var(--ink); color: var(--paper); }
}
.btn-light:active { background: var(--ink); color: var(--paper); }

h2.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-2);
  line-height: 1.08;
  letter-spacing: -0.005em;
}
h3.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-3);
  line-height: 1.15;
}

.eyebrow {
  font-size: var(--text--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* figures row: counts spoken as figures, not sentences — Fraunces numeral,
   quiet Archivo label, a middle dot between figures drawn by the CSS */
.figures {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-4);
}
.figures .fig {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-size: var(--text--1);
  color: var(--ink-soft);
}
.figures .fig b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.figures .fig + .fig::before { content: "·"; margin-right: var(--sp-2); }

.prose { max-width: var(--measure); }
.prose p + p { margin-top: var(--sp-4); }
.prose .lede { font-size: var(--text-1); }

.muted { color: var(--ink-soft); }
.small { font-size: var(--text--1); }

/* section heads share one rhythm everywhere */
.section-head { margin-bottom: var(--sp-5); }
.section-head .small { margin-top: var(--sp-2); }

/* ---- footer ---- */
.site-footer {
  --cut: var(--cut-md);
  margin-top: var(--sp-7);
  background: var(--ink);
  color: var(--paper);
  padding: calc(var(--sp-6) + var(--cut)) var(--gutter) var(--sp-6);
  clip-path: polygon(0 var(--cut), calc(var(--cut) / 0.21256) 0, 100% 0, 100% 100%, 0 100%);
  font-size: var(--text--1);
  line-height: 1.7;
}
.site-footer a { color: var(--paper); }
.foot-grid {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: baseline; gap: var(--sp-3); }
.foot-brand .brandmark { align-self: center; }
.foot-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
}
.foot-sub {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.65;
}
.foot-links { display: flex; gap: var(--sp-5); }
.foot-links a { font-weight: 500; text-underline-offset: 3px; }
.foot-note {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(250, 246, 239, 0.2);
  opacity: 0.7;
  max-width: 72ch;
}

/* ---- motion policy: nothing moves unless motion is welcome ---- */
@media (prefers-reduced-motion: no-preference) {
  a.chip, .navlink { transition: background-color 150ms ease, color 150ms ease; }
}

/* ---- touch: fingers get honest targets ---- */
@media (pointer: coarse) {
  .navlink, .btn-light, .btn-ink, a.chip, .foot-links a {
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 760px) {
  .brandsub { display: none; }
}
@media (max-width: 640px) {
  /* content decides the rows: one row while Scenotopie and its three links
     fit, a clean second row when they stop fitting (~400px) */
  .site-nav {
    flex-wrap: wrap;
    height: auto; min-height: 3rem;
    padding-block: var(--sp-2); row-gap: 0;
  }
  /* the wrapped row's first link aligns optically with the wordmark */
  .site-nav nav { margin-left: -0.85em; }
  .wordmark { font-size: 1.2rem; }
  .hero { padding-top: var(--sp-6); --cut: 2rem; }
  .site-footer { --cut: 2rem; }
  .foot-grid { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .foot-links { flex-wrap: wrap; gap: var(--sp-4) var(--sp-5); }
  .foot-brand { flex-wrap: wrap; }
}
