/* PAROL HOUSE - base.css
   Source stylesheet. build_site.py emits styles.css from this; base.css is never deployed.
   Every value here traces to DESIGN.md. Read that before changing anything. */

/* ---------------------------------------------------------------- tokens */

:root {
  /* Three colour roles. That is the whole palette. The accent appears in under
     2% of the pixels: the hairline under a section label, one arrow link, and
     the single Field section. Nowhere else. */
  --ground:   #FBF7F0;
  --ink:      #14110E;   /* warm near-black. never #000 on warm paper */
  --ink-mid:  #5B534A;
  --accent:   #7A4A24;   /* burnt ochre */
  --rule:     #DCD3C6;

  --serif: "Newsreader", Charter, "Iowan Old Style", Georgia, serif;
  --sans:  "Archivo", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono:  "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* display sits at 1.0-1.10, text at 1.4-1.6. the gap between those two bands
     is the most reliable single move in the reference study. */
  --s--2: 0.75rem;
  --s--1: 0.875rem;
  --s-0:  1rem;
  --s-1:  1.1875rem;
  --s-2:  1.5rem;
  --s-3:  2rem;
  --s-4:  3rem;
  --s-5:  clamp(2.05rem, 4.6vw, 3.5rem);

  --measure: 64ch;
  --gutter:  max(clamp(1.25rem, 5vw, 4.5rem), env(safe-area-inset-left));
  --shell:   84rem;
}

/* ---------------------------------------------------------------- reset */

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--s-1);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-weight: 400; line-height: 1.08; letter-spacing: -0.02em; }
p { max-width: var(--measure); }

a { color: inherit; }

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

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--ground);
  padding: 0.75rem 1rem; font-family: var(--sans); font-size: var(--s--1);
  z-index: 99;
}
.skip:focus { left: var(--gutter); top: 0.75rem; }

.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* the eight-column grid, exposed as hairlines. structure is the ornament.
   hidden below tablet, where it would only add noise. */
.rails {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; display: none;
  max-width: var(--shell); margin-inline: auto;   /* track the content measure,
                                     not the viewport, or they align to nothing */
}
@media (min-width: 900px) {
  .rails { display: block; }
  .rails div {
    position: absolute; top: 0; bottom: 0; width: 1px;
    background: var(--rule); opacity: 0.22;
  }
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: relative; z-index: 2;
  padding-block: 1.5rem 0;
}
.masthead-inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: baseline; justify-content: space-between;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.mark {
  padding-block: 0.4rem;              /* was 22.4px, below the 24px minimum */
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--s--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}
.utility {
  display: flex; gap: 1.75rem;
  font-family: var(--sans); font-size: var(--s--1);
  letter-spacing: 0.02em;
}
.utility a {
  text-decoration: none;
  padding-block: 0.68rem;             /* 44.2px measured at 14px/1.6 */
  border-bottom: 1px solid transparent;
  transition: border-color 220ms ease, color 220ms ease;
}
.utility a:hover { border-bottom-color: var(--ink); }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative; z-index: 1;
  overflow: hidden;                    /* clips .bleed. do not remove: without it
                                          the wordmark widens the document. */
  padding-block: clamp(3.5rem, 11vh, 8rem) clamp(3.5rem, 10vh, 7rem);
}

/* the wordmark IS the hero image. there is no photograph.
   set huge, tracked tight, and bled off the right edge. */
.bleed {
  position: absolute;
  bottom: -0.12em; left: 0; right: -16vw;
  font-family: var(--serif);
  font-variation-settings: "opsz" 72;
  font-size: clamp(5rem, 17vw, 15rem);
  line-height: 0.78;
  letter-spacing: -0.055em;
  color: var(--ink);
  opacity: 0.05;
  pointer-events: none; user-select: none;
  white-space: nowrap;
  z-index: -1;
}

.hero h1 {
  position: relative;
  font-variation-settings: "opsz" 60;
  font-size: var(--s-5);
  line-height: 1.05;
  letter-spacing: -0.022em;
  max-width: 44ch;
}
.hero h1 .soft { color: var(--ink-mid); }

/* the <br> breaks are hand-set for the desktop measure. below that they fight
   the natural rag, so drop them and let the browser balance instead. */
@media (max-width: 719px) {
  .hero h1 br { display: none; }
  .hero h1 { text-wrap: pretty; }
}

