:root {
  --bg: #F8F7F5;
  --bg-tint: #F1F0F4;
  --ink: #2A2733;
  --ink-soft: #5E5A6B;
  --line: #E4E1EC;

  --lavender: #E8E3F6;
  --sky: #DFEDF7;
  --mint: #E1F2EA;
  --butter: #F4F2DD;

  --accent: #6F66C4;
  --accent-ink: #4A4192;

  --surface: #FFFFFF;
  --hover-tint: #DCD3F2;

  --glow: linear-gradient(135deg, #D9CFF7 0%, #CFE8F6 50%, #D6F1DF 100%);

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Karla', -apple-system, sans-serif;
  --font-scale: 1;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 32px;
  --section-pad: clamp(2.5rem, 5vw, 4rem);
}

/* Dark mode — same low-saturation-tint philosophy, just inverted.
   Light is the deliberate default for every visitor regardless of
   their system setting; the accessibility menu's Dark mode button is
   what switches to this, via data-theme. High contrast still wins
   over either. */
:root[data-theme="dark"] {
  --bg: #1C1A22;
  --bg-tint: #242230;
  --ink: #EDEBF2;
  --ink-soft: #A9A5B8;
  --line: #3A3648;

  --lavender: #322C47;
  --sky: #212B38;
  --mint: #1E2C27;
  --butter: #2C2A1E;

  --accent: #A79BEF;
  --accent-ink: #C7BCFF;

  --surface: #242230;
  --hover-tint: #3D3656;

  --glow: linear-gradient(135deg, #3A3157 0%, #223244 50%, #223B2F 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: calc(100% * var(--font-scale));
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* Accessibility menu — one button, opens a panel, instead of a permanent row */

.a11y-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1.5rem;
  font-family: var(--sans);
}

.a11y-widget {
  position: relative;
  display: inline-block;
}

.a11y-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
}

.a11y-toggle-icon {
  flex-shrink: 0;
}

.a11y-toggle-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.a11y-toggle:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.a11y-toggle[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--accent);
}

.a11y-toggle[aria-expanded="true"] .a11y-toggle-chevron {
  transform: rotate(180deg);
}

.a11y-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 101;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 280px;
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

.a11y-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.a11y-panel button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-tint);
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}

.a11y-panel button:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.a11y-panel button[aria-pressed="true"] {
  background: var(--lavender);
  color: var(--accent-ink);
  font-weight: 600;
}

.a11y-reset-row {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.a11y-reset-row button {
  background: none;
  color: var(--ink-soft);
  text-decoration: underline;
  padding: 0.2rem 0;
}

.a11y-reset-row button:hover {
  color: var(--ink);
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.75rem 2rem 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.tagline {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.site-nav {
  padding-top: 2px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: var(--lavender);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.pill-link:hover {
  background: var(--hover-tint);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero */

.hero {
  padding: 2.5rem 0 var(--section-pad);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 1.4rem;
  max-width: 18ch;
  color: var(--ink);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 2rem;
}

.actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--lavender);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--hover-tint);
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

/* Logo stage — the only saturated thing on the page */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--lavender);
  filter: blur(60px);
  opacity: 0.5;
}

.stage img {
  width: min(100%, 240px);
  height: auto;
  position: relative;
  z-index: 1;
  animation: float 9s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .stage img { animation: none; }
}

html.reduce-motion .stage img {
  animation: none !important;
}

html.high-contrast .stage::before {
  display: none;
}

/* Approach — flat tint, no gradient */

.approach {
  background: var(--bg-tint);
  margin: 0 -2rem;
  padding: var(--section-pad) 2rem;
  border-radius: var(--r-lg);
}

.approach-inner {
  max-width: 640px;
  margin: 0 auto;
}

.approach h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--ink);
}

.approach p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.05rem;
}

/* Pillars — the site's three tints, one each */

