/* /calc: one input, one answer. Deliberately spare; light and dark. */

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

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --chip: #f9fafb;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --faint: #6b7280;
    --line: #262a33;
    --chip: #171a21;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* ===== NAV ===== */
.nav {
  border-bottom: 1px solid var(--line);
  height: 64px;
  display: flex;
  align-items: center;
}

.nav__logo {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ===== CALC ===== */
.calc {
  padding-top: clamp(3rem, 12vh, 8rem);
  padding-bottom: 4rem;
}

#q {
  display: block;
  width: 100%;
  font: inherit;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 0.75rem;
  outline: none;
}

#q::placeholder { color: var(--faint); }
#q:focus { border-bottom-color: var(--muted); }

.out {
  display: block;
  margin-top: 2rem;
  font-variant-numeric: tabular-nums;
  min-height: 6rem;
}

/* "can't read that yet" / "Dec 2026 has only 31 days" */
.out--note { color: var(--faint); font-size: 0.9375rem; }

.head {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.echo {
  margin-top: 0.25rem;
  color: var(--faint);
  font-size: 0.875rem;
}

/* ===== EXAMPLES ===== */
.hints {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hints button {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

.hints button:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ===== 404 ===== */
.notfound {
  padding-top: clamp(3rem, 12vh, 8rem);
  color: var(--muted);
}

.notfound a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* ===== HISTORY ===== */
/* The query scrolls under a fade; short queries are unaffected because the
   mask only covers empty space, so no JS overflow check is needed. */
.log { list-style: none; margin-top: 2rem; }

.log li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.log__q {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  text-align: left;
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
}

.log__q::-webkit-scrollbar { display: none; }
.log__q:hover { color: var(--text); }

.log__a {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.clear {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--faint);
  background: none;
  border: 0;
  padding: 0.5rem 0;
  cursor: pointer;
}

.clear:hover { color: var(--text); }
.hints[hidden], .clear[hidden] { display: none; }

/* Answers copy to the clipboard on click; the dim is the receipt. */
.head, .log__a { cursor: pointer; }
.copied { opacity: 0.4; transition: opacity 120ms; }
