/* SleepSwitch design tokens and shared components, from design/preview.html (approved 2026-11-16).
   Night indigo base, one warm lamp accent, cream paper for cards. Two themes: day (landers,
   checkout, admin) and night (member area, used in bed). */
:root {
  --night-950: #10152b;
  --night-900: #161c38;
  --night-800: #1f2748;
  --night-700: #2b3561;
  --indigo-500: #5c65a6;
  --lavender-300: #b8b7e2;
  --lamp-500: #eea657;
  --lamp-400: #f4b96f;
  --cream-50: #fcf8f0;
  --cream-100: #f6eedf;
  --cream-200: #ebdfc8;
  --mist-50: #f5f4fb;
  --mist-100: #eae9f6;
  --ink: #1c2343;
  --ink-soft: #4a5072;
  --on-night: #ece8f6;
  --on-night-soft: #a6a9cf;

  --font-display: "Literata", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;

  --radius-card: 18px;
  --radius-btn: 999px;
  --shadow-paper: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 30px -12px rgba(16,21,43,.35);
  --lift: 0 8px 20px -8px rgba(16,21,43,.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.theme-day { background: var(--mist-50); color: var(--ink); }
.theme-night {
  background: radial-gradient(1200px 500px at 85% -10%, #39353f, var(--night-900) 60%) no-repeat, var(--night-900);
  color: var(--on-night);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(34px, 5vw, 50px); }
h2 { font-size: clamp(26px, 3.5vw, 34px); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.eyebrow { font-weight: 700; font-size: 15px; letter-spacing: .04em; margin: 0 0 12px; color: var(--indigo-500); }
.theme-night .eyebrow { color: var(--lamp-400); }
.muted { color: var(--ink-soft); }
.theme-night .muted { color: var(--on-night-soft); }

/* Buttons: one lamp-amber primary per screen, large enough to hit in the dark */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 19px/1 var(--font-body);
  padding: 20px 32px; min-height: 60px;
  border: 0; border-radius: var(--radius-btn); cursor: pointer;
  background: var(--lamp-400); color: var(--night-950);
  box-shadow: var(--lift);
  text-decoration: none;
}
.btn:hover { background: var(--lamp-500); }
.btn:focus-visible, .field:focus-visible { outline: 3px solid var(--indigo-500); outline-offset: 2px; }
.btn--quiet { background: transparent; color: inherit; box-shadow: none; border: 1.5px solid currentColor; }

/* Form fields */
label { display: block; font-weight: 700; margin-bottom: 8px; }
.field {
  width: 100%; font: 19px var(--font-body); padding: 16px 18px; min-height: 58px;
  border: 1.5px solid var(--cream-200); border-radius: 14px; background: #fff; color: var(--ink);
}
.field:focus { border-color: var(--indigo-500); }
.error { color: #a3352b; font-weight: 700; font-size: 16px; margin: 8px 0 0; }

/* Cream paper card (modules, checkout) */
.card {
  background: var(--cream-100); color: var(--ink);
  border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-paper);
}

/* Landers: one readable column, daytime theme */
.lander { padding: 24px 0 56px; }
.ad-label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 24px; }
.lander-head { max-width: 760px; }
.lander-hero { width: 100%; height: auto; border-radius: 24px; box-shadow: var(--shadow-paper); margin: 8px 0 40px; }
.article { max-width: 680px; margin: 0 auto; }
.article p { margin: 0 0 1.1em; }
.article h2 { margin-top: 1.6em; }
.object-row { display: flex; gap: 12px; margin: 24px 0; }
.object-card {
  flex: 1; text-align: center; padding: 22px 8px;
  background: var(--cream-100); border-radius: 14px; box-shadow: var(--shadow-paper);
  font-family: var(--font-display); font-size: 20px;
}
.cta-box {
  margin: 40px 0; padding: 28px; text-align: center;
  background: var(--mist-100); border-radius: var(--radius-card);
}
.cta-box p { margin: 0 0 20px; }
.lander-foot { border-top: 1px solid var(--mist-100); padding: 24px 0 40px; font-size: 14px; color: var(--ink-soft); }

/* Member area: night theme, big targets, nothing bright */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.member-bar { border-bottom: 1px solid rgba(184,183,226,.12); }
.member-bar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { font-family: var(--font-display); font-size: 22px; text-decoration: none; }
.link-btn { background: none; border: 0; color: var(--on-night-soft); font: 16px var(--font-body); cursor: pointer;
            padding: 12px 0; text-decoration: underline; }
.member-main { padding-top: 32px; padding-bottom: 64px; }
.focus-link { margin: 0 0 4px; font-weight: 700; }
.focus-link a { color: var(--lamp-400); }
.tip { font-size: 15px; color: var(--on-night-soft); margin: 16px 0 0; }
.back { margin: 0 0 24px; font-size: 16px; }
.back a { color: var(--on-night-soft); }
.lead { font-size: 20px; }

.tonight {
  display: grid; grid-template-columns: 1fr 1.1fr; overflow: hidden;
  border-radius: 24px; background: var(--night-800); border: 1px solid rgba(184,183,226,.12);
}
.tonight-img { background: url(img/phone.jpg) center/cover; min-height: 280px; }
.tonight-body { padding: 32px; }
.tonight-body h1 { font-size: clamp(28px, 4vw, 38px); }

.quest { margin-top: 40px; }
.quest h2 { font-size: 26px; }
.nights { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; max-width: 520px; }
.night {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; border: 1.5px solid var(--night-700); color: var(--on-night-soft);
}
.night.done { background: var(--lamp-400); border-color: var(--lamp-400); color: var(--night-950); }
.night.today { border: 2px solid var(--lamp-400); color: var(--lamp-400); }

.modules { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module {
  background: var(--cream-100); color: var(--ink); border-radius: var(--radius-card);
  padding: 20px; box-shadow: var(--shadow-paper); display: flex; flex-direction: column; gap: 6px;
  text-decoration: none;
}
.module .num { font-family: var(--font-display); font-size: 15px; color: var(--indigo-500); }
.module h3 { font-size: 22px; margin: 0; }
.module p { margin: 0; font-size: 16px; color: var(--ink-soft); line-height: 1.45; }
.module.feature { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
.module.feature .feature-img { background: url(img/objects.jpg) center/cover; min-height: 220px; }
.module.feature .feature-body { padding: 24px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.module.locked { background: var(--night-800); color: var(--on-night-soft); box-shadow: none;
                 border: 1.5px dashed var(--night-700); }
.module.locked h3 { color: var(--on-night); }
.module.locked p, .module.locked .num { color: var(--on-night-soft); }

/* Audio player (templates/member/_player.html, static/player.js) */
.player-card { margin-top: 20px; }
.items .player-card { margin-top: 0; }
.player { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 18px; background: var(--night-950); }
.play {
  flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--lamp-400); color: var(--night-950); box-shadow: var(--lift); display: grid; place-items: center;
}
.play:focus-visible { outline: 3px solid var(--lavender-300); outline-offset: 3px; }
.play .icon-pause, .is-playing .play .icon-play { display: none; }
.is-playing .play .icon-pause { display: block; }
.player-meta { flex: 1; min-width: 0; }
.player-meta strong { display: block; font-size: 17px; }
.seek { width: 100%; margin: 10px 0 4px; accent-color: var(--lavender-300); height: 24px; }
.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--on-night-soft); }
.player-links { margin: 10px 0 0; font-size: 15px; }
.player-links a { color: var(--on-night-soft); }
.inapp-hint { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 15px;
              background: rgba(244,185,111,.12); color: var(--on-night); }

.items { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
.item { background: var(--night-800); border: 1px solid rgba(184,183,226,.12); border-radius: var(--radius-card); padding: 20px; }
.item-title { font-family: var(--font-body); font-weight: 700; font-size: 19px; margin: 0 0 12px; }
.item video { width: 100%; border-radius: 12px; background: #000; }
.pdf-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.pdf-links .btn { min-height: 52px; padding: 14px 24px; }

.page { padding-top: 56px; padding-bottom: 56px; }
.fineprint { font-size: 14px; color: var(--ink-soft); }

@media (max-width: 760px) {
  .page { padding-top: 40px; padding-bottom: 40px; }
  .btn { width: 100%; }
  .tonight, .module.feature, .modules { grid-template-columns: 1fr; }
  .module.feature { grid-column: auto; }
  .tonight-img { min-height: 200px; }
  .tonight-body { padding: 24px 20px; }
  .nights { gap: 6px; }
  .pdf-links .btn { width: auto; flex: 1; }
}
