/*
  Yogaudio website styles.

  Accessibility notes
  - Every text and control color pair meets WCAG AAA contrast (7:1) in light and dark mode.
  - Sizes are in rem so browser text size settings and zoom scale the whole page.
  - No fixed heights on text containers, so user text-spacing overrides (WCAG 1.4.12) never clip.
  - One-column layout that reflows down to 320 CSS pixels wide (WCAG 1.4.10).
  - Focus is always visible, thick and high contrast (WCAG 2.4.7, 2.4.11, 2.4.13).
  - Controls are at least 48 by 48 CSS pixels (WCAG 2.5.5, 2.5.8).
  - Works in Windows High Contrast / forced colors mode.
*/

:root {
  color-scheme: light dark;

  /* Light palette. Contrast against --bg in brackets. */
  --bg: #faf8f4;
  --text: #1b1f1f;          /* 15.7:1 */
  --text-muted: #4a5252;    /* 7.6:1 */
  --accent: #244a4d;        /* 9.2:1, the app's teal, darkened for AAA */
  --surface: #e3f0f0;       /* card background; text 14.3:1, accent 8.3:1 */
  --border: #6b7777;        /* 4.6:1, non-text contrast for card edges */
  --button-bg: #244a4d;
  --button-text: #ffffff;   /* 9.7:1 */
  --button-hover-bg: #1b3739;
  --focus: #1b1f1f;
  --focus-halo: #faf8f4;

  --radius: 0.75rem;
  --measure: 40rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101414;
    --text: #f3f5f5;        /* 17:1 */
    --text-muted: #c2caca;  /* 11.1:1 */
    --accent: #8fd0d3;      /* 10.7:1 */
    --surface: #1a2728;     /* text 14.1:1, accent 8.9:1 */
    --border: #8a9898;
    --button-bg: #8fd0d3;
    --button-text: #0b1a1b; /* 10.3:1 */
    --button-hover-bg: #b5e2e4;
    --focus: #f3f5f5;
    --focus-halo: #101414;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text-muted: var(--text);
    --border: var(--text);
  }
}

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

html {
  /* Never lock the text size: respect the browser and OS setting. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.5rem, 2rem + 3vw, 3.75rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.75rem;
  margin-top: 0;
}

h3 {
  font-size: 1.3rem;
}

p,
ul {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

/* Visible focus for every interactive element: a two-tone ring that shows on any background. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-halo);
  border-radius: 0.25rem;
}

/* Hidden visually, still read by screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: first thing a keyboard user reaches, shown when focused. */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100vh;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 700;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: var(--gutter);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header on inner pages */
.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.site-header a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.site-header a:hover span {
  text-decoration: underline;
}

.site-header img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
}

main {
  display: block;
  padding: 3rem 0 4rem;
}

main:focus {
  outline: none;
}

/* Home page hero */
.hero {
  text-align: center;
  padding-bottom: 3rem;
}

.app-icon {
  display: block;
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1.5rem;
  border-radius: 1.8rem;
  /* Keeps the icon edge visible on the dark background without relying on color alone. */
  box-shadow: 0 0 0 1px var(--border);
}

.tagline {
  font-size: 1.375rem;
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 auto 2rem;
}

.badge-link {
  display: inline-block;
  border-radius: 0.6rem;
  /* The link area stays at least 48px tall even before the badge image loads. */
  min-height: 3rem;
  min-width: 3rem;
}

.badge-link img {
  display: block;
  height: 3.5rem;
  width: auto;
}

.availability {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
}

section + section {
  margin-top: 3.5rem;
}

.features {
  padding-left: 1.25rem;
}

.features li + li {
  margin-top: 0.6em;
}

/* Calls to action */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card + .card {
  margin-top: 1.25rem;
}

.card > :last-child {
  margin-bottom: 0;
}

.card--primary {
  border-width: 3px;
  border-color: var(--accent);
  padding: 2rem 1.5rem;
}

.card--primary h3 {
  font-size: 1.6rem;
}

.contact-note {
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  min-width: 3rem;
  padding: 0.75rem 1.5rem;
  /* Transparent border becomes visible in forced colors mode, so the button keeps its shape. */
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--button-hover-bg);
  text-decoration: underline;
}

.button--large {
  font-size: 1.25rem;
  padding: 1rem 2rem;
  min-height: 3.5rem;
}

.button--secondary {
  background: transparent;
  color: var(--accent);
  border-color: currentColor;
}

.button--secondary:hover {
  background: var(--bg);
}

/* Inner page content */
.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.4em;
}

.updated {
  color: var(--text-muted);
}

/* Footer: the same on every page, in the same order (WCAG 3.2.6 Consistent Help). */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  font-size: 1rem;
}

.site-footer h2 {
  font-size: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.footer-links li + li {
  margin-top: 0.25rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
}

.footer-links a[aria-current="page"] {
  font-weight: 700;
}

.copyright {
  margin: 1.5rem 0 0;
  color: var(--text-muted);
}

@media (forced-colors: active) {
  .button,
  .card,
  .skip-link {
    border: 2px solid CanvasText;
  }

  .button,
  .skip-link {
    color: LinkText;
  }

  :focus-visible {
    outline: 3px solid Highlight;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  .skip-link {
    display: none;
  }
}
