/* Valley Sans (SIL Open Font License, see /fonts/OFL.txt), self-hosted so
   pages make no requests to font services. Variable font, weights 100–900. */
@font-face {
  font-family: "Valley Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/ValleySans.ttf") format("truetype");
}

/* Lunar Eclipse: midnight indigo, frosted slate, moonlit silver-blue. */
:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --ink: #101726;
  --muted: #566278;
  --line: #d8e1ee;
  --accent: #142038;
  --accent-ink: #f4f7fc;
  --glow: rgba(120, 168, 245, 0.34);
  --hero-glow: rgba(120, 168, 245, 0.16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b101c;
    --surface: #141d30;
    --ink: #eef3fc;
    --muted: #93a3bd;
    --line: #23314d;
    --accent: #dbe8ff;
    --accent-ink: #0b101c;
    --glow: rgba(158, 197, 255, 0.28);
    --hero-glow: rgba(158, 197, 255, 0.14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b101c; --surface: #141d30; --ink: #eef3fc; --muted: #93a3bd; --line: #23314d;
  --accent: #dbe8ff; --accent-ink: #0b101c;
  --glow: rgba(158, 197, 255, 0.28); --hero-glow: rgba(158, 197, 255, 0.14); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(760px 440px at 50% 0%, var(--hero-glow), transparent 72%), var(--bg);
  color: var(--ink);
  font: 17px/1.6 "Valley Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, .brand, .plan .price, .word-name {
  font-family: "Valley Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
h1, h2 { letter-spacing: -0.025em; }
img { max-width: 100%; height: auto; }
main, .wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.narrow { max-width: 640px; padding-top: 32px; padding-bottom: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: 19px; }
.brand img { display: block; }
header.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
header.top nav a { margin-left: 20px; text-decoration: none; color: var(--muted); }
header.top nav a:hover { color: var(--ink); }

.hero { text-align: center; padding: 56px 0 40px; }
.hero .icon { width: 150px; filter: drop-shadow(0 0 48px var(--glow)) drop-shadow(0 0 16px var(--glow)); }
.hero h1 { font-size: clamp(36px, 7vw, 58px); line-height: 1.08; letter-spacing: -0.02em; margin: 36px 0 14px; }
.hero p.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 600px; margin: 0 auto 30px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fine { color: var(--muted); font-size: 14px; margin-top: 14px; }

.button {
  display: inline-block; padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  font-family: inherit;
}
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.button:hover { filter: brightness(0.97); }
.button.soon { color: var(--muted); cursor: default; }
.button.soon:hover { filter: none; }

.word { margin: 40px auto 0; max-width: 420px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); text-align: left; }
.word p { margin: 0; }
.word-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.word-name { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.word-ipa { font: 17px ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); }
.word-say { margin-top: 6px !important; }
.word-def { margin-top: 4px !important; color: var(--muted); }

section { padding: 48px 0; border-top: 1px solid var(--line); }
section h2 { font-size: 30px; letter-spacing: -0.01em; margin: 0 0 24px; text-align: center; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.plan.pro { border: 2px solid var(--accent); }
.plan h3 { margin: 0; font-size: 22px; }
.plan .price { font-size: 32px; font-weight: 700; margin: 8px 0 4px; }
.plan .price small { font-size: 15px; font-weight: 400; color: var(--muted); }
.plan ul { padding-left: 20px; margin: 16px 0 22px; }
.plan li { margin: 6px 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.features h3 { font-size: 18px; margin: 0 0 6px; }
.features p { margin: 0; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--muted); margin: 10px 0 0; }
code { font: 15px ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { margin-right: 16px; }

textarea { width: 100%; font: 13px ui-monospace, "SF Mono", Menlo, monospace; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); word-break: break-all; resize: vertical; }
.muted { color: var(--muted); }
.licensekey { font: 600 clamp(15px, 4.2vw, 22px) ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center;
  user-select: all; overflow-wrap: anywhere; }
.legal h2 { font-size: 21px; margin-top: 32px; }

@media (max-width: 560px) {
  header.top nav a { margin-left: 14px; font-size: 15px; }
  .hero { padding-top: 32px; }
}

.center { text-align: center; }

/* Short personal note after the FAQ */
.note { max-width: 560px; margin: 0 auto; text-align: center; }
.note .word { margin: 0 auto 28px; }
.note-label { font-family: "Valley Sans", -apple-system, sans-serif; font-weight: 600; color: var(--ink); margin: 0 0 6px !important; letter-spacing: 0.02em; }
.note p { color: var(--muted); margin: 0; }

/* Footer on the legal pages */
footer.page-foot { margin-top: 48px; padding: 20px 0 0; }

/* Interactive demo */
.demo { text-align: center; }
.demo-intro { color: var(--muted); margin: -12px 0 28px; }
.demo-stage { display: flex; gap: 28px; justify-content: center; align-items: center; flex-wrap: wrap; }
.demo-lid {
  --glow: 0.5;
  position: relative; width: min(100%, 360px); aspect-ratio: 16 / 10.5; border-radius: 18px;
  background: linear-gradient(160deg, #3a4150, #262b35 60%, #1f232b); border: 1px solid #454c5a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 40px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.demo-lid::after { /* the room glow the logo throws */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(219,232,255, calc(var(--glow) * var(--glow) * 0.44)), transparent calc(25% + var(--glow) * 40%));
  transition: background 0.35s ease;
}
.demo-logo {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, rgba(246,250,255,1) 0%, rgba(219,232,255,0.92) 55%, rgba(158,197,255,0.28) 100%);
  opacity: calc(0.08 + var(--glow) * var(--glow) * 0.92);
  box-shadow: 0 0 calc(var(--glow) * var(--glow) * 80px) calc(var(--glow) * var(--glow) * 26px) rgba(206,226,255, calc(var(--glow) * 0.8));
  transition: opacity 0.35s ease, box-shadow 0.35s ease;
}
.demo-lid.off .demo-logo { background: #2d323c; box-shadow: none; opacity: 1; }
.demo-menu {
  width: 280px; text-align: left; background: #232427; color: #f2f2f2; border-radius: 14px; padding: 14px 16px 10px;
  border: 1px solid #3a3b3f; box-shadow: 0 18px 40px rgba(0,0,0,0.35); font-size: 15px;
}
.demo-row { display: flex; justify-content: space-between; align-items: center; }
.demo-status { color: #8e8e93; font-size: 14px; margin: 6px 0 10px; border-bottom: 1px solid #3a3b3f; padding-bottom: 10px; }
.demo-switch { width: 44px; height: 26px; border-radius: 13px; border: 0; background: #5b5c60; position: relative; cursor: pointer; padding: 0; }
.demo-switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.demo-switch[aria-checked="true"] { background: #34c759; }
.demo-switch[aria-checked="true"] span { transform: translateX(18px); }
.demo-seg { display: grid; grid-template-columns: 1fr 1fr; background: #2f3034; border-radius: 9px; padding: 2px; margin-bottom: 10px; }
.demo-seg button { border: 0; background: transparent; color: #f2f2f2; font: inherit; font-size: 14px; padding: 6px 0; border-radius: 7px; cursor: pointer; }
.demo-seg button[aria-pressed="true"] { background: #55565b; }
.demo-slider { display: flex; align-items: center; gap: 10px; color: #8e8e93; font-size: 13px; }
.demo-slider input { flex: 1; accent-color: #f2f2f2; }
.demo-slider input:disabled { opacity: 0.4; }
.demo-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.demo-presets button {
  border: 0; background: #2f3034; color: #f2f2f2; font: inherit; font-size: 12.5px;
  padding: 5px 0; border-radius: 7px; cursor: pointer; transition: background 0.15s ease;
}
.demo-presets button:hover { background: #3f4045; }
.demo-presets button[aria-pressed="true"] { background: #55565b; }
.demo-sep { border-top: 1px solid #3a3b3f; margin: 10px 0 8px; }
.demo-item { display: flex; justify-content: space-between; color: #f2f2f2; padding: 2px 0; }
.demo-item span { color: #8e8e93; }
.demo-caption { color: var(--muted); margin: 22px auto 0; min-height: 1.6em; }
.demo .demo-menu :focus-visible { outline: 2px solid #f2f2f2; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .demo-logo, .demo-lid::after, .demo-switch span { transition: none; }
}

/* Screenshots */
.shots-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; align-items: end; }
.shots figure { margin: 0; text-align: center; }
.shots img { width: 100%; height: auto; max-width: 440px; }
.shots figure:first-child img { max-width: 310px; }
.shots figure:last-child img { border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 44px -18px rgba(0,0,0,0.45); }
.shots figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* Accessibility */
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10; padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
/* One clear focus ring everywhere (WCAG 2.4.7 / 2.4.11): ink color contrasts with the page in both themes. */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
/* Comfortable click and tap targets (WCAG 2.5.8: at least 24 px) */
header.top nav a, footer a { display: inline-block; padding: 4px 0; }
.demo-slider input { height: 24px; }
/* Visible button edges */
.button { border-color: var(--line); }
.button:hover { border-color: var(--muted); }
.button.primary { border-color: transparent; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.note .word .word-say { color: var(--ink); }