.pillars {
  padding: var(--section-pad) 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pillar {
  background: var(--tint, var(--sky));
  border-radius: var(--r-md);
  padding: 1.75rem 1.75rem 2rem;
}

.pillar:nth-child(1) { --tint: var(--sky); }
.pillar:nth-child(2) { --tint: var(--mint); }
.pillar:nth-child(3) { --tint: var(--butter); }

.pillar h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.pillar p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

/* Product */

.product {
  padding: 0 0 calc(var(--section-pad) + 1rem);
  max-width: 640px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 2rem 2.25rem;
}

.product-card h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.product-card p {
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  font-size: 16px;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  background: var(--lavender);
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-size: 15px;
  transition: background 0.2s ease;
}

.product-link:hover {
  background: var(--hover-tint);
}

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

/* High contrast mode.
   Every component below reads its colors from the tokens (--ink,
   --line, --lavender, etc.) — overriding the tokens themselves, not
   just body's background/color, means every current AND future
   component is covered automatically, including ones built on a tint
   token rather than a hardcoded color. This must come after the dark
   mode token blocks above so it always wins when both are active —
   high contrast should never leave near-white text on a near-white
   forced background (or vice versa) just because dark mode also has
   an opinion about what --ink means. The specific overrides below are
   kept as an extra safety net on top of this, not a replacement for it. */
/* :root.high-contrast, not html.high-contrast — same element, but
   html.high-contrast's specificity (0,1,1) loses to the dark-mode
   token rules above (:root[data-theme="dark"] etc., both (0,2,0)),
   regardless of source order. :root.high-contrast ties at (0,2,0), so
   appearing later in the file is what makes it actually win. */
:root.high-contrast {
  --bg: #ffffff;
  --bg-tint: #ffffff;
  --ink: #000000;
  --ink-soft: #000000;
  --line: #000000;
  --lavender: #ffffff;
  --sky: #ffffff;
  --mint: #ffffff;
  --butter: #ffffff;
  --accent: #000000;
  --accent-ink: #000000;
  --surface: #ffffff;
  --hover-tint: #000000;
}

html.high-contrast body {
  background: #ffffff;
  color: #000000;
}

html.high-contrast .a11y-bar {
  background: #ffffff;
  border-bottom: 2px solid #000000;
}

html.high-contrast .a11y-toggle {
  color: #000000;
  border: 2px solid #000000;
}

html.high-contrast .a11y-panel {
  background: #ffffff;
  border: 2px solid #000000;
  box-shadow: none;
}

html.high-contrast .a11y-group-label {
  color: #000000;
}

html.high-contrast .a11y-panel button {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
}

html.high-contrast .a11y-panel button[aria-pressed="true"] {
  background: #000000;
  color: #ffffff;
}

html.high-contrast h1,
html.high-contrast .approach h2,
html.high-contrast .pillar h2,
html.high-contrast .product-card h2,
html.high-contrast .wordmark {
  color: #000000;
}

html.high-contrast .lede,
html.high-contrast .approach p,
html.high-contrast .pillar p,
html.high-contrast .product-card p,
html.high-contrast .site-footer p,
html.high-contrast .tagline {
  color: #000000;
}

html.high-contrast .approach,
html.high-contrast .pillar,
html.high-contrast .product-card,
html.high-contrast .btn-primary,
html.high-contrast .pill-link,
html.high-contrast .product-link {
  background: #ffffff;
  border: 2px solid #000000;
}

html.high-contrast .pill-link,
html.high-contrast .product-link,
html.high-contrast .site-nav a {
  color: #000000;
  text-decoration: underline;
}

html.high-contrast .site-footer {
  border-color: #000000;
}

/* Underline links */

html.underline-links a {
  text-decoration: underline !important;
}

/* Dyslexia-friendly font — swaps both the display and body face for
   Lexend, a humanist sans built from reading-proficiency research
   (clearer letterforms, generous spacing), rather than layering a
   separate style on top of Newsreader/Karla. */
html.dyslexia-font {
  --serif: 'Lexend', 'Karla', -apple-system, sans-serif;
  --sans: 'Lexend', -apple-system, sans-serif;
}

/* Wider spacing — the other half of the classic dyslexia-friendly
   reading pair: looser line height, letter spacing, and word spacing. */
html.wide-spacing body {
  line-height: 1.95;
  letter-spacing: 0.01em;
  word-spacing: 0.06em;
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 280px;
    order: -1;
  }

  .stage img {
    width: min(70%, 240px);
  }
}

@media (max-width: 720px) {
  .pillars {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding-top: 1.5rem;
  }

  .a11y-panel {
    left: 0;
    right: 0;
    min-width: 0;
    width: calc(100vw - 3rem);
  }

}
