/* Shared by the MyBeat landing page (index.html) and its privacy page (privacy/index.html).
   Page-specific rules stay inline in each page.

   MyBeat's three-tier type system (Shared/Views/Typography.swift in the app):
     Large  — Rajdhani Bold     — titles, hero numbers, primary values
     Medium — Rajdhani Medium   — body, secondary values
     Small  — Orbitron          — captions, units, sheet titles; always uppercase
   Faces are subset to Latin from the TTFs the app bundles (both SIL OFL). */
@font-face { font-family: "Rajdhani"; font-weight: 500; font-display: swap; src: url("fonts/Rajdhani-Medium.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url("fonts/Rajdhani-Bold.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 400; font-display: swap; src: url("fonts/Orbitron-Regular.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 600; font-display: swap; src: url("fonts/Orbitron-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 700; font-display: swap; src: url("fonts/Orbitron-Bold.woff2") format("woff2"); }

:root {
  /* Always dark, for every visitor: the app's black base, system label colours on it */
  color-scheme: dark;
  --bg: #000000;
  --primary: #ffffff;
  --secondary: rgba(235, 235, 245, 0.74);
  --caption: rgba(235, 235, 245, 0.62);
  --hairline: rgba(255, 255, 255, 0.12);  /* dividers, arc track */
  --glass: rgba(44, 44, 50, 0.6);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --glow: 0.5;                            /* restingGlowOpacity */
  /* Zone colours (WorkoutHeartRateZone.color → SwiftUI system colours, dark appearance) */
  --z0: #98989d; --z1: #64d2ff; --z2: #0a84ff; --z3: #30d158; --z4: #ff9f0a; --z5: #ff453a;
  /* Phase colours (WorkoutPhase.PhaseType.color): yellow, green, cyan */
  --warmup: #ffd60a; --work: var(--z3); --cooldown: var(--z1);
  /* The zone the page is "in". The landing page's sample workout sets it on its own panel. */
  --zone: var(--z3);
  --large: "Rajdhani", "Avenir Next Condensed", system-ui, sans-serif;
  --small: "Orbitron", "Eurostile", system-ui, sans-serif;
  /* Layout */
  --backdrop-h: min(1150px, 190vh);
  --bar-top: 12px;
  --bar-h: 50px;
}

*, *::before, *::after { box-sizing: border-box; }
/* hidden="until-found" is left to the browser (content-visibility), so find-in-page can reach the
   landing page's inactive tab panels. Every other [hidden] is simply gone. */
[hidden]:not([hidden="until-found"]) { display: none !important; }
/* Anchors land below the sticky bar */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-top) + var(--bar-h) + 22px); }
body {
  margin: 0; background: var(--bg); color: var(--primary);
  font-family: var(--large); font-weight: 500; font-size: 20px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums lining-nums;
}
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
/* Form fields carry focus as a doubled rule under the field; the box sat heavily on borderless inputs. */
input:not([type="range"]):focus-visible, select:focus-visible { outline: none; box-shadow: 0 1px 0 var(--primary); }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }

/* Small tier: Orbitron, always uppercase (captionStyle) */
.cap { font-family: var(--small); font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; line-height: 1.3; color: var(--caption); }
/* Sheet title: Orbitron SemiBold, tracked (MyBeatSheet header) */
.sheet-title { font-family: var(--small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 14px; line-height: 1.3; color: var(--primary); }
/* The app's glass material: a translucent surface, blurred where it floats over other content.
   Cards sit on the backdrop, where the blur shows nothing and costs paint, so they take the surface alone. */
.glass, .card { background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); }
.glass { -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
.card { border-radius: 32px; padding: clamp(18px, 2.6vw, 26px); }
.lede { font-size: clamp(21px, 2.3vw, 24px); }

.page { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); position: relative; }

/* ---------- backdrop: AuroraBackgroundView ----------
   The aurora is the app's purple and blue: they tint the black, and the photo sits on top.
   The page background stays on body alone. Giving html a background as well would stop body's
   reaching the canvas, and body would then paint over this layer (z-index: -1). */
.backdrop { position: absolute; top: 0; left: 0; right: 0; height: var(--backdrop-h); z-index: -1; pointer-events: none; overflow: hidden;
  background: linear-gradient(135deg, #000, rgba(175, 82, 222, 0.3) 35%, rgba(10, 132, 255, 0.3) 62%, #000); }
.backdrop::before {            /* the photo at 40%, faded out at top and bottom (edgeFadeMask) */
  content: ""; position: absolute; inset: 0; opacity: 0.4;
  background: url("aurora.jpg") center 22% / cover no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 45%, transparent);
          mask-image: linear-gradient(transparent, #000 30%, #000 45%, transparent);
}
.backdrop::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, #000); }

/* ---------- header: one floating glass bar ----------
   A spectrum ring flows around it, the heart beats, and the glow takes the colour of --zone. */
.top { position: sticky; top: var(--bar-top); z-index: 20; margin-top: var(--bar-top); min-height: var(--bar-h);
       display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 999px;
       box-shadow: var(--glass-shadow), 0 10px 34px -10px color-mix(in srgb, var(--zone) 70%, transparent); transition: box-shadow 0.6s ease; }
/* The ring: a 2px frame cut out by the mask, with a gradient strip sliding behind it.
   The strip moves by transform so the animation stays off the main thread. */
.ring { position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none; overflow: hidden;
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
                mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.ring i { position: absolute; top: 0; left: 0; width: 400%; height: 100%;
          background: linear-gradient(90deg, #f7211e, #fe7b03, #febd03, #8fcb0d, #136de7, #6942cb, #f7211e) 0 0 / 50% 100%;
          animation: flow 7s linear infinite; }
@keyframes flow { to { transform: translateX(-50%); } }
.capsule { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; border-radius: 999px; padding: 0 16px 0 0; text-decoration: none; }
.capsule .icon { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none;
                 animation: lubdub 0.845s cubic-bezier(.2, .8, .2, 1) infinite; }
.capsule .icon img { width: 28px; height: 28px; display: block; }
.capsule .sheet-title { font-size: 13px; }
@keyframes lubdub { 0%, 30%, 100% { transform: scale(1); } 14% { transform: scale(1.2); } 44% { transform: scale(1.09); } }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a { font-family: var(--small); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; line-height: 1; color: var(--secondary);
         text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; transition: background 0.2s, color 0.2s; }
.nav a:hover, .nav a[aria-current] { color: var(--primary); background: var(--hairline); }
@media (max-width: 520px) { .nav { display: none; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--hairline); padding: 28px 0 56px; color: var(--secondary); font-size: 18px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring i, .capsule .icon { animation: none; }
}
