/* =========================================================================
   Nightside Bureau
   Single stylesheet, no build step.
   Order: tokens → reset → primitives → masthead → hero → sections → footer
          → responsive → motion.
   ========================================================================= */

/* --- Tokens ------------------------------------------------------------- */

:root {
  /* Ink on charcoal, warmed slightly so the page reads as paper, not screen. */
  --bg:        #0c0c0e;
  --ink:       #e7e3db;
  --ink-muted: #a09a92;
  --ink-faint: #807a73;
  --rule:      rgba(231, 227, 219, 0.16);
  --rule-soft: rgba(231, 227, 219, 0.08);
  --accent:    #b4695c; /* used only for focus states and the mark's shading */

  --serif: "Cormorant Garamond", "Times New Roman", Times, serif;
  --sans:  "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* One gutter value drives the whole page margin system. */
  --gutter: clamp(1.25rem, 5vw, 6rem);
  --measure: 1560px;

  --step: clamp(4rem, 10vw, 10rem); /* vertical rhythm between sections */
}

/* --- Reset -------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Faint grain. Keeps the flat charcoal from reading as a default "dark mode". */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }

svg.sprite { position: absolute; }

/* --- Primitives --------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Tracked-out uppercase sans: signage, labels, running heads. */
.label {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.muted { color: var(--ink-muted); }

.mark {
  width: 0.75rem;
  height: 0.75rem;
  flex: none;
  color: var(--ink-muted);
}
.mark--sm { width: 0.625rem; height: 0.625rem; }

/* Underline that sits away from the baseline, editorial rather than web-blue. */
.link {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 0.15em;
  border-bottom: 1px solid var(--rule);
  transition: border-color 300ms ease, color 300ms ease;
}
.link:hover { border-bottom-color: var(--ink); }

a:focus-visible,
.link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 0.35em;
  border-bottom-color: transparent;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--bg);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
}
.skip-link:focus { left: var(--gutter); top: 0.75rem; }

/* --- Masthead ----------------------------------------------------------- */

.masthead {
  padding-block: clamp(1.25rem, 2.4vw, 2rem);
}

.masthead__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.masthead__name,
.masthead__place {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.masthead__name a {
  color: var(--ink);
  text-decoration: none;
}

.masthead__place { color: var(--ink-muted); }

/* --- Hero --------------------------------------------------------------- */

.hero {
  /* svh keeps the composition intact under mobile browser chrome; the cap
     stops the composition from stretching apart on very tall windows. */
  min-height: min(calc(100svh - 5rem), 58rem);
  display: flex;
  align-items: stretch;
  padding-block: clamp(3rem, 8vh, 7rem) clamp(1.5rem, 3vh, 2.5rem);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(3rem, 10vh, 8rem);
  flex: 1;
}

/* Wordmark and tagline share a row; the tagline hangs in the negative space
   left by the indented second line. */
.hero__type {
  display: grid;
  /* Column two is sized in vw so the wordmark's width (a fixed multiple of
     its vw-based font-size) can never grow into it. */
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 16vw);
  align-items: end;
  column-gap: var(--gutter);
}

.wordmark {
  grid-column: 1;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 13vw, 13rem);
  line-height: 0.86;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  margin: 0;
}

.wordmark__line { display: block; }

/* Above-the-fold pieces fade on load rather than on scroll, so they never
   depend on the observer firing. */
.wordmark__line,
.hero__tagline,
.hero__meta { animation: rise 1100ms cubic-bezier(0.22, 1, 0.36, 1) both; }

.wordmark__line--a { animation-delay: 60ms; }
.wordmark__line--b { animation-delay: 180ms; }
.hero__tagline     { animation-delay: 420ms; }
.hero__meta        { animation-delay: 620ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.4rem); }
  to   { opacity: 1; transform: none; }
}

/* Deliberate asymmetry: the second line steps in from the first. */
.wordmark__line--b { padding-left: clamp(0.75rem, 7vw, 7rem); }

