/* Tokens — light (default) */
:root {
  --bg: #fafafa;
  --fg: #0a0a0a;
  --muted: #6b7280;
  --body: #374151;
  --border: #e5e7eb;
  --accent: hsl(173 80% 40%);       /* brand accent — wordmark dot, focus ring */
  --accent-cta: hsl(173 80% 28%);   /* darker variant for CTA fill (WCAG AA w/ white) */
  --accent-cta-hover: hsl(173 80% 22%);
  --cta-fg: #ffffff;
  --error: hsl(0 84% 45%);
  --focus-offset: 2px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  width: 100%;
  max-width: 480px;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}

.mark {
  font-family: 'Source Serif 4', ui-serif, Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
}

.mark-dot { color: var(--accent); }

.status {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Rule */
.rule {
  border: 0;
  height: 1px;
  background: var(--fg);
  margin: 0 0 24px;
}

/* Tagline */
.tagline {
  font-family: 'Source Serif 4', ui-serif, Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

/* Body paragraph */
.body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--body);
  margin-bottom: 26px;
}

/* Metadata block */
.meta {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-bottom: 24px;
}

.meta-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 4px 0;
}

.meta dt {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.meta dd {
  font-size: 12px;
  color: var(--fg);
  line-height: 1.5;
}

/* Form */
.form {
  display: flex;
  border: 1px solid var(--fg);
  margin-bottom: 10px;
}

.form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 11px 13px;
  font: inherit;
  font-size: 12.5px;
  color: var(--fg);
  outline: 0;
}

.form input::placeholder { color: var(--muted); }

.form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: calc(-1 * var(--focus-offset));
}

.form button {
  border: 0;
  border-left: 1px solid var(--fg);
  background: var(--accent-cta);
  color: var(--cta-fg);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 16px;
  cursor: pointer;
  transition: background 120ms ease;
  white-space: nowrap;
}

.form button:hover { background: var(--accent-cta-hover); }
.form button:disabled { opacity: 0.6; cursor: wait; }

.form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: var(--focus-offset);
}

/* Form status line */
.form-status {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-height: 1.5em;
  margin-bottom: 16px;
}

.form-status.is-success { color: var(--accent); }
.form-status.is-error { color: var(--error); }

/* Footer */
.footer {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

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

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

/* Narrow viewports — stack the form so the button isn't cramped */
@media (max-width: 380px) {
  body { padding: 32px 16px; }
  .form { flex-direction: column; }
  .form button { border-left: 0; border-top: 1px solid var(--fg); padding: 11px 13px; text-align: left; }
}

/* Tokens — dark (prefers-color-scheme: dark) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(220 20% 10%);
    --fg: hsl(210 40% 98%);
    --muted: hsl(215 20% 65%);
    --body: hsl(215 20% 75%);
    --border: hsl(220 15% 20%);
    --error: hsl(0 84% 62%);
    /* --accent and --accent-cta stay the same — teal works in both themes */
  }
}
