/* FitBeat — fitbeat.me static site
   Palette + principles from 03-design/design-tokens.md and 04-app/lib/core/theme/app_colors.dart.
   Dark, single brass accent, "silent luxury / no AI feel". No external assets. */

:root {
  /* backgrounds & surfaces (app app_colors.dart) */
  --bg: #0E0F13;
  --surface: #16181F;
  --surface-raised: #1E212A;
  --border: #272B36;
  --ambient-top: #14161D;
  --ambient-bottom: #0B0C10;

  /* ink */
  --ink: #ECEEF2;
  --ink-2: #8A91A0;
  --ink-3: #5B606E;

  /* accent: brass (one color only) */
  --accent: #C7A14A;
  --accent-bright: #E6C871;
  --accent-deep: #9C7A2E;
  --accent-glow: rgba(199, 161, 74, 0.12);

  /* brand coral (logo only — matches the wordmark asset) */
  --coral: #E0564E;

  /* glass */
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-stroke: rgba(255, 255, 255, 0.12);
  --hairline: rgba(236, 238, 242, 0.10);

  --radius: 18px;
  --maxw: 1140px;
  --font: "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient backdrop: near-black base with two low-saturation brass glows that
   drift slowly and out of phase — a subtle "undulating" gradient. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--ambient-top) 0%, var(--bg) 46%, var(--ambient-bottom) 100%);
}
.backdrop::before,
.backdrop::after {
  content: "";
  position: absolute;
  inset: -35%;
  will-change: transform;
}
.backdrop::before {
  background: radial-gradient(42% 42% at 24% 26%, rgba(199, 161, 74, 0.11), transparent 70%);
  animation: undulateA 30s ease-in-out infinite alternate;
}
.backdrop::after {
  background: radial-gradient(46% 46% at 80% 70%, rgba(199, 161, 74, 0.075), transparent 70%);
  animation: undulateB 39s ease-in-out infinite alternate;
}
@keyframes undulateA {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4%, -3%, 0) scale(1.08); }
  100% { transform: translate3d(-3%, 3%, 0) scale(1.03); }
}
@keyframes undulateB {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  50%  { transform: translate3d(-4%, 3%, 0) scale(1); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .backdrop::before,
  .backdrop::after { animation: none; }
}

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; height: 26px; width: auto; }

/* ============================================================
   HOME
   ============================================================ */
.hero {
  min-height: 100svh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px clamp(22px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "left right"
    "footer footer";
  align-items: center;
  column-gap: clamp(28px, 5vw, 76px);
}

.hero-left { grid-area: left; max-width: 540px; }
.hero .brand { margin-bottom: clamp(32px, 6vh, 56px); }
.hero .brand img { height: clamp(30px, 4vw, 40px); }

.hero h1 {
  margin: 0 0 36px;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.24;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}
/* Brass accent gradient on the highlighted phrase (design-tokens Primary gradient). */
.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent), var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Intro sequence: logo only → heading types in → rest fades in.
   Hidden state applies only while JS has flagged .is-intro (no-JS shows all). ---------- */
.is-intro .hero h1 { visibility: hidden; }
.is-intro .reveal-later { opacity: 0; transform: translateY(12px); }
.reveal-later { transition: opacity 0.85s ease, transform 0.85s ease; }
.hero-right.reveal-later { transition-delay: 0.12s; }
.home-footer.reveal-later { transition-delay: 0.24s; }
/* blinking type caret */
.type-caret {
  display: inline-block;
  width: 2px;
  height: 0.92em;
  margin-left: 3px;
  vertical-align: -0.1em;
  background: var(--accent-bright);
  -webkit-text-fill-color: initial;
  animation: caretBlink 0.9s steps(1, end) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .reveal-later { transition: none; }
  .type-caret { display: none; }
}

/* App mockup carousel below the heading: 5 small iPhones, ~3 visible, edges fade,
   auto-advances one phone at a time (smooth, seamless loop via a duplicated set). */
.mockup-carousel {
  --pw: clamp(94px, 26vw, 116px);            /* phone width */
  --gap: clamp(12px, 3vw, 18px);
  --step: calc(var(--pw) + var(--gap));      /* one phone advance */
  width: calc(var(--pw) * 3 + var(--gap) * 2); /* ~3 phones visible */
  max-width: 100%;
  margin: 10px 0 40px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 17%, #000 83%, transparent 100%);
}
.mockup-track {
  display: flex;
  gap: var(--gap);
  width: max-content;
  will-change: transform;
  animation: phoneShift 16s ease-in-out infinite;
}
/* hold, then ease one phone over — five steps, then loop seamlessly onto the duplicates. */
@keyframes phoneShift {
  0%, 14%   { transform: translateX(0); }
  20%, 34%  { transform: translateX(calc(var(--step) * -1)); }
  40%, 54%  { transform: translateX(calc(var(--step) * -2)); }
  60%, 74%  { transform: translateX(calc(var(--step) * -3)); }
  80%, 94%  { transform: translateX(calc(var(--step) * -4)); }
  100%      { transform: translateX(calc(var(--step) * -5)); }
}
@media (prefers-reduced-motion: reduce) {
  .mockup-track { animation: none; }
}

