/* ============================================================
   TallyCast — editorial pre-flight briefing aesthetic
   ============================================================ */

:root {
  /* Cockpit-night palette — shifted slightly off pure navy toward midnight
     indigo so cool/bluish watch screenshots read as distinct from the page. */
  --bg:           #0b0712;
  --bg-lift:     #14102a;
  --bg-card:     #181432;
  --fg:          #f3eddf;        /* warm near-white */
  --fg-muted:    #9aa1b8;
  --fg-faint:    #5a6280;
  --rule:        #1f2640;
  --rule-soft:   rgba(255, 255, 255, 0.06);

  /* Caution amber — the one accent */
  --amber:       #f5b942;
  --amber-soft:  rgba(245, 185, 66, 0.16);
  --sky:         #7fb3d5;        /* secondary, for inline links */

  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-prose:   "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max:         960px;
}

/* ---- Reset & base ---- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-prose);
  font-weight: 400;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Thin amber rule across the top edge — like a flag on a briefing card. */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(245, 185, 66, 0.3) 12%,
    rgba(245, 185, 66, 0.85) 50%,
    rgba(245, 185, 66, 0.3) 88%,
    transparent 100%);
  z-index: 50;
  pointer-events: none;
}

/* Subtle aeronautical-chart graticule. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(243, 237, 223, 0.035) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

body > * { position: relative; z-index: 1; }

a {
  color: var(--sky);
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 179, 213, 0.25);
  transition: color 160ms ease, border-color 160ms ease;
}
a:hover { color: var(--fg); border-bottom-color: var(--fg); }

::selection { background: var(--amber); color: #0b0712; }

/* ---- Typography primitives ---- */

h1, h2, h3 { margin: 0; font-weight: 400; }

.mono, .callsign, .cta-note, figcaption, .rubric .num, footer p {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

/* ---- Layout shell ---- */

.hero,
.pitches,
.join,
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding-top: 5.5rem;
  padding-bottom: 4rem;
  text-align: center;
}

.callsign {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7em;
  max-width: calc(100% - 1rem);
  padding: 0.45em 1.1em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  background: rgba(20, 26, 50, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.callsign .sep { color: var(--amber); opacity: 0.75; }
@media (max-width: 480px) {
  .callsign {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    gap: 0.55em;
    padding: 0.4em 0.9em;
  }
}

.logo {
  width: 88px;
  height: 88px;
  border-radius: 24%;
  margin: 0 auto 1.5rem;
  display: block;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 24px rgba(245, 185, 66, 0.08));
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 10vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 0.4em;
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  line-height: 1.35;
  color: var(--fg);
  margin: 0 0 1.1rem;
  letter-spacing: 0.005em;
}

.sub {
  max-width: 36rem;
  margin: 0 auto 2.4rem;
  color: var(--fg-muted);
  font-size: 1.025rem;
}

/* ---- CTA ---- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0b0712;
  background: var(--amber);
  padding: 0.95rem 1.6rem 0.9rem;
  border: 1px solid var(--amber);
  border-radius: 2px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 0 0 1px rgba(245, 185, 66, 0.0),
              0 10px 28px -8px rgba(245, 185, 66, 0.35);
}
.cta:hover {
  background: transparent;
  color: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(245, 185, 66, 0.4),
              0 12px 32px -8px rgba(245, 185, 66, 0.5);
}
.cta:active { transform: translateY(1px); }
.cta-arrow {
  display: inline-block;
  font-size: 1.05em;
  transform: translateX(0);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cta:hover .cta-arrow { transform: translateX(4px); }

.cta-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 1.1rem 0 0;
}

/* ============================================================
   SECTION RUBRICS  ("01 — In-flight glance")
   ============================================================ */

.rubric {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.5vw, 1.95rem);
  line-height: 1.2;
  color: var(--fg);
  margin: 0 0 1.6rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.rubric .num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  padding: 0.25em 0.55em;
  border: 1px solid var(--amber-soft);
  border-radius: 2px;
  background: var(--amber-soft);
  position: relative;
  top: -0.25em;
}

/* ============================================================
   PITCHES — "floating instruments" rhythm
   Watch faces are radial-masked so they dissolve into the page;
   each one carries a soft amber halo to feel "lit."
   Alternating rows + varied vertical offsets break the rigidity.
   ============================================================ */

.pitches {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  --face-size: clamp(260px, 38vw, 460px);
}

.instrument {
  display: grid;
  grid-template-columns: var(--face-size) 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  margin: clamp(1rem, 2.5vw, 2rem) 0;
  animation: rise 800ms cubic-bezier(0.16, 0.7, 0.2, 1) backwards;
}
.instrument:nth-of-type(1) { animation-delay:  40ms; }
.instrument:nth-of-type(2) { animation-delay: 120ms; }
.instrument:nth-of-type(3) { animation-delay: 200ms; }
.instrument:nth-of-type(4) { animation-delay: 280ms; }
.instrument:nth-of-type(5) { animation-delay: 360ms; }
.instrument:nth-of-type(6) { animation-delay: 440ms; }

