/* Pine Island internal tools - shared app chrome + accessibility defaults.
   Link brand/styles.css FIRST (tokens), then this file.

   Accessibility posture (see docs/accessibility.md):
   - Everything sized in rem, so OS/browser zoom scales the whole UI.
   - Runtime text-size and contrast knobs via [data-text-size]/[data-contrast]
     (set by brand/prefs.js before first paint).
   - Large, forgiving hit targets and an always-visible focus ring. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  font-size: 100%;              /* 16px base; respects the design tokens as authored */
  -webkit-text-size-adjust: 100%;
}
:root[data-text-size="large"]  { font-size: 112.5%; }  /* ~18px */
:root[data-text-size="xlarge"] { font-size: 125%;   }  /* ~20px */

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--surface-page);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
}

/* Honor the OS high-contrast preference, and an explicit in-app toggle. */
@media (prefers-contrast: more) {
  :root { --text-body: #10231b; --text-muted: #24463a; --border-subtle: var(--neutral-400); }
}
:root[data-contrast="high"] {
  --text-body:    #10231b;
  --text-muted:   #24463a;
  --border-subtle: var(--neutral-400);
  --border-strong: var(--neutral-500);
}

a { color: var(--text-link); }

/* Never remove keyboard focus visibility. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Buttons: large hit targets by default (motor-friendly). */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-5);
  font-family: var(--font-body); font-weight: var(--weight-bold);
  font-size: var(--text-md); line-height: 1;
  border-radius: var(--radius-sm); border: var(--border-thick) solid transparent;
  cursor: pointer; text-decoration: none; color: var(--text-on-dark);
  transition: filter var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.btn:hover  { filter: brightness(0.92); }
.btn:active { transform: translateY(1px); }
.btn--primary   { background: var(--brand-primary); }   /* pine; white text passes AA */
.btn--secondary { background: transparent; color: var(--brand-secondary);
                  border-color: var(--brand-secondary); }
.btn--action    { background: var(--brand-action); }    /* leaf; reserve for accents */

.eyebrow {
  font-family: var(--eyebrow-font); font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-tracking); text-transform: uppercase;
  font-size: var(--text-2xs); color: var(--text-muted); margin: 0;
}

.container { width: min(1120px, 100% - 2 * var(--space-5)); margin-inline: auto; }

/* Small display-preferences control shown in the top bar. */
.prefs { display: flex; align-items: center; gap: var(--space-2); }
.prefs__group { display: inline-flex; border-radius: var(--radius-pill); overflow: hidden;
                border: 1px solid var(--border-on-dark); }
.prefs__btn {
  min-width: 44px; min-height: 40px; padding: 0 var(--space-3);
  background: transparent; color: var(--text-on-dark);
  border: 0; cursor: pointer; font-family: var(--font-display);
  font-weight: var(--weight-semibold); font-size: var(--text-sm);
}
.prefs__btn:hover { background: rgba(255,255,255,0.12); }
.prefs__btn + .prefs__btn { border-left: 1px solid var(--border-on-dark); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
