/* The Nightstand tokens, copied from frontend/app/tokens.css: dark first, light
   from the OS or from the toggle (data-theme). Change them there first. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/InstrumentSans-wght.woff2") format("woff2");
}

@font-face {
  font-family: "Bronova";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Bronova-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Bronova";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Bronova-Bold.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: oklch(0.2 0.01 95);
  --surface: oklch(0.245 0.012 95);
  --surface-2: oklch(0.29 0.012 95);
  --line: oklch(0.31 0.012 95);
  --line-strong: oklch(0.56 0.014 95);
  --text: oklch(0.96 0.006 95);
  --text-2: oklch(0.88 0.008 95);
  --text-muted: oklch(0.72 0.012 95);
  --accent: oklch(0.72 0.09 110);
  --accent-hover: oklch(0.78 0.09 110);
  --accent-soft: oklch(0.3 0.035 110);
  --accent-line: oklch(0.38 0.05 110);
  --on-accent: oklch(0.2 0.01 95);
  --warning: oklch(0.8 0.1 75);
  --warning-soft: oklch(0.3 0.03 75);
  --danger: oklch(0.76 0.12 28);

  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-control: 0.375rem;
  --weight-normal: 430;
  --weight-medium: 570;
  --weight-semi: 620;
  --control-lg: 2.75rem;
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 120ms;
  --duration-state: 190ms;
  --font-display: "Bronova", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: oklch(0.985 0.006 95);
    --surface: #fff;
    --surface-2: oklch(0.955 0.012 95);
    --line: oklch(0.9 0.012 100);
    --line-strong: oklch(0.62 0.018 105);
    --text: oklch(0.18 0.012 105);
    --text-2: oklch(0.34 0.016 105);
    --text-muted: oklch(0.49 0.018 105);
    --accent: oklch(0.35 0.075 110);
    --accent-hover: oklch(0.28 0.066 110);
    --accent-soft: oklch(0.955 0.018 110);
    --accent-line: oklch(0.9 0.027 110);
    --on-accent: #fff;
    --warning: oklch(0.52 0.13 75);
    --warning-soft: oklch(0.95 0.035 75);
    --danger: oklch(0.52 0.18 28);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.985 0.006 95);
  --surface: #fff;
  --surface-2: oklch(0.955 0.012 95);
  --line: oklch(0.9 0.012 100);
  --line-strong: oklch(0.62 0.018 105);
  --text: oklch(0.18 0.012 105);
  --text-2: oklch(0.34 0.016 105);
  --text-muted: oklch(0.49 0.018 105);
  --accent: oklch(0.35 0.075 110);
  --accent-hover: oklch(0.28 0.066 110);
  --accent-soft: oklch(0.955 0.018 110);
  --accent-line: oklch(0.9 0.027 110);
  --on-accent: #fff;
  --warning: oklch(0.52 0.13 75);
  --warning-soft: oklch(0.95 0.035 75);
  --danger: oklch(0.52 0.18 28);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--weight-normal);
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  hyphens: auto;
}

h1 {
  font-size: clamp(2.125rem, 1.4rem + 3.6vw, 3.5rem);
  letter-spacing: -0.012em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  letter-spacing: -0.006em;
  line-height: 1.15;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
}

strong {
  font-weight: var(--weight-semi);
}

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

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

:focus-visible {
  outline: 0.125rem solid var(--accent);
  outline-offset: 0.1875rem;
}

/* A class that sets display would otherwise win over the hidden attribute. */
[hidden] {
  display: none !important;
}

