/* ===========================================================================
   Starship Suits - Direction A, "Mission Patch"
   See docs/02-visual-directions.html for the direction and its alternatives.

   Everything visual is a token in :root. Switching to Direction B or C is a
   change to those values plus the @font-face block - not a rewrite.

   CONTRAST RULES, measured against the bone background:
     ink    15.67:1  - all text, any size
     orange  3.21:1  - LARGE display text only (>=24px, or >=18.7px bold)
     pink    2.75:1  - DECORATIVE SHAPES ONLY. Never text, at any size.
   Do not use orange for body copy or pink for type. Both fail WCAG AA there.
   =========================================================================== */

/* --- Self-hosted fonts. Both SIL OFL 1.1; see assets/fonts/FONTS.md ------
   Loaded from this origin because the site's CSP is default-src 'self'.
   A CDN font would breach that policy, add a third party to the render
   path, and leak visitor IPs. ------------------------------------------- */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-var.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martianmono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martianmono-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette */
  --bone: #f3ede3;
  --ink: #17150f;
  --ink-60: rgba(23, 21, 15, 0.62);
  --orange: #e2571e;
  --pink: #e8628c;

  /* Type */
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing scale */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.75rem;
  --s4: 3rem;
  --s5: 5rem;

  --rule: 2px solid var(--ink);
  --measure: 46ch;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.6;
  position: relative;
}

/* Halftone print texture - the direction's signature surface. Sits behind
   everything and never intercepts pointer events. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(var(--ink) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--s3);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- Manifest bar ------------------------------------------------------- */

.manifest {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  align-items: baseline;
  padding: var(--s2) 0;
  border-bottom: var(--rule);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.manifest .spacer {
  margin-left: auto;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s5) 0 var(--s4);
  gap: var(--s3);
}

/* Mission patch. Built from stacked radial gradients so it needs no image
   file and stays crisp at any size. */
.patch {
  width: clamp(8rem, 22vw, 11.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 118%, var(--pink) 0 42%, transparent 42%),
    radial-gradient(circle at 50% 32%, var(--orange) 0 24%, transparent 24%),
    var(--bone);
  box-shadow:
    0 0 0 7px var(--bone),
    0 0 0 10px var(--ink);
}

.patch span {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.8;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.wordmark {
  margin: 0;
  font-variation-settings: "wdth" 112, "wght" 900;
  font-size: clamp(2.6rem, 11vw, 6rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

/* Orange is legible here only because this is very large display type. */
.wordmark .b {
  display: block;
  color: var(--orange);
}

.tagline {
  margin: 0;
  font-variation-settings: "wdth" 100, "wght" 600;
  font-size: clamp(1.05rem, 3.2vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.blurb {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-60);
  font-size: 1rem;
}

/* --- Status stub -------------------------------------------------------- */

.stub {
  display: flex;
  width: 100%;
  border: var(--rule);
  background: var(--bone);
  text-align: left;
}

.stub div {
  flex: 1;
  padding: var(--s2);
  border-right: 2px dashed var(--ink);
}

.stub div:last-child {
  border-right: 0;
}

.stub b {
  display: block;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.stub p {
  margin: 0.35rem 0 0;
  font-variation-settings: "wdth" 104, "wght" 800;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

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

.foot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 60rem;
  margin: var(--s4) auto 0;
  padding: var(--s2) var(--s3) var(--s3);
  border-top: var(--rule);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
}

.foot .spacer {
  margin-left: auto;
}

/* --- Entrance ----------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }
  .hero > *:nth-child(1) { animation-delay: 0.05s; }
  .hero > *:nth-child(2) { animation-delay: 0.15s; }
  .hero > *:nth-child(3) { animation-delay: 0.25s; }
  .hero > *:nth-child(4) { animation-delay: 0.35s; }
  .hero > *:nth-child(5) { animation-delay: 0.45s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(0.9rem); }
    to   { opacity: 1; transform: none; }
  }
}

/* --- Narrow ------------------------------------------------------------- */

@media (max-width: 40rem) {
  .shell { padding: 0 var(--s2); }
  .foot { padding-left: var(--s2); padding-right: var(--s2); }
  .hero { padding: var(--s4) 0 var(--s3); gap: var(--s2); }
  .stub { display: grid; grid-template-columns: 1fr 1fr; }
  .stub div { border-right: 0; border-bottom: 2px dashed var(--ink); }
  .stub div:nth-child(odd) { border-right: 2px dashed var(--ink); }
  .stub div:nth-last-child(-n + 2) { border-bottom: 0; }
  .manifest { font-size: 0.55rem; letter-spacing: 0.12em; }
  .manifest .spacer { margin-left: 0; }
}

@media print {
  body::before { display: none; }
}
