@font-face {
  font-family: "Michroma";
  src: url("/fonts/michroma-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --g900: #162200;
  --g800: #283C00;
  --g700: #34500A;
  --g200: #C8EAA7;
  --g100: #E4F4D3;
  --ink: #252423;
  --white: #FFFFFF;
  --warn: #E39B2D;
  --water: #2A58C9;
  --deficit: #D12F2F;
  --surface: #FFFFFF;
  --surface2: #F1F3EC;
  --line: #D9DDD1;
  --text: #252423;
  --muted: #5A5E52;
  --accent: #283C00;
  --display: "Michroma", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --page-gutter: clamp(1rem, 3vw, 4rem);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #10180A;
    --surface2: #172210;
    --line: #2C3A20;
    --text: #EEF3E6;
    --muted: #A9B59B;
    --accent: #C8EAA7;
    --water: #7FA2FF;
    --deficit: #FF7B7B;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #10180A;
  --surface2: #172210;
  --line: #2C3A20;
  --text: #EEF3E6;
  --muted: #A9B59B;
  --accent: #C8EAA7;
  --water: #7FA2FF;
  --deficit: #FF7B7B;
}

*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; background: var(--surface); color: var(--text); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--display); font-weight: 400; font-synthesis: none; letter-spacing: .02em; text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; max-width: 100%; padding: 15px 22px; border-radius: 999px; text-decoration: none; text-align: center; border: 1.5px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn svg { flex: none; }
.btn-primary, .btn-success { background: var(--g200); color: var(--g800); }
.btn-primary:hover, .btn-success:hover { background: #DDF3C6; }
.btn-ghost { border-color: rgba(200, 234, 167, .55); color: var(--white); }
.btn-ghost:hover { border-color: var(--g200); background: rgba(200, 234, 167, .1); }
.btn-dark { background: var(--g800); color: var(--white); }
.btn-dark:hover { background: var(--g700); }

.theme-toggle { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(200, 234, 167, .5); border-radius: 50%; background: transparent; color: var(--g200); cursor: pointer; }
.theme-toggle:hover { background: rgba(200, 234, 167, .12); }
.theme-toggle .theme-icon-sun, .theme-toggle[aria-pressed="true"] .theme-icon-moon { display: none; }
.theme-toggle[aria-pressed="true"] .theme-icon-sun { display: block; }

.skip-link { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px; z-index: 1100; max-width: calc(100% - 24px); padding: 12px 18px; border-radius: 8px; background: var(--g200); color: var(--g900); font-weight: 700; transform: translateY(calc(-100% - 24px - env(safe-area-inset-top, 0px))); }
.skip-link:focus { transform: translateY(0); }

/* A contrasting outer ring remains visible on both light and dark surfaces. */
:focus-visible, .btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .form-check-input:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; box-shadow: 0 0 0 6px #34500A; }
#main-content:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
