/*
  Coconut Invasion — shared styles.

  Palette is lifted directly from the game (Sources/Data/Palette.swift) so the
  site and the app read as one thing. Type is a monospace stack, matching the
  Menlo the game's HUD uses.

  No external requests: no web fonts, no CDN, no analytics. That is a deliberate
  match for the app's "collects nothing" promise — a privacy page that loads a
  tracker would be self-refuting.

  Nor is there any JavaScript. `_headers` sends `default-src 'none'` with no
  `script-src` at all, so a script would not run even if one were added — and
  the interactive parts of this site are built to live inside that. The officer
  roster is a labelled radio group driven by `:checked ~`, the enemy dossier is
  `<details>`, and the scroll reveals are `animation-timeline: view()` that
  degrade to plain visible content. All of it works with a keyboard.

  The same policy forbids inline `style=` attributes, which is why there are
  utility classes here for things that would otherwise be one-off inline rules.
*/

:root {
  --void: #0b0b2a;
  --void-deep: #07071c;
  --shadow: #2a2a5e;
  --cyan: #22e6ff;
  --magenta: #ff3ea5;
  --lime: #b6ff3e;
  --amber: #ffd23e;
  --white: #f2f7ff;
  --muted: #9aa3c7;

  --measure: 68ch;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--white);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  /* Faint nebula wash, drawn in CSS so there is nothing extra to load. */
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 62, 165, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 45% at 85% 15%, rgba(34, 230, 255, 0.09), transparent 60%);
  background-attachment: fixed;
}

/* Skip link: keyboard users shouldn't have to tab the whole nav. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cyan);
  color: var(--void);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.site-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(42, 42, 94, 0.7);
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cyan);
  text-decoration: none;
  font-size: 1.05rem;
}
.wordmark span { color: var(--magenta); }

.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--cyan); border-bottom-color: var(--cyan); }
.site-nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--magenta); }

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

.hero { padding: 4.5rem 0 3rem; text-align: center; }

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 5rem);
  letter-spacing: 0.06em;
  color: var(--cyan);
  line-height: 1.05;
  text-shadow: 0 0 28px rgba(34, 230, 255, 0.28);
}

.hero .tagline {
  margin: 1rem 0 0;
  color: var(--magenta);
  letter-spacing: 0.22em;
  font-size: clamp(0.72rem, 2.6vw, 0.95rem);
}

.hero .pitch {
  margin: 2rem auto 0;
  max-width: 52ch;
  color: var(--white);
  opacity: 0.86;
}

.cta-row {
  margin-top: 2.5rem;
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  text-transform: uppercase;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover, .btn:focus-visible { background: var(--cyan); color: var(--void); }

.btn.primary { border-color: var(--lime); color: var(--lime); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--lime); color: var(--void); }

/* Disabled until the App Store listing exists. Rendered as a non-link so it
   cannot be clicked through to a dead page. */
.btn.pending {
  border-color: var(--shadow);
  color: var(--muted);
  cursor: default;
}

/* ---------------------------------------------------------------- shots */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.1rem;
  padding: 1rem 0 3.5rem;
}

.shots figure { margin: 0; }

.shots img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid rgba(42, 42, 94, 0.9);
  border-radius: 10px;
  background: var(--void-deep);
}

.shots figcaption {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

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

section { padding: 3rem 0; border-top: 1px solid rgba(42, 42, 94, 0.55); }

h2 {
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 1.6rem;
}

h3 {
  font-size: 1rem;
  color: var(--cyan);
  margin: 2rem 0 0.6rem;
  letter-spacing: 0.04em;
}

p { max-width: var(--measure); }

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
}
.features li { border-left: 2px solid var(--magenta); padding-left: 1rem; }
.features strong { display: block; color: var(--white); letter-spacing: 0.04em; }
.features span { color: var(--muted); font-size: 0.9rem; }

.story p { color: var(--muted); }
.story p:first-of-type { color: var(--white); }

/* A short, loud statement of the privacy position. */
.promise {
  border: 1px solid var(--lime);
  padding: 1.6rem;
  border-radius: 10px;
  background: rgba(182, 255, 62, 0.04);
}
.promise p { margin: 0; max-width: none; }
.promise strong { color: var(--lime); }

/* ---------------------------------------------------------------- prose */

.prose { padding: 3rem 0 1rem; }
.prose h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin: 0 0 0.4rem;
}
.prose .updated {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 2.5rem;
}
.prose h2 {
  color: var(--magenta);
  font-size: 0.85rem;
  margin-top: 2.6rem;
}
.prose ul { max-width: var(--measure); color: var(--muted); padding-left: 1.2rem; }
.prose li { margin: 0.4rem 0; }
.prose a { color: var(--cyan); }

