/* ShiftLedger website. Colours, spacing and type come from tokens.css (generated from design/tokens). */
@import url('tokens.css');

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-next.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  src: url('../fonts/atkinson-mono.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-text: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* Night band: the brand's indigo, always dark, in both colour schemes. */
  --night-deep: #171E57;
  --night: #26338F;
  --night-high: #3D4AA8;
  --on-night: #FFFFFF;
  --on-night-muted: #DEE0FF;
  --amber: #FFB870;
  --on-amber: #2C1600;

  --page: var(--sl-surface);
  --ink: var(--sl-on-surface);
  --ink-muted: var(--sl-on-surface-variant);
  --rule: var(--sl-outline-variant);
  --accent-text: var(--sl-tertiary);
  --focus: var(--sl-primary);
  --wrap: 75rem;
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2rem);
  --section-pad: clamp(3.5rem, 2rem + 6vw, 7rem);
  --radius-card: 1.5rem;

  /* Scroll motion (docs/MOTION.md). */
  --motion-ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --motion-ease-settle: cubic-bezier(0.34, 1.25, 0.64, 1);
  --motion-rise: 12px;
  --motion-rise-small: 8px;
  --motion-rise-card: 16px;
  --motion-step: 60ms;
  --motion-cascade-step: 40ms;
  --motion-cell-step: 14ms;
  --motion-sunrise: 1400ms;
}
@media (prefers-color-scheme: dark) {
  :root {
    --focus: var(--amber);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--sl-type-body-large-size);
  line-height: 1.55;
  letter-spacing: 0.005em;
  font-kerning: normal;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
}
svg.icon {
  flex: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.25rem, 1.35rem + 3.4vw, 3.75rem);
  font-weight: 760;
  letter-spacing: -0.022em;
  line-height: 1.04;
}
h2 {
  font-size: clamp(1.75rem, 1.25rem + 1.9vw, 2.625rem);
  font-weight: 720;
  letter-spacing: -0.016em;
}
h3 {
  font-size: var(--sl-type-title-medium-size);
  font-weight: 680;
  line-height: 1.3;
}
p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--sl-primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 0.14em;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  border-radius: 0.5rem;
}
.skip-link:focus {
  top: 1rem;
}

main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header (part of the night band) ---------- */
.site-header {
  background: var(--night-deep);
  color: var(--on-night);
  --focus: var(--amber);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
}
@media (min-width: 80rem) {
  .header-inner {
    min-height: 5rem;
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: var(--sl-touch-target);
  color: inherit;
  text-decoration: none;
  font-weight: 760;
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
/* The logo carries its own light ring; the shadow only adds depth on the dark band. */
.logo {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgb(10 12 40 / 0.35));
}
.brand .logo {
  width: 2.5rem;
  height: 2.5rem;
}
@media (min-width: 48rem) {
  .brand {
    font-size: 1.375rem;
  }
  .brand .logo {
    width: 2.75rem;
    height: 2.75rem;
  }
}
@media (min-width: 80rem) {
  .brand {
    font-size: 1.5rem;
  }
  .brand .logo {
    width: 3rem;
    height: 3rem;
  }
}
.section-nav {
  margin-inline-start: auto;
}
.section-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--sl-touch-target);
  padding-inline: 0.75rem;
  color: var(--on-night-muted);
  text-decoration: none;
  font-size: var(--sl-type-label-large-size);
  font-weight: 600;
  border-radius: 999px;
}
.section-nav a:hover {
  color: var(--on-night);
  background: rgb(255 255 255 / 0.08);
}
.header-cta {
  display: none;
}
@media (min-width: 80rem) {
  .header-cta {
    display: inline-flex;
    align-items: center;
    min-height: var(--sl-touch-target);
    padding-inline: 1rem;
    border: 1.5px solid var(--amber);
    border-radius: 999px;
    color: var(--on-night);
    text-decoration: none;
    font-size: var(--sl-type-label-large-size);
    font-weight: 680;
    white-space: nowrap;
  }
  .header-cta:hover {
    background: rgb(255 184 112 / 0.14);
  }
}
@media (max-width: 63.99rem) {
  .section-nav {
    display: none;
  }
  .lang-picker {
    margin-inline-start: auto;
  }
}

