/* ── Typography & Tokens ─────────────────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("fonts/RobotoMono.woff2") format("woff2");
  font-weight: 400;
}

:root {
  --bg: #fbfbfb;
  --text: #121212;
  --sub: #999999;
  --pill-bg: #f2f2f2;
  --accent: #ff3300;
  --border: rgba(0, 0, 0, 0.05);
  --font-mono: "Roboto Mono", monospace;
  --font-sans: "Inter", sans-serif;
  --max-width: 600px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e2e;
    --text: #efefef;
    --sub: #888899;
    --pill-bg: rgba(255, 255, 255, 0.07);
    --accent: #ff3300;
    --border: rgba(255, 255, 255, 0.1);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
header, main, footer {
  width: 100%;
  max-width: var(--max-width);
  padding: 2rem;
}

header {
  padding-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

header a {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
  line-height: 1;
}

header p {
  margin: 0;
  color: var(--sub);
  font-size: 0.9rem;
}

main {
  flex: 1;
}

footer {
  padding-bottom: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--sub);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

footer nav {
  display: flex;
  gap: 1.5rem;
}

footer a {
  color: var(--sub);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 3rem 0 1.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin: 0 0 1.5rem;
}

a {
  color: var(--text);
  text-decoration: none;
}

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--pill-bg);
  border-radius: 1rem;
}

blockquote p {
  margin: 0;
  font-size: 1.1rem;
}

cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  color: var(--sub);
}

/* ── Elements ────────────────────────────────────────────────────────────── */
dl {
  margin: 2rem 0;
}

dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
}

dd {
  margin: 0.5rem 0 0 0;
  color: var(--sub);
}

code {
  font-family: inherit;
  background: var(--pill-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.9em;
}

ul {
  padding-left: 1.2rem;
  margin-bottom: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

details {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details p {
  margin-top: 1rem;
  color: var(--sub);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 1rem;
}

form > div {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 0.8rem;
}

input[type="email"], textarea {
  width: 100%;
  padding: 0 0 0.8rem;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
  outline: none;
  border-radius: 0;
}

input[type="email"]::placeholder, textarea::placeholder {
  color: var(--pill-bg);
}

input[type="email"]:focus, textarea:focus {
  outline: none;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--sub);
  margin-top: 0.5rem;
}

.char-count {
  font-size: 0.7rem;
  color: var(--sub);
  text-align: right;
  margin-top: 0.4rem;
  opacity: 0.6;
}

.char-count.warn {
  color: #ff3b30;
  opacity: 1;
}

button[type="submit"] {
  align-self: flex-start;
  padding: 0.8rem 2rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 2rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

button[type="submit"]:active {
  opacity: 0.7;
}

/* ── Stars ── */
.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.stars input { display: none; }

.stars label {
  font-size: 2.5rem;
  color: var(--pill-bg);
  cursor: pointer;
  margin: 0;
  transition: color 0.1s, transform 0.1s;
}

.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
  color: #f5a623;
}

.stars label:hover { transform: scale(1.1); }

/* ── Toggles ── */
.platform-toggle {
  display: flex;
  gap: 12px;
}

.platform-toggle input { display: none; }

.platform-toggle label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  background: var(--pill-bg);
  border-radius: 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--sub);
  text-transform: lowercase;
  margin: 0;
}

.platform-toggle input:checked + label {
  background: var(--text);
  color: var(--bg);
}

/* ── Messages ── */
.msg-success {
  padding: 1.5rem;
  background: color-mix(in srgb, #34c759 10%, var(--bg));
  border-radius: 1rem;
  margin-top: 2rem;
}

.msg-success strong {
  display: block;
  font-family: var(--font-sans);
  font-weight: 900;
  color: #34c759;
  margin-bottom: 0.5rem;
}

.msg-success p {
  font-size: 0.9rem;
  margin: 0;
  color: var(--sub);
}

.msg-error {
  font-size: 0.85rem;
  color: #ff3b30;
  margin: 0;
}

.spots {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--sub);
  background: var(--pill-bg);
  padding: 0.4rem 1rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
}

/* ── Dictionary / Word Map ───────────────────────────────────────────────── */
#word-map, #anchors {
  margin: 2rem 0;
}

#word-map b {
  display: inline-block;
  min-width: 100px;
  color: var(--text);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.group { margin-bottom: 32px; }
.group-header {
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; margin-bottom: 12px;
    color: var(--text);
}
.word-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.word-row:last-child { border-bottom: none; }

[type="pill"] {
    font-size: 0.7rem; font-weight: 600; padding: 4px 12px;
    border-radius: 99px; white-space: nowrap;
    background: var(--pill-bg);
    color: var(--sub);
    text-transform: uppercase;
}

[data-pill="0"] { background: #e8f5e9; color: #2e7d32; } /* money */
[data-pill="1"] { background: #e3f2fd; color: #1565c0; } /* task */
[data-pill="2"] { background: #f3e5f5; color: #7b1fa2; } /* reminder */
[data-pill="3"] { background: #fff3e0; color: #ef6c00; } /* counter */
[data-pill="4"] { background: #fce4ec; color: #c2185b; } /* vault */
[data-pill="5"] { background: #efebe9; color: #4e342e; } /* split */
[data-pill="6"] { background: #e0f2f1; color: #00695c; } /* health */