mark {
  padding: 0 0.2em;
  border-radius: 0.25rem;
  background: var(--warning-soft);
  color: var(--warning);
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.5rem 0.75rem;
  transform: translateY(-200%);
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header: brand and actions on one row, the section links under them on a
   phone, all three on one row once there is room. */
.site-header {
  display: grid;
  grid-template-areas: "brand actions" "nav nav";
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding-block: 1rem 0.5rem;
}

.brand {
  grid-area: brand;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  grid-area: nav;
  gap: 0.25rem 0.875rem;
}

.site-nav a,
.site-footer a {
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover,
:is(.site-nav, .site-footer) a[aria-current="page"] {
  color: var(--text);
}

:is(.site-nav, .site-footer) a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.header-actions {
  display: flex;
  grid-area: actions;
  gap: 0.5rem;
  align-items: center;
}

.theme-toggle {
  display: inline-grid;
  width: var(--control-lg);
  height: var(--control-lg);
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  place-items: center;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-toggle .moon {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-toggle .moon {
    display: block;
  }
}

:root[data-theme="light"] .theme-toggle .sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .moon {
  display: block;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-state) ease;
}

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

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.button-small {
  min-height: var(--control-lg);
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
}

/* Page body. */
main {
  padding-bottom: 4rem;
}

.hero {
  padding-block: 2.5rem 3.5rem;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: var(--weight-semi);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 15em;
}

.lede {
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.5;
}

.hero .button {
  margin-top: 2rem;
}

.note {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.block {
  display: grid;
  gap: 1.25rem;
  padding-block: 2.75rem;
  border-top: 1px solid var(--line);
}

.block > div > * + * {
  margin-top: 1rem;
}

.prose {
  max-width: 40rem;
  color: var(--text-2);
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.5rem;
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose ul,
.block ul,
.block ol {
  padding-left: 1.25rem;
}

.prose li + li,
.block li + li {
  margin-top: 0.5rem;
}

.small {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* On a wide screen a section's heading stays in its own column while its
   body scrolls past. */
@media (min-width: 60rem) {
  .wrap {
    padding-inline: 2rem;
  }

  .site-header {
    grid-template-areas: "brand nav actions";
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    padding-block: 1.25rem;
  }

  .site-nav {
    justify-content: center;
  }

  .hero {
    padding-block: 5rem 5.5rem;
  }

  .block {
    grid-template-columns: 16rem minmax(0, 46rem);
    gap: 3rem;
    padding-block: 4rem;
  }

  .block > h2 {
    position: sticky;
    top: 1.5rem;
    align-self: start;
  }
}

/* Numbered steps: a large olive numeral beside each one. */
ol.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 0.75rem;
  counter-increment: step;
}

.steps > li + li {
  margin-top: 1.75rem;
}

.steps > li::before {
  grid-row: span 2;
  color: var(--accent);
  content: counter(step);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.steps h3 {
  margin-bottom: 0.375rem;
}

.steps p {
  color: var(--text-2);
}

/* Does and doesn't: a small olive tick for what he does, a muted dash for
   what he never does. */
ul.marks {
  padding: 0;
  list-style: none;
}

.marks > li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-2);
}

.marks > li + li {
  margin-top: 0.75rem;
}

.marks > li::before {
  position: absolute;
  top: 0.45em;
  left: 0.25rem;
  width: 0.75rem;
  height: 0.4rem;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  content: "";
  transform: rotate(-45deg);
}

.marks-not > li::before {
  top: 0.75em;
  height: 0;
  border-bottom-color: var(--text-muted);
  border-left: 0;
  transform: none;
}

/* Pricing: two plans, the recommended one carries the only accent line. */
.plans {
  display: grid;
  gap: 1rem;
}

@media (min-width: 44rem) {
  .plans {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.plan {
  padding: 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.plan-recommended {
  border-color: var(--accent-line);
}

.plan-name {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 1.125rem;
}

.plan-tag {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: var(--weight-semi);
}

.plan-price {
  margin-top: 0.75rem;
  color: var(--text-muted);
}

.plan-price .amount {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.plan-lead {
  margin-top: 0.75rem;
  color: var(--text);
}

.plan .marks {
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.plan-foot {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

.trial > li {
  padding-left: 0.25rem;
  color: var(--text-2);
}

.trial > li::marker {
  color: var(--accent);
  font-weight: var(--weight-semi);
}

.trial ul {
  margin-top: 0.5rem;
}

/* Questions: native disclosure, one hairline between them. */
.faq details {
  border-bottom: 1px solid var(--line);
}

.faq details:first-of-type {
  border-top: 1px solid var(--line);
}

.faq details + details {
  margin-top: 0;
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  cursor: pointer;
  font-weight: var(--weight-semi);
  list-style: none;
}

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

.faq summary::after {
  flex-shrink: 0;
  color: var(--accent);
  content: "+";
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  padding-bottom: 1.25rem;
  color: var(--text-2);
}

.cta {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding-block: 3.5rem 1rem;
  border-top: 1px solid var(--line);
}

.cta p {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
}

/* Text pages: trust, legal, the form. */
.page {
  max-width: 42rem;
  padding-block: 2.5rem 0;
}

.page h1 + p {
  margin-top: 1.25rem;
}

.page .lede {
  margin-top: 1.25rem;
}

.address {
  font-style: normal;
}

.binding {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* The demo recording: phone-sized, never wider than the screen. */
.demo-video {
  margin: 0;
}

.demo-video video {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.demo-video figcaption {
  max-width: 22rem;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer {
  display: grid;
  gap: 0.75rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

@media (min-width: 60rem) {
  .site-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