/* Language picker: a disclosure with plain links. */
.lang-picker {
  position: relative;
}
.lang-picker summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--sl-touch-target);
  padding-inline: 0.875rem 0.625rem;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  font-size: var(--sl-type-label-large-size);
  font-weight: 600;
  color: var(--on-night);
}
.lang-code {
  display: none;
}
@media (max-width: 29.99rem) {
  .lang-picker .lang-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .lang-code {
    display: inline;
  }
}
.lang-picker summary {
  white-space: nowrap;
}
@media (max-width: 22.49rem) {
  .lang-picker summary {
    gap: 0.25rem;
    padding-inline: 0.625rem 0.375rem;
  }
  .lang-picker summary > .icon:first-child {
    display: none;
  }
}
.lang-picker summary::-webkit-details-marker {
  display: none;
}
.lang-picker summary:hover {
  background: rgb(255 255 255 / 0.08);
}
.lang-picker[open] .chevron {
  transform: rotate(180deg);
}
.lang-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 40;
  min-width: 13rem;
  margin: 0;
  padding: 0.375rem;
  list-style: none;
  background: var(--sl-surface-container-lowest);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: 0 18px 40px -12px rgb(10 12 40 / 0.45);
  --focus: var(--sl-primary);
}
@media (prefers-color-scheme: dark) {
  .lang-list {
    background: var(--sl-surface-container-high);
    --focus: var(--amber);
  }
}
.lang-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--sl-touch-target);
  padding-inline: 0.875rem;
  border-radius: 0.625rem;
  color: inherit;
  text-decoration: none;
  font-weight: 560;
}
.lang-list a:hover {
  background: var(--sl-surface-container);
}
.lang-list a[aria-current] {
  font-weight: 760;
  color: var(--sl-primary);
}

/* ---------- Hero: the night shift ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(90% 70% at 85% 10%, rgb(61 74 168 / 0.85), transparent 70%),
    linear-gradient(180deg, var(--night-deep) 0%, var(--night) 100%);
  color: var(--on-night);
  padding-block: clamp(2.5rem, 1rem + 5vw, 5.5rem) clamp(3rem, 1.5rem + 5vw, 6rem);
  --focus: var(--amber);
  isolation: isolate;
}
/* The horizon: a thin line of sunrise where the night band meets the day. */
.hero::after,
.night::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--amber) 35%, #ffdcbe 55%, var(--amber) 75%, transparent 100%);
  box-shadow: 0 0 24px 4px rgb(255 184 112 / 0.45);
}
.hero-grid {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}
@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}
.hero h1 {
  max-width: 14ch;
}
.lead {
  margin-top: 1.25rem;
  max-width: 38rem;
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--on-night-muted);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  font-weight: 650;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.facts .icon {
  color: var(--amber);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.5rem 1.25rem 0.5rem 1rem;
  border-radius: 0.875rem;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 720;
  text-decoration: none;
}
.store-badge.is-soon {
  background: transparent;
  color: var(--on-night);
  border: 1.5px dashed rgb(255 184 112 / 0.85);
}
.store-badge.is-soon .icon {
  color: var(--amber);
}
.button-secondary,
.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sl-touch-target);
  padding-inline: 1.25rem;
  border-radius: 0.875rem;
  font: inherit;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
}
.button-primary {
  border: 0;
  background: var(--sl-primary);
  color: var(--sl-on-primary);
}
.button-secondary {
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
}
.button-amber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  border-radius: 0.875rem;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 720;
  text-decoration: none;
}
.night a.button-amber,
.hero a.button-amber {
  color: var(--on-amber);
}
.button-amber:hover {
  background: #ffc68c;
}
.tester-note {
  margin-top: 0.75rem;
  max-width: 34rem;
  font-size: var(--sl-type-body-medium-size);
  color: var(--on-night-muted);
}
.platform {
  margin-top: 1rem;
  font-size: var(--sl-type-body-medium-size);
  color: var(--on-night-muted);
}

