/* Feather & Heart: The Last Ferry. One stylesheet for the whole site.
   The cyberart look (demos/ferry/ART.md): saturated ultramarine darks, molten amber light,
   electric violet dark, cyan for interaction, dark-glass panels over a painted sky.
   No web fonts, no external resources, no scripts. */

:root {
  --void: #01020f;
  --abyss: #020536;
  --deep: #04126a;
  --ultra: #1a2fd6;
  --cobalt: #2b5cff;
  --electric: #4f8dff;
  --sky: #7fc4ff;
  --ice: #d9ecff;
  --ink: #eaf2ff;
  --ink-2: #b9c8ef;
  --cyan: #2de2ff;
  --violet: #9b4dff;
  --violet-hi: #e7a6ff;
  --amber: #ffc65a;
  --amber-hi: #fff1c2;
  --amber-lo: #c9701a;
  --glass: rgba(2, 5, 54, 0.74);
  --glass-edge: rgba(79, 141, 255, 0.55);
  --radius: 18px;
  --wrap: 68rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font: 1.0625rem/1.6 var(--sans);
  color: var(--ink);
  background: var(--void);
  overflow-x: hidden;
}

/* The night behind every page: a fixed layer, so iOS doesn't repaint a fixed background. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(155, 77, 255, 0.28), transparent 70%),
    radial-gradient(50rem 36rem at 0% 30%, rgba(43, 92, 255, 0.22), transparent 70%),
    radial-gradient(40rem 30rem at 70% 110%, rgba(255, 178, 58, 0.10), transparent 70%),
    linear-gradient(180deg, var(--abyss) 0%, var(--deep) 45%, var(--abyss) 80%, var(--void) 100%);
}

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

a { color: var(--cyan); text-underline-offset: 0.18em; }
a:hover { color: var(--ice); }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ice);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.3rem, 7vw, 4rem); }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--ice); }
.muted { color: var(--ink-2); }
small, .small { font-size: 0.9rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 46rem); margin-inline: auto; }

.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;
}

/* Skip link, visible on focus only */
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--amber); color: #1d0e00; padding: 0.6rem 1rem; border-radius: 10px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(1, 2, 15, 0.72);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(79, 141, 255, 0.25);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3.75rem; flex-wrap: wrap; padding-block: 0.4rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--ice); text-decoration: none; font-family: var(--serif); font-size: 1.15rem;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 14px rgba(255, 198, 90, 0.35); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.55rem 0.8rem; min-height: 44px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 0.98rem;
}
.site-nav a:hover { color: var(--ice); background: rgba(45, 226, 255, 0.08); }
.site-nav a[aria-current="page"] { color: var(--ice); box-shadow: inset 0 0 0 1px rgba(45, 226, 255, 0.6); }

/* Hero over the painted dusk sky */
.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: url("assets/sky-dusk.webp") center 38% / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(1, 2, 15, 0.35) 0%, rgba(2, 5, 54, 0.45) 55%, var(--abyss) 100%),
    radial-gradient(80% 60% at 20% 40%, rgba(1, 2, 15, 0.55), transparent 70%);
}
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
.hero-text { max-width: 36rem; }
.hero-title { margin-bottom: 0.1em; text-shadow: 0 2px 24px rgba(2, 5, 54, 0.9); }
.hero-sub {
  font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 1.6rem); color: var(--amber-hi);
  margin-bottom: 1.2rem; text-shadow: 0 0 18px rgba(255, 178, 58, 0.45);
}
.hero-icon {
  width: 88px; height: 88px; border-radius: 20px; margin-bottom: 1.2rem;
  box-shadow: 0 0 0 1px rgba(255, 241, 194, 0.35), 0 0 34px rgba(255, 178, 58, 0.45);
}
.hero .lead { text-shadow: 0 1px 12px rgba(1, 2, 15, 0.9); }
.hero-shot { justify-self: center; }

