/* ============================================================
   SFRMC — canonical styles. Tokens defined in CLAUDE.md.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink:   #0E1110;
  --panel: #161A18;
  --line:  #333A36;
  --steel: #B6BCC2;
  --bone:  #EDEBE7;
  --beret: #1E5C39;
  --flash: #3D8F62;
  --brass: #B99B6B;

  --font-display: "Big Shoulders Display", sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section: clamp(4rem, 10vh, 7rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--beret); color: var(--bone); }

a { color: var(--bone); text-decoration-color: var(--steel); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--flash); }

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
}

/* ---------- header / nav ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  border-top: 2px solid var(--flash);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--bone);
}

.site-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--bone); }

/* ---------- hero ---------- */

.hero {
  padding: var(--section) var(--gutter) calc(var(--section) * 0.8);
  text-align: center;
}

.rocker { width: min(560px, 86vw); margin: 0 auto 0.5rem; display: block; }

.rocker text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 42px;
  letter-spacing: 0.34em;
  fill: var(--steel);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--flash);
}

.hero .eyebrow { margin-bottom: 2.25rem; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  max-width: 17ch;
  margin: 0 auto;
}

.hero .lead {
  max-width: var(--measure);
  margin: 2rem auto 0;
  color: var(--steel);
  font-size: 1.125rem;
}

/* ---------- sections ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 var(--gutter);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.divider .mark {
  width: 12px;
  height: 14px;
  margin: 0 14px;
  background: var(--flash);
  clip-path: polygon(50% 0, 100% 78%, 100% 100%, 0 100%, 0 78%);
  opacity: 0.7;
}

.section {
  padding: var(--section) var(--gutter);
  max-width: 56rem;
  margin: 0 auto;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0.6rem 0 1.4rem;
}

.section .eyebrow { display: block; }

.section p { max-width: var(--measure); }
.section p + p { margin-top: 1rem; }

.more {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--beret);
  padding-bottom: 3px;
}
.more:hover { border-bottom-color: var(--flash); }

/* ---------- charter cards ---------- */

.charters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 1.8rem; }

.charter {
  background: var(--panel);
  padding: 1.8rem 1.6rem;
}

.charter .coords {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--flash);
}

.charter h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0.5rem 0 0.6rem;
}

.charter p { color: var(--steel); font-size: 0.98rem; }

/* ---------- colors section: text left, emblem watermark right ---------- */

/* Text column keeps the same left edge as every other .section; the emblem hangs in the right margin. */
.section-colors { max-width: min(100%, 82rem); margin: 0 0 0 max(0px, calc(50% - 28rem)); display: grid; grid-template-columns: minmax(0, 48rem) minmax(220px, 380px); gap: 3rem; align-items: center; }
.colors-mark { aspect-ratio: 1200 / 1573; background: url(/assets/img/logo/emblem-1200.png) center / contain no-repeat;
  filter: grayscale(1) contrast(1.05); opacity: 0.32; }

@media (max-width: 820px) {
  .section-colors { grid-template-columns: 1fr; }
  .colors-mark { width: 60%; max-width: 300px; margin: 0 auto; order: -1; }
}

/* ---------- colors list ---------- */

.colors { display: flex; flex-direction: column; max-width: var(--measure); margin: 0.4rem 0 1.6rem; border-top: 1px solid var(--line); }
.color { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.color dt { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.05em; text-transform: uppercase; }
.color dd { color: var(--steel); font-size: 0.98rem; }
.section .close { font-style: italic; }

@media (max-width: 640px) {
  .color { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ---------- mission block ---------- */

.mission {
  border-left: 2px solid var(--beret);
  padding-left: 1.4rem;
  max-width: var(--measure);
  font-size: 1.2rem;
  font-style: italic;
}

/* ---------- forms (membership) ---------- */

.form-grid { display: grid; gap: 1.1rem; max-width: 40rem; margin-top: 1.8rem; }

label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  display: block;
  margin-bottom: 0.4rem;
}

input, select, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--steel); outline: none; }

.btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--steel);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.btn:hover { border-color: var(--flash); background: var(--panel); }

/* store pages swap the accent: brass in place of green */
.store .site-header { border-top-color: var(--brass); }
.store .eyebrow, .store .charter .coords { color: var(--brass); }
.store .divider .mark { background: var(--brass); }
.store a:hover { text-decoration-color: var(--brass); }
.store .btn { border-color: var(--brass); }
.store .btn:hover { border-color: var(--brass); }
.store .more { border-bottom-color: var(--brass); }
.store .more:hover { border-bottom-color: var(--brass); }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--gutter) 3rem;
  text-align: center;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--steel);
  max-width: 60ch;
  margin: 0 auto;
}
.site-footer p + p { margin-top: 0.8rem; }

/* ---------- motion ---------- */

.rise { opacity: 0; transform: translateY(14px); animation: rise 700ms ease forwards; }
.rise-2 { animation-delay: 120ms; }
.rise-3 { animation-delay: 240ms; }

@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .rise-2, .rise-3 { animation: none; opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 0.8rem; }
}

/* ============================================================
   Landing v3 — "Night Formation". Transform/opacity only.
   ============================================================ */

/* ---------- atmosphere ---------- */

.hero-night { position: relative; overflow: hidden; isolation: isolate; }

.hero-night .atmosphere {
  position: absolute; inset: -20% 0 0 0; z-index: -1;
  pointer-events: none; will-change: transform;
  background: var(--ink);
}

.hero-photo {
  position: absolute; inset: 0;
  background-position: center; background-size: cover;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.35; mix-blend-mode: multiply;
}
.hero-photo::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0.4; }