/* Rotation picker: native radios styled as chips. */
.rotation-picker {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  min-width: 0;
}
.rotation-picker legend {
  padding: 0;
  margin-bottom: 0.625rem;
  font-weight: 700;
  color: var(--on-night-muted);
  font-size: var(--sl-type-label-large-size);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  position: relative;
  display: inline-flex;
}
.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.875rem;
  border: 1px solid rgb(222 224 255 / 0.4);
  border-radius: 999px;
  font-size: var(--sl-type-label-large-size);
  font-weight: 620;
  color: var(--on-night);
  white-space: nowrap;
  pointer-events: none;
}
.chip input:hover + span {
  background: rgb(255 255 255 / 0.08);
}
.chip input:checked + span {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-amber);
}
.chip input:focus-visible + span {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

/* The calendar card echoes the app icon: paper, an amber header, labelled cells. */
.calendar-card {
  background: var(--sl-surface-container-lowest);
  color: var(--ink);
  border-radius: var(--radius-card);
  padding: 0 clamp(0.75rem, 0.4rem + 1.2vw, 1.25rem) 1rem;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.5) inset,
    0 40px 80px -30px rgb(5 8 40 / 0.75),
    0 12px 24px -12px rgb(5 8 40 / 0.5);
  overflow: hidden;
  --focus: var(--sl-primary);
  --card-surface: var(--sl-surface-container-lowest);
}
@media (prefers-color-scheme: dark) {
  .calendar-card {
    --card-surface: var(--sl-surface-container);
    background: var(--sl-surface-container);
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 0.08),
      0 40px 80px -30px rgb(0 0 0 / 0.8);
  }
}
.calendar-month {
  position: relative;
}
.calendar-scene {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}
.month {
  position: relative;
  z-index: 1;
  width: 100%;
  border-collapse: separate;
  border-spacing: clamp(3px, 0.15rem + 0.3vw, 6px);
  table-layout: fixed;
}
.month caption {
  margin: 0 calc(-1 * clamp(0.75rem, 0.4rem + 1.2vw, 1.25rem)) 0.5rem;
  padding: 0.875rem 1.25rem;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 760;
  font-size: var(--sl-type-title-medium-size);
  text-align: start;
  letter-spacing: -0.005em;
}
.month th {
  padding-block: 0.25rem;
  font-size: var(--sl-type-label-small-size);
  font-weight: 650;
  color: var(--ink-muted);
  text-align: center;
}
.month td {
  position: relative;
  height: clamp(2.75rem, 2.1rem + 2.2vw, 3.75rem);
  padding: 0;
  border-radius: 0.5rem;
  vertical-align: top;
  text-align: center;
}
.month td.pad {
  background: transparent;
}
.month .d {
  position: absolute;
  top: 0.2rem;
  left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.85;
}
.month .s {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 0.68rem + 0.3vw, 0.9375rem);
  font-weight: 760;
}
.month td.is-off {
  --tile-bg: var(--sl-surface-container);
  background: var(--tile-bg);
  color: var(--ink-muted);
}
.month td.is-off .s {
  font-weight: 560;
}
@media (prefers-color-scheme: dark) {
  .month td.is-off {
    --tile-bg: var(--sl-surface-container-high);
    background: var(--tile-bg);
  }
}
.month td.is-today {
  box-shadow:
    0 0 0 2.5px var(--sl-surface-container-lowest),
    0 0 0 5px var(--accent-text);
}
@media (prefers-color-scheme: dark) {
  .month td.is-today {
    box-shadow:
      0 0 0 2.5px var(--sl-surface-container),
      0 0 0 5px var(--amber);
  }
}
.calendar-legend .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--sl-type-body-small-size);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.legend .times {
  font-family: var(--font-mono);
  color: var(--ink-muted);
}
/* Legend toggles (rotation.js, run time only). The box of an entry is exactly the plain
   entry's: the padding that grows the hit area is taken back by the negative margin, and
   the font, line height and inner flex are the same as the li's. */
.legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: -2px -6px;
  padding: 2px 6px;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  text-transform: inherit;
  text-indent: 0;
  text-align: start;
  text-rendering: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.legend-toggle:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.legend-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
}
.legend-toggle[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px var(--ink);
  text-decoration: underline 2px;
  text-underline-offset: 0.2em;
}
.chip-cell {
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.5rem;
  padding-inline: 0.25rem;
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 760;
}
.calendar-note {
  margin-top: 0.625rem;
  font-size: var(--sl-type-body-small-size);
  color: var(--ink-muted);
}

/* Category colours: the app's shift palette (container + label). */
.cat-0 { --tile-bg: var(--sl-cat-0-bg); background: var(--tile-bg); color: var(--sl-cat-0-fg); }
.cat-1 { --tile-bg: var(--sl-cat-1-bg); background: var(--tile-bg); color: var(--sl-cat-1-fg); }
.cat-2 { --tile-bg: var(--sl-cat-2-bg); background: var(--tile-bg); color: var(--sl-cat-2-fg); }
.cat-3 { --tile-bg: var(--sl-cat-3-bg); background: var(--tile-bg); color: var(--sl-cat-3-fg); }
.cat-4 { --tile-bg: var(--sl-cat-4-bg); background: var(--tile-bg); color: var(--sl-cat-4-fg); }
.cat-5 { --tile-bg: var(--sl-cat-5-bg); background: var(--tile-bg); color: var(--sl-cat-5-fg); }
.cat-6 { --tile-bg: var(--sl-cat-6-bg); background: var(--tile-bg); color: var(--sl-cat-6-fg); }
.cat-7 { --tile-bg: var(--sl-cat-7-bg); background: var(--tile-bg); color: var(--sl-cat-7-fg); }

/* The one orchestrated motion: cells fill in when the rotation changes. */
@media (prefers-reduced-motion: no-preference) {
  .month.is-filling td:not(.pad) {
    animation: cell-in 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 14ms);
  }
}
@keyframes cell-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }
}

