/* cut+paste — Components */

/* ==================== SKIP LINK ==================== */

.skip {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75em 1.25em;
  border-radius: 9999px;
  transition: top 0.2s var(--ease-out);
}

.skip:focus {
  top: 12px;
}

/* ==================== TICKER TAPE ==================== */
/* Concrete bar across the top, mono. A static left-justified list on desktop;
   below 880 it becomes a marquee. That breakpoint is the tape's own, not the
   site's 768: four chapters measure 682px of content plus gutter and item
   padding, so the list stops fitting at about 843 and would clip silently
   against overflow: hidden. */

.tape {
  position: relative;
  z-index: 10;
  background: var(--concrete);
  color: var(--ink);
  border-bottom: var(--rule) solid var(--ink);
  overflow: hidden;
  padding-block: 0.6rem;
}

.tape__track {
  display: flex;
  align-items: center;
  padding-inline-start: var(--gutter);
}

/* Each run is one flex child of exactly the same width, so the marquee's -50%
   lands on a repeat boundary. The static list shows only the first. */
.tape__run {
  display: flex;
  align-items: center;
}

.tape__run + .tape__run {
  display: none;
}

/* Dot, city and time share one horizontal axis. The trailing space is the
   item's own padding, never a track gap: a gap falls between runs too and
   would push the loop off its boundary. */
.tape__item {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding-inline-end: clamp(2rem, 5vw, 4.5rem);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: var(--step-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
}

.tape__city {
  font-weight: 700;
}

/* Each city's dot carries its chapter color into the tape */
.tape__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, var(--orange));
  flex: none;
}

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

@media (max-width: 880px) {
  .tape__track {
    width: max-content;
    padding-inline-start: 0;
    animation: tape-roll 48s linear infinite;
  }

  .tape__run + .tape__run {
    display: flex;
  }

  .tape:hover .tape__track,
  .tape:focus-within .tape__track {
    animation-play-state: paused;
  }

  /* Ends fade into the band's own ground, so the bar stays solid edge to edge.
     Overlays rather than a mask: a mask on .tape__track would travel with the
     animation instead of staying pinned to the edges, and a mask on .tape
     takes the background out with the text. */
  .tape::before,
  .tape::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(2rem, 8vw, 4rem);
    z-index: 1;
    pointer-events: none;
  }

  .tape::before {
    left: 0;
    background: linear-gradient(90deg, var(--concrete), transparent);
  }

  .tape::after {
    right: 0;
    background: linear-gradient(270deg, var(--concrete), transparent);
  }
}

@keyframes tape-roll {
  from {
    transform: translateX(0);
  }
  to {
    /* Track holds two identical runs; -50% loops seamlessly. */
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tape__track {
    animation: none;
  }
  .tape {
    overflow-x: auto;
  }
  .tape::before,
  .tape::after {
    display: none;
  }
}

/* ==================== BUTTONS ==================== */
/* Fully pill. Solid fills. No shadows, ever. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.95em 1.9em;
  border-radius: 9999px;
  border: var(--rule) solid var(--ink);
  font-family: var(--mono);
  font-size: var(--step-control);
  font-weight: 700;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s var(--ease-snap), background-color 0.18s linear,
    color 0.18s linear;
}

.btn--solid {
  background: var(--orange);
  color: var(--ink);
}

.btn--solid:hover {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(calc(var(--tilt-soft) * -1)) scale(1.02);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(var(--tilt-soft)) scale(1.02);
}

/* Secondary: orange type and stroke on nothing. Used where a solid pill would
   compete with artwork behind it. */
.btn--line {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}

.btn--line:hover {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--orange);
  transform: rotate(var(--tilt-soft)) scale(1.02);
}

.btn--wide {
  width: 100%;
  padding-block: 1.15em;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ==================== FILTER CHIPS ==================== */
/* Chips ARE the legend. Color = chapter. Off state is outline only. */

/* `hidden` is set by js/calendar.js when nothing is scheduled. The UA rule
   loses to the display below it, so it is restated here. */
.filters[hidden] {
  display: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: clamp(1.25rem, 3vw, 2rem);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 1.25em;
  border-radius: 9999px;
  border: none;
  background: var(--white);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--step-control);
  font-weight: 700;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s var(--ease-snap), background-color 0.18s linear,
    color 0.18s linear;
}

.chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: var(--rule-hair) solid var(--ink);
  background: var(--c, transparent);
  flex: none;
}

.chip:hover {
  transform: rotate(calc(var(--tilt-soft) * -1));
}

/* On state: chip floods with its chapter color */
.chip.is-on {
  background: var(--c, var(--ink));
  color: var(--on-c, var(--paper));
}

.chip.is-on .chip__dot {
  background: var(--on-c, var(--paper));
  border-color: var(--on-c, var(--paper));
}

.chip--all.is-on {
  background: var(--ink);
  color: var(--paper);
}

/* A chapter with nothing upcoming. Still legible as the colour legend, but it
   filters to an empty view, so it stops taking clicks. */
.chip.is-dim {
  opacity: 0.2;
  cursor: default;
}

.chip.is-dim:hover {
  transform: none;
}

/* ==================== FRAMES ==================== */
/* Photos are objects: hard black edge, off-axis, duotoned, dot-screened. */

.frame {
  position: relative;
  margin: 0;
  border: var(--rule) solid var(--ink);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.frame img {
  width: 100%;
  display: block;
  filter: grayscale(0.5) contrast(1.25) brightness(1.06);
}

/* Chapter color multiplied over a half-desaturated plate, so some of the
   photograph's own color survives under the tint */
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--duo, var(--blue));
  mix-blend-mode: multiply;
  opacity: 0.62;
  pointer-events: none;
}

