/* PRESNAP
   Two colors, one typeface, art first.
   Owners comes from the Adobe Fonts kit linked in each page head:
   400 for body copy, 700 for headlines. */

:root {
  --ink: #302010;
  --paper: #ffffff;
  --font: "owners", sans-serif;

  --bar: 3.5rem;                                  /* height of the top bar */
  --rail: 3.5rem;                                 /* width of each sideline */
  --yard: 1rem;                                   /* space between hash marks */
  --gutter: calc(var(--rail) + clamp(1rem, 4vw, 3rem));
  --measure: 38rem;                               /* body text column */
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }


/* ---------- Top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--bar);
  background: var(--ink);
}

.bar__logo {
  position: relative;
  display: block;
  width: 10.5rem;
  aspect-ratio: 4640 / 700;
}

.bar__mark,
.bar__reveal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The reveal video is white on black. Screen blending drops the black,
   so the logo sits on the brown bar with no box around it. */
.bar__reveal {
  object-fit: fill;
  filter: contrast(1.06); /* pushes near-black video noise to true black */
  mix-blend-mode: screen;
  opacity: 0;
}

.reveal .bar__reveal { opacity: 1; }
.reveal .bar__mark { opacity: 0; }


/* ---------- The field ----------
   Each rail is a sideline: one long line with a hash mark every yard
   and a longer one every five. They scroll with the page. */

.field {
  position: relative;
  padding: clamp(2.5rem, 7vh, 4.5rem) var(--gutter) clamp(5rem, 12vh, 8rem);
}

.field::before,
.field::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--rail);
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) var(--x) / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px calc(var(--yard) * 5))
      var(--x) / 1.75rem 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px var(--yard))
      var(--x) / 0.625rem 100% no-repeat;
}

.field::before { left: 0;  --x: left 0 top 0; }
.field::after  { right: 0; --x: right 0 top 0; }

.field--home { min-height: 100vh; }

/* Full-bleed images are 100vw wide; this hides the few pixels a scrollbar adds */
.field { overflow-x: clip; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}


/* ---------- Home: the grid of covers ----------
   auto-fill keeps empty columns, so the first cover sits small in the
   top left and each new week fills in beside it. */

.covers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
}

.covers a { display: block; }
.covers img { width: 100%; height: auto; }


/* ---------- End zone ---------- */

.endzone {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
  min-height: min(38rem, 80vh);
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter);
  background: var(--ink);
  color: var(--paper);
}

.endzone__icon { width: clamp(4.5rem, 9vw, 7rem); height: auto; }

.endzone__mission {
  max-width: 20ch;
  margin: 0;
  font-weight: 700;
  font-size: clamp(2rem, 4.8vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
}

.endzone address {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.4;
}


/* ---------- Issue page ---------- */

.cover img {
  width: min(100%, calc((100vh - var(--bar)) * 0.72));
  height: auto;
  margin: 0 auto;
}

.cover figcaption {
  width: min(100%, calc((100vh - var(--bar)) * 0.72));
  margin: 0.75rem auto 0;
  font-size: 0.8125rem;
}

.issue__head {
  max-width: 50rem;
  margin: clamp(2.5rem, 7vh, 4.5rem) auto 0;
  text-align: center;
}

.issue__title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.25rem, 5.5vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
}

.prose {
  max-width: var(--measure);
  margin: clamp(3rem, 8vh, 5rem) auto 0;
  font-size: 1.3125rem;
  line-height: 1.5;
}

.prose p { margin: 0 0 1.2em; }

.prose figcaption {
  font-size: 0.8125rem;
  line-height: 1.35;
}

/* Everything that breaks out of the text column uses this */
.breakout {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* A big image pushed left, caption on one line underneath */
.plate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(100vw - 2 * var(--gutter), 66rem);
  margin: 4.5rem 0;
}

.plate img {
  width: min(100%, calc((100vh - var(--bar)) * 0.8));
  height: auto;
}

.plate figcaption { margin-top: 0.75rem; white-space: nowrap; }

/* Same as the plate, mirrored: image on the right */
.plate--flip { align-items: flex-end; }

/* One image on its own, centered and large, caption underneath */
.solo {
  width: min(100vw - 2 * var(--gutter), calc((100vh - var(--bar)) * 0.8));
  margin: 5rem 0;
}
.solo img { width: 100%; height: auto; }
.solo figcaption { margin-top: 0.75rem; }


/* ---------- Small screens ---------- */

@media (max-width: 47.99rem) {
  :root {
    --bar: 3rem;
    --rail: 1.5rem;
    --gutter: calc(var(--rail) + 0.75rem);
  }
  .field::before, .field::after {
    background-size: 1px 100%, 0.875rem 100%, 0.375rem 100%;
  }
  .bar__logo { width: 8.5rem; }
  .field--home { min-height: 85vh; }
  .covers { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
  .cover img, .cover figcaption { width: 100%; }
  .prose { font-size: 1.125rem; }
  .plate { margin: 3rem 0; }
  .plate img { width: 100%; }
  .plate figcaption { white-space: normal; }
  .solo { margin: 3rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bar__reveal { display: none; }
}
