/* Base elements, typography, buttons, shared primitives, forms, map, and footer. */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  color: var(--paper);
  background: var(--night);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Cinematic room: a fixed vignette and a faint projector glow. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -12%, rgba(224, 56, 46, 0.07), transparent 34rem),
    radial-gradient(ellipse at 50% 52%, transparent 0 30rem, rgba(0, 0, 0, 0.5) 70rem);
}

/* Film grain: a static noise overlay that gives every surface the texture of
   projected stock. Static by design (never animated). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.085;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Projector beam: created by site.js on fine-pointer desktops. A soft pool of
   ivory light that trails the cursor. transform is driven from JS. */
.projector-beam {
  position: fixed;
  left: -32vmin;
  top: -32vmin;
  z-index: var(--z-beam);
  width: 64vmin;
  height: 64vmin;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(243, 236, 220, 0.065),
    rgba(243, 236, 220, 0.022) 40%,
    transparent 68%
  );
  opacity: 0;
  transition: opacity 700ms ease;
  pointer-events: none;
  will-change: transform;
}

.projector-beam.is-on {
  opacity: 1;
}

::selection {
  background: var(--red);
  color: var(--on-red);
}

main {
  position: relative;
  overflow: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.02;
  text-wrap: balance;
}

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(3rem, 6.4vw, 5.4rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2.2rem, 3.9vw, 3.6rem);
}

h3 {
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.16;
}