/* Highlight a shift (rotation.js). With the WebGL scene the tiles are drawn there. */
.calendar-card.is-live .month td:not(.pad) {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.calendar-card.has-scene .month td:not(.pad) {
  background: transparent;
  /* Labels follow their tile: the scene writes --face-x/--face-y on single cells (MOTION.md 11.3), never animated. */
  transform: translate(var(--face-x, 0px), var(--face-y, 0px));
}
/* Never cell-in above the WebGL tiles: a fill still running when the scene appears ends in that frame. */
.calendar-card.has-scene .month.is-filling td:not(.pad) {
  animation: none;
}
/* Today under the scene: the ring lies on the tile's front face (inset), so it rides the face
   through the wave and the highlight and never covers the tile's walls, its shadow or a
   neighbour (MOTION.md 11.3). It meets the face colour at 4.98:1 or more, light and dark.
   Screen only: print shows the plain calendar with its outer ring. */
@media screen {
  .calendar-card.has-scene .month td.is-today {
    box-shadow: inset 0 0 0 2.5px var(--accent-text);
  }
}
@media screen and (prefers-color-scheme: dark) {
  .calendar-card.has-scene .month td.is-today {
    box-shadow: inset 0 0 0 2.5px var(--amber);
  }
}
.calendar-card:not(.has-scene) .month td.is-raised {
  transform: translateY(-2px);
  outline: 2px solid currentColor;
  box-shadow: 0 6px 10px -4px rgb(5 8 40 / 0.4);
}
.calendar-card:not(.has-scene) .month td.is-raised.is-today {
  box-shadow:
    0 0 0 2.5px var(--sl-surface-container-lowest),
    0 0 0 5px var(--accent-text),
    0 6px 10px -4px rgb(5 8 40 / 0.4);
}
.calendar-card:not(.has-scene) .month td.is-dimmed {
  background: color-mix(in srgb, var(--tile-bg) 28%, var(--card-surface));
  outline: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  outline-offset: -1px;
}
@media (prefers-color-scheme: dark) {
  .calendar-card:not(.has-scene) .month td.is-raised {
    box-shadow: 0 6px 10px -4px rgb(0 0 0 / 0.7);
  }
  .calendar-card:not(.has-scene) .month td.is-raised.is-today {
    box-shadow:
      0 0 0 2.5px var(--sl-surface-container),
      0 0 0 5px var(--amber),
      0 6px 10px -4px rgb(0 0 0 / 0.7);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .calendar-card:not(.has-scene) .month td:not(.pad) {
    transition:
      transform 200ms var(--motion-ease-out),
      box-shadow 200ms var(--motion-ease-out),
      background-color 200ms var(--motion-ease-out),
      outline-color 200ms var(--motion-ease-out);
  }
}

/* ---------- Day sections ---------- */
.section {
  padding-block: var(--section-pad);
}
.section h2 {
  max-width: 22ch;
}
.section-lead {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  color: var(--ink-muted);
}

/* Rotations: each preset as its real cycle. */
.preset-list {
  display: grid;
  margin: clamp(2rem, 1.5rem + 2vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.preset {
  display: grid;
  gap: 0.5rem 2rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .preset {
    grid-template-columns: 17rem minmax(0, 1fr);
    align-items: center;
  }
  .preset .strip {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
.preset-name {
  font-size: var(--sl-type-title-medium-size);
}
.preset-meta {
  font-size: var(--sl-type-body-medium-size);
  color: var(--ink-muted);
}
.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.75rem;
}
.strip-week {
  display: inline-flex;
  gap: 3px;
}
.strip-cell {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 760;
}
.preset-custom .preset-meta {
  max-width: 32rem;
}

/* Features */
.feature-list {
  display: grid;
  gap: clamp(2rem, 1.5rem + 1.5vw, 3rem) clamp(1.5rem, 1rem + 2vw, 3.5rem);
  margin: clamp(2rem, 1.5rem + 2vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .feature-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.feature h3 {
  margin-top: 1rem;
}
.feature p {
  margin-top: 0.5rem;
  color: var(--ink-muted);
  max-width: 34rem;
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
}
.feature:nth-child(1) .feature-icon { background: var(--sl-cat-0-bg); color: var(--sl-cat-0-fg); }
.feature:nth-child(2) .feature-icon { background: var(--sl-cat-2-bg); color: var(--sl-cat-2-fg); }
.feature:nth-child(3) .feature-icon { background: var(--sl-cat-5-bg); color: var(--sl-cat-5-fg); }
.feature:nth-child(4) .feature-icon { background: var(--sl-cat-1-bg); color: var(--sl-cat-1-fg); }
.feature:nth-child(5) .feature-icon { background: var(--sl-cat-3-bg); color: var(--sl-cat-3-fg); }
.feature:nth-child(6) .feature-icon { background: var(--sl-cat-4-bg); color: var(--sl-cat-4-fg); }

/* Privacy: back to the night band. */
.night {
  position: relative;
  background:
    radial-gradient(70% 90% at 10% 0%, rgb(61 74 168 / 0.7), transparent 70%),
    var(--night-deep);
  color: var(--on-night);
  --focus: var(--amber);
}
.night::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--amber) 30%, transparent 85%);
  opacity: 0.6;
}
.night .section-lead {
  color: var(--on-night-muted);
}
.night a {
  color: var(--amber);
}
.privacy-mark {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  background: rgb(255 184 112 / 0.16);
  color: var(--amber);
}
.privacy-mark .icon {
  width: 2rem;
  height: 2rem;
}
.privacy-points {
  display: grid;
  gap: 2rem;
  margin: clamp(2rem, 1.5rem + 2vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .privacy-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .privacy-points {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.privacy-points .point-icon {
  color: var(--amber);
}
.privacy-points h3 {
  margin-top: 0.75rem;
}
.privacy-points p {
  margin-top: 0.375rem;
  color: var(--on-night-muted);
}
.permissions {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  border-radius: var(--radius-card);
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(222 224 255 / 0.16);
}
.permissions dl {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}
.permissions dl div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}
.permissions dt {
  font-weight: 720;
}
.permissions dt::after {
  content: ':';
}
.permissions dd {
  margin: 0;
  color: var(--on-night-muted);
}
.link-strong {
  display: inline-flex;
  align-items: center;
  min-height: var(--sl-touch-target);
  font-weight: 700;
}

/* Free and Pro */
.plans {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
}
@media (min-width: 48rem) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.plan {
  padding: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem);
  border-radius: var(--radius-card);
}
.plan-free {
  background: var(--sl-surface-container-low);
  border: 1px solid var(--rule);
}
.plan-pro {
  background: var(--sl-primary-container);
  color: var(--sl-on-primary-container);
}
.plan h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-size: var(--sl-type-headline-small-size);
}
.plan-price {
  font-size: var(--sl-type-body-medium-size);
  font-weight: 650;
  opacity: 0.9;
}
.plan ul {
  display: grid;
  gap: 0.625rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.plan li {
  display: flex;
  gap: 0.625rem;
}
.plan li .icon {
  margin-top: 0.15rem;
  color: var(--accent-text);
}
.plan-pro li .icon {
  color: var(--sl-primary);
}
@media (prefers-color-scheme: dark) {
  .plan li .icon {
    color: var(--amber);
  }
  .plan-pro li .icon {
    color: var(--sl-on-primary-container);
  }
}
.plan-soon {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.75rem;
  border: 1.5px dashed currentColor;
  border-radius: 999px;
  font-size: var(--sl-type-label-large-size);
  font-weight: 650;
}
.plan-trial {
  margin-top: 1.25rem;
  font-size: var(--sl-type-body-medium-size);
}
.pricing-note {
  margin-top: 1.5rem;
  max-width: 46rem;
  color: var(--ink-muted);
}
.pricing-why {
  margin-top: 2rem;
  padding-top: 1.5rem;
  max-width: 46rem;
  border-top: 1px solid var(--rule);
}
.pricing-why h3 {
  font-size: var(--sl-type-title-large-size);
}
.pricing-why p {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

/* Tester band: the pre-launch ask, back on the night band. */
.tester-inner {
  max-width: 48rem;
}
.tester-cta {
  margin-top: 1.75rem;
}
.tester-soon {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px dashed rgb(255 184 112 / 0.85);
  border-radius: 0.875rem;
  color: var(--on-night);
  font-weight: 650;
}
.tester-micro,
.tester-notify {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: var(--sl-type-body-medium-size);
  color: var(--on-night-muted);
}
.tester-gift {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-width: 40rem;
  color: var(--on-night);
}
.tester-gift .icon {
  flex: none;
  margin-top: 0.2rem;
  color: var(--amber);
}

/* FAQ */
.faq-list {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  max-width: 50rem;
  border-top: 1px solid var(--rule);
}
.faq-list details {
  border-bottom: 1px solid var(--rule);
}
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  padding-block: 0.875rem;
  cursor: pointer;
  list-style: none;
  font-weight: 680;
  font-size: var(--sl-type-title-medium-size);
}
.faq-list summary::-webkit-details-marker {
  display: none;
}
.faq-list summary .chevron {
  color: var(--ink-muted);
}
@media (prefers-reduced-motion: no-preference) {
  .faq-list summary .chevron,
  .faq-more > summary .chevron,
  .lang-picker .chevron {
    transition: transform var(--sl-motion-short) ease;
  }
}
.faq-list details[open] summary .chevron {
  transform: rotate(180deg);
}
.faq-list details p {
  padding-bottom: 1.25rem;
  max-width: 44rem;
  color: var(--ink-muted);
}
.faq-more {
  margin-top: 1.5rem;
  max-width: 50rem;
}
.faq-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--sl-touch-target);
  cursor: pointer;
  list-style: none;
  font-weight: 680;
  color: var(--accent-text);
}
.faq-more > summary::-webkit-details-marker {
  display: none;
}
.faq-more[open] > summary .chevron {
  transform: rotate(180deg);
}
.faq-more .faq-list {
  margin-top: 0.75rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sl-surface-container);
  color: var(--ink);
  padding-block: 3rem 2rem;
  font-size: var(--sl-type-body-medium-size);
}
.footer-inner {
  display: grid;
  gap: 1.5rem 3rem;
}
@media (min-width: 48rem) {
  .footer-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }
  .footer-copy {
    grid-column: 1 / -1;
  }
}
.footer-mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 760;
  font-size: var(--sl-type-title-medium-size);
}
.footer-brand p:not(.footer-mark) {
  color: var(--ink-muted);
  max-width: 28rem;
}
.footer-links,
.footer-langs ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li,
.footer-langs li {
  min-height: 2.25rem;
}
.footer-links a,
.footer-langs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
}
.footer-langs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.footer-langs a[aria-current] {
  font-weight: 760;
  color: inherit;
  text-decoration: none;
}
.footer-copy {
  color: var(--ink-muted);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ---------- Privacy policy ---------- */
.policy {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) var(--section-pad);
}
.policy h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.policy-updated {
  margin-top: 0.75rem;
  color: var(--ink-muted);
}
.policy-intro {
  margin-top: 1.5rem;
  font-size: 1.1875rem;
}
.policy-summary {
  margin-top: 2rem;
  padding: 1.5rem clamp(1.25rem, 1rem + 1vw, 2rem);
  border-radius: var(--radius-card);
  background: var(--sl-primary-container);
  color: var(--sl-on-primary-container);
}
.policy-summary h2,
.policy-toc h2 {
  font-size: var(--sl-type-title-large-size);
}
.policy-summary ul {
  margin: 0.75rem 0 0;
  padding-inline-start: 1.25rem;
}
.policy-summary li + li {
  margin-top: 0.375rem;
}
.policy-toc {
  margin-top: 2rem;
}
.policy-toc ol {
  margin: 0.75rem 0 0;
  padding-inline-start: 1.5rem;
  columns: 2 16rem;
  column-gap: 2rem;
}
.policy-toc li {
  min-height: 2rem;
  break-inside: avoid;
}
.policy-section {
  margin-top: 2.5rem;
}
.policy-section h2 {
  font-size: var(--sl-type-headline-small-size);
}
.policy-section p {
  margin-top: 0.875rem;
  max-width: 42rem;
}