.standfirst {
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: var(--s-0);
  line-height: 1.55;
  max-width: 46ch;
  color: var(--ink-mid);
}

/* ---------------------------------------------------------------- sections */

section { position: relative; z-index: 1; }

.label {
  font-family: var(--mono);
  font-size: var(--s--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-mid);
  display: block;
  margin-bottom: 0.9rem;
}

/* the one hand-made artefact. a single drawn rule, plotted by hand so it is
   visibly not a border. used under section labels. one artefact, reused. */
.drawn { display: block; width: 108px; height: 7px; overflow: visible; margin-bottom: 2.6rem; }
.drawn path { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }

/* INDEX - contents-page rows. */
.index { padding-block: clamp(3rem, 8vh, 5.5rem); }
.row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.35rem 1.5rem;
  padding-block: 1.6rem;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.row:last-child { border-bottom: 1px solid var(--rule); }
.row .num {
  font-family: var(--mono); font-size: var(--s--2);
  letter-spacing: 0.06em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.row h2 { text-wrap: balance; font-size: var(--s-2); line-height: 1.15; letter-spacing: -0.015em; }
.row p {
  grid-column: 2;
  font-family: var(--sans); font-size: var(--s-0);
  line-height: 1.6; color: var(--ink-mid); max-width: 54ch;
}
@media (min-width: 860px) {
  .row { grid-template-columns: 3.5rem minmax(0, 20rem) minmax(0, 1fr); }
  .row p { grid-column: 3; margin-top: 0; }
}

/* MEASURE - one column of running text, no image. */
.measure { padding-block: clamp(3.5rem, 9vh, 6rem); }
.measure .body { max-width: var(--measure); }
.measure .body p + p { margin-top: 1.35rem; }
.measure .body p:first-of-type::first-line { font-variant: small-caps; letter-spacing: 0.02em; }
@media (min-width: 900px) {
  .measure .body { margin-left: 22%; }   /* deliberate indent. not centred. */
}

/* FIELD - full bleed. the only place the accent covers area. */
.field {
  background: var(--accent);
  color: var(--ground);
  margin-block: clamp(2rem, 6vh, 4rem);
  padding-block: clamp(3.5rem, 10vh, 7rem);
}
.field p {
  text-wrap: balance;
  font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  font-size: clamp(1.7rem, 4.2vw, var(--s-4));
  line-height: 1.14;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.field .label { color: rgba(251, 247, 240, 0.72); }
.field .drawn path { stroke: rgba(251, 247, 240, 0.8); }

/* ENTRY - three columns, deliberately unruled so it does not repeat the index. */
.entry { padding-block: clamp(3rem, 8vh, 5.5rem) clamp(3.5rem, 9vh, 6rem); }
.entry-grid { display: grid; gap: 2.75rem; }
@media (min-width: 820px) { .entry-grid { grid-template-columns: repeat(3, 1fr); gap: 3.5rem; } }
.entry-grid h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--s--1);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.entry-grid p { font-size: var(--s-0); line-height: 1.55; color: var(--ink-mid); }


/* ---------------------------------------------------------------- footer */

.foot {
  position: relative; z-index: 1;     /* else the fixed rails paint over it */
  border-top: 1px solid var(--rule);
  padding-block: 3rem 4rem;
  margin-top: clamp(2rem, 6vh, 4rem);
}
.foot-grid { display: grid; gap: 2.25rem; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: 1fr auto; align-items: end; } }

/* the brand device. Yoruba orthography, tone marks intact, set large enough
   that the marks read as texture. translate="no" in the markup. */
.place {
  font-family: var(--serif);
  font-variation-settings: "opsz" 40;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.place span { color: var(--ink-mid); }

.coda {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--s-2);
  line-height: 1.25;
  color: var(--accent);
}

.registry {
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: var(--s--2);
  line-height: 1.9;
  letter-spacing: 0.045em;
  color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { border-bottom-color: var(--ink); }

/* ---------------------------------------------------------------- motion */

/* one entrance, then stillness. opacity only, non-repeating. */
.rise { opacity: 1; }                       /* visible by default. do not invert. */
html.js .rise { opacity: 0; transform: translateY(14px); }
html.js .rise.in {
  opacity: 1; transform: none;
  transition: opacity 520ms ease, transform 520ms ease;
}
@media (prefers-reduced-motion: reduce) {
  html.js .rise, html.js .rise.in { opacity: 1; transform: none; transition: none; }
}
