:root {
  --bg: #FFFDF7;
  --surface: #FFFFFF;
  --text: #17181B;
  --muted: #45433D;
  --accent: #6E5100;
  --on-accent: #FFFFFF;
  --line: #6F6956;
  --soft: #F3EEDF;
  --focus: #0B57D0;
  --dock-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #1B1D22;
    --text: #F4F1E8;
    --muted: #C9C4B6;
    --accent: #F2C230;
    --on-accent: #101114;
    --line: #8C8672;
    --soft: #23252B;
    --focus: #8AB4F8;
  }
}

@media (prefers-contrast: more) {
  :root { --muted: var(--text); --line: var(--text); }
}

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

html {
  scroll-padding-top: 16px;
  scroll-padding-bottom: calc(var(--dock-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
}

img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
[tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--accent); color: var(--on-accent);
  padding: .75rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .75rem; }
h1 { font-size: clamp(2.25rem, 7vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
h3.sub { font-size: 1.3rem; margin-top: 2rem; }

/* Header */
.top { border-bottom: 1px solid var(--soft); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand img { border-radius: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .7rem 1.4rem;
  background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--accent); border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn:active { transform: scale(.97); }
.btn-small { min-height: 44px; padding: .45rem 1rem; font-size: 1rem; }
.btn[disabled] { opacity: .7; cursor: progress; }

/* Sections */
.sec { padding: 3rem 0 2rem; }
.sec + .sec { border-top: 1px solid var(--soft); }
.hero { padding-top: 2.5rem; }
.hero-logo { border-radius: 22px; margin-bottom: 1.25rem; }
.lead { font-size: 1.3rem; color: var(--muted); max-width: 34ch; }
.lead-s { font-size: 1.2rem; }
.facts { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .75rem; }
.facts li { padding: 1rem 1.1rem; background: var(--soft); border-radius: 14px; }
.facts strong { display: block; }
.note { color: var(--muted); }

/* Search */
.search { margin: 1.5rem 0 1rem; }
.search label { display: block; font-weight: 700; margin-bottom: .35rem; }
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; padding: .7rem .9rem; min-height: 48px;
}
input:focus-visible, textarea:focus-visible { border-color: var(--focus); outline-offset: 1px; }
.search-status { min-height: 1.6em; margin: .4rem 0 0; color: var(--muted); }

/* Disclosures */
.groups { display: grid; gap: .75rem; }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.disc-h { margin: 0; font-size: inherit; }
.disc {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px;
  padding: .85rem 1rem; text-align: left; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.disc:hover { background: var(--soft); }
.disc[aria-expanded="true"] { border-color: var(--accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.disc-t { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; }
.disc-group { font-size: 1.2rem; min-height: 64px; }
.count { font-weight: 400; font-size: 1rem; color: var(--muted); }
.chev { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.disc[aria-expanded="true"] .chev { transform: rotate(180deg); }

.tag {
  display: inline-block; font-size: .85rem; font-weight: 700; line-height: 1.2;
  padding: .2rem .55rem; border-radius: 999px;
  color: var(--accent); border: 1.5px solid var(--accent);
}

.panel {
  padding: 1rem 1.1rem .4rem;
  border: 2px solid var(--accent); border-top: 0;
  border-radius: 0 0 14px 14px; background: var(--surface);
}
.js .panel[hidden] { display: none; }
.panel.opening { animation: reveal .22s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.group > .panel { background: transparent; padding: 1rem .75rem .9rem; }
.group-intro { color: var(--muted); }
.item .disc { font-size: 1.1rem; }
.how { font-weight: 700; margin: 0 0 .35rem; }
.panel ol, .panel ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.panel li + li { margin-top: .3rem; }
.item[hidden] { display: none; }

.prose h4 { font-size: 1.1rem; margin: 1.25rem 0 .4rem; }

/* Plans */
.plans { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.plan { padding: 1rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.plan p { margin: 0; }
.plan-n { font-size: 1.3rem; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .25rem !important; }
.plan-best { border-color: var(--accent); }
.plan-info { margin: 1.5rem 0; }
.plan-cards { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .plan-cards { grid-template-columns: repeat(4, 1fr); } }
.plan-card {
  width: 100%; height: 100%; min-height: 120px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .2rem;
  padding: 1rem; text-align: left; cursor: pointer; position: relative;
  font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 16px;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.plan-card:hover { background: var(--soft); border-color: var(--accent); }
.plan-card:active { transform: scale(.98); }
.plan-card-best { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.plan-card .tag { order: -1; margin-bottom: .2rem; }
.plan-name { font-weight: 700; font-size: 1.15rem; }
.plan-price { font-weight: 700; font-size: 1.75rem; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; }
.plan-per { color: var(--muted); font-size: .95rem; }
.plan-dlg-price { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.plan-facts { padding-left: 1.4rem; margin: 0 0 1rem; }
.plan-facts li + li { margin-top: .35rem; }
.cols { columns: 2 200px; }

/* Developer */
.apps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.apps li { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; background: var(--soft); border-radius: 14px; }
.apps img { border-radius: 12px; flex: none; }
.apps p { margin: 0 0 .3rem; }
.app-n { font-weight: 700; }
.links { padding-left: 1.3rem; }
.links li { margin: .4rem 0; }

/* Form */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; }
.err { margin: .35rem 0 0; color: #A1150B; font-weight: 700; }
.err:empty { display: none; }
@media (prefers-color-scheme: dark) { .err { color: #FF9C8F; } [aria-invalid="true"] { border-color: #FF9C8F; } }
[aria-invalid="true"] { border-color: #A1150B; }
.form-status { margin-top: 1rem; font-weight: 700; min-height: 1.6em; }

.foot { padding: 2rem 0 1.5rem; color: var(--muted); border-top: 1px solid var(--soft); }

/* Bottom section menu */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.dock ul { list-style: none; margin: 0 auto; padding: 0 4px; max-width: 760px; display: grid; grid-template-columns: repeat(5, 1fr); }
.dock a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--dock-h); padding: 6px 2px;
  color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 700;
  border-radius: 12px; position: relative;
}
.dock svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: transform .2s var(--ease); }
.dock a[aria-current] { color: var(--accent); }
.dock a[aria-current] svg { transform: translateY(-2px); }
.dock a::after {
  content: ""; position: absolute; top: 4px; left: 50%; width: 28px; height: 4px; margin-left: -14px;
  border-radius: 4px; background: var(--accent); transform: scaleX(0); transition: transform .25s var(--ease);
}
.dock a[aria-current]::after { transform: scaleX(1); }
.dock a:focus-visible { outline-offset: -3px; }

@media (min-width: 800px) {
  .dock { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 560px; border: 2px solid var(--line); border-radius: 20px; }
  body { padding-bottom: calc(var(--dock-h) + 40px); }
}

@media (forced-colors: active) {
  .disc, .plan, .plan-card, .dock, .panel, input, textarea { border-color: CanvasText; }
  .dock a[aria-current] { text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Greeting */
.greet { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-bottom: .35rem; }
.promise { font-size: 1.2rem; font-weight: 700; max-width: 34ch; }
@media (prefers-reduced-motion: no-preference) {
  .greet, #home-h, .promise { animation: rise .6s var(--ease) both; }
  #home-h { animation-delay: .08s; }
  .promise { animation-delay: .16s; }
}
@keyframes rise { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Live local date and time */
.clock { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; margin: 0 0 1rem; color: var(--muted); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.clock time { color: var(--text); font-weight: 700; }
.clock-zone { font-size: .95rem; }
.dock span { text-align: center; line-height: 1.15; }

/* Subscribe dialog */
.price { font-size: 1.2rem; font-weight: 700; margin-bottom: .75rem; }
.pay {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 1.25rem 1.1rem 1rem; border: 2px solid var(--accent); border-radius: 18px;
  background: var(--surface); color: var(--text);
}
.pay::backdrop { background: rgb(0 0 0 / .6); }
.pay[open] { animation: reveal .22s var(--ease); }
.pay-title { font-size: 1.5rem; margin-bottom: .5rem; }
.pay-summary { color: var(--muted); }
.pay-demo { font-weight: 700; padding: .5rem .75rem; border: 2px dashed var(--accent); border-radius: 10px; }
.pay-note { padding: .75rem .9rem; background: var(--soft); border-radius: 12px; font-size: 1rem; }
.checks { border: 0; padding: 0; margin: 0 0 .75rem; }
.checks legend { font-weight: 700; margin-bottom: .4rem; padding: 0; }
.check { display: flex; align-items: flex-start; gap: .75rem; padding: .55rem 0; }
.check input { width: 26px; height: 26px; min-height: 0; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check label { cursor: pointer; }
.pay-hint { color: var(--muted); font-size: 1rem; margin-bottom: .25rem; }
.pay-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.pay-details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.pay-details dt { font-weight: 700; }
.pay-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .pay-details { grid-template-columns: 1fr; } .pay-details dd { margin-bottom: .4rem; } }

/* Stand-alone subscribe page: no bottom section menu */
body.solo { padding-bottom: 2rem; }
p.brand { margin: 0; }

/* Currency choice for plan prices */
.currency-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: 0 0 1rem; }
.currency-pick label { font-weight: 700; }
.currency-pick select { font: inherit; min-height: 48px; padding: .5rem .75rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); max-width: 100%; }
.currency-pick[hidden] { display: none; }
