:root {
  color-scheme: light dark;
  --brand: #075e54;
  --brand-strong: #06483f;
  --accent: #a33d54;
  --text: #172126;
  --muted: #56676f;
  --surface: #ffffff;
  --elevated: #ffffff;
  --subtle: #edf1ef;
  --border: #cbd5d2;
  --focus: #b12f50;
  --max-width: 1080px;
  --reading-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #71d0c0;
    --brand-strong: #9de5d8;
    --accent: #ff9caf;
    --text: #f3f6f4;
    --muted: #bdc9c5;
    --surface: #131819;
    --elevated: #1d2527;
    --subtle: #253033;
    --border: #455457;
    --focus: #ff9caf;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  background: var(--elevated);
  left: 16px;
  padding: 10px 14px;
  position: fixed;
  top: 12px;
  transform: translateY(-180%);
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
main {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 22px 0;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 750;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
  display: block;
}

nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
  min-height: 500px;
  padding: 46px 0 38px;
}

.hero-copy {
  min-width: 0;
}

.hero-logo {
  border-radius: 22%;
  clip-path: inset(1.5% round 22%);
  display: block;
  height: auto;
  justify-self: end;
  max-width: 100%;
}

.eyebrow,
.category-label {
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  font-size: 4.25rem;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  max-width: 780px;
}

.lead {
  color: var(--muted);
  font-size: 1.25rem;
  margin: 22px 0 0;
  max-width: 690px;
}

.lead strong {
  color: var(--text);
  display: block;
  font-weight: 750;
  margin-bottom: 4px;
}

.primary-link,
.secondary-link {
  align-items: center;
  display: inline-flex;
  font-weight: 750;
  gap: 8px;
  margin-top: 28px;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 26px;
}

.hero-actions .primary-link {
  margin-top: 0;
}

.app-store-link {
  background: var(--text);
  border: 2px solid var(--text);
  border-radius: 7px;
  color: var(--surface);
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 750;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  text-decoration: none;
}

.app-store-link:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--surface);
}

.privacy-note {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 14px 0 0;
}

.section {
  padding: 38px 0;
}

.section-heading {
  margin-bottom: 24px;
  max-width: 640px;
}

.section-heading h2,
.learn-band h2 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.article-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}

.card h3,
.article-card h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 9px;
}

.card p,
.article-card > p:not(.category-label) {
  color: var(--muted);
  margin: 0;
}

.learn-band {
  align-items: end;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 32px;
  justify-content: space-between;
  margin: 28px 0 52px;
  padding: 32px 0;
}

.learn-band p:not(.eyebrow) {
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 640px;
}

.learn-band .secondary-link {
  flex: 0 0 auto;
  margin: 0;
}

.content {
  margin: 52px 0 72px;
  max-width: var(--reading-width);
}

.content h1,
.article-header h1,
.learn-header h1 {
  font-size: 3.25rem;
  line-height: 1.05;
}

.content h2,
.article-body h2,
.education-note h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 38px 0 10px;
}

.content p,
.content li,
.article-body p,
.article-body li {
  color: var(--muted);
}

.content ul,
.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
}

.compact-content {
  min-height: 420px;
}

.meta,
.article-meta,
.card-meta,
.result-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.learn-header {
  border-bottom: 1px solid var(--border);
  padding: 72px 0 46px;
}

.learn-tools {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
  padding: 32px 0 12px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  appearance: none;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 36px;
}

.result-count {
  margin: 8px 0 18px;
}

.article-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 72px;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 290px;
}

.article-card h2 a {
  color: var(--text);
  text-decoration-color: var(--brand);
}

.article-card .card-meta {
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: auto;
  padding-top: 18px;
}

[hidden] {
  display: none !important;
}

.empty-state {
  border-top: 1px solid var(--border);
  margin-bottom: 72px;
  padding: 32px 0;
}

.empty-state h2 {
  font-size: 1.3rem;
  margin: 0;
}

.empty-state p {
  color: var(--muted);
  margin: 6px 0 0;
}

.article-shell {
  margin: 48px auto 72px;
  max-width: var(--reading-width);
}

.back-link::before {
  content: "\2190";
  margin-right: 8px;
}

.article-header {
  border-bottom: 1px solid var(--border);
  padding: 42px 0 30px;
}

.article-summary {
  color: var(--muted);
  font-size: 1.2rem;
  margin: 20px 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.article-body {
  font-size: 1.06rem;
  padding: 18px 0;
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}

.education-note {
  background: var(--subtle);
  border-left: 5px solid var(--accent);
  margin: 32px 0;
  padding: 20px 22px;
}

.education-note h2 {
  font-size: 1.1rem;
  margin: 0 0 5px;
}

.education-note p {
  color: var(--muted);
  margin: 0;
}

.article-footer-nav {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 14px 24px;
  justify-content: space-between;
  padding: 26px 0 38px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 820px) {
  h1 {
    font-size: 3.25rem;
  }

  .grid,
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    gap: 12px 16px;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 34px 0 30px;
  }

  h1,
  .content h1,
  .article-header h1,
  .learn-header h1 {
    font-size: 2.5rem;
  }

  .hero-logo {
    margin-top: 34px;
    width: min(210px, 65vw);
  }

  .grid,
  .article-grid,
  .learn-tools {
    grid-template-columns: 1fr;
  }

  .learn-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-card {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .education-note {
    border: 2px solid CanvasText;
  }

  nav a[aria-current="page"] {
    border-bottom: 3px solid CanvasText;
  }
}