.phone {
  flex: 0 0 var(--pw);
  width: var(--pw);
  aspect-ratio: 9 / 19.5;
  padding: 4px;
  border-radius: 22px;
  background: linear-gradient(150deg, #2b2e37, #101116 62%);   /* titanium bezel */
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.45),
    0 16px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-screen .phone-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
/* placeholder number (until real screenshots are dropped in) */
.ph-n {
  font-weight: 800;
  font-size: calc(var(--pw) * 0.34);
  color: rgba(236, 238, 242, 0.16);
  letter-spacing: -0.02em;
}

.home-footer {
  grid-area: footer;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
.home-footer a { color: var(--ink-2); text-decoration: none; }
.home-footer a:hover { color: var(--ink); }
.home-footer .sep { color: var(--border); }

/* ----- Right: coming-soon glass card ----- */
.hero-right { grid-area: right; display: flex; justify-content: center; }

.showcase {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 40px 36px 34px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
/* top hairline highlight (glass edge) */
.showcase::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236, 238, 242, 0.22), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
}

.showcase h2 {
  margin: 0 0 10px;
  font-size: 27px;
  letter-spacing: -0.01em;
  font-weight: 800;
  color: var(--ink);
}
.showcase p {
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 14.5px;
}

/* thin brass rule */
.rule {
  height: 2px;
  width: 52px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent), var(--accent-deep));
  margin: 0 0 26px;
}

/* App Store "coming soon" badge */
.appstore {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 22px;
  border-radius: 14px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
  color: #fff;
  transition: border-color 0.2s ease;
}
.appstore:hover { border-color: rgba(255, 255, 255, 0.32); }
.appstore .apple { width: 25px; height: 25px; flex: none; }
.appstore .txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.appstore .txt small { font-size: 11px; color: #b7b7bf; letter-spacing: 0.01em; }
.appstore .txt strong { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }

.showcase .note {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}
.showcase .note a { color: var(--ink-2); text-decoration: none; }
.showcase .note a:hover { color: var(--ink); }

/* ============================================================
   DOC PAGES (privacy / terms / support / delete-account)
   ============================================================ */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.site-header .brand img { height: 22px; }
.site-header nav { display: flex; gap: 22px; font-size: 14px; }
.site-header nav a { color: var(--ink-2); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }

.doc {
  max-width: 760px;
  margin: 8px auto 0;
  padding: clamp(24px, 4vw, 48px) clamp(22px, 5vw, 44px) 64px;
}
.doc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(28px, 5vw, 52px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.doc h1 {
  font-size: clamp(27px, 5vw, 37px);
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin: 0 0 6px;
  font-weight: 800;
}
.doc .updated { color: var(--ink-3); font-size: 13.5px; margin: 0 0 30px; }

.doc h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 38px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--ink);
}
.doc h2:first-of-type { border-top: none; padding-top: 0; }
.doc h3 { font-size: 16px; margin: 24px 0 10px; font-weight: 700; color: var(--ink); }

.doc p { color: var(--ink-2); margin: 0 0 16px; }
.doc strong { color: var(--ink); font-weight: 700; }
.doc a { color: var(--accent-bright); text-decoration: none; border-bottom: 1px solid rgba(230, 200, 113, 0.32); }
.doc a:hover { border-bottom-color: var(--accent-bright); }

.doc ul { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.doc li { margin-bottom: 8px; }

/* Important note: left brass rule, no fill flood */
.doc .callout {
  border-left: 2px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 14.5px;
}
.doc .callout strong { color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 0 0 22px; -webkit-overflow-scrolling: touch; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.doc th, .doc td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink-2);
}
.doc th { color: var(--ink); font-weight: 700; white-space: nowrap; }
.doc tr:last-child td { border-bottom: none; }

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: 8px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}
.contact-card .mail { font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: none; }
.btn-mail {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent), var(--accent-deep));
  color: #17130a;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-bottom: none;
}
.btn-mail:hover { filter: brightness(1.05); }

.doc-foot {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.doc-foot a { color: var(--ink-2); text-decoration: none; }
.doc-foot a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* Stack: branding panel, then card panel, then footer at the very end
     (footer is a sibling now, so it lands after the card — not mid-page). */
  .hero {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 0 clamp(22px, 5vw, 40px);
  }
  .hero-left {
    min-height: 100svh;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 0;
  }
  .hero-left .brand { margin-bottom: clamp(28px, 6vh, 52px); }

  .hero-right {
    min-height: 100svh;
    display: flex;
    align-items: center;      /* card centered in its full-height screen */
    justify-content: center;
    padding: 40px 0;
  }
  .showcase { max-width: 440px; width: 100%; }

  .home-footer { margin-top: 0; padding: 24px 0 34px; }
}
@media (max-width: 600px) {
  /* fit the 3-column table into the viewport instead of hiding a column behind scroll */
  .doc table { min-width: 0; font-size: 12.5px; }
  .doc th, .doc td { padding: 8px 9px; }
}
@media (max-width: 520px) {
  /* nav drops to its own line so the header never overflows on small phones */
  .site-header nav { gap: 16px; width: 100%; }
  .showcase { padding: 32px 26px 28px; }
  .home-footer { gap: 6px 14px; }
}