.fog {
  position: absolute; width: 120vmax; height: 120vmax; border-radius: 50%;
  filter: blur(60px); opacity: 0.5; will-change: transform;
}
.fog-a { top: -60vmax; left: -40vmax; background: radial-gradient(circle, #1A211D 0%, rgba(26,33,29,0) 60%); animation: fog-a 52s ease-in-out infinite alternate; }
.fog-b { bottom: -70vmax; right: -50vmax; background: radial-gradient(circle, #171C19 0%, rgba(23,28,25,0) 60%); animation: fog-b 44s ease-in-out infinite alternate; }
@keyframes fog-a { from { transform: translate3d(0,0,0); } to { transform: translate3d(18vw, 10vh, 0); } }
@keyframes fog-b { from { transform: translate3d(0,0,0); } to { transform: translate3d(-16vw, -12vh, 0); } }

.grain {
  position: absolute; inset: 0; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(14,17,16,0) 55%, rgba(14,17,16,0.7) 100%); }

.hero-content { position: relative; }

/* ---------- entrance (once, ~1.6s) ---------- */

.js .site-header::before {
  content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 100%;
  background: var(--flash); transform-origin: left; transform: scaleX(0);
  animation: sweep 700ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.js .site-header { position: relative; border-top-color: transparent; }
@keyframes sweep { to { transform: scaleX(1); } }

/* Chrome does not re-lay out textPath after an animated letter-spacing, so the
   settle is a transform scale (wide to final) plus opacity. Transform only. */
.js .rocker-enter { opacity: 0; transform: scale(1.08); transform-origin: 50% 100%; animation: settle 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms forwards; }
@keyframes settle { to { opacity: 1; transform: scale(1); } }

.js .rise { animation-duration: 700ms; }
.js .rise-1 { animation-delay: 600ms; }
.js .rise-2 { animation-delay: 760ms; }
.js .rise-3 { animation-delay: 920ms; }

/* ---------- scroll reveals ---------- */

.js .section.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.js .section.reveal.in { opacity: 1; transform: none; }

.js .divider.reveal::before, .js .divider.reveal::after { transform: scaleX(0); transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .divider.reveal::before { transform-origin: right; }
.js .divider.reveal::after { transform-origin: left; }
.js .divider.reveal .mark { transform: scale(0); transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms; }
.js .divider.reveal.in::before, .js .divider.reveal.in::after { transform: scaleX(1); }
.js .divider.reveal.in .mark { transform: scale(1); }

/* ---------- ticker ---------- */

.ticker { overflow: hidden; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.55rem 0; }
.ticker-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-run { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--flash); white-space: nowrap; padding-right: 2rem; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- charter cards ---------- */

.charter { text-decoration: none; color: inherit; border: 1px solid transparent; transition: transform 150ms ease, border-color 150ms ease; }
.charter .coords { transition: color 150ms ease; }
.charter:hover { transform: translateY(-2px); border-color: var(--flash); }
.charter:hover .coords { color: var(--bone); }

/* ---------- photo band ---------- */

.band-photo { position: relative; height: clamp(260px, 42vh, 480px); overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-photo-img {
  position: absolute; inset: 0;
  background-color: var(--panel);
  background-image:
    linear-gradient(180deg, rgba(14,17,16,0.2), rgba(14,17,16,0.85)),
    repeating-linear-gradient(115deg, #161A18 0 18px, #131715 18px 36px),
    radial-gradient(ellipse at 30% 40%, #1C221E, #0E1110 70%);
  background-position: center; background-size: cover;
  filter: grayscale(1);
}
/* Real photo: set background-image inline and add .has-photo for the duotone. */
.band-photo-img.has-photo { opacity: 0.35; mix-blend-mode: multiply; }
.band-caption { position: absolute; left: var(--gutter); bottom: 1.4rem; margin: 0; }

/* ---------- reduced motion / static ---------- */

@media (prefers-reduced-motion: reduce) {
  .fog, .ticker-track, .rocker-enter, .site-header::before { animation: none; }
  .rocker-enter { opacity: 1; transform: none; }
  .hero-night .atmosphere { transform: none; }
  .section.reveal, .divider.reveal::before, .divider.reveal::after, .divider.reveal .mark { opacity: 1; transform: none; transition: none; }
  .charter, .charter .coords { transition: none; }
  .charter:hover { transform: none; }
  .ticker-track { transform: none; }
}

@media (max-width: 640px) {
  .fog { filter: blur(40px); }
}

/* ---------- hero imagery (locked reference, see CLAUDE.md) ---------- */

/* Flag: one diagonal sheet, upper-left to lower-right. Soft-light against --ink so
   the stripe/star structure emerges in the highlights. Saturation ceiling 15%. */
.flag-sheet { position: absolute; left: -15%; top: -25%; width: 130%; height: 150%;
  transform: rotate(-16deg); transform-origin: center; display: flex; opacity: 0; mix-blend-mode: screen; }
.flag { position: relative; flex: 0 0 58%; background-size: cover; background-position: center;
  filter: saturate(0.15) contrast(1.25) brightness(0.7); }
.flag-stars { background-image: url(/assets/img/flag-stars.jpg); -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent 100%); mask-image: linear-gradient(90deg, #000 55%, transparent 100%); }
.flag-stripes { background-image: url(/assets/img/flag-stripes.jpg); margin-left: -16%; -webkit-mask-image: linear-gradient(270deg, #000 55%, transparent 100%); mask-image: linear-gradient(270deg, #000 55%, transparent 100%); }
.flag-sheet::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(14,17,16,0) 40%, rgba(14,17,16,0.9) 85%); }


.hero-photo { opacity: 0; }

/* Text scrim: above flag and patch, below type. */
.hero-content { position: relative; isolation: isolate; }
.hero-content::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(100%, 980px); height: 120%;
  transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgba(14,17,16,0.68) 0%, rgba(14,17,16,0.52) 40%, rgba(14,17,16,0) 75%); }

/* (a) flag + patch watermark + type: the locked hero */
[data-hero="a"] .flag-sheet { opacity: 0.35; }

/* (b) treated photo + fog + type */
[data-hero="b"] .hero-photo { opacity: 0.3; mix-blend-mode: normal; background-position: center 30%; }

/* (c) pure type / atmosphere: nothing extra */
