/* Reset, typography and the small shared vocabulary of controls. */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h); /* the only offset for jumps and #links; elements add their own scroll-margin */
  interpolate-size: allow-keywords;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text);
  line-height: var(--leading);
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color .6s var(--ease-out), color .6s var(--ease-out);
}
html.is-locked, html.is-locked body { overflow: hidden; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--sage-200); color: var(--ink); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Type */
.display, h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: var(--h1); line-height: .94; letter-spacing: -.035em; }
h2 { font-size: var(--h2); line-height: 1; letter-spacing: -.03em; }
h3 { font-size: var(--h3); line-height: 1.08; }
h4 { font-size: var(--h4); line-height: 1.15; }
h1 em, h2 em, h3 em, .display em { font-style: italic; color: var(--terracotta); }
p { text-wrap: pretty; }
.lead { font-size: var(--text-lead); line-height: 1.6; color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: var(--text-small); }
.micro { font-size: var(--text-micro); line-height: 1.55; }
.note { font-size: var(--text-small); color: var(--muted); line-height: 1.6; }
/* The one place-holder for a section label: a quiet italic serif line, not a tracked eyebrow. */
.kicker { display: inline-flex; align-items: center; gap: 12px; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 1.4vw + 12px, 26px); line-height: 1.2; color: var(--terracotta-ink); }
.kicker::before { content: ''; width: 34px; height: 1px; background: currentColor; opacity: .55; }
.handwrite { font-family: var(--serif); font-style: italic; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Layout primitives */
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--section); position: relative; }
.stack > * + * { margin-top: var(--stack, 20px); }

/* Buttons: one family. Lift on hover, settle on press, a slow shine on the main one. */
.btn {
  --btn-bg: var(--green); --btn-fg: var(--on-green); --btn-bd: transparent; --btn-glow: color-mix(in srgb, var(--green) 55%, transparent);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px;
  border-radius: 999px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: var(--control); font-weight: 500; line-height: 1.3; letter-spacing: -.005em;
  text-decoration: none; text-align: center;
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out), border-color .25s var(--ease-out), transform .38s var(--ease-settle), box-shadow .38s var(--ease-settle);
  -webkit-tap-highlight-color: transparent;
}
.btn .icon { width: 20px; height: 20px; transition: transform .38s var(--ease-settle); }
.btn:hover { transform: translateY(var(--lift)); box-shadow: 0 14px 28px -14px var(--btn-glow); }
.btn:hover .icon-arrow { transform: translateX(4px); }
.btn:active { transform: translateY(0) scale(var(--press)); box-shadow: none; transition-duration: .09s; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; transform: none; box-shadow: none; }
.btn--primary::after { /* a slow strip of window light across the button */
  content: ''; position: absolute; z-index: -1; inset: -2px; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .26) 50%, transparent 68%);
  transform: translateX(-110%); transition: transform .9s var(--ease-settle);
}
.btn--primary:hover::after { transform: translateX(110%); }
.btn--primary:hover { --btn-bg: var(--green-deep); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-strong); --btn-glow: transparent; }
.btn--ghost:hover { --btn-bg: var(--sage-100); --btn-bd: var(--sage-300); }
.btn--soft { --btn-bg: var(--sage-100); --btn-fg: var(--ink); --btn-glow: color-mix(in srgb, var(--sage-500) 40%, transparent); }
.btn--soft:hover { --btn-bg: var(--sage-200); }
.btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-glow: rgba(0, 0, 0, .35); }
.btn--light:hover { --btn-bg: #fff; }
html[data-theme='night'] .btn--light { --btn-bg: #e6e4da; --btn-fg: #17201a; }
html[data-theme='night'] .btn--light:hover { --btn-bg: #f3f1e8; }
.btn--small { min-height: 44px; padding: 9px 18px; font-size: var(--text-small); gap: 8px; }
.btn--small .icon { width: 18px; height: 18px; }
.btn--block { width: 100%; }

.link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-align: left;
  color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px; text-underline-offset: .32em;
  transition: color .25s var(--ease-out), text-decoration-color .25s var(--ease-out), text-underline-offset .3s var(--ease-settle);
}
.link:hover { color: var(--terracotta-ink); text-decoration-color: currentColor; text-underline-offset: .2em; }
.link .icon { width: 18px; height: 18px; transition: transform .38s var(--ease-settle); }
.link:hover .icon-arrow, .link:hover .icon:last-child:not(:first-child) { transform: translateX(3px); }

/* Chips: real buttons with aria-pressed */
.chip {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: var(--control); line-height: 1.3; color: var(--ink);
  transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out), color .25s var(--ease-out), transform .3s var(--ease-settle), box-shadow .3s var(--ease-settle);
  -webkit-tap-highlight-color: transparent;
}
.chip .icon { width: 20px; height: 20px; color: var(--sage-500); transition: color .25s var(--ease-out), transform .45s var(--ease-settle); }
.chip:hover { border-color: var(--sage-500); background: var(--sage-50); transform: translateY(calc(var(--lift) * .5)); }
.chip:hover .icon { transform: scale(1.12); }
.chip:active { transform: scale(var(--press)); transition-duration: .09s; }
.chip[aria-pressed='true'], .chip[aria-checked='true'] { background: var(--green); border-color: var(--green); color: var(--on-green); box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--green) 80%, transparent); animation: pop .45s var(--ease-settle); }
.chip[aria-pressed='true'] .icon, .chip[aria-checked='true'] .icon { color: currentColor; }

/* Forms */
.field { display: grid; gap: 8px; }
.field > label, .label { font-size: var(--text-small); font-weight: 500; color: var(--ink-soft); }
.input, .textarea, .select {
  width: 100%; min-height: 52px; padding: 13px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-size: max(17px, var(--control)); line-height: 1.5;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.textarea { min-height: 120px; resize: vertical; field-sizing: content; max-height: 50vh; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }

/* Small shared bits */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--sage-100); color: var(--ink-soft); font-size: var(--text-micro); line-height: 1.4; }
.privacy-line { display: flex; align-items: flex-start; gap: 10px; font-size: var(--text-micro); color: var(--muted); line-height: 1.55; }
.privacy-line .icon { width: 16px; height: 16px; margin-top: 2px; }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 1000; padding: 12px 18px; border-radius: var(--radius-sm); background: var(--green); color: var(--on-green); font-weight: 500; text-decoration: none; transition: top var(--t-fast); }
.skip-link:focus { top: 12px; }

/* Paper grain: a tiny SVG noise, felt rather than seen. */
.grain::after {
  content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .055; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme='night'] .grain::after { mix-blend-mode: screen; opacity: .04; }

/* Less motion. Every animation and transition is turned off here; motion.css brings
   back only the soft fades. Hover lifts read --lift and --press, which drop to zero. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html:not(.motion-allowed) { --lift: 0px; --press: 1; }
}
html.motion-reduced { scroll-behavior: auto; --lift: 0px; --press: 1; }
html.motion-reduced *, html.motion-reduced *::before, html.motion-reduced *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-allowed) *, html:not(.motion-allowed) *::before, html:not(.motion-allowed) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