dl.faq { max-width: var(--measure); }
dl.faq dt {
  color: var(--white);
  margin-top: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
dl.faq dd { margin: 0.5rem 0 0; color: var(--muted); }

code {
  background: rgba(42, 42, 94, 0.55);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--amber);
  font-size: 0.9em;
}

a.mail { color: var(--amber); }

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

.site-foot {
  border-top: 1px solid rgba(42, 42, 94, 0.7);
  padding: 2.5rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.site-foot a { color: var(--muted); }
.site-foot a:hover, .site-foot a:focus-visible { color: var(--cyan); }
.site-foot nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- a11y */

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- utility */

/* Visually hidden but still focusable. `display:none` would drop the officer
   radios out of the tab order and break keyboard use entirely. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.promise-more { margin-top: 1rem; }

.footnote {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
  max-width: var(--measure);
}

.lede { color: var(--white); opacity: 0.9; }

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

.alert {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.6rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 62, 165, 0.85);
  background: rgba(255, 62, 165, 0.12);
  color: var(--magenta);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 3px;
}
.alert .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--magenta);
  animation: blip 1.4s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.hero-boss {
  display: block;
  width: min(320px, 62vw);
  height: auto;
  margin: 3rem auto 0;
  filter: drop-shadow(0 0 40px rgba(255, 62, 165, 0.28));
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-14px) rotate(1.2deg); }
}

/* ---------------------------------------------------------------- acts */

.act-label {
  margin: 0 0 0.5rem;
  color: var(--lime);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.act h2 {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--cyan);
  margin: 0 0 1.4rem;
}

/* ---------------------------------------------------------------- timeline */

.timeline {
  list-style: none;
  margin: 2.5rem 0;
  padding: 0 0 0 1.6rem;
  border-left: 1px solid var(--shadow);
  max-width: var(--measure);
}

.timeline li {
  position: relative;
  padding: 0 0 1.8rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem - 5px);
  top: 0.55rem;
  width: 9px; height: 9px;
  background: var(--cyan);
  border-radius: 50%;
}
.timeline li.danger::before {
  background: var(--magenta);
  box-shadow: 0 0 0 5px rgba(255, 62, 165, 0.18);
}

.timeline .stamp {
  display: block;
  color: var(--amber);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}
.timeline p { margin: 0.25rem 0 0; max-width: none; }
.timeline li.danger p { color: var(--magenta); }

/* ---------------------------------------------------------------- dossier */

.dossier {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.file {
  border: 1px solid var(--shadow);
  border-radius: 8px;
  background: rgba(7, 7, 28, 0.6);
  overflow: hidden;
}
.file[open] { border-color: var(--magenta); }

.file summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  list-style: none;
}
.file summary::-webkit-details-marker { display: none; }
.file summary:hover { background: rgba(34, 230, 255, 0.05); }
.file summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}

.file summary img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: none;
}

.file-name {
  color: var(--white);
  letter-spacing: 0.05em;
  font-weight: 700;
}
.file-role {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: auto;
  text-align: right;
}

/* The chevron doubles as the open/closed state, since the marker is hidden. */
.file summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.1rem;
  flex: none;
}
.file[open] summary::after { content: "–"; }

.file-body {
  padding: 0 1.1rem 1.2rem;
  border-top: 1px solid rgba(42, 42, 94, 0.6);
}
.file-body p { margin: 1rem 0 0; color: var(--muted); }

