/* Emberwise site: one calm dark theme ("Night Map" with the cinnabar accent), system fonts, no images, no web fonts.
   Every text/background pair is checked by tests/contrast.test.mjs (>= 4.5:1; borders and focus ring >= 3:1). */

:root {
  color-scheme: dark;

  --bg: #0F141C;
  --surface: #18202B;
  --border: #6B7A8F;
  --text: #EEF1F5;
  --text-2: #A9B4C2;
  --accent: #FF7F86;
  --accent-hover: #FFA0A5;
  --accent-strong: #E5484D;
  --on-accent: #0F141C;
  --focus: #FF7F86;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 0.875rem;
  --gutter: 1rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  /* a faint ember glow at the top and a few topographic rings in the corner */
  background-image:
    radial-gradient(ellipse 70rem 30rem at 50% -9rem, rgba(229, 72, 77, 0.16), transparent 70%),
    repeating-radial-gradient(circle at 92% 108%, transparent 0 2.4rem, rgba(169, 180, 194, 0.05) 2.4rem 2.48rem);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--gutter);
}

main {
  flex: 1;
  width: 100%;
  margin-inline: auto;
  padding: 3rem var(--gutter) 2rem;
}

/* ---------- landing ---------- */

.landing main,
.notice {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.5rem, 11vw, 4rem);
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.notice h1 {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  line-height: 1.2;
}

.description {
  margin: 0 0 2rem;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--text-2);
}

#waitlist-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  appearance: none;
}

input::placeholder {
  color: var(--text-2);
  opacity: 1;
}

input[aria-invalid="true"] {
  border-color: var(--accent);
}

button {
  min-height: 3.25rem;
  min-width: 3rem;
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.consent {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-2);
}

.status {
  min-height: 1.6em;
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.status[data-state="error"] {
  color: var(--accent);
}

.status[data-state="success"] {
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-strong);
}

/* honeypot: off-screen, not display:none, so simple bots still fill it */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 34rem) {
  #waitlist-form {
    grid-template-columns: 1fr auto;
    column-gap: 0.75rem;
  }

  #waitlist-form > label,
  #waitlist-form > .consent,
  #waitlist-form > .status {
    grid-column: 1 / -1;
  }
}

/* ---------- notice pages (unsubscribe, no-JavaScript waitlist result, 404) ---------- */

.notice form {
  margin-top: 1.5rem;
}

.notice p {
  margin: 0 0 1rem;
}

.notice .description {
  margin-bottom: 1.5rem;
}

/* ---------- legal pages ---------- */

header {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: 1.25rem var(--gutter) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text);
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  margin-right: 0.55em;
  border-radius: 50%;
  background: var(--accent-strong);
}

.prose {
  max-width: 44rem;
  padding-top: 1.5rem;
}

.prose h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
}

.prose h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.4rem;
  line-height: 1.25;
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

.prose ul {
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose .meta {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.prose a {
  overflow-wrap: anywhere;
}

.prose pre {
  margin: 0 0 1.25rem;
  padding: 1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---------- footer ---------- */

footer {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: 1rem calc(var(--gutter) - 0.5rem) 2rem;
  font-size: 0.9375rem;
}

footer nav + nav {
  margin-top: 0.25rem;
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  color: var(--text-2);
  text-decoration: none;
}

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

footer a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.landing footer {
  max-width: 34rem;
}

footer a:focus-visible,
.brand:focus-visible {
  border-radius: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background-color 120ms ease;
  }
}
