:root {
  color-scheme: light dark;
  --accent: #3559d8;
  --accent-strong: #2444b8;
  --background: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #657086;
  --border: #dfe4ed;
  --header-text: #ffffff;
  --shadow: 0 14px 38px rgba(31, 43, 77, 0.08);
}

.theme-land {
  --accent: #087f6a;
  --accent-strong: #066b59;
}

.theme-sunmoon {
  --accent: #314f7c;
  --accent-strong: #1f3658;
}

.theme-paycheck {
  --accent: #4a61e8;
  --accent-strong: #3548ba;
}

.theme-cleflark {
  /* Sight Reading Practice brand violet (design/tokens.yaml colors.light.primary). */
  --accent: #5740ae;
  --accent-strong: #46338c;
}

.theme-alarm {
  /* One-Time Alarm brand indigo (design/tokens.yaml colors.light.primary). */
  --accent: #3947a6;
  --accent-strong: #273d9d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #10131b;
    --surface: #191e2a;
    --text: #f1f4fa;
    --muted: #adb6c8;
    --border: #31394a;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

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

a:hover {
  color: var(--accent-strong);
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

header {
  padding: 3.25rem 1.25rem 2.75rem;
  color: var(--header-text);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.wrap {
  width: min(48rem, calc(100% - 2.5rem));
  margin: 0 auto;
}

.brand {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

main {
  padding: 2rem 0 3rem;
}

.summary,
section {
  margin-bottom: 1rem;
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary {
  border-left: 4px solid var(--accent);
  font-size: 1.05rem;
}

h2 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

p {
  margin: 0;
}

p + p,
p + ul,
ul + p {
  margin-top: 0.7rem;
}

ul,
ol {
  margin: 0.55rem 0 0;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.35rem;
}

.button {
  display: inline-block;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-strong);
  color: #ffffff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.card-grid section {
  margin: 0;
}

nav {
  margin-top: 1.6rem;
  text-align: center;
}

nav a + a::before {
  content: " · ";
  color: var(--muted);
  text-decoration: none;
}

footer {
  padding: 0 0 2.5rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

@media (max-width: 32rem) {
  header {
    padding-top: 2.4rem;
  }

  .wrap {
    width: min(100% - 1.5rem, 48rem);
  }

  .summary,
  section {
    padding: 1.1rem;
  }
}