.stat {
  font-size: 0.82rem;
  color: var(--muted);
}
.stat span {
  display: inline-block;
  min-width: 8.5em;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* ---------------------------------------------------------------- roster */

.roster {
  margin-top: 2rem;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .roster { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
}

.roster-list { display: grid; gap: 2px; }

.roster-list label {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.roster-list label b {
  color: var(--shadow);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: none;
  min-width: 4.4em;
}
.roster-list label:hover { background: rgba(34, 230, 255, 0.06); color: var(--white); }

.roster-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  min-height: 15rem;
}

/* Bubbles stack in one grid cell; the checked radio reveals exactly one. */
.bubble {
  grid-area: 1 / 1;
  align-self: start;
  position: relative;
  border: 1.5px solid rgba(255, 62, 165, 0.9);
  background: rgba(7, 7, 28, 0.94);
  border-radius: 8px;
  padding: 1rem 1.2rem 1.2rem;
  visibility: hidden;
  opacity: 0;
}
/* The tail, pointing down-right at the officer. */
.bubble::after {
  content: "";
  position: absolute;
  right: 2.2rem;
  bottom: -13px;
  width: 22px; height: 13px;
  background: rgba(7, 7, 28, 0.94);
  border-right: 1.5px solid rgba(255, 62, 165, 0.9);
  border-bottom: 1.5px solid rgba(255, 62, 165, 0.9);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.bubble-head {
  margin: 0;
  color: var(--cyan);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
}
.bubble-who {
  margin: 0.5rem 0 0;
  color: var(--amber);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.bubble-line {
  margin: 0.5rem 0 0;
  color: var(--white);
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  line-height: 1.5;
  max-width: 34ch;
}

.officer-art {
  grid-area: 1 / 2;
  align-self: end;
  width: min(170px, 34vw);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(255, 62, 165, 0.25));
}

/* The whole interaction, in ten pairs of rules. Each radio reveals its bubble
   and lights its label; everything else stays hidden. */
#of1:checked  ~ .roster-stage #say1,
#of2:checked  ~ .roster-stage #say2,
#of3:checked  ~ .roster-stage #say3,
#of4:checked  ~ .roster-stage #say4,
#of5:checked  ~ .roster-stage #say5,
#of6:checked  ~ .roster-stage #say6,
#of7:checked  ~ .roster-stage #say7,
#of8:checked  ~ .roster-stage #say8,
#of9:checked  ~ .roster-stage #say9,
#of10:checked ~ .roster-stage #say10 {
  visibility: visible;
  opacity: 1;
  animation: transmit 0.28s ease-out;
}
@keyframes transmit {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

#of1:checked  ~ .roster-list label[for="of1"],
#of2:checked  ~ .roster-list label[for="of2"],
#of3:checked  ~ .roster-list label[for="of3"],
#of4:checked  ~ .roster-list label[for="of4"],
#of5:checked  ~ .roster-list label[for="of5"],
#of6:checked  ~ .roster-list label[for="of6"],
#of7:checked  ~ .roster-list label[for="of7"],
#of8:checked  ~ .roster-list label[for="of8"],
#of9:checked  ~ .roster-list label[for="of9"],
#of10:checked ~ .roster-list label[for="of10"] {
  background: rgba(255, 62, 165, 0.10);
  border-left-color: var(--magenta);
  color: var(--white);
}
#of1:checked  ~ .roster-list label[for="of1"] b,
#of2:checked  ~ .roster-list label[for="of2"] b,
#of3:checked  ~ .roster-list label[for="of3"] b,
#of4:checked  ~ .roster-list label[for="of4"] b,
#of5:checked  ~ .roster-list label[for="of5"] b,
#of6:checked  ~ .roster-list label[for="of6"] b,
#of7:checked  ~ .roster-list label[for="of7"] b,
#of8:checked  ~ .roster-list label[for="of8"] b,
#of9:checked  ~ .roster-list label[for="of9"] b,
#of10:checked ~ .roster-list label[for="of10"] b { color: var(--magenta); }

/* Keyboard users must be able to see which officer they are on. */
#of1:focus-visible  ~ .roster-list label[for="of1"],
#of2:focus-visible  ~ .roster-list label[for="of2"],
#of3:focus-visible  ~ .roster-list label[for="of3"],
#of4:focus-visible  ~ .roster-list label[for="of4"],
#of5:focus-visible  ~ .roster-list label[for="of5"],
#of6:focus-visible  ~ .roster-list label[for="of6"],
#of7:focus-visible  ~ .roster-list label[for="of7"],
#of8:focus-visible  ~ .roster-list label[for="of8"],
#of9:focus-visible  ~ .roster-list label[for="of9"],
#of10:focus-visible ~ .roster-list label[for="of10"] {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}

/* ---------------------------------------------------------------- fleet */

.fleet {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  max-width: var(--measure);
  counter-reset: hull;
}
.fleet li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(42, 42, 94, 0.5);
}
.fleet .hull {
  color: var(--white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
  min-width: 9em;
}
.fleet .note { color: var(--muted); font-size: 0.85rem; flex: 1 1 12ch; }
.fleet .req {
  color: var(--amber);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-left: auto;
}
.fleet .req.open { color: var(--lime); }

.pickups {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pickups li {
  border: 1px solid var(--shadow);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------- reveal */

/* Progressive: without scroll-driven animation support the content is simply
   there. Nothing is hidden by default, so this can never eat the page. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 55%;
    }
    @keyframes rise-in {
      from { opacity: 0; transform: translateY(14px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .bubble { transform: none !important; }
}