@media (min-width: 52rem) {
  .hero .wrap { grid-template-columns: 1.25fr 1fr; }
}

/* Slow drift of the sky: everything moves, gently. Off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: drift 60s ease-in-out infinite alternate; transform-origin: 60% 40%; }
  @keyframes drift {
    from { transform: scale(1.04) translate3d(0, 0, 0); }
    to { transform: scale(1.12) translate3d(-1.5%, 1%, 0); }
  }
}

/* App Store area: a placeholder until the official badge can be used */
.store {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.2rem; margin-top: 1.6rem;
}
.store-soon {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 56px; padding: 0.55rem 1.2rem; border-radius: 14px;
  border: 1px dashed rgba(217, 236, 255, 0.6);
  background: rgba(1, 2, 15, 0.6);
  color: var(--ice); line-height: 1.25;
}
.store-soon span { font-size: 0.8rem; color: var(--ink-2); }
.store-soon strong { font-size: 1.15rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.9rem; color: var(--ice);
  background: rgba(2, 5, 54, 0.7); border: 1px solid rgba(45, 226, 255, 0.45);
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0.7rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  color: #241000;
  background: linear-gradient(180deg, var(--amber-hi) 0%, var(--amber) 45%, #f49d2b 100%);
  box-shadow: 0 0 22px rgba(255, 178, 58, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.button:hover { color: #241000; filter: brightness(1.05); }
.button.secondary {
  color: var(--ice); background: rgba(2, 5, 54, 0.75);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

/* Screenshot card. Deliberately NOT a drawn iPhone: Apple's marketing guidelines allow only Apple's own
   unmodified device bezels and forbid illustrations standing in for an Apple product. So a screenshot sits on a
   plain glass card: rounded corners, a thin electric edge and a soft glow, like the game's own panels. */
.phone {
  margin: 0;
  width: min(100%, 15rem);
  border-radius: 16px;
  overflow: hidden;
  background: var(--abyss);
  border: 1px solid rgba(79, 141, 255, 0.6);
  box-shadow: 0 16px 44px rgba(1, 2, 15, 0.75), 0 0 32px rgba(45, 226, 255, 0.16);
}
.phone img { width: 100%; aspect-ratio: 460 / 1000; object-fit: cover; }
.hero-shot.phone { width: min(70vw, 17rem); }
.phone + figcaption, figure figcaption { font-size: 0.92rem; color: var(--ink-2); margin-top: 0.8rem; text-align: center; }

/* Sections */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head { max-width: 44rem; margin-bottom: 2rem; }
.eyebrow {
  display: block; margin-bottom: 0.4rem;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan);
}

/* Dark glass panel */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: 0 0 18px rgba(79, 141, 255, 0.22), inset 0 1px 0 rgba(217, 236, 255, 0.12);
  padding: clamp(1.2rem, 3.5vw, 2rem);
}

/* Promise row: three cards */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card h3 { display: flex; align-items: center; gap: 0.6rem; }
.card p:last-child { margin-bottom: 0; }
.card svg { flex: none; width: 30px; height: 30px; }

/* The five puzzles */
.games { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); }
.game { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.game .phone { width: 100%; max-width: 13rem; }
.game h3 { margin: 1rem 0 0.25rem; font-size: 1.2rem; }
.game p { margin: 0; color: var(--ink-2); font-size: 0.95rem; max-width: 17rem; }

/* Two-column feature: text beside shots */
.feature { display: grid; gap: 2rem; align-items: center; }
.feature .shots { display: flex; gap: 1rem; justify-content: center; }
.feature .shots .phone { width: min(44vw, 14rem); }
@media (min-width: 52rem) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature.flip .shots { order: -1; }
}

ul.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.5rem; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.6em;
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 10px rgba(255, 198, 90, 0.8);
}
ul.ticks.violet li::before { background: var(--violet-hi); box-shadow: 0 0 10px rgba(155, 77, 255, 0.9); }

/* Screenshot strip: scrolls sideways on phones */
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(62vw, 13.5rem); gap: 1.2rem;
  overflow-x: auto; padding: 0.6rem 0.4rem 1.4rem; scroll-snap-type: x mandatory;
  scrollbar-color: var(--electric) transparent;
}
.strip figure { margin: 0; scroll-snap-align: center; }
.strip .phone { width: 100%; }