p {
  text-wrap: pretty;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.2rem;
  z-index: var(--z-skip);
  padding: 0.7rem 1rem;
  background: var(--paper);
  color: var(--black);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------------------
   Labels and metadata
--------------------------------------------------------------------------- */

.section-kicker,
.meta-line,
.section-number {
  margin-bottom: 0.85rem;
  color: var(--paper-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-kicker {
  color: var(--red);
}

.chapter-slate {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: clamp(1.1rem, 2.4svh, 1.7rem);
  color: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
}

.chapter-slate .slate-label {
  line-height: 1;
}

.chapter-slate .slate-no {
  color: var(--red);
}

.chapter-slate .slate-sep {
  display: block;
  flex-shrink: 0;
  width: 1.6rem;
  height: 1px;
  background: var(--red);
  transform-origin: left;
}

.hero-redline {
  display: block;
  width: 5.2rem;
  height: 2px;
  margin: 1.3rem 0 1.5rem;
  background: var(--red);
  transform-origin: left;
}

.hero-body {
  max-width: 36rem;
  color: var(--paper-2);
  font-size: clamp(1.02rem, 1.25vw, 1.16rem);
  line-height: 1.62;
}

.small-disclaimer {
  margin-top: 1.2rem;
  color: var(--paper-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.community-line {
  color: var(--paper-3);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Buttons and links
--------------------------------------------------------------------------- */

.button,
.entry-link,
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.85rem;
  padding: 0.78rem 1.35rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.button:hover,
.button:focus-visible,
.entry-link:hover,
.entry-link:focus-visible,
.nav-cta:hover,
.nav-cta:focus-visible {
  border-color: var(--red);
  background: var(--red);
  color: var(--on-red);
  outline: none;
}

.button:active,
.entry-link:active,
.nav-cta:active {
  transform: translateY(1px);
}

.button-primary,
.entry-link.entry-primary {
  border-color: var(--red);
  background: var(--red);
  color: var(--on-red);
}

.button-primary:hover,
.button-primary:focus-visible,
.entry-link.entry-primary:hover,
.entry-link.entry-primary:focus-visible {
  border-color: var(--red-bright);
  background: var(--red-bright);
}

.button-outline,
.button-outline.light {
  border-color: var(--hairline-strong);
  background: transparent;
  color: var(--paper);
}

.text-link {
  position: relative;
  font-weight: 600;
}

.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -0.3rem;
  height: 1px;
  background: var(--red);
  transition: right 220ms ease;
}

.text-link:hover::after,
.text-link:focus-visible::after {
  right: 0;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.1rem;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arrow-link span {
  color: var(--red);
  transition: transform 220ms ease;
}

.arrow-link:hover span,
.arrow-link:focus-visible span {
  transform: translateX(0.3rem);
}

/* ---------------------------------------------------------------------------
   Shared layout primitives (used by founder, stories, submit, activities)
--------------------------------------------------------------------------- */

.entry-row,
.cta-row,
.band-heading {
  display: flex;
  align-items: center;
}

.band-heading {
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.2rem;
}

.content-band,
.two-column,
.form-layout {
  width: min(100% - 2.4rem, var(--content));
  margin: 0 auto;
  padding: clamp(2.6rem, 6svh, 4.2rem) 0;
}

.two-column,
.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.longform p,
.two-column p {
  max-width: 62ch;
  color: var(--paper-2);
}

.longform p + p {
  margin-top: 1rem;
}

.evidence-panel,
.trust-panel {
  padding: clamp(1.4rem, 2.4vw, 1.9rem);
  border: 1px solid var(--hairline);
  background: var(--coal);
}

.evidence-panel h2,
.trust-panel h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
}

/* Content arrives via Django linebreaks (one <p> with <br> lines),
   so style it as an open list with generous line spacing. */
.line-list p {
  margin: 0 0 0.9rem;
  color: var(--paper-2);
  line-height: 1.9;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.library-list {
  display: grid;
  gap: 1.25rem;
}

.library-item,
.activity-entry {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1.6rem;
  padding: 1.2rem;
  border: 1px solid var(--hairline);
  background: var(--coal);
}

.activity-journal {
  min-height: 16rem;
}

.activity-feed {
  display: grid;
  gap: 1.5rem;
}

.journal-item {
  padding: 1.1rem 0;
  border-top: 1px solid var(--hairline);
}

.journal-item p {
  color: var(--paper-2);
}

.impact-note {
  color: var(--gold);
  font-weight: 600;
}

.empty-frame {
  display: grid;
  place-items: center;
  min-height: 14rem;
  padding: 2rem;
  border: 1px dashed var(--hairline-strong);
  color: var(--paper-2);
  text-align: center;
}

.plus-mark {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  color: var(--red);
  font-size: 1.6rem;
}

.empty-frame p {
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-frame small {
  max-width: 26rem;
  color: var(--muted);
}

.media-skeleton {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  min-height: 14rem;
  border: 1px solid var(--hairline);
  background: var(--hairline);
}

.media-skeleton.large {
  min-height: 22rem;
}

.media-skeleton span {
  background: var(--coal);
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.gallery-strip figure {
  margin: 0;
}

.gallery-strip img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--hairline);
}

.portrait-frame img,
.activity-cover img,
.video-thumbnail img,
.gallery-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail,
.activity-cover {
  display: grid;
  place-items: center;
  min-height: 13rem;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--coal-2);
}

.video-thumbnail span,
.activity-cover span {
  color: var(--paper-3);
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
}

.portrait-frame {
  width: 21rem;
  aspect-ratio: 1 / 1.25;
  border: 1px solid var(--hairline-strong);
  background: var(--coal);
  box-shadow: var(--shadow);
}

.portrait-empty {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(135deg, transparent 0 49%, rgba(224, 56, 46, 0.6) 49% 50.5%, transparent 50.5%),
    var(--coal);
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}

.portrait-empty i {
  position: absolute;
  inset: 12% 10%;
  border: 1px solid var(--hairline);
}

details {
  margin-top: 1rem;
}

summary {
  color: var(--red);
  cursor: pointer;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--black);
  color: var(--paper);
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--paper-3);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224, 56, 46, 0.22);
}

input[type="checkbox"] {
  width: 1.15rem;
  min-height: 1.15rem;
  margin-right: 0.5rem;
  accent-color: var(--red);
}

.checkbox-label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.65rem;
  color: var(--paper-2);
  line-height: 1.45;
}

.checkbox-label input {
  margin-top: 0.2rem;
}

input[type="file"] {
  padding: 0.95rem;
  border-style: dashed;
}

input[type="file"]::file-selector-button {
  margin-right: 0.85rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--red);
  background: rgba(224, 56, 46, 0.12);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   U.S. map artwork
--------------------------------------------------------------------------- */

.map-ocean {
  fill: transparent;
}

.map-grid path {
  fill: none;
  stroke: rgba(243, 236, 220, 0.08);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-state {
  fill: rgba(28, 24, 21, 0.92) !important;
  stroke: rgba(243, 236, 220, 0.4) !important;
  stroke-width: 1 !important;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-state-inset {
  fill: rgba(34, 29, 25, 0.92) !important;
}

.map-state-small {
  stroke-width: 1.5 !important;
}

.map-coast-notes path {
  fill: none;
  stroke: rgba(243, 236, 220, 0.18);
  stroke-dasharray: 10 9;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.map-inset-labels text {
  fill: rgba(243, 236, 220, 0.45);
  font-family: var(--font-mono);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.map-land {
  fill: var(--coal);
  stroke: rgba(243, 236, 220, 0.5);
  stroke-width: 3;
  stroke-linejoin: round;
}

.map-waterline {
  fill: none;
  stroke: rgba(139, 167, 174, 0.3);
  stroke-width: 2;
  stroke-dasharray: 9 8;
}

.map-stage {
  position: relative;
  min-height: 33rem;
  padding: 1rem;
  border: 1px solid var(--hairline);
  background: var(--coal);
  box-shadow: var(--shadow);
}

.map-empty-note {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(82%, 26rem);
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--hairline);
  background: rgba(11, 9, 8, 0.92);
  color: var(--paper);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.map-empty-note h2 {
  margin-bottom: 0.5rem;
  font-size: 1.45rem;
}

.map-empty-note p:last-child {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.92rem;
}

.selected-story-panel {
  min-height: 100%;
}

.selected-story-panel h2 {
  font-size: clamp(1.9rem, 2.8vw, 2.6rem);
}

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

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - 2.4rem, var(--content));
  margin: 0 auto;
  padding: 2.6rem 0 2.4rem;
  border-top: 1px solid var(--hairline);
}

.site-footer strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-footer p {
  margin: 0.4rem 0 0;
  color: var(--paper-3);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1.2rem;
  color: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-links a {
  position: relative;
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -0.3rem;
  height: 1px;
  background: var(--red);
  transition: right 200ms ease;
}

.footer-links a:hover::after,
.footer-links a:focus-visible::after {
  right: 0;
}

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

@media (max-width: 900px) {
  .two-column,
  .founder-grid {
    grid-template-columns: 1fr;
  }

  .library-item,
  .activity-entry {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    width: 100%;
    max-width: 18rem;
  }

  .media-skeleton {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .band-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
