@font-face {
  font-family: Fraunces;
  src: url("/assets/fraunces.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f0e2;
  --ink: #182f28;
  --muted: #4a5e53;
  --line: #d8d1bc;
  --pine: #102d27;
  --gold: #f4ce76;
  --display: Fraunces, Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
body.paper { background: var(--paper); color: var(--ink); }
body.welcome {
  color: #faf3dd;
  background:
    radial-gradient(ellipse at 78% 43%, #285441 0%, transparent 48%),
    radial-gradient(ellipse at 15% 90%, #183d34 0%, transparent 60%),
    #102d27;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, select:focus-visible,
textarea:focus-visible, input:focus-visible {
  outline: 3px solid #307b60;
  outline-offset: 3px;
}
.welcome :focus-visible { outline-color: var(--gold); }
p { margin: 0; }
h1, h2 { margin: 0; font-family: var(--display); line-height: 1.08; }
h1 { font-weight: 650; letter-spacing: -.044em; }
h2 { font-weight: 620; letter-spacing: -.025em; font-size: clamp(1.45rem, 2.8vw, 1.9rem); }
img { display: block; max-width: 100%; height: auto; }

.welcome-frame, .page-frame {
  max-width: 1232px;
  margin-inline: auto;
  padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.site-header {
  padding-block: max(20px, env(safe-area-inset-top)) 15px;
  border-bottom: 1px solid var(--line);
}
.site-footer {
  margin-top: auto;
  padding-block: 12px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: .93rem;
  color: var(--muted);
}
.welcome .site-header, .welcome .site-footer { border-color: #ecd6904a; }
.welcome .site-footer { color: #e0e7d4; }
.brand, .quiet-link, .site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 620;
  text-decoration: none;
}
.brand { gap: 10px; font-family: var(--display); font-size: 1.03rem; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.quiet-link { font-size: .95rem; }
.quiet-link:hover, .site-footer a:hover { text-decoration: underline; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.site-footer a { color: inherit; }
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: clamp(2.5rem, 7vw, 7rem);
  padding: 74px clamp(0px, 3vw, 44px);
}
.hero-art { grid-column: 2; grid-row: 1; justify-self: center; position: relative; width: min(100%, 430px); }
.hero-art::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 25%;
  border: 1px solid #edcc7569;
  pointer-events: none;
}
.hero-art img {
  position: relative;
  border-radius: 23%;
  box-shadow: 0 24px 75px #041714b5;
}
.hero-copy { grid-column: 1; grid-row: 1; }
.eyebrow {
  color: var(--gold);
  font-size: .83rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 { font-size: clamp(4rem, 7.5vw, 7.3rem); margin-block: .16em .22em; line-height: .99; }
.hero-description { color: #dbe6d8; max-width: 32ch; font-size: clamp(1rem, 1.65vw, 1.17rem); }
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-actions { margin-top: 25px; }
.welcome-status:not(:empty) { color: #dbe6d8; margin-top: 13px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 49px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 680;
  text-decoration: none;
}
.button.primary { background: #205642; color: #fff9e8; }
.button.primary:hover { background: #154231; }
.button.primary:disabled { opacity: .58; }
.button.secondary { border-color: #8b9a89; color: var(--ink); background: transparent; }
.button.secondary:hover { background: #182f280a; }
.welcome .button.primary { background: var(--gold); color: #252413; }
.welcome .button.primary:hover { background: #ffe5a5; }
.welcome .button.secondary { border-color: #dfcc927f; color: #faf0d6; }
.welcome .button.secondary:hover { background: #fff8dc12; }

.inner { width: min(100%, 960px); margin-inline: auto; padding-block: clamp(36px, 6vw, 76px) 48px; }
.inner.single { max-width: 670px; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
.page-heading p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.17rem); margin-top: 12px; max-width: 52ch; }
.guide-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.lesson, .form-card, .policy-body, .rule-note {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(17px, 3.5vw, 29px);
  background: #fffaf0;
}
.lesson > p, .rule-note p, .policy p, .tool-list dd { color: var(--muted); margin-top: 8px; }
.open-lesson { background: #e5eadb; border-color: #cbd5c1; }
.free-art { width: 48px; filter: drop-shadow(2px 3px 2px #23322b30); margin-bottom: 14px; }
.demo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 12px 10px;
  margin-top: 14px;
  border-radius: 10px;
  background: radial-gradient(ellipse at center, #285f49, #14362c);
}
.tile {
  padding: 0;
  min-width: 0;
  min-height: 44px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
}
.tile img { width: min(100%, 77px); margin-inline: auto; }
.tile:focus-visible { outline-color: var(--gold); outline-offset: 1px; }
.tile[aria-pressed="true"] { border-color: var(--gold); background: #f4ce7626; }
.tile:disabled img { opacity: .64; }
.tile.removed { visibility: hidden; }
.demo-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 10px; }
.demo-status { color: var(--muted); font-size: .93rem; }
.text-button { padding: 0; border: 0; background: none; color: #1e6148; text-decoration: underline; min-height: 44px; font-weight: 650; }
.text-button:disabled { opacity: .58; }
.tool-section { margin-block: 24px; }
.tool-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 0; }
.tool-list div { border-top: 1px solid var(--line); padding-top: 10px; }
.tool-list dt { font-weight: 700; }
.tool-list dd { margin-left: 0; margin-top: 3px; }

.form-card { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 700; }
.optional { color: var(--muted); font-weight: 400; font-size: .88rem; margin-left: 4px; }
.field input, .field select, .field textarea {
  display: block;
  min-height: 46px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #8a9a87;
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 1rem;
}
.field textarea { resize: vertical; }
.field-note { color: var(--muted); display: flex; gap: 5px 12px; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; }
.field-note #message-count { white-space: nowrap; }
.form-actions { gap: 16px; }
.error { color: #8f2523; }
.receipt { justify-items: start; }
.receipt p { color: var(--muted); }
.receipt code { padding: 6px 9px; color: var(--ink); background: #e7ebdd; border-radius: 5px; overflow-wrap: anywhere; max-width: 100%; }
.policy-body { display: grid; gap: 20px; }
.policy-body section + section { border-top: 1px solid var(--line); padding-top: 20px; }
.policy-body h2 { font-size: clamp(1.3rem, 4vw, 1.58rem); }
.policy-body a { color: #1e6148; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 29px; padding: 29px 0 32px; }
  .hero-art { grid-column: 1; grid-row: 1; width: clamp(140px, 43vw, 218px); }
  .hero-art::before { inset: -6px; }
  .hero-copy { grid-column: 1; grid-row: 2; text-align: center; }
  .hero h1 { font-size: clamp(3.2rem, 11vw, 5.2rem); }
  .hero-description { margin-inline: auto; max-width: 33ch; }
  .hero-actions { justify-content: center; margin-top: 18px; }
  .hero-actions .button { padding-inline: 14px; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-list { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .welcome-frame, .page-frame { padding-inline: max(17px, env(safe-area-inset-left)) max(17px, env(safe-area-inset-right)); }
  .site-footer { gap: 0 12px; }
  .site-footer nav { gap: 0 15px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color .15s ease; }
}