/* Duotone tint per chapter. These are classes rather than inline style
   attributes because the CSP is style-src 'self' -- an inline style="--duo:..."
   is blocked and the photo renders untinted. */
.frame--duo-red { --duo: var(--red); }
.frame--duo-blue { --duo: var(--blue); }
.frame--duo-yellow { --duo: var(--yellow); }
.frame--duo-green { --duo: var(--green); }

/* Halftone dot screen — the print artifact that ties back to the flyers */
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: radial-gradient(var(--ink) 0.9px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
  opacity: 0.3;
  pointer-events: none;
}

.frame figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5em 0.85em;
  border-top: var(--rule) solid var(--ink);
  border-right: var(--rule) solid var(--ink);
}

/* ==================== FLOAT ==================== */
/* Contract with js/parallax.js: JS owns --fx/--fy (drift), CSS owns --fr
   (authored rotation). Composed here so neither clobbers the other and
   responsive rotation still works. */

.float {
  transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) rotate(var(--fr, 0deg));
  will-change: transform;
}

/* ==================== BAUHAUS SHAPES ==================== */
/* Decorative furniture. Absolutely placed by section, parallaxed by JS. */

.shape {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.shape--circle {
  width: clamp(80px, 11vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
}

.shape--square {
  width: clamp(60px, 8vw, 140px);
  aspect-ratio: 1;
  background: var(--blue);
}

.shape--tri {
  width: 0;
  height: 0;
  border-left: clamp(40px, 5vw, 85px) solid transparent;
  border-right: clamp(40px, 5vw, 85px) solid transparent;
  border-bottom: clamp(70px, 9vw, 150px) solid var(--yellow);
}

.shape--bar {
  width: clamp(120px, 18vw, 340px);
  height: clamp(14px, 1.6vw, 26px);
  background: var(--ink);
}

/* ==================== FORM ==================== */

.field {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field > label,
.field > legend {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0;
  padding-bottom: 1rem;
}

.opt {
  color: var(--ink-35);
  letter-spacing: 0.14em;
}

.field input[type="email"],
.field input[type="text"] {
  width: 100%;
  padding: 0.9em 1em;
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.875rem;
  transition: transform 0.18s var(--ease-snap), background-color 0.18s linear;
}

.field input::placeholder {
  color: var(--ink-35);
}

.field input:focus {
  background: var(--white);
  transform: rotate(calc(var(--tilt-hair) * -1));
}

.field input[aria-invalid="true"] {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--paper));
}

.err {
  color: var(--red);
  min-height: 1em;
}

.err:empty {
  min-height: 0;
}

/* Checkbox chips */
/* The .field gap is set for label-over-input. A pill row is heavier and
   tilts on hover, so it takes its extra room here rather than by loosening
   the gap for every field on the form. */
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 0.4rem;
}

.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.6em 1.1em;
  border: var(--rule) solid transparent;
  border-radius: 9999px;
  background: var(--paper);
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--step-control);
  font-weight: 700;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  transition: transform 0.18s var(--ease-snap), background-color 0.18s linear,
    color 0.18s linear;
}

.check:hover {
  transform: rotate(calc(var(--tilt-hair) * -1));
}

.check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Fake box so we control the whole mark */
.check span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 0.7em;
  border: var(--rule-hair) solid currentColor;
  background: transparent;
  transform: translateY(0.5px);
}

.check:has(input:checked) {
  background: var(--c, var(--ink));
  color: var(--on-c, var(--paper));
}

.check:has(input:checked) span::before {
  background: currentColor;
}

.check:has(input:focus-visible) {
  outline: var(--rule) solid var(--orange);
  outline-offset: 3px;
}

/* Honeypot — visually gone, still fillable by bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Sits below the submit button, running the full width of the panel: it is
   the last thing read, not a gate in front of the button. Still out of the
   uncomfortably-small register -- the small type is a style choice, consent
   is not -- and still sentence-case. */
.consent {
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--ink-60);
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.form__status {
  margin-top: 0.9rem;
  min-height: 1.2em;
}

.form__status.is-ok {
  color: var(--green);
  font-weight: 700;
}

.form__status.is-bad {
  color: var(--red);
  font-weight: 700;
}

/* ==================== DOCUMENT CHROME ==================== */
/* Masthead and footer for text-only pages (privacy, and whatever follows).
   Deliberately quiet: no ticker, no shapes, no parallax. The page is a
   document, and the chrome's only job is to get you back to the site. */

.masthead {
  border-block-end: var(--rule) solid var(--ink);
  background: var(--paper);
}

.masthead__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1rem, 2.5vw, 1.5rem);
}

.masthead__mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.masthead__back {
  color: var(--ink-60);
  white-space: nowrap;
  transition: color 0.18s linear;
}

/* The full label crowds the corner crop mark on narrow screens. */
@media (max-width: 560px) {
  .masthead__back-long {
    display: none;
  }
}

.masthead__back:hover {
  color: var(--ink);
}

/* ---------- document head ---------- */

.doc__head {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(1.75rem, 4vw, 2.75rem);
}

.doc__title {
  margin-block-end: 1rem;
}

.doc__stamp {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.25em;
  color: var(--ink-60);
}

.doc__body {
  padding-block-end: clamp(3.5rem, 9vw, 7rem);
}

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

.doc-foot {
  border-block-start: var(--rule) solid var(--ink);
}

.doc-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--ink-60);
}

/* Treatment is the global inline-link rule in base.css. */