/* ---------- Root, 404 ---------- */
.page-root {
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 80% 0%, rgb(61 74 168 / 0.8), transparent 70%),
    var(--night-deep);
  color: var(--on-night);
  --focus: var(--amber);
}
.root-main {
  max-width: 40rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 1.5rem + 5vw, 5rem) var(--gutter);
}
.root-mark {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 760;
  letter-spacing: -0.02em;
}
.root-langs {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgb(222 224 255 / 0.2);
}
.root-langs li {
  border-bottom: 1px solid rgb(222 224 255 / 0.2);
}
.root-langs a {
  display: grid;
  gap: 0.125rem;
  padding-block: 0.875rem;
  color: inherit;
  text-decoration: none;
}
.root-lang {
  font-weight: 720;
  font-size: var(--sl-type-title-large-size);
}
.root-tagline {
  color: var(--on-night-muted);
}
.root-langs a:hover .root-lang {
  color: var(--amber);
}

/* ---------- Studio (margeralabs.com root) ---------- */
.page-studio .root-mark {
  margin-bottom: 1rem;
}
.studio-intro {
  margin: 0 0 2.5rem;
  max-width: 34rem;
  font-size: var(--sl-type-title-medium-size);
  color: var(--on-night-muted);
}
.studio-heading {
  margin: 0 0 0.75rem;
  font-size: var(--sl-type-label-large-size);
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-night-muted);
}
.studio-app {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.studio-meta {
  margin: 1.25rem 0 0;
  color: var(--on-night-muted);
}
.studio-meta + .studio-meta {
  margin-top: 0.5rem;
}
.studio-meta a {
  color: var(--on-night);
  text-underline-offset: 0.2em;
}
.studio-meta a:hover {
  color: var(--amber);
}

/* ---------- Admin ---------- */
.page-admin {
  background: var(--page);
}
.admin {
  padding-block: 3rem;
}
.admin h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--sl-type-headline-medium-size);
}
.admin > p {
  margin-top: 1rem;
  color: var(--ink-muted);
}
.admin form {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  justify-items: start;
}
.admin label {
  font-weight: 650;
}
.admin input[type='password'] {
  width: min(100%, 28rem);
  min-height: var(--sl-touch-target);
  padding-inline: 0.875rem;
  border: 1.5px solid var(--sl-outline);
  border-radius: 0.75rem;
  background: var(--sl-surface-container-lowest);
  color: var(--ink);
  font: inherit;
}
.admin fieldset {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  min-width: min(100%, 28rem);
}
.admin fieldset label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: var(--sl-touch-target);
  font-weight: 560;
}
.admin input[type='checkbox'],
.admin input[type='radio'] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--sl-primary);
}
.hint {
  font-size: var(--sl-type-body-small-size);
  color: var(--ink-muted);
}
.admin-status {
  margin-top: 1.5rem;
  font-weight: 650;
}
.admin-status.is-error {
  color: var(--sl-error);
}