.hero__tagline {
  grid-column: 2;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.125rem, 1.9vw, 1.875rem);
  line-height: 1.25;
  color: var(--ink-muted);
  text-align: right;
  padding-bottom: 0.6em;
  text-wrap: balance;
}

.hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.hero__meta-item { color: var(--ink-faint); }
.hero__meta-item--end { display: flex; }

/* --- Sections ----------------------------------------------------------- */

.section {
  padding-block: var(--step);
  border-top: 1px solid var(--rule-soft);
}

/* Label column left, body offset to the right — an index page, not a card. */
.section__inner {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: start;
}

.section__aside {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section__aside .label { color: var(--ink-faint); }
.section__aside .mark { color: var(--ink-faint); }

.section__body { max-width: 50ch; }

/* Statement sits a step below the wordmark in the hierarchy: serif, quiet. */
.statement {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.375rem, 2.4vw, 2.125rem);
  line-height: 1.32;
  letter-spacing: 0.004em;
  color: var(--ink);
  text-wrap: pretty;
}

.statement--quiet {
  margin-top: 1.5em;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-style: italic;
  color: var(--ink-muted);
}

/* The ledger runs wider than a reading column so entries can carry
   date, title and venue side by side later on. */
.section--program .section__body { max-width: none; }

/* Program rows read as ruled ledger entries; the empty state is one of them. */
.program__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26ch);
  align-items: baseline;
  column-gap: var(--gutter);
  row-gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.program__state {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.375rem, 2.4vw, 2.125rem);
  line-height: 1.32;
}

.program__note {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-align: right;
  text-wrap: balance;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule-soft);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  column-gap: var(--gutter);
  row-gap: 2.5rem;
}

.site-footer__name {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.site-footer__links ul {
  display: flex;
  gap: clamp(1.5rem, 3vw, 3rem);
}

.site-footer__links .link {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.site-footer__colophon {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: none;
  white-space: nowrap;
}

/* --- Responsive --------------------------------------------------------- */

/* Tablet: the hero tagline drops beneath the wordmark rather than beside it. */
@media (max-width: 900px) {
  .hero__type {
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(1.75rem, 5vw, 2.5rem);
  }

  .hero__tagline {
    grid-column: 1;
    text-align: left;
    padding-bottom: 0;
    padding-left: clamp(0.75rem, 7vw, 7rem); /* aligns with the stepped line */
    font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  }

  .section__inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.75rem;
  }

  .section__body { max-width: 34em; }
}

@media (max-width: 620px) {
  :root { --step: clamp(3.5rem, 14vw, 6rem); }

  .masthead__place-full { display: none; }

  .hero {
    min-height: min(calc(100svh - 4.5rem), 46rem);
    padding-block: clamp(2rem, 6vh, 4rem) 1.25rem;
  }

  /* 15vw keeps the longest line clear of the gutters on a 320px viewport. */
  .wordmark { font-size: clamp(2.75rem, 15vw, 5rem); }
  .wordmark__line--b { padding-left: 1.5rem; }

  .hero__tagline { padding-left: 1.5rem; }

  .hero__meta { padding-top: 1rem; }

  .program__row {
    grid-template-columns: minmax(0, 1fr);
  }
  .program__note { text-align: left; }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 2rem;
  }
  .site-footer__links ul { flex-direction: column; gap: 0.85rem; }
  .site-footer__links .link { display: inline-block; }
}

/* Very large screens: cap the display type so the composition stays a page. */
@media (min-width: 1800px) {
  .wordmark { font-size: 13rem; }
}

/* --- Motion ------------------------------------------------------------- */

/* Reveal is opt-in: without JS (no .js class) everything renders visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(0.5rem);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 900ms ease, transform 900ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .wordmark__line,
  .hero__tagline,
  .hero__meta { animation: none; }

  .js [data-reveal],
  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
