/* Shared by every page: tokens, type, buttons, form fields, dialogs, motion rules */
:root {
  color-scheme: light;
  /* produce palette: kale, carrot, beet, mango on a pale celery ground */
  --bg: #f4f6ec;
  --paper: #fffef9;
  --tint: #e7eedb;
  --tint-2: #dbe5cc;
  --line: #d3dcc4;
  --line-strong: #a9b89d;
  --text: #15231a;
  --muted: #4a584d;          /* 7:1 on --bg */
  --green: #1d4a2c;          /* kale */
  --green-deep: #133520;
  --green-2: #2c6a3f;
  --orange: #b4440b;         /* carrot, dark enough for white text (5.2:1) */
  --orange-deep: #93370a;
  --orange-bright: #ec7a1c;
  --beet: #8e1c48;
  --mango: #f2b01e;
  --mango-soft: #fff3d1;
  --danger: #a3251d;
  --ok: #24693a;

  --radius: 18px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(21, 35, 26, .06), 0 2px 6px -2px rgba(21, 35, 26, .1);
  --shadow: 0 2px 4px rgba(21, 35, 26, .05), 0 18px 40px -20px rgba(21, 35, 26, .4);
  --shadow-lg: 0 4px 10px rgba(21, 35, 26, .06), 0 30px 70px -28px rgba(21, 35, 26, .55);

  --display: 'Bricolage Grotesque', 'Arial Narrow', Arial, sans-serif;
  --body: 'Figtree', 'Trebuchet MS', Arial, sans-serif;

  /* type scale (1.25) and rhythm */
  --fs-sm: .875rem;
  --fs-lg: 1.125rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(2rem, 1.3rem + 2.8vw, 3.25rem);
  --fs-h1: clamp(2.5rem, 1.2rem + 5.4vw, 5.25rem);
  --section: clamp(64px, 4rem + 4vw, 128px);

  /* motion: one curve for everything that arrives, one for things that move back and forth */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-ui: 220ms;
  --t-in: 800ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.04; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -.022em; }
h3 { font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color var(--t-ui) var(--ease); }
a:hover { color: var(--orange); }
img, svg { max-width: 100%; }
::selection { background: var(--mango); color: var(--text); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.block { display: block; }
.fine { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.center { text-align: center; }
.tabular { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--orange-bright); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: 12px; z-index: 100; background: var(--green); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700; transform: translateY(-160%); transition: transform var(--t-ui) var(--ease); }
.skip:focus { transform: none; color: #fff; }

/* buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 48px; padding: 0 24px;
  border: 2px solid var(--orange); border-radius: 999px; background: var(--orange); color: #fff;
  font: 700 1rem/1 var(--body); letter-spacing: .005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease), color var(--t-ui) var(--ease),
    transform var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease);
}
.btn:hover { background: var(--orange-deep); border-color: var(--orange-deep); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(147, 55, 10, .7); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; transition-duration: 80ms; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .arrow { display: inline-block; transition: transform var(--t-ui) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-ghost:hover { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 10px 22px -12px rgba(29, 74, 44, .7); }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn-block { width: 100%; }
.danger { color: var(--danger); border-color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: var(--tint); color: var(--text); border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; flex: none;
  transition: background-color var(--t-ui) var(--ease), transform var(--t-ui) var(--ease); }
.icon-btn:hover { background: var(--tint-2); transform: rotate(90deg); }
.linkish { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }
.linkish:hover { color: var(--orange); }

/* fields */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit;
  transition: border-color var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #85977a; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(44, 106, 63, .2); }
.field input:disabled, .field select:disabled { background: var(--tint); color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 14px; font-size: .92rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; gap: 0; } }
.error-msg { color: var(--danger); font-weight: 600; min-height: 0; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: #fbe9e7; animation: shake .4s var(--ease); }
.error-msg:empty { display: none; }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--green); border-radius: 999px; overflow: hidden; background: #fff; flex: none; }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--green); font-size: 1.3rem; cursor: pointer; transition: background-color var(--t-ui) var(--ease); }
.stepper button:hover { background: var(--tint); }
.stepper button:active { background: var(--tint-2); }
.stepper output { min-width: 2.2em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* dialogs */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(12, 26, 16, .5); backdrop-filter: blur(3px); }
dialog[open]::backdrop { animation: fade var(--t-ui) var(--ease); }
.modal { width: min(520px, 100% - 24px); max-height: calc(100dvh - 24px); border: 0; border-radius: var(--radius); padding: 24px; background: var(--paper); box-shadow: var(--shadow-lg); }
.modal[open] { animation: pop 280ms var(--ease); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 1.6rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 160%); background: var(--green); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 200; box-shadow: var(--shadow); transition: transform 300ms var(--ease); max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

/* Entrances (hero) and scroll reveals: only once boot.js has set .js, so without JS nothing hides */
.js .enter { animation: rise var(--t-in) var(--ease) both; }
.js .e2 { animation-delay: 110ms; }
.js .e3 { animation-delay: 220ms; }
.js .e4 { animation-delay: 330ms; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity var(--t-in) var(--ease), transform var(--t-in) var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
