/* Moonglass waitlist. System fonts, one accent, 4 px grid. */

:root {
  color-scheme: light;

  --bg: oklch(0.985 0.004 210);
  --surface: oklch(0.995 0.002 210);
  --field: oklch(1 0 0);
  --text: oklch(0.22 0.012 230);
  --muted: oklch(0.47 0.012 230);
  --control: oklch(0.6 0.012 225);
  --hairline: oklch(0.9 0.006 220);
  --hairline-soft: oklch(0.93 0.005 220);
  --hover: oklch(0.95 0.006 210);
  --accent: oklch(0.52 0.09 195);
  --accent-hover: oklch(0.46 0.085 195);
  --on-accent: oklch(0.99 0.003 210);
  --error: oklch(0.5 0.15 25);

  --moon-dark: oklch(0.925 0.008 215);
  --moon-lit: oklch(0.995 0.004 195);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --s20: 80px;
  --s24: 96px;
  --s32: 128px;

  --prose: 680px;
  --page: 1040px;
  --gutter: var(--s5);

  --fade: 150ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: oklch(0.18 0.01 230);
    --surface: oklch(0.2 0.01 230);
    --field: oklch(0.21 0.01 230);
    --text: oklch(0.94 0.006 220);
    --muted: oklch(0.75 0.01 225);
    --control: oklch(0.56 0.012 225);
    --hairline: oklch(0.31 0.01 230);
    --hairline-soft: oklch(0.26 0.01 230);
    --hover: oklch(0.23 0.01 230);
    --accent: oklch(0.76 0.1 195);
    --accent-hover: oklch(0.82 0.09 195);
    --on-accent: oklch(0.18 0.01 230);
    --error: oklch(0.76 0.12 25);

    --moon-dark: oklch(0.25 0.012 230);
    --moon-lit: oklch(0.93 0.02 195);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: var(--s10);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.frame {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s8);
}

.wordmark {
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--control);
}

/* Hero */

.hero {
  display: grid;
  gap: var(--s8);
  padding-block: var(--s10) var(--s20);
}

.hero-text {
  max-width: 600px;
}

.eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}

h1 {
  margin-top: var(--s4);
  font-size: 40px;
  line-height: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.subline {
  margin-top: var(--s5);
  color: var(--muted);
  font-size: 20px;
  line-height: 30px;
  text-wrap: pretty;
}

.moon {
  order: -1;
  width: 96px;
  height: auto;
  overflow: visible;
}

.moon-halo circle {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1;
}

.moon-halo circle:nth-child(2) {
  stroke: var(--hairline-soft);
}

.moon-halo circle:nth-child(3) {
  stroke: var(--hairline-soft);
  stroke-dasharray: 2 6;
}

.moon-stars circle {
  fill: var(--control);
}

.moon-disc {
  fill: var(--moon-dark);
}

.moon-crescent {
  fill: var(--moon-lit);
}

.moon-edge {
  fill: none;
  stroke: var(--control);
  stroke-width: 1;
}

.moon-horizon {
  stroke: var(--control);
  stroke-width: 1;
}

.moon-reflection line {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.moon-reflection line:nth-child(n + 4) {
  stroke-opacity: 0.7;
}

.moon-reflection line:nth-child(n + 7) {
  stroke-opacity: 0.45;
}

@media (max-width: 719px) {
  .moon-halo,
  .moon-stars {
    display: none;
  }
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
    align-items: start;
    gap: var(--s12);
    padding-block: var(--s16) var(--s24);
  }

  h1 {
    margin-top: var(--s5);
    font-size: 56px;
    line-height: 60px;
  }

  .moon {
    order: 0;
    justify-self: end;
    width: 100%;
    max-width: 360px;
    margin-top: var(--s8);
  }
}

/* Form */

.join {
  margin-top: var(--s10);
}

.field + .field {
  margin-top: var(--s5);
}

label {
  display: block;
  margin-bottom: var(--s2);
  font-weight: 500;
}

.optional {
  margin-left: var(--s1);
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

input,
select,
button {
  font: inherit;
  color: inherit;
}

input[type="email"],
select {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--control);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
}

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

input[type="email"]:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  outline-offset: 0;
  border-radius: 4px;
}

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

