/* TipShark marketing site — minimal, Apple-clean */

:root {
  color-scheme: light dark;
  --page-bg: #f2f2f7;
  --header-bg: #ffffff;
  --footer-bg: #1c1c1e;
  --footer-text: rgba(235, 235, 245, 0.72);
  --footer-link: rgba(235, 235, 245, 0.9);
  --bg: #ffffff;
  --surface: rgba(0, 0, 0, 0.04);
  --text: #0b0b0f;
  --muted: rgba(60, 60, 67, 0.72);
  --hairline: rgba(60, 60, 67, 0.18);
  --accent: #0a84ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #000000;
    --header-bg: #000000;
    --footer-bg: #000000;
    --footer-text: rgba(235, 235, 245, 0.66);
    --footer-link: rgba(235, 235, 245, 0.92);
    --bg: #0b0b0f;
    --surface: rgba(255, 255, 255, 0.08);
    --text: #f5f5f7;
    --muted: rgba(235, 235, 245, 0.66);
    --hairline: rgba(235, 235, 245, 0.18);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  letter-spacing: -0.01em;
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Bulletproof container alignment for ALL sections */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
}

@media (max-width: 520px) {
  .container { padding: 0 16px; }
}

/* Header */
header {
  position: sticky;
  top: 16px;
  margin: 0 auto;
  width: 100%;
  max-width: 1040px;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 28px;
}

/* Reserve space while shared header is fetched (avoids layout jump). */
#shared-header:empty {
  min-height: 64px;
}

main .container {
  max-width: 880px;
}

.nav {
  height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 0 16px 0 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: none;
}

@media (max-width: 820px) {
  header { padding: 0 20px; top: 12px; }
  .nav { height: 56px; padding: 0 8px 0 16px; }
  #shared-header:empty { min-height: 56px; }
  main { padding: 40px 0 60px; }
}

@media (max-width: 520px) {
  header { padding: 0 16px; top: 10px; }
  .container { padding: 0 16px; }
  main .container { padding: 0 28px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  object-fit: cover;
  display: block;
}

.brand-name {
  font-weight: 560;
  font-size: 17px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.support-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  transition: color 0.15s;
}

.support-link:hover { color: var(--text); }

/* Download button */
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #008BFF;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1;
  user-select: none;
  border: none;
  box-shadow: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.download:hover {
  filter: brightness(1.03);
  box-shadow: none;
}
.download:active {
  transform: translateY(1px);
  filter: brightness(0.97);
}
.download[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 1; /* Keeps it strictly black as requested */
}

/* Mobile alternate style when CTA switches to Support */
.download.as-support {
  background: transparent;
  color: var(--muted);
  border: none;
  box-shadow: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 560;
  font-size: 14px;
  line-height: 1;
  justify-content: center;
}

/* Up/down appear transition when CTA mode flips on mobile */
.download.cta-swap {
  animation: ctaSwapY 220ms ease;
}

@keyframes ctaSwapY {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  65% {
    opacity: 1;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .nav-right { gap: 10px; }
  .support-link { display: none; }
}

/* Main */
main {
  flex: 1;
  padding: 60px 0 80px;
}

/* Hero Flexbox (prevents all grid auto-width skew bugs) */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-copy {
  flex: 1;
  min-width: 0;
  max-width: 540px;
  display: flex;
  flex-direction: column;
}

h1 {
  margin: 0 0 4px; /* Set exactly to 4px as requested */
  font-size: clamp(46px, 6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.text-accent {
  color: var(--accent);
}

.subtitle {
  margin: 0 0 18px; /* Reverted to 18px as previously requested */
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-flex;
}

.hero-badge img {
  height: 54px;
  width: auto;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .hero-badge img { filter: invert(1) hue-rotate(180deg); }
}

.shot {
  flex: 0 0 300px; /* Reverted back to 300px */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}

/* Subtle "earth" shadow under the phone (lives on the reel, not on .shot,
   so it sits under the phone — not under the pause button below it). */
.sprite-reel {
  position: relative;
  width: 100%;
}

.sprite-reel::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 10%;
  right: 10%;
  height: 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  filter: blur(8px);
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  .sprite-reel::after {
    background: rgba(255, 255, 255, 0.18);
    filter: blur(10px);
  }
}

.screenshot {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Hero sprite frames stack inside the reel */
.sprite-reel img {
  display: block;
  width: 100%;
  height: auto;
}

.sprite-reel img + img {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* Snap (no fade) animation: each frame visible for 1.5s, total 4.5s */
@media (prefers-reduced-motion: no-preference) {
  .sprite-f1 { animation: ts-f1 4.5s linear infinite; }
  .sprite-f2 { animation: ts-f2 4.5s linear infinite; }
  .sprite-f3 { animation: ts-f3 4.5s linear infinite; }
}

/* Frame 1: visible 0–1.5s, then off */
@keyframes ts-f1 {
  0%, 33.33%      { opacity: 1; }
  33.34%, 100%    { opacity: 0; }
}

/* Frame 2: visible 1.5s–3s */
@keyframes ts-f2 {
  0%, 33.33%      { opacity: 0; }
  33.34%, 66.66%  { opacity: 1; }
  66.67%, 100%    { opacity: 0; }
}

/* Frame 3: visible 3s–4.5s */
@keyframes ts-f3 {
  0%, 66.66%      { opacity: 0; }
  66.67%, 100%    { opacity: 1; }
}

/* Pause control for the sprite animation (WCAG 2.2.2) */
.sprite-reel.is-paused .sprite-f1,
.sprite-reel.is-paused .sprite-f2,
.sprite-reel.is-paused .sprite-f3 {
  animation-play-state: paused;
}

.sprite-toggle {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  margin: 18px auto 0;
  align-self: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.sprite-toggle:hover { background: rgba(0, 0, 0, 0.75); }
.sprite-toggle:active { transform: scale(0.94); }

/* Hide pause button when no motion is shown anyway */
@media (prefers-reduced-motion: reduce) {
  .sprite-toggle { display: none; }
}

/* Screen-reader only utility */
.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;
}

/* Visible focus indicators on every interactive element (a11y) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 820px) {
  main { padding: 40px 0 60px; }
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    transform: none;
  }
  .shot {
    flex: 0 0 auto;
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }
}

/* Footer */
footer {
  padding: 24px 0 32px;
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 13px;
}

footer a { color: var(--footer-link); }
footer a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
footer a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  border-radius: 4px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Legal pages */
.page-title {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}

.page-subtitle {
  margin: 0 0 32px;
  color: var(--muted);
  max-width: 70ch;
}

.legal {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
}

.legal h2 {
  margin: 24px 0 10px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.legal h2:first-child { margin-top: 0; }

.legal p, .legal li {
  color: color-mix(in oklab, var(--text) 85%, var(--muted));
  line-height: 1.6;
  font-size: 15px;
  margin-top: 0;
}

.legal ul { padding-left: 20px; }

.inline-link {
  color: var(--accent);
}
.inline-link:hover { text-decoration: underline; }

/* Accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  outline: 2px solid var(--accent);
  z-index: 9999;
}