/* Alternate: even-numbered instruments push the watch to the right column. */
.instrument:nth-of-type(even) {
  grid-template-columns: 1fr var(--face-size);
}
.instrument:nth-of-type(even) > .instrument__face { grid-column: 2; grid-row: 1; }
.instrument:nth-of-type(even) > .instrument__copy { grid-column: 1; grid-row: 1; text-align: right; justify-self: end; }
.instrument:nth-of-type(even) .instrument__copy p { margin-left: auto; }
.instrument:nth-of-type(even) .instrument__copy h3::before { left: auto; right: -1.6rem; }

/* ---- The face: a circular subject masked from the playstore screenshot. ---- */

.instrument__face {
  position: relative;
  width: var(--face-size);
  height: var(--face-size);
  margin: 0;
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.instrument:hover .instrument__face,
.instrument__face:hover {
  transform: scale(1.045);
}
@media (prefers-reduced-motion: reduce) {
  .instrument__face { transition: none; }
  .instrument:hover .instrument__face,
  .instrument__face:hover { transform: none; }
}

/* The image itself: object-fit cover into a square, then radial-masked
   so the watch face dissolves into the page background.
   The colored playstore backdrop bleeds softly through the fade zone,
   giving each watch its own ambient color. */
.instrument__face img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  -webkit-mask-image: radial-gradient(circle at 50% 50%,
    #000 0%,
    #000 34%,
    rgba(0, 0, 0, 0.78) 41%,
    rgba(0, 0, 0, 0.35) 49%,
    rgba(0, 0, 0, 0.10) 55%,
    transparent 62%);
          mask-image: radial-gradient(circle at 50% 50%,
    #000 0%,
    #000 34%,
    rgba(0, 0, 0, 0.78) 41%,
    rgba(0, 0, 0, 0.35) 49%,
    rgba(0, 0, 0, 0.10) 55%,
    transparent 62%);
}

/* ---- The copy: editorial weight, anchored to the watch. ---- */

.instrument__copy {
  position: relative;
  max-width: 30em;
}
.instrument__copy h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  color: var(--fg);
  margin: 0 0 0.7rem;
  position: relative;
}
/* a small amber rule before each heading — like a paragraph mark in a journal */
.instrument__copy h3::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 0.62em;
  width: 0.85rem;
  height: 1px;
  background: var(--amber);
}
.instrument__copy p {
  font-family: var(--font-prose);
  font-size: 1.05rem;
  line-height: 1.62;
  color: var(--fg-muted);
  margin: 0;
  max-width: 28em;
}


/* ============================================================
   Responsive: collapse to a single column.
   ============================================================ */

@media (max-width: 760px) {
  .pitches { --face-size: min(78vw, 360px); }
  .instrument,
  .instrument:nth-of-type(even) {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 1rem;
    margin: 2rem 0;
  }
  .instrument > .instrument__face,
  .instrument:nth-of-type(even) > .instrument__face {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
  }
  .instrument > .instrument__copy,
  .instrument:nth-of-type(even) > .instrument__copy {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    text-align: center;
    padding: 0;
    max-width: 32em;
  }
  .instrument__copy h3::before,
  .instrument:nth-of-type(even) .instrument__copy h3::before { display: none; }
  .instrument__copy p { margin: 0 auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .instrument { animation: none; }
}

/* ============================================================
   JOIN / CLOSING CTA
   ============================================================ */

.join {
  padding-top: 3.5rem;
  padding-bottom: 5rem;
  text-align: center;
}
.join .rubric {
  justify-content: center;
  border-bottom: 0;
  margin-bottom: 2rem;
  padding-bottom: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  padding-bottom: 3rem;
  font-size: 0.72rem;
  text-align: center;
  color: var(--fg-faint);
}
footer p { margin: 0.5rem 0; letter-spacing: 0.16em; }
footer a {
  color: var(--fg-muted);
  border-bottom-color: var(--rule);
}
footer a:hover { color: var(--fg); border-bottom-color: var(--fg-muted); }
footer .fineprint {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-prose);
  font-size: 0.78rem;
  max-width: 38rem;
  margin: 1rem auto 0;
  opacity: 0.7;
  line-height: 1.5;
}

/* ============================================================
   PROSE PAGES (privacy policy)
   ============================================================ */

.prose-nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}
.prose-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: none;
}
.prose-nav a:hover { color: var(--amber); }

.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  font-family: var(--font-prose);
  color: var(--fg-muted);
  line-height: 1.7;
}
.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1.05;
  color: var(--fg);
  margin: 1.2rem 0 0.5em;
  letter-spacing: -0.01em;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--fg);
  margin: 2.4rem 0 0.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  letter-spacing: -0.005em;
}
.prose p { margin: 0.8em 0; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose ul { padding-left: 1.2rem; margin: 0.8em 0; }
.prose li { margin: 0.45em 0; }
.prose code { font-size: 0.88em; }
.prose hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.4rem 0;
}

/* ============================================================
   PAGE-LOAD STAGGER
   ============================================================ */

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

.hero > * {
  animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.hero > *:nth-child(1) { animation-delay:  60ms; }
.hero > *:nth-child(2) { animation-delay: 160ms; }
.hero > *:nth-child(3) { animation-delay: 240ms; }
.hero > *:nth-child(4) { animation-delay: 320ms; }
.hero > *:nth-child(5) { animation-delay: 400ms; }
.hero > *:nth-child(6) { animation-delay: 480ms; }
.hero > *:nth-child(7) { animation-delay: 560ms; }

@media (prefers-reduced-motion: reduce) {
  .hero > * { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