.select {
  position: relative;
}

select {
  appearance: none;
  padding-right: var(--s10);
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: var(--s4);
  width: 12px;
  height: 12px;
  margin-top: -6px;
  color: var(--muted);
  pointer-events: none;
}

.field-error:not(:empty) {
  margin-top: var(--s2);
  color: var(--error);
  font-size: 13px;
  line-height: 20px;
}

/* Honeypot: off-screen, out of the tab order, hidden from assistive tech. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 100%;
  min-height: 48px;
  padding: var(--s3) var(--s5);
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--fade) ease, border-color var(--fade) ease, opacity var(--fade) ease;
}

@media (min-width: 560px) {
  .button {
    flex: 0 1 auto;
  }
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button-secondary {
  background: transparent;
  border-color: var(--control);
  color: var(--text);
}

.button-secondary:hover:not(:disabled) {
  background: var(--hover);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.waitlist[aria-busy="true"] .button {
  cursor: progress;
}

.turnstile:not(:empty) {
  margin-top: var(--s4);
}

.form-message:not(:empty) {
  margin-top: var(--s4);
  color: var(--error);
}

noscript .form-message {
  display: block;
  margin-top: var(--s4);
  color: var(--text);
}

.privacy {
  margin-top: var(--s4);
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

/* Confirmation */

.confirmation {
  padding: var(--s6);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
}

.confirmation h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.confirmation h2:focus {
  outline: none;
}

.confirmation p {
  margin-top: var(--s3);
  color: var(--muted);
}

.confirmation p + p {
  margin-top: var(--s2);
}

.is-entering {
  animation: enter var(--fade) ease-out both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Sections */

.section-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

/* Proof points */

.proofs {
  padding-block: var(--s16);
  border-top: 1px solid var(--hairline);
}

.proof-grid {
  display: grid;
  gap: var(--s10);
  margin-top: var(--s8);
}

.proof {
  max-width: var(--prose);
}

.proof-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}

.proof h3 {
  margin-top: var(--s3);
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.proof p:last-child {
  margin-top: var(--s2);
  color: var(--muted);
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .proof-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s12);
  }
}

/* How it works */

.how {
  display: grid;
  gap: var(--s12);
  padding-block: var(--s16) var(--s20);
  border-top: 1px solid var(--hairline);
}

.how-text {
  max-width: var(--prose);
}

.how-lead {
  margin-top: var(--s4);
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.how-text p:not(.how-lead):not(.section-label) {
  margin-top: var(--s4);
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
  text-wrap: pretty;
}

.diagram {
  display: grid;
  gap: var(--s4);
}

.node {
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
}

.node-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}

.node-parts {
  display: grid;
  gap: var(--s2);
  margin-top: var(--s3);
}

.node-parts li {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.node-parts li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border: 1px solid var(--control);
  border-radius: 50%;
}

.link {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--s2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}

.link-line {
  position: relative;
  width: 1px;
  height: 40px;
  background: var(--control);
}

.link-line::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -3px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--control);
  border-bottom: 1px solid var(--control);
  transform: rotate(45deg);
}

.diagram figcaption {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

@media (min-width: 720px) {
  .diagram {
    grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr);
    align-items: stretch;
    gap: var(--s6);
  }

  .link-line {
    width: 100%;
    height: 1px;
  }

  .link-line::after {
    top: -3px;
    right: 0;
    bottom: auto;
    left: auto;
    transform: rotate(-45deg);
  }

  .diagram figcaption {
    grid-column: 1 / -1;
    margin-top: var(--s2);
  }
}

/* Footer */

.site-footer {
  padding-block: var(--s16) var(--s12);
  border-top: 1px solid var(--hairline);
}

.closing {
  max-width: var(--prose);
}

.closing-lead {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.closing p:not(.closing-lead) {
  margin-top: var(--s3);
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
}

.closing a {
  font-weight: 600;
}

.footer-meta {
  margin-top: var(--s16);
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
