/* CradleShift waitlist. Colours and fonts mirror src/theme/tokens.ts (DESIGN.md is the authority):
   warm near-black, cream text (never pure white), amber = on duty / act now, blue-grey = asleep / all fine.
   IBM Plex Mono for every time and duration, Instrument Sans for everything else. */

@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/InstrumentSans_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/InstrumentSans_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono_500Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

:root {
  --background: #0a0806;
  --text: #f2e7d7;
  --headline: #f6ecdd;
  --text-muted: rgba(242, 231, 215, 0.72);
  --text-faint: rgba(242, 231, 215, 0.5);
  --amber: #e0a355;
  --amber-text: #eab979;
  --amber-fill: rgba(224, 163, 85, 0.14);
  --blue-grey: #8ca8d6;
  --blue-grey-fill: rgba(140, 168, 214, 0.12);
  --surface: rgba(255, 232, 200, 0.04);
  --surface-raised: rgba(255, 232, 200, 0.08);
  --border: rgba(255, 232, 200, 0.14);
  --error: #e8a08a;

  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --gutter: 20px;
  --measure: 36rem;
}

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

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

body {
  margin: 0;
  background: var(--background);
  /* A faint warm glow at the top, like a nightlight in the corner. */
  background-image: radial-gradient(60rem 30rem at 50% -10rem, rgba(224, 163, 85, 0.08), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.mono,
time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--amber-text);
  text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
  color: var(--headline);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  z-index: 1;
}
.skip:focus {
  top: 0.75rem;
}

/* Layout */