/* ---------- Support chat ---------- */
.chat-launcher {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  min-width: 3.5rem;
  padding: 0 1.125rem 0 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--sl-primary);
  color: var(--sl-on-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 0 0 2px rgb(255 184 112 / 0.9),
    0 14px 30px -10px rgb(10 12 50 / 0.6);
}
@media (prefers-color-scheme: dark) {
  .chat-launcher {
    background: var(--sl-primary-container);
    color: var(--sl-on-primary-container);
  }
}
.chat-launcher[aria-expanded='true'] {
  display: none;
}
@media (max-width: 37.49rem) {
  .chat-launcher {
    padding: 0;
    justify-content: center;
  }
  .chat-launcher-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.chat-panel {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(24rem, calc(100vw - 2rem));
  height: min(38rem, calc(100vh - 2rem));
  background: var(--sl-surface-container-lowest);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  box-shadow: 0 30px 70px -20px rgb(10 12 50 / 0.55);
  overflow: hidden;
  --focus: var(--sl-primary);
}
.chat-panel[hidden] {
  display: none;
}
@media (prefers-color-scheme: dark) {
  .chat-panel {
    background: var(--sl-surface-container);
    --focus: var(--amber);
  }
}
@media (max-width: 37.49rem) {
  .chat-panel {
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .chat-panel:not([hidden]) {
    animation: panel-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  background: var(--night-deep);
  color: var(--on-night);
  --focus: var(--amber);
}
.chat-title {
  flex: 1;
  font-size: var(--sl-type-title-medium-size);
}
.chat-icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--sl-touch-target);
  height: var(--sl-touch-target);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.chat-icon-btn:hover {
  background: rgb(255 255 255 / 0.1);
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  overscroll-behavior: contain;
}
.chat-notice {
  padding: 0.75rem 0.875rem;
  border-radius: 0.875rem;
  background: var(--sl-tertiary-container);
  color: var(--sl-on-tertiary-container);
  font-size: var(--sl-type-body-small-size);
  line-height: 1.45;
}
.chat-log {
  display: grid;
  gap: 0.625rem;
  margin-top: 1rem;
}
.chat-msg {
  max-width: 88%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: var(--sl-type-body-medium-size);
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-msg.from-user {
  justify-self: end;
  background: var(--sl-primary);
  color: var(--sl-on-primary);
  border-bottom-right-radius: 0.25rem;
}
.chat-msg.from-user a {
  color: inherit;
}
.chat-msg.from-assistant {
  justify-self: start;
  background: var(--sl-surface-container-high);
  color: var(--ink);
  border-bottom-left-radius: 0.25rem;
}
.chat-msg.is-error {
  background: var(--sl-error-container);
  color: var(--sl-on-error-container);
}
.chat-retry {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  padding-inline: 0.875rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.chat-typing {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
}
.chat-typing span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
@media (prefers-reduced-motion: no-preference) {
  .chat-typing span {
    animation: typing 1s infinite ease-in-out;
  }
  .chat-typing span:nth-child(2) {
    animation-delay: 150ms;
  }
  .chat-typing span:nth-child(3) {
    animation-delay: 300ms;
  }
}
@keyframes typing {
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.chat-suggestions[hidden] {
  display: none;
}
.chat-suggestion {
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--sl-outline);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--sl-type-body-small-size);
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.chat-suggestion:hover {
  background: var(--sl-surface-container);
}
.chat-status:empty {
  display: none;
}
.chat-status {
  margin-top: 0.75rem;
  font-size: var(--sl-type-body-small-size);
  color: var(--ink-muted);
}
.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}
.chat-form textarea {
  min-height: var(--sl-touch-target);
  max-height: 8rem;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--sl-outline);
  border-radius: 0.875rem;
  background: var(--page);
  color: var(--ink);
  font: inherit;
  font-size: var(--sl-type-body-medium-size);
  line-height: 1.4;
  resize: none;
}
.chat-form textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.chat-send {
  display: inline-grid;
  place-items: center;
  width: var(--sl-touch-target);
  height: var(--sl-touch-target);
  border: 0;
  border-radius: 0.875rem;
  background: var(--sl-primary);
  color: var(--sl-on-primary);
  cursor: pointer;
  align-self: end;
}
.chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.chat-email {
  grid-column: 1 / -1;
  font-size: var(--sl-type-body-small-size);
  color: var(--ink-muted);
}
body.chat-modal-open {
  overflow: hidden;
}
/* Room below the footer so the chat button never hides its last line. */
body.has-chat .site-footer {
  padding-bottom: 6rem;
}

/* ---------- Scroll motion ---------- */
/* See docs/MOTION.md. Content is visible by default: the start state exists only under
   .sl-motion, which motion.js sets, and only on items that were below the fold at that moment. */

/* The sunrise in the tester band. This is its static, risen state, which is what visitors see with
   reduced motion, without JavaScript, and in print (hidden there). */
.tester-band {
  isolation: isolate;
}
.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sky::before,
.sky::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
}
.sky::before {
  width: min(60rem, 140%);
  aspect-ratio: 2;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 184 112 / 0.28), rgb(255 184 112 / 0.1) 60%, transparent);
}
.sky::after {
  width: 5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #ffdcbe 0 35%, var(--amber) 62%, rgb(255 184 112 / 0) 72%);
}