/* Long-form pages (privacy, support, press) */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.prose h2 { margin-top: 2.4rem; font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .glass { margin: 1.4rem 0; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.97rem; }
caption { text-align: left; color: var(--ink-2); padding-bottom: 0.4rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.7rem; border-bottom: 1px solid rgba(79, 141, 255, 0.28); }
th { color: var(--ice); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.facts th { width: 38%; color: var(--ink-2); font-weight: 500; }

details {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 14px;
  margin: 0 0 0.8rem; padding: 0 1.1rem;
}
details[open] { box-shadow: 0 0 16px rgba(45, 226, 255, 0.15); }
summary {
  cursor: pointer; padding: 0.95rem 0; font-weight: 600; color: var(--ice);
  list-style-position: outside; min-height: 44px;
}
details > :not(summary) { margin-top: 0; }
details > :last-child { margin-bottom: 1rem; }

/* Notices */
.draft {
  border: 2px dashed var(--amber); border-radius: 14px; padding: 1rem 1.2rem; margin: 0 0 1.5rem;
  background: rgba(201, 112, 26, 0.12); color: var(--amber-hi);
}
.draft strong { color: var(--amber); }
.summary { border-color: rgba(45, 226, 255, 0.6); }

/* Placeholders that must be filled before launch: grep for class="ph" */
.ph {
  color: var(--amber-hi);
  background: rgba(201, 112, 26, 0.18);
  border-bottom: 1px dashed var(--amber);
  padding: 0 0.2em; border-radius: 3px;
}

/* Press image grid */
.press-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.press-grid figure { margin: 0; text-align: center; }
.press-grid .phone { width: 100%; border-radius: 12px; }
.press-grid figcaption { font-size: 0.85rem; }
.logo-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.logo-row img { width: 128px; height: 128px; border-radius: 28px; }
.placeholder-box {
  display: grid; place-items: center; width: 220px; height: 128px; border-radius: 14px;
  border: 1px dashed rgba(217, 236, 255, 0.5); color: var(--ink-2); font-size: 0.9rem; text-align: center; padding: 0.5rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem; padding: 2.5rem 0 3rem;
  border-top: 1px solid rgba(79, 141, 255, 0.25);
  background: rgba(1, 2, 15, 0.6);
  color: var(--ink-2); font-size: 0.95rem;
}
.site-footer .wrap { display: grid; gap: 1.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ice); }
.site-footer p { margin: 0; }
.legal-small { font-size: 0.82rem; }

@media (min-width: 52rem) {
  .site-footer .wrap { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

/* Small utilities (the pages use no inline styles, so the CSP needs no 'unsafe-inline') */
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mt-s { margin-top: 1rem; }
.flush { margin-inline: 0; }
.center { text-align: center; }
.store.center { justify-content: center; }
.feature.top { align-items: start; }
.icon-fig { margin: 0; text-align: center; }
.lost { padding: 5rem 0; }
.lost-icon { margin: 0 auto 1.5rem; border-radius: 22px; }

/* Calm everything for reduced motion; also no smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Forced colours (Windows high contrast) keep frames and focus visible */
@media (forced-colors: active) {
  .phone, .glass, details, .store-soon { border: 1px solid CanvasText; }
}

@media print {
  body::before, .hero::before, .hero::after, .site-header, .skip { display: none; }
  body { background: #fff; color: #000; }
  h1, h2, h3, .lead, .muted { color: #000; }
  .glass, details { background: none; box-shadow: none; border: 1px solid #999; }
  a { color: #000; }
}
