/* Six AM's own look, loaded after Parrity's shared glass.css on every page.
   glass.css is copied into every Parrity app, so Six AM's changes live here instead.
   The SIXAM identity, V1 (docs/sixam-brand-v1), with Style guide V2's layout and components
   (docs/sixam-style-guide-v2): Charcoal #151819, Chalk #F4F5F0, Acid #D9F45D.
   Flat surfaces, no gradients or glow, 8px controls, 12px cards. Acid is a fill: as text on a
   light background it is Acid Ink (#42540B). One container and gutter on every page (16/24/32px).
   A gym's colour arrives as --gym-accent, --gym-ink, --gym-text-light and --gym-text-dark on <html>,
   worked out by brandColour() in src/rules.ts; it takes Acid's place as the accent. */

:root {
  --sx-charcoal: #151819;
  --sx-chalk: #F4F5F0;
  --sx-acid: #D9F45D;
  --sx-acid-ink: #42540B;
  /* The wordmark's AM: Acid on dark, Acid Ink on light. */
  --sx-am: var(--sx-acid-ink);
  --sx-focus: var(--sx-acid-ink);

  --pb-bg: #F8F9F5;
  --pb-surface: #FFFFFF;
  --pb-surface-2: #E6E9E4;
  --pb-line: #D5DBD6;      /* decorative dividers */
  --pb-control: #64726A;   /* the edge of things you can press */
  --pb-text: #151819;
  --pb-muted: #4D5752;
  --pb-faint: #64726A;
  --pb-accent: var(--gym-accent, #D9F45D);
  --pb-accent-ink: var(--gym-ink, #151819);
  --pb-accent-text: var(--gym-text-light, #42540B);
  --pb-success: #285C3B;
  --pb-warning: #775014;
  --pb-danger: #9F302D;
  --pb-font-marker: "Permanent Marker", "Segoe Print", "Bradley Hand", cursive;
  --pb-tap: 44px;

  /* glass.css's surfaces, made flat. */
  --glass: var(--pb-surface);
  --glass-flat: var(--pb-surface);
  --edge: var(--pb-line);
  --raised: var(--pb-surface);
  --field: var(--pb-surface);
  --tint: rgba(21, 24, 25, .06);
  --line: rgba(21, 24, 25, .1);
  --line-strong: var(--pb-control);
  --blur: none;
  --shadow: none;
  --highlight: none;
  --r: 12px;
  --r-sm: 8px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Style guide V2: one gutter, one spacing rhythm. */
  --gutter: 16px;
  --section-space: 40px;
  /* WhatsApp's own colours, used only on its mark: its teal on light (3.4:1 on the grey button),
     its green on dark (6:1). */
  --wa-green: #128C7E;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --section-space: 72px; } }
:root[data-theme="dark"] {
  --sx-am: var(--sx-acid);
  --wa-green: #25D366;
  --sx-focus: var(--sx-acid);

  --pb-bg: #151819;
  --pb-surface: #202526;
  --pb-surface-2: #303837;
  --pb-line: #353D3B;
  --pb-text: #F4F5F0;
  --pb-muted: #AAB4AD;
  --pb-faint: #8B968F;
  --pb-accent: var(--gym-accent, #D9F45D);
  --pb-accent-ink: var(--gym-ink, #151819);
  --pb-accent-text: var(--gym-text-dark, #D9F45D);
  --pb-success: #B9E7C5;
  --pb-warning: #FFD38A;
  --pb-danger: #FFB4A9;

  --glass: var(--pb-surface);
  --glass-flat: var(--pb-surface);
  --edge: var(--pb-line);
  --raised: var(--pb-surface-2);
  --field: var(--pb-bg);
  --tint: rgba(244, 245, 240, .07);
  --line: rgba(244, 245, 240, .1);
  --line-strong: var(--pb-control);
  --glow: transparent;
}
/* glass.css's names, pointed at Six AM's tokens (both selectors, so dark beats glass.css's dark). */
:root, :root[data-theme="dark"] {
  --bg: var(--pb-bg);
  --text: var(--pb-text);
  --muted: var(--pb-muted);
  --faint: var(--pb-faint);
  --accent: var(--pb-accent);
  --accent-ink: var(--pb-accent-ink);
  --accent-text: var(--pb-accent-text);
  --danger: var(--pb-danger);
  --success: var(--pb-success);
  --warning: var(--pb-warning);
  --inverse: var(--pb-text);
  --inverse-ink: var(--pb-bg);
}

/* No light behind glass: the canvas is flat. */
body::before { display: none; }
body { font-size: 16px; }
:focus-visible { outline: 2px solid var(--sx-focus); outline-offset: 2px; }
img, video, svg { max-width: 100%; }
img, video { height: auto; }

/* The shared container: header and content share it, so everything lines up on one gutter.
   Public pages up to 1200px; the app narrows it (index.html). Notch-safe on the sides. */
.wrap {
  width: 100%; max-width: 1200px; margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
a { color: var(--accent-text); }

/* Type: display 800, headings 700, numbers tabular. */
h1 { font-weight: 800; letter-spacing: -.035em; }
h2, h3 { font-weight: 700; }

/* Cards: flat, a hairline edge, 12px corners. */
.glass, .card { box-shadow: none; }

/* Controls: 8px corners, flat, big enough to hit with a thumb between sets.
   The action is the accent (Acid, or the gym's colour) with its ink on it. */
button, .btn { min-height: var(--pb-tap); border-radius: 8px; border-color: var(--pb-control); background: var(--pb-surface); box-shadow: none; font-weight: 600; }
button:hover, .btn:hover { background: var(--pb-surface-2); }
button.primary, .btn.primary {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 80%, #151819);
  color: var(--accent-ink);
  box-shadow: none;
}
button.primary:hover, .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #151819); }
.chip { min-height: var(--pb-tap); }
input, select, textarea { border-radius: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--sx-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sx-focus) 22%, transparent); }
.badge.accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.badge.success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge.warning { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.notice { border-radius: 8px; }

/* ---------- the top bar ----------
   No card: a 2px acid rule across the top of the screen, the wordmark, and a small tab hanging from
   the rule for the one thing to do (Sign in, Sign out, The app). It sits straight on the page and
   turns solid with a hairline once you scroll (nav.js adds .scrolled).
   The rule and the solid background reach the screen's edges with a spread shadow trimmed by
   clip-path: a shadow is painted, not laid out, so it can never make the page wider than the screen. */
/* The bar shrinks on scroll, but a bottom margin makes up the difference, so the page never gets
   shorter: otherwise, on a page only a little taller than the screen, shrinking un-scrolls it and
   the bar flickers between the two sizes. */
.nav { --h-full: 76px; --h: var(--h-full); position: sticky; top: 0; z-index: 20; height: var(--h); margin: 0 0 calc(var(--h-full) - var(--h)); padding: 0; gap: 8px; align-items: center; background: none; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; transition: height .35s var(--ease), margin-bottom .35s var(--ease); }
.nav.scrolled { --h: 60px; }
.nav::before, .nav::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.nav::before { top: 0; bottom: 0; z-index: -1; background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px); opacity: 0; transition: opacity .3s; }
.nav.scrolled::before { opacity: 1; }
.nav::after { top: 0; height: 2px; background: var(--accent); box-shadow: 0 0 0 100vmax var(--accent); clip-path: inset(0 -100vmax); }
/* The wordmark, drawn from the supplied paths, never retyped. */
.brand { flex: none; gap: 0; margin-right: 20px; color: var(--text); white-space: nowrap; }
.brand::before { display: none; }
.brand svg { display: block; height: 30px; width: auto; transition: height .35s var(--ease); }
.nav.scrolled .brand svg { height: 24px; }
.brand .sx-six { fill: currentColor; }
.brand .sx-am { fill: var(--sx-am); }
.nav-links { gap: 26px; }
.nav-links a { position: relative; padding: 8px 0; border-radius: 0; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; transition: color .2s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); background: none; box-shadow: none; text-decoration: none; }
.nav-links a:hover::after, .nav-links a[aria-current="true"]::after { transform: scaleX(1); }
/* Icon buttons in the bar (dark mode, messages): no box until you point at them. */
.nav .theme-btn { width: 44px; padding: 0; border: 0; background: none; color: var(--muted); }
.nav .theme-btn:hover { background: var(--tint); color: var(--text); }
/* The tab: quiet, its text on the bar's middle line; it turns to the accent when you reach for it. */
.nav-tab { position: relative; display: inline-flex; align-self: flex-start; align-items: flex-end; gap: 8px; height: calc(var(--h) / 2 + 14px); margin-left: 4px; padding: 0 16px 8px; border-radius: 0 0 8px 8px; background: var(--pb-surface-2); color: var(--text); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: height .35s var(--ease), background .2s, color .2s; }
.nav-tab::after { content: "→"; font-size: 13px; line-height: 12px; transition: transform .25s var(--ease); }
.nav-tab:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.nav-tab:hover::after { transform: translateX(3px); }
/* Phones: a 64px bar, the wordmark at least 120px wide (V1's minimum), 44px buttons. At the narrowest
   the tab tightens up (no arrow) rather than clip. */
@media (max-width: 760px) { .nav-links { display: none; } .nav, .nav.scrolled { --h-full: 64px; --h: 64px; } .brand svg, .nav.scrolled .brand svg { height: 27px; } }
@media (max-width: 420px) { .nav { gap: 4px; } .nav-tab { margin-left: 0; padding-inline: 10px; letter-spacing: .04em; } .nav-tab::after { display: none; } .brand { margin-right: 4px; } .brand svg, .nav.scrolled .brand svg { height: 26px; } }

.marker { font-family: var(--pb-font-marker); font-weight: 400; letter-spacing: 0; }