@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translateY(var(--rise, var(--motion-rise)));
  }
}
@keyframes reveal-settle {
  from {
    opacity: 0;
    transform: scale(var(--from-scale, 0.82)) rotate(var(--from-rotate, -6deg));
  }
}
@keyframes reveal-cell {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
}
@keyframes sunrise-disc {
  from {
    transform: translate(-50%, 100%);
  }
}
@keyframes sunrise-glow {
  from {
    opacity: 0.25;
    transform: translate(-50%, 50%) scale(0.6);
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* Start states: opacity only, so layout and find-in-page are untouched. */
  .sl-motion :is([data-reveal='rise'], [data-reveal='settle'], [data-reveal='plans']).reveal-pending,
  .sl-motion [data-reveal='cascade'].reveal-pending > *,
  .sl-motion [data-reveal='feature'].reveal-pending :is(.feature-icon, .point-icon .icon, h3, p),
  .sl-motion [data-reveal='preset'].reveal-pending :is(.preset-name, .preset-meta, .strip-cell),
  .sl-motion [data-reveal='plans'].reveal-pending .plan-soon,
  .sl-motion [data-reveal='calendar'].reveal-pending:not(.scene-wanted) .month td:not(.pad) {
    opacity: 0;
  }

  /* Running: every animation uses fill both, so the start state holds through the stagger delay. */
  .sl-motion :is([data-reveal='rise'], [data-reveal='plans']).reveal-run {
    animation: reveal-rise var(--sl-motion-long) var(--motion-ease-out) both;
    animation-delay: var(--reveal-delay, 0ms);
  }
  .sl-motion [data-reveal='plans'].reveal-run {
    --rise: var(--motion-rise-card);
  }
  .sl-motion [data-reveal='settle'].reveal-run {
    animation: reveal-settle var(--sl-motion-long) var(--motion-ease-settle) both;
    animation-delay: var(--reveal-delay, 0ms);
  }
  .sl-motion [data-reveal='feature'].reveal-run :is(.feature-icon, .point-icon .icon) {
    animation: reveal-settle var(--sl-motion-long) var(--motion-ease-settle) both;
    animation-delay: var(--reveal-delay, 0ms);
  }
  .sl-motion [data-reveal='feature'].reveal-run :is(h3, p),
  .sl-motion [data-reveal='preset'].reveal-run :is(.preset-name, .preset-meta),
  .sl-motion [data-reveal='cascade'].reveal-run > * {
    --rise: var(--motion-rise-small);
    animation: reveal-rise var(--sl-motion-long) var(--motion-ease-out) both;
    animation-delay: var(--reveal-delay, 0ms);
  }
  .sl-motion [data-reveal='feature'].reveal-run :is(h3, p) {
    animation-delay: calc(var(--reveal-delay, 0ms) + 80ms);
  }
  .sl-motion [data-reveal='cascade'].reveal-run > * {
    animation-delay: calc(var(--reveal-delay, 0ms) + var(--reveal-i, 0) * var(--motion-cascade-step));
  }
  .sl-motion [data-reveal='preset'].reveal-run .strip-cell {
    animation: reveal-cell var(--sl-motion-medium) var(--motion-ease-out) both;
    animation-delay: calc(var(--reveal-delay, 0ms) + 80ms + var(--cell, 0) * var(--motion-cell-step));
  }
  .sl-motion [data-reveal='plans'].reveal-run .plan-soon {
    --from-scale: 0.92;
    --from-rotate: 0deg;
    animation: reveal-settle var(--sl-motion-medium) var(--motion-ease-out) both;
    animation-delay: calc(var(--reveal-delay, 0ms) + 250ms);
  }

  /* Path A: the browser scrubs the sunrise with the band's own scroll position. */
  @supports (animation-timeline: view()) {
    .tester-band {
      view-timeline: --sunrise block;
    }
    .sky::before {
      animation: sunrise-glow linear both;
      animation-timeline: --sunrise;
      animation-range: cover 40% cover 75%;
    }
    .sky::after {
      animation: sunrise-disc linear both;
      animation-timeline: --sunrise;
      animation-range: cover 40% cover 75%;
    }
  }

  /* Path B: elsewhere, motion.js plays the sunrise once when half the band is visible. */
  @supports not (animation-timeline: view()) {
    .sl-motion .sky.reveal-pending::after {
      transform: translate(-50%, 100%);
    }
    .sl-motion .sky.reveal-pending::before {
      opacity: 0.25;
      transform: translate(-50%, 50%) scale(0.6);
    }
    .sl-motion .sky.reveal-run::after {
      animation: sunrise-disc var(--motion-sunrise) var(--motion-ease-out) both;
    }
    .sl-motion .sky.reveal-run::before {
      animation: sunrise-glow var(--motion-sunrise) var(--motion-ease-out) 200ms both;
    }
  }
}

@media print {
  .sky {
    display: none;
  }
  .calendar-scene {
    display: none;
  }
  .calendar-card.has-scene .month td:not(.pad) {
    background: var(--tile-bg);
    transform: none;
  }
  [data-reveal],
  [data-reveal='cascade'] > *,
  [data-reveal] :is(.feature-icon, .point-icon .icon, h3, p, .preset-name, .preset-meta, .strip-cell, .plan-soon),
  [data-reveal='calendar'] .month td {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .site-header,
  .site-footer,
  .chat,
  .policy-toc {
    display: none;
  }
  .night,
  .hero {
    background: none;
    color: #000;
  }
}