.masthead,
main > section,
.footer {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main > section {
  padding-top: 3rem;
  padding-bottom: 1rem;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}

.wordmark {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.cradle {
  color: var(--headline);
}
.shift {
  color: var(--blue-grey);
}

.nav-cta {
  font-size: 0.9375rem;
  color: var(--amber-text);
  text-decoration: none;
  padding: 0.5rem 0;
}
.nav-cta:hover {
  text-decoration: underline;
}

/* Hero */

.hero {
  padding-top: 3.5rem !important;
}

.eyebrow {
  color: var(--blue-grey);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(2.5rem, 11vw, 3.75rem);
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.1875rem;
  color: var(--text);
}

.night {
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.night-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.night-row + .night-row {
  margin-top: 0.625rem;
}

.night-row .label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.duty {
  background: var(--amber-fill);
  border-color: rgba(224, 163, 85, 0.4);
}
.duty .label {
  color: var(--amber-text);
}

.sleeping {
  background: var(--blue-grey-fill);
  border-color: rgba(140, 168, 214, 0.35);
}
.sleeping .label {
  color: var(--blue-grey);
}

.alarm {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-left: 0.25rem;
}

.alarm .old {
  color: var(--text-faint);
  text-decoration-thickness: 1px;
}

.alarm .new {
  color: var(--headline);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
}

.night figcaption {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* The alarm visibly slides from the old time to the new one, once. */
@media (prefers-reduced-motion: no-preference) {
  .alarm .old {
    animation: strike 1.6s ease-out 0.6s both;
  }
  .alarm .new {
    animation: arrive 1.2s ease-out 1.4s both;
  }
}

@keyframes strike {
  from {
    color: var(--headline);
    text-decoration-color: transparent;
  }
  to {
    color: var(--text-faint);
    text-decoration-color: currentColor;
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Buttons glow through a translucent amber fill and outline, never a solid block. */
.button {
  display: inline-block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.875rem 1.5rem;
  border: 1px solid var(--amber);
  border-radius: var(--radius-md);
  background: var(--amber-fill);
  box-shadow: 0 0 1.5rem rgba(224, 163, 85, 0.12);
  color: var(--amber-text);
  font: 600 1.0625rem/1.4 var(--body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: rgba(224, 163, 85, 0.22);
}
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

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

/* Sections */

h2 {
  font-size: 1.625rem;
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.steps {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.steps li {
  position: relative;
  padding: 1.125rem 1.125rem 0.25rem 3.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.step-num {
  position: absolute;
  left: 1.125rem;
  top: 1.05rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.steps li:nth-child(1) .step-num {
  border-color: var(--amber);
  color: var(--amber-text);
}
.steps li:nth-child(3) .step-num {
  border-color: var(--blue-grey);
  color: var(--blue-grey);
}

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

.needs {
  margin: 0;
  padding: 0;
  list-style: none;
}
.needs li {
  padding: 0.5rem 0 0.5rem 1.75rem;
  position: relative;
  border-top: 1px solid var(--border);
}
.needs li:last-child {
  border-bottom: 1px solid var(--border);
}
.needs li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 1.05rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--blue-grey);
}

.honest {
  color: var(--text-muted);
}

/* Form */

.join {
  scroll-margin-top: 1rem;
}

.form {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.field {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

label,
legend {
  display: block;
  font-weight: 600;
  color: var(--headline);
  margin-bottom: 0.5rem;
  padding: 0;
}

.optional {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

input[type='email'],
input[type='text'],
select {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.875rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 1.0625rem/1.4 var(--body);
  color-scheme: dark;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.9rem) 50%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: transparent;
}

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

.error {
  color: var(--error);
  font-size: 0.9375rem;
  margin: 0.5rem 0 0;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--blue-grey);
  background: var(--blue-grey-fill);
}

input[type='radio'],
input[type='checkbox'] {
  accent-color: var(--blue-grey);
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.check input {
  margin-top: 0.3rem;
}

.trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fine {
  margin: 1rem 0 0;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.status {
  margin: 1rem 0 0;
}
.status:empty {
  display: none;
}
.status.ok {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--blue-grey-fill);
  border: 1px solid rgba(140, 168, 214, 0.35);
  color: var(--headline);
}
.status.bad {
  color: var(--error);
}

.privacy p {
  color: var(--text-muted);
}

.footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.footer p {
  margin: 0;
}

/* Privacy notice page */

.doc h1 {
  font-size: 2.25rem;
}
.doc h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}
.doc ul {
  padding-left: 1.25rem;
}
.doc li {
  margin-bottom: 0.375rem;
}

@media (min-width: 40rem) {
  :root {
    --gutter: 32px;
  }
  .button {
    width: auto;
  }
  .hero .note {
    text-align: left;
  }
  .form {
    padding: 2rem;
  }
}

/* ---- Site pages added for the Cloudflare Pages build ---- */
.draft-banner {
  margin: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  background: var(--amber);
  color: #0a0806;
  font-weight: 600;
}
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 0.95rem;
}
.topnav a {
  color: var(--text-muted);
}
.topnav a:hover {
  color: var(--headline);
}
.sitenav {
  margin: 0 0 0.75rem;
  line-height: 1.9;
}
.cards {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: grid;
  gap: 0.9rem;
}
.cards li {
  border: 1px solid rgba(255, 232, 200, 0.14);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 232, 200, 0.03);
}
.cards h3 {
  margin: 0 0 0.35rem;
}
.cards p {
  margin: 0;
}
@media (min-width: 40rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
.comingsoon {
  border: 1px dashed var(--amber);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--amber-fill);
}
.comingsoon p {
  margin: 0.4rem 0;
}
.faq details {
  border-bottom: 1px solid rgba(255, 232, 200, 0.14);
  padding: 0.85rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--headline);
}
.faq details p {
  margin: 0.6rem 0 0;
}

/* The printable planner: dark on screen like the rest of the site, plain black on white in print. */
.planner-sheet {
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: #f6f1e8;
  color: #1a1612;
}
.planner-sheet h2,
.planner-sheet h3,
.planner-sheet p,
.planner-sheet li,
.planner-sheet th,
.planner-sheet td {
  color: #1a1612;
}
.planner-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.planner-sheet th,
.planner-sheet td {
  border: 1px solid #1a1612;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}
.planner-sheet td {
  height: 2.6rem;
}
.planner-sheet .handoff-card {
  border: 2px dashed #1a1612;
  border-radius: 0.5rem;
  padding: 0.8rem 1rem;
  margin: 0.9rem 0;
  break-inside: avoid;
}
.planner-sheet .line {
  display: block;
  border-bottom: 1px solid #1a1612;
  height: 1.6rem;
}
.planner-sheet .tick::before {
  content: '\2610\00a0';
}
.source-list {
  font-size: 0.9rem;
  color: var(--text-muted);
}
@media print {
  :root {
    color-scheme: light;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .draft-banner,
  .masthead,
  .skip,
  .footer,
  .no-print {
    display: none !important;
  }
  .planner-sheet {
    padding: 0;
    background: #fff;
    margin-top: 0;
  }
  .planner-sheet {
    break-before: page;
  }
  .planner-sheet h2#cards-title {
    break-before: page;
  }
  a {
    color: #000;
  }
  .optional {
    color: #444 !important;
    font-weight: 400;
    font-size: 0.8em;
  }
  .guide h1,
  .guide h2,
  .guide h3,
  .guide p,
  .guide li,
  .guide .eyebrow,
  .guide .lede {
    color: #000;
  }
  .guide a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
  }
}
