/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --paper: #F2F4EE;
  --wash: #E3E8DB;
  --ink: #1B2016;
  --muted: #6C7364;
  --accent: #FFD84D;
  --accent-2: #2B4EFF;

  --shadow: 0 24px 60px -22px rgba(27, 32, 22, 0.25);
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Figtree', sans-serif;
  --font-receipt: 'Courier Prime', monospace;

  --step-hero: clamp(3.2rem, 18vw, 10rem);
  --step-h2: clamp(1.9rem, 7vw, 3.2rem);
  --step-lead: clamp(1.1rem, 4vw, 1.4rem);
  --step-body: clamp(1rem, 3.6vw, 1.1rem);
  --step-small: 0.8rem;
  --step-receipt: clamp(0.82rem, 3.2vw, 0.95rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 3rem;
  --space-5: 5rem;
  --space-6: 8rem;
  --space-7: 13rem;

  --gutter: 1.5rem;
  --content-max: 1100px;
  --section-pad-y: 6rem;
}

@media (min-width: 900px) {
  :root {
    --gutter: 3rem;
    --section-pad-y: 10rem;
  }
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--step-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

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

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

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--section-pad-y) var(--gutter);
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: var(--step-small);
  color: var(--muted);
  margin: 0 0 var(--space-2);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-h2);
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin: 0 0 var(--space-5);
}

.highlight {
  background: linear-gradient(transparent 58%, var(--accent) 58%);
}

/* ==========================================================================
   Motion
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--slow {
  transition-duration: 1.2s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--gutter);
  background: var(--paper);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  filter: blur(1px);
  transform: scale(1.1);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--paper) 55%, transparent) 0%,
    color-mix(in srgb, var(--paper) 80%, transparent) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.hero__content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: hero-in 0.9s var(--ease) forwards;
}

.hero__content .eyebrow { animation-delay: 0.1s; }
.hero__name { animation-delay: 0.19s; }
.hero__lead { animation-delay: 0.28s; }
.scroll-cue-wrap { animation-delay: 0.37s; }

@keyframes hero-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__content > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-hero);
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin: 0;
}

.hero__lead {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: var(--step-lead);
  max-width: 32ch;
  margin: var(--space-3) auto 0;
}

.scroll-cue-wrap {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scroll-cue {
  display: block;
  width: 1px;
  height: 48px;
  background: var(--muted);
  opacity: 0.5;
  animation: pulse 2.4s ease-in-out infinite 1.2s;
}

.scroll-cue-label {
  margin: var(--space-2) 0 0;
  font-family: var(--font-body);
  font-size: var(--step-small);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
}

@keyframes pulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; opacity: 0.4; }
}

/* ==========================================================================
   The incidents
   ========================================================================== */

.incidents { background: var(--wash); }

.incidents__spine {
  position: relative;
  padding-left: calc(var(--space-2) + 1px);
  border-left: 1px solid var(--ink);
  border-left-color: rgba(27, 32, 22, 0.25);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.incident {
  max-width: 420px;
}

.incident__photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-3);
}

.incident__year {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-h2);
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin: 0 0 var(--space-1);
}

.incident__caption {
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 4.6vw, 1.6rem);
  color: var(--ink);
  text-transform: capitalize;
  margin: 0;
}

@media (min-width: 900px) {
  .incidents__spine {
    border-left: none;
    gap: var(--space-7);
  }

  .incidents__spine::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(27, 32, 22, 0.25);
  }

  .incident {
    width: calc(50% - var(--space-4));
    max-width: 460px;
  }

  .incident:nth-child(odd) { margin-right: auto; }
  .incident:nth-child(even) { margin-left: auto; }
}

/* ==========================================================================
   The evidence
   ========================================================================== */

.evidence { background: var(--paper); }

.evidence__grid {
  columns: 1;
  column-gap: var(--space-2);
}

@media (min-width: 600px) {
  .evidence__grid { columns: 2; }
}

@media (min-width: 1000px) {
  .evidence__grid { columns: 3; }
}

.evidence__tile {
  display: block;
  position: relative;
  width: 100%;
  break-inside: avoid;
  margin-bottom: var(--space-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.evidence__tile img,
.evidence__tile video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

@media (hover: hover) {
  .evidence__tile {
    transition: transform 0.6s var(--ease);
  }
  .evidence__tile:hover {
    transform: scale(1.03);
  }
}

/* ==========================================================================
   The receipt
   ========================================================================== */

.receipt-section {
  background: var(--wash);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.receipt-section .section-inner {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

@media (min-width: 900px) {
  .receipt-section .section-inner {
    padding-top: 14rem;
    padding-bottom: 14rem;
  }
}

.receipt {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(-0.6deg);
  padding: 2.5rem 1.75rem;
}

@media (max-width: 500px) {
  .receipt { transform: none; }
}

.receipt__tear {
  --tear: 10px;
  position: absolute;
  left: 0;
  right: 0;
  height: var(--tear);
  background: var(--paper);
  -webkit-mask-image: conic-gradient(from -45deg at 50% var(--tear), #0000 25%, #000 0);
  mask-image: conic-gradient(from -45deg at 50% var(--tear), #0000 25%, #000 0);
  -webkit-mask-size: 20px 100%;
  mask-size: 20px 100%;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}

.receipt__tear--top {
  top: calc(var(--tear) * -1 + 1px);
  transform: scaleY(-1);
}

.receipt__tear--bottom {
  bottom: calc(var(--tear) * -1 + 1px);
}

.receipt__body {
  font-family: var(--font-receipt);
  font-size: var(--step-receipt);
  line-height: 1.6;
}

.receipt__title {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.receipt__rule,
.receipt__rule-double {
  margin: 0.9em 0;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  color: var(--ink);
  opacity: 0.5;
}

.receipt__meta p,
.receipt__totals p {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  margin: 0.2em 0;
}

.receipt__cols {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.receipt__items li {
  display: grid;
  grid-template-columns: 2.5em 1fr auto;
  gap: 0.5em;
  margin: 0.6em 0;
  align-items: start;
}

.receipt__items .qty {
  text-align: right;
}

.receipt__items .item {
  text-align: left;
}

.receipt__items .amt {
  text-align: right;
}

.receipt__total-final {
  font-weight: 700;
}

.receipt__notes {
  margin-top: 1.5em;
  padding-top: 1.5em;
  border-top: 1px dashed var(--ink);
  border-top-color: rgba(27, 32, 22, 0.3);
}

.receipt__notes p {
  margin: 1em 0;
}

.receipt__notes-heading {
  font-weight: 700;
}

.receipt__signature {
  text-align: right;
  font-weight: 700;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--paper);
  padding: var(--space-4) var(--gutter);
  text-align: center;
  color: var(--muted);
  font-size: var(--step-small);
}

.site-footer p { margin: 0.3em 0; }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 32, 22, 0.9);
}

.lightbox__content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 88svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__content img,
.lightbox__content video {
  max-width: 92vw;
  max-height: 88svh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  border-radius: 50%;
}

.lightbox__close svg line,
.lightbox__nav svg polyline {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox__close {
  top: var(--space-2);
  right: var(--space-2);
}

.lightbox__nav--prev { left: var(--space-2); }
.lightbox__nav--next { right: var(--space-2); }

@media (max-width: 700px) {
  .lightbox__nav { display: none; }
}

@media (hover: hover) {
  .lightbox__close:hover,
  .lightbox__nav:hover {
    opacity: 0.7;
  }
}
