/* ==========================================================================
   Font-size scaling (driven by the accessibility widget)
   ========================================================================== */
html { font-size: calc(100% * var(--a11y-scale, 1)); }

/* ==========================================================================
   Accessibility adjustment modes
   ========================================================================== */
html.a11y-contrast {
  --bg: #ffffff;
  --bg-alt: #ffffff;
  --ink: #000000;
  --ink-soft: #111111;
  --ink-faint: #1a1a1a;
  --teal: #00473a;
  --teal-dark: #002b22;
  --teal-tint: #d6f0e9;
  --amber: #7a3e00;
  --amber-tint: #ffe1ac;
  --card: #ffffff;
  --line: #000000;
  --line-soft: rgba(0, 0, 0, 0.45);
}
html.a11y-contrast body { background: #ffffff; }
html.a11y-contrast .philosophy { background: #000000; color: #ffffff; }
html.a11y-contrast .hero-blob,
html.a11y-contrast .floater,
html.a11y-contrast .hero-grid,
html.a11y-contrast .hero-grid-fine { opacity: 0 !important; }

html.a11y-grayscale body { filter: grayscale(1); }

html.a11y-underline-links a { text-decoration: underline !important; text-underline-offset: 3px; }

html.a11y-readable body { letter-spacing: .02em; word-spacing: .04em; }
html.a11y-readable p,
html.a11y-readable li,
html.a11y-readable .hero-lead { line-height: 1.9 !important; }

html.a11y-stop-motion *,
html.a11y-stop-motion *::before,
html.a11y-stop-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3 L6 38 L15 30 L21 41 L27 38 L21 27 L32 27 Z' fill='black' stroke='white' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 4, auto !important;
}

/* ==========================================================================
   Accessibility widget
   ========================================================================== */
.a11y-trigger {
  position: fixed; bottom: calc(20px + var(--cookie-banner-offset, 0px)); left: 20px; z-index: 301;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform .3s var(--ease), background .3s var(--ease), bottom .3s var(--ease);
}
.a11y-trigger:hover { transform: scale(1.08); background: var(--teal-dark); }
.a11y-trigger svg { width: 27px; height: 27px; }

.a11y-panel {
  position: fixed; bottom: calc(82px + var(--cookie-banner-offset, 0px)); left: 20px; z-index: 301;
  width: min(320px, calc(100vw - 40px));
  background: var(--card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line-soft);
  padding: 0;
  max-height: min(75vh, 560px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft);
}
.a11y-panel-head h2 { font-size: 1.05rem; font-weight: 700; font-family: var(--font-display); }
.a11y-close { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-soft); }
.a11y-close:hover { background: var(--bg-alt); color: var(--ink); }
.a11y-close svg { width: 18px; height: 18px; }
.a11y-panel-body { padding: 1rem 1.2rem 1.3rem; overflow-y: auto; display: flex; flex-direction: column; gap: .2rem; }
.a11y-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem 0; border-bottom: 1px solid var(--line-soft);
  font-size: .93rem; color: var(--ink);
}
.a11y-row:last-of-type { border-bottom: none; }
.a11y-font-controls { display: flex; gap: .4rem; }
.a11y-font-controls button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  font-size: .8rem; font-weight: 700; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.a11y-font-controls button:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.a11y-toggle { cursor: pointer; }
.a11y-toggle input {
  appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line);
  position: relative; flex-shrink: 0; cursor: pointer; transition: background .25s var(--ease);
}
.a11y-toggle input::before {
  content: ""; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .25s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.a11y-toggle input:checked { background: var(--teal); }
.a11y-toggle input:checked::before { transform: translateX(-18px); }
.a11y-reset {
  margin-top: .9rem; width: 100%; padding: .65rem; border-radius: 10px;
  border: 1px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .2s, color .2s;
}
.a11y-reset:hover { border-color: var(--teal); color: var(--teal); }
.a11y-statement-link {
  display: block; text-align: center; margin-top: .8rem; font-size: .82rem;
  color: var(--teal); text-decoration: underline; text-underline-offset: 3px;
}

@media (max-width: 480px) {
  .a11y-trigger { width: 48px; height: 48px; left: 14px; bottom: calc(14px + var(--cookie-banner-offset, 0px)); }
  .a11y-panel { left: 14px; bottom: calc(70px + var(--cookie-banner-offset, 0px)); }
}

/* ==========================================================================
   Cookie consent banner
   ========================================================================== */
.cookie-banner {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 250;
  background: var(--teal-dark); color: #F4F1E8;
  padding: 1rem 1.4rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1rem; box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  animation: cookie-in .45s var(--ease);
}
.cookie-banner p { margin: 0; font-size: .9rem; max-width: 640px; line-height: 1.6; }
.cookie-banner a { color: #F4C98B; text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner-actions { flex-shrink: 0; }
.cookie-banner.is-dismissed { opacity: 0; transform: translateY(16px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
@keyframes cookie-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .cookie-banner { animation: none; } }

/* ==========================================================================
   Footer legal links row
   ========================================================================== */
.footer-legal { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.footer-legal a { color: var(--ink-faint); font-size: .82rem; transition: color .2s; }
.footer-legal a:hover { color: var(--teal); }
.footer-legal .sep { color: var(--line); }

/* ==========================================================================
   Legal / static content pages (accessibility, privacy, terms)
   ========================================================================== */
.legal-hero { padding-block: clamp(56px, 8vw, 90px) 20px; }
.legal-hero .container { max-width: 760px; }
.legal-back {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.4rem;
  color: var(--teal); font-size: .9rem; font-weight: 600;
}
.legal-back svg { width: 16px; height: 16px; transform: scaleX(-1); }
.legal-hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
.legal-updated { color: var(--ink-faint); font-size: .88rem; margin-top: .6rem; }

.legal-body { padding-bottom: clamp(60px, 8vw, 100px); }
.legal-body .container { max-width: 760px; display: flex; flex-direction: column; gap: 2rem; }
.legal-section h2 {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: .7rem;
  display: flex; align-items: center; gap: .55rem;
}
.legal-section h2 svg { width: 22px; height: 22px; color: var(--teal); flex-shrink: 0; }
.legal-section p, .legal-section li { color: var(--ink-soft); font-size: .98rem; line-height: 1.75; }
.legal-section ul { padding-inline-start: 1.3rem; list-style: disc; display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.legal-section + .legal-section { border-top: 1px solid var(--line-soft); padding-top: 2rem; }
.legal-note {
  background: var(--bg-alt); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; font-size: .9rem; color: var(--ink-soft);
}
.legal-contact-box {
  background: var(--teal-tint); border-radius: var(--radius-md); padding: 1.4rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.legal-contact-box a { color: var(--teal); font-weight: 600; text-decoration: underline; }
