/* ==========================================================================
   Lanternbeak: Sea Riddle — global layer
   Tokens, reset, typography, header, store buttons, footer, sticky CTA.
   Mobile-first: base rules target <= 768px, min-width queries enhance.
   ========================================================================== */

:root {
  /* Deep Tide with Lantern Amber */
  --abyss:        #08202e;
  --deep:         #0b2a3a;
  --tide:         #123f57;
  --tide-line:    #22566f;
  --brass:        #b98a3f;
  --lantern:      #f4a83c;
  --lantern-soft: #ffd28a;
  --foam:         #f2f6f8;
  --mist:         #b9cbd6;
  --ink:          #08202e;
  --disabled-bg:  #2a2a2a;
  --disabled-fg:  #f0f0f0;

  --shell:  1120px;
  --radius: 14px;
  --radius-lg: 26px;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 56px;
}

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

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

body {
  margin: 0;
  background: var(--abyss);
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--lantern); text-decoration: none; }
a:hover { color: var(--lantern-soft); }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--foam);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

/* Keep anchor targets clear of the sticky header */
section[id], #top { scroll-margin-top: calc(var(--header-h) + 10px); }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  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 {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--lantern); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Shared eyebrow label with a chart-rule tick */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--lantern);
}
.eyebrow-rule {
  width: 28px; height: 1px; flex: none;
  background: linear-gradient(90deg, var(--brass), transparent);
}

/* --------------------------------------------------------------------------
   Sticky header — 56px mobile / 64px desktop
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 32, 46, 0.94);
  border-bottom: 1px solid var(--tide-line);
  backdrop-filter: blur(10px);
}

.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  border: 1px solid var(--tide-line);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700; color: var(--foam);
  letter-spacing: 0.01em; white-space: nowrap;
}

.header-nav { display: none; }

.header-cta {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  border-radius: 12px;
  background: var(--lantern); color: var(--ink);
  border: 1px solid var(--lantern-soft);
  font-weight: 700;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.header-cta-text { display: none; }
.header-cta:hover { background: var(--lantern-soft); color: var(--ink); }
.header-cta:active { transform: scale(0.95); }

/* --------------------------------------------------------------------------
   Store buttons — engraved brass plates
   -------------------------------------------------------------------------- */

.store-row {
  display: flex; flex-direction: column; gap: 12px;
  margin: 0 0 22px;
}
.store-row--center { align-items: stretch; }

.store-btn {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 60px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.store-btn-glyph { display: flex; flex: none; }
.store-btn-text { display: flex; flex-direction: column; line-height: 1.2; }
.store-btn-top {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.85;
}
.store-btn-brand {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; letter-spacing: 0.01em;
}

/* Live Google Play plate */
.store-btn--live {
  background: linear-gradient(180deg, #f6b552, var(--lantern));
  color: var(--ink);
  border: 1px solid #ffdda0;
  box-shadow: 0 6px 0 0 #9a6a21, 0 12px 24px -12px rgba(244, 168, 60, 0.7);
}
.store-btn--live:hover { color: var(--ink); transform: translateY(-2px); }
.store-btn--live:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 0 #9a6a21, 0 6px 14px -10px rgba(244, 168, 60, 0.6);
}

/* Disabled App Store plate — neutral grey, never brand-coloured */
.store-btn--soon {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  border: 1px solid #454545;
  opacity: 0.55;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

.store-btn-flag {
  position: absolute; top: -9px; right: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #3d3d3d;
  border: 1px solid #5a5a5a;
  color: var(--disabled-fg);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}

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

.site-footer {
  background: #061a26;
  border-top: 1px solid var(--tide-line);
  padding: 40px 0 calc(96px + env(safe-area-inset-bottom));
}

.footer-inner { display: flex; flex-direction: column; gap: 20px; }

.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img {
  width: 48px; height: 48px; flex: none;
  border-radius: 12px; border: 1px solid var(--tide-line);
}
.footer-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700; color: var(--foam);
}
.footer-tag { margin: 2px 0 0; font-size: 14px; color: var(--mist); }

.footer-links, .footer-legal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  font-size: 15px;
}
.footer-links a, .footer-legal a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: var(--mist);
}
.footer-links a:hover, .footer-legal a:hover { color: var(--lantern); }
.footer-legal { border-top: 1px solid var(--tide-line); padding-top: 10px; }
.footer-sep { color: var(--tide-line); }

.footer-copy { margin: 0; font-size: 14px; color: #92a8b5; }

/* --------------------------------------------------------------------------
   Mobile sticky CTA bar
   -------------------------------------------------------------------------- */

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 42, 58, 0.97);
  border-top: 1px solid var(--tide-line);
  backdrop-filter: blur(10px);
  transform: translateY(110%);
  transition: transform 0.3s var(--ease);
}
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta[hidden] { display: none; }

.sticky-cta img {
  width: 40px; height: 40px; flex: none;
  border-radius: 10px; border: 1px solid var(--tide-line);
}
.sticky-cta-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sticky-cta-name {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--foam);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sticky-cta-sub { font-size: 13px; color: var(--mist); }

.sticky-cta-btn {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border-radius: 12px;
  background: var(--lantern); color: var(--ink);
  font-weight: 700; font-size: 15px;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.sticky-cta-btn:hover { background: var(--lantern-soft); color: var(--ink); }
.sticky-cta-btn:active { transform: scale(0.96); }

/* --------------------------------------------------------------------------
   Desktop enhancements
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  :root { --header-h: 64px; }

  body { font-size: 17px; }

  .shell { padding-inline: 32px; }

  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 20px; }

  .header-nav {
    display: flex; align-items: center; gap: 26px;
    margin-left: 32px;
    font-size: 15px; font-weight: 600;
  }
  .header-nav a {
    display: inline-flex; align-items: center;
    min-height: 44px;
    color: var(--mist);
  }
  .header-nav a:hover { color: var(--lantern); }

  .header-cta { padding: 0 20px; gap: 8px; }
  .header-cta-text { display: inline; font-size: 15px; }
  .header-cta-icon { display: none; }

  .store-row { flex-direction: row; flex-wrap: wrap; }
  .store-row--center { justify-content: center; }
  .store-btn { width: auto; min-width: 218px; }

  .footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px 32px;
  }
  .footer-brand { grid-column: 1; }
  .footer-links { grid-column: 2; justify-content: flex-end; }
  .footer-legal { grid-column: 1 / -1; justify-content: flex-start; }
  .footer-copy { grid-column: 1 / -1; }

  .site-footer { padding-bottom: 40px; }

  /* Sticky bar is a mobile-only affordance */
  .sticky-cta { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
