/* ==========================================================================
   Clean Day marketing site: "The Day Ribbon"
   One purple thread runs through a single day. The kiosk simulator
   (css/kiosk.css) is the only dark object on a white field.
   ========================================================================== */

@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/young-serif.woff2') format('woff2');
}

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

/* Kiosk face (the real app display uses Outfit) */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/outfit.woff2') format('woff2');
}

:root {
  --ground: #ffffff;
  --ground-deep: #f1eff8;
  --paper: #f5f3fa;
  --ink: #18212b;
  --ink-2: #3f4b58;
  --ink-3: #596572;
  --thread: #6b4fa8;
  --thread-deep: #4f3a82;
  --thread-track: #d3cde3;
  --rule: rgba(24, 33, 43, 0.16);
  --rule-strong: rgba(24, 33, 43, 0.34);
  --on-thread: #ffffff;

  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Type roles (DESIGN.md typography). The vw caps on fluid minimums keep
     whole words on a line at large browser text sizes. */
  --fs-label: 0.8rem;
  --fs-small: 0.95rem;
  --fs-body: 1rem;
  --fs-ui: 1.05rem;
  --fs-body-lg: 1.125rem;
  --fs-lead: clamp(1.125rem, 1.6vw, 1.3rem);
  --fs-title-sm: 1.3rem;
  --fs-question: clamp(1.15rem, 2vw, 1.4rem);
  --fs-title: 1.5rem;
  --fs-subhead: clamp(1.4rem, 2.4vw, 1.8rem);
  --fs-section: clamp(1.8rem, 3.4vw, 2.6rem);
  --fs-headline: clamp(min(2rem, 9vw), 4.4vw, 3.5rem);
  --fs-page-title: clamp(min(2.2rem, 10vw), 5vw, 3.6rem);
  --fs-display: clamp(min(2.5rem, 11vw), 5.2vw, 4.4rem);
  --fs-price: 4rem;

  --pad: clamp(18px, 4vw, 40px);
  --gut: clamp(40px, 9vw, 128px);
  --space: clamp(56px, 7.5vw, 104px);
  --wrap: 1280px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--thread) var(--ground-deep);
  accent-color: var(--thread);
}

body {
  font-family: var(--sans);
  background-color: var(--ground);
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--thread);
}

::selection {
  background: var(--thread);
  color: var(--on-thread);
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

section {
  position: relative;
}

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--thread);
  color: var(--on-thread);
  padding: 12px 20px;
  font-weight: 700;
  z-index: 9999;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* Type ------------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}

/* Running text pulls a word down beside a lone last word (the kiosk wraps as the app does) */
:where(p, li, blockquote):not(.kiosk-screen *) {
  text-wrap: pretty;
}

.h2 {
  font-family: var(--serif);
  font-size: var(--fs-headline);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  max-width: 18ch;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 40em;
}

.stop em,
.legal-content em {
  font-style: normal;
  font-weight: 700;
}

/* Layout: the day ------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.day {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Thread: the track, then the traveled part in purple. ::after draws it whole;
   with JS, .day-travel replaces it and is scaled down to the reader's position. */
.day::before,
.day::after,
.day-travel {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--pad) + var(--gut) / 2 - 1.5px);
  width: 3px;
}

.day::before {
  background: var(--thread-track);
}

.day::after,
.day-travel {
  background: var(--thread);
  z-index: 1;
}

.day.has-travel::after {
  display: none;
}

.day-travel {
  transform-origin: top;
  will-change: transform;
}

.stop {
  position: relative;
  padding: var(--space) 0 var(--space) var(--gut);
}

.stop::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: calc(var(--gut) / 2 - 8px);
  top: calc(var(--space) + 14px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ground);
  border: 3px solid var(--thread);
}

.stop::after {
  content: attr(data-time) / "";
  position: absolute;
  left: calc(var(--gut) / 2 - 38px);
  top: calc(var(--space) + 6px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

@media (max-width: 56.25em) {
  .stop::after {
    display: none;
  }
}

/* Buttons --------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  max-width: 100%;
  padding: 10px 28px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  font-weight: 700;
  line-height: 1.2;
  border-radius: 3px;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn-primary {
  background: var(--thread);
  color: var(--on-thread);
  padding-right: 42px;
  --notch: var(--ground);
}

/* Swallowtail end: a notch cut from the ribbon */
.btn-primary::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 15px;
  background: var(--notch);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.btn-primary:hover {
  background: var(--thread-deep);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--ground);
}

.btn-sm {
  min-height: 44px;
  padding: 8px 20px;
  font-size: var(--fs-small);
}

.btn-primary.btn-sm {
  padding-right: 34px;
}

.btn-block {
  width: 100%;
}

/* Narrow screens (or large text): long labels wrap instead of running off the page */
@media (max-width: 30em) {
  .btn:not(.btn-sm) {
    white-space: normal;
    text-align: center;
  }
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: var(--thread);
  transition: color 0.2s var(--ease);
}

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

/* Header ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-icon {
  width: auto;
  height: 48px;
}

.brand-text {
  font-family: var(--serif);
  font-size: var(--fs-title);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 0;
  transition: color 0.2s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--thread);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.signin-link,
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.back-link:hover {
  color: var(--thread);
}

.site-nav a {
  white-space: nowrap;
}

@media (max-width: 75em) {
  .site-nav ul {
    gap: 24px;
  }
}

.signin-link:hover {
  color: var(--thread);
}

/* Menu toggle and in-menu Sign In: narrow screens only */
.nav-toggle,
.nav-signin {
  display: none;
}

.nav-toggle {
  order: 3;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  place-items: center;
  color: var(--ink);
  border-radius: 3px;
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.nav-toggle-close,
.nav-toggle[aria-expanded="true"] .nav-toggle-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-close {
  display: inline;
}

@media (max-width: 62em) {
  .signin-link {
    display: none;
  }

  .site-header-inner {
    gap: 12px;
  }

  .header-actions {
    margin-left: auto;
  }

  .nav-toggle:not([hidden]) {
    display: grid;
  }

  /* The nav drops below the header as a panel */
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    background: var(--ground);
    border-bottom: 3px solid var(--ink);
  }

  .site-nav:not(.is-open) {
    display: none;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 4px var(--pad) 12px;
  }

  .site-nav li + li {
    border-top: 1px solid var(--rule);
  }

  .nav-signin {
    display: block;
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0;
    font-size: var(--fs-body-lg);
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
    transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
  }

  .site-nav a::after {
    display: none;
  }

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

  .site-nav a:focus-visible {
    outline-offset: -3px;
  }
}

@media (max-width: 48em) {
  .site-header-inner {
    height: 64px;
  }

  .brand-icon {
    height: 40px;
  }

  .brand-text {
    font-size: var(--fs-title-sm);
  }
}

@media (max-width: 30em) {
  .btn-long {
    display: none;
  }
}

@media (max-width: 23.375em) {
  .site-header-inner,
  .brand {
    gap: 8px;
  }

  .brand-text {
    font-size: var(--fs-body-lg);
  }
}

/* Smallest phones: the mark carries the brand; the name stays for screen readers */
@media (max-width: 22.4375em) {
  .site-header .brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* Hero ------------------------------------------------------------------ */
.hero {
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

.hero::before {
  top: clamp(52px, 7vw, 94px);
}

.hero::after {
  top: clamp(52px, 7vw, 94px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.hero-title {
  font-size: var(--fs-display);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
  max-width: 15em;
}

.hero-title .hl {
  color: var(--thread);
}

.hero-sub {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 32px;
}

.hero-actions .text-link {
  min-height: 44px;
}

.assure {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 6px;
}

.assure li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--fs-ui);
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.4;
}

.check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--thread);
}

@media (max-width: 56.25em) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}

/* The day in miniature: a sun-height curve with four stops */
.daycurve {
  position: relative;
  margin-top: clamp(28px, 4vw, 48px);
}

.daycurve-plot {
  position: relative;
  height: 150px;
}

.daycurve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.daycurve-line {
  fill: none;
  stroke: var(--thread);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.daycurve-line.is-inferred {
  stroke: var(--ink-3);
  stroke-dasharray: 1 10;
}

.daycurve-draw {
  animation: draw 1.8s var(--ease) 0.2s both;
}

@keyframes draw {
  from { clip-path: inset(-6px 100% -6px 0); }
  to { clip-path: inset(-6px 0 -6px 0); }
}

.daycurve-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--ground);
  border: 3px solid var(--thread);
  transition: background-color 0.3s var(--ease);
}

.daycurve-dot.is-now {
  background: var(--thread);
  box-shadow: 0 0 0 5px var(--ground), 0 0 0 7px var(--thread);
}

.daycurve-stops {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

.daycurve-stops li {
  padding: 0 12px;
  text-align: center;
}

.daycurve-stops strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-title-sm);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.daycurve-stops span {
  display: block;
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--ink-2);
  margin-top: 4px;
  text-wrap: balance;
}

.daycurve-stops .is-now strong {
  color: var(--thread);
}

@media (max-width: 40em) {
  .daycurve-plot {
    height: 110px;
  }

  .daycurve-stops li {
    padding: 0 2px;
  }

  .daycurve-stops strong {
    font-size: var(--fs-label);
    letter-spacing: -0.01em;
  }

  .daycurve-stops span {
    display: none;
  }
}

/* Demo (kiosk) ---------------------------------------------------------- */
.demo-section {
  --space: clamp(36px, 4.5vw, 56px);
}

.demo-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px clamp(24px, 4vw, 56px);
  align-items: end;
  margin-bottom: 20px;
}

.demo-head .h2 {
  margin-bottom: 0;
  font-size: var(--fs-section);
}

.demo-head .lead {
  font-size: var(--fs-ui);
  line-height: 1.5;
}

/* Controls: a two-row, two-column pill panel above the display.
   The display keeps one fixed size. */
.demo-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  gap: 12px 28px;
  padding: 14px 18px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control-label {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

.segment-btn {
  flex: 1 1 auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.segment-btn:hover {
  background: var(--ground-deep);
}

.segment-btn.active {
  background: var(--thread);
  color: var(--on-thread);
}

.segment-btn:focus-visible {
  outline-offset: -3px;
}

/* Touch screens (iPad landscape reaches the simulator): full-size pills */
@media (pointer: coarse) {
  .segment-btn {
    min-height: 44px;
  }
}

/* Isolate the kiosk from shell type settings so it renders as in the app */
.tablet-container {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  text-align: left;
  color: var(--ink);
}

/* One fixed display size: the tallest mode (full schedule + gentle reminder) is 760px;
   shorter modes fill the same screen, as on a real tablet. */
@media (min-width: 861px) {
  .tablet-container .kiosk-screen {
    height: 760px;
  }
}

.stop .tablet-bezel {
  box-shadow: 0 34px 48px -26px rgba(24, 33, 43, 0.6), 0 0 0 1px rgba(24, 33, 43, 0.2);
}

.note-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 40px;
  margin-top: 40px;
}

.note-bar-text {
  max-width: 340px;
}

.note-bar-text strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-title-sm);
  margin-bottom: 4px;
}

.note-bar-text span {
  font-size: var(--fs-body);
  color: var(--ink-2);
}

.note-form {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 300px;
}

.note-input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 3px;
}

.note-input:focus {
  outline: 3px solid var(--thread);
  outline-offset: 2px;
}

/* The kiosk needs room to render as it does on a tablet: hide the simulator
   (and every link to it) below 1024px. */
@media (max-width: 1023px) {
  #demo,
  .demo-section,
  .demo-link {
    display: none !important;
  }
}

@media (max-width: 56.25em) {
  .demo-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .segmented {
    flex-wrap: wrap;
    border-radius: 16px;
  }
}

/* How it works ---------------------------------------------------------- */
.how {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.how-intro {
  position: sticky;
  top: 112px;
}

.steps {
  list-style: none;
}

.step {
  position: relative;
  padding: 36px 0 40px 44px;
  border-top: 1px solid var(--rule-strong);
}

.step:last-child {
  border-bottom: 1px solid var(--rule-strong);
}

/* Bookmark ribbon hanging from the rule */
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 16px;
  height: 34px;
  background: var(--thread);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

.step h3 {
  font-size: var(--fs-subhead);
  line-height: 1.2;
  margin-bottom: 12px;
}

.step p {
  color: var(--ink-2);
  max-width: 34em;
}

.step strong {
  color: var(--ink);
}

.step .guide-link {
  margin-top: 8px;
}

@media (max-width: 56.25em) {
  .how {
    grid-template-columns: minmax(0, 1fr);
  }

  .how-intro {
    position: static;
  }
}

/* Anchoring ------------------------------------------------------------- */
.anchor-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 0 clamp(32px, 6vw, 96px);
  margin-top: 56px;
}

.pillar {
  padding: 32px 0;
  border-top: 1px solid var(--rule-strong);
}

.pillar h3 {
  font-size: var(--fs-title);
  line-height: 1.2;
  margin-bottom: 12px;
}

.pillar p {
  color: var(--ink-2);
}

.pillar-lead {
  grid-row: span 2;
  padding-top: 40px;
}

.pillar-lead h3 {
  font-size: var(--fs-section);
  line-height: 1.1;
  margin-bottom: 20px;
}

.pillar-lead p {
  font-size: var(--fs-lead);
  line-height: 1.6;
  max-width: 30em;
}

.pillar-lead .impact {
  font-size: var(--fs-body-lg);
  margin-top: 28px;
}

.impact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.origin {
  margin-top: clamp(64px, 8vw, 112px);
  position: relative;
  padding-left: 44px;
}

/* Narrow screens: the bookmark keeps a 16px gap so the quote gets the column */
@media (max-width: 37.5em) {
  .origin {
    padding-left: 32px;
  }
}

.origin::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 16px;
  height: 34px;
  background: var(--thread);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

.origin-quote {
  font-family: var(--serif);
  font-size: var(--fs-subhead);
  line-height: 1.4;
  max-width: 32em;
  color: var(--ink);
}

.origin-quote em {
  color: var(--thread);
  font-weight: 400;
}

.origin-author {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.origin-author strong {
  font-size: var(--fs-ui);
}

.origin-author span {
  color: var(--ink-3);
}

@media (max-width: 56.25em) {
  .anchor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillar-lead {
    grid-row: auto;
  }
}

/* Trust ----------------------------------------------------------------- */
.trust-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
}

.seal {
  flex-shrink: 0;
  width: 168px;
  height: 168px;
  color: var(--thread);
  transform: rotate(-9deg);
  opacity: 0.88;
}

.trust-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 3px solid var(--ink);
}

.trust-col {
  padding: 32px 32px 8px 0;
}

.trust-col + .trust-col {
  padding-left: 32px;
  border-left: 1px solid var(--rule-strong);
}

.trust-col h3 {
  font-size: var(--fs-title);
  line-height: 1.2;
  margin-bottom: 12px;
}

.trust-col p {
  color: var(--ink-2);
}

@media (max-width: 56.25em) {
  .trust-head {
    flex-direction: column-reverse;
    gap: 16px;
  }

  /* 160px keeps the ring text (14 of 200 units) at 11px or more. */
  .seal {
    width: 160px;
    height: 160px;
  }

  .trust-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .trust-col,
  .trust-col + .trust-col {
    padding: 28px 0 8px;
    border-left: 0;
  }

  .trust-col + .trust-col {
    border-top: 1px solid var(--rule-strong);
  }
}

/* Pricing --------------------------------------------------------------- */
.billing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.billing-label {
  font-weight: 600;
  color: var(--ink-3);
  transition: color 0.2s var(--ease);
}

.billing-label.active {
  color: var(--ink);
  font-weight: 700;
}

.save-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--on-thread);
  background: var(--thread);
  border-radius: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* The input is the hit area: 5px past the 60x34 track on every side (70x44) */
.switch input {
  position: absolute;
  inset: -5px;
  opacity: 0;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  cursor: pointer;
  z-index: 1;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  transition: background-color 0.25s var(--ease);
}

.slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}

.switch input:checked + .slider {
  background: var(--thread);
  border-color: var(--thread);
}

.switch input:checked + .slider::before {
  transform: translateX(26px);
  background: var(--on-thread);
}

.switch input:focus-visible + .slider {
  outline: 3px solid var(--thread);
  outline-offset: 3px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 920px;
  margin-top: 48px;
  border-top: 1px solid var(--rule-strong);
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 32px 40px;
}

.plan:first-child {
  padding-left: 0;
}

.plan + .plan {
  border-left: 1px solid var(--rule-strong);
}

.plan.featured {
  margin-top: -1px;
  border-top: 4px solid var(--thread);
  background: var(--paper);
  padding-left: 32px;
}

.plan-flag {
  position: absolute;
  top: -4px;
  right: 28px;
  padding: 18px 14px 26px;
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
  text-align: center;
  color: var(--on-thread);
  background: var(--thread);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
  width: 7.5em;
}


.plan-name {
  font-size: var(--fs-title);
  line-height: 1.15;
  margin-bottom: 8px;
}

.plan.featured .plan-name {
  padding-right: 6.25rem;
}

.plan-desc {
  color: var(--ink-2);
  margin-bottom: 24px;
  min-height: 3.2em;
}

.plan-price-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 28px;
}

.plan-price {
  font-family: var(--serif);
  font-size: var(--fs-price);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: lining-nums;
}

.plan-period {
  color: var(--ink-3);
  font-weight: 600;
}

.plan-trial {
  margin: -12px 0 28px;
  color: var(--ink-2);
}

.plan-trial strong {
  color: var(--ink);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-body);
  line-height: 1.4;
}

.plan-features .check {
  width: 20px;
  height: 20px;
}

.facility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin-top: 56px;
  padding: 32px 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule-strong);
}

.facility h3 {
  font-size: var(--fs-title);
  margin-bottom: 6px;
}

.facility p {
  color: var(--ink-2);
  max-width: 44em;
}

@media (max-width: 62em) {
  .plans {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }

  .plan,
  .plan:first-child {
    padding: 36px 0 40px;
  }

  .plan + .plan {
    border-left: 0;
    border-top: 1px solid var(--rule-strong);
  }

  .plan.featured {
    padding: 36px 20px 40px;
  }
}

/* FAQ ------------------------------------------------------------------- */
.faq {
  max-width: 820px;
  margin-top: 40px;
  border-top: 3px solid var(--ink);
}

.faq-item {
  border-bottom: 1px solid var(--rule-strong);
}

.faq-question {
  width: 100%;
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  text-align: left;
  font-family: var(--serif);
  font-size: var(--fs-question);
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}

.faq-question:hover {
  color: var(--thread);
}

/* Questions are headings in a button: balance them like h3s */
.faq-question span {
  text-wrap: balance;
}

.faq-chevron {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--thread);
  transition: transform 0.3s var(--ease);
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

/* Without JS (.faq not enhanced) every answer stays open and the chevron hides */
.faq:not(.is-enhanced) .faq-chevron {
  display: none;
}

.faq-answer {
  display: grid;
  grid-template-rows: 1fr;
}

.faq.is-enhanced .faq-answer {
  grid-template-rows: 0fr;
}

/* Enabled a frame after enhancement so answers collapse instantly on load */
.faq.is-ready .faq-answer {
  transition: grid-template-rows 0.4s var(--ease);
}

.faq.is-enhanced .faq-item.active .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  min-height: 0;
  overflow: hidden;
}

.faq-answer p {
  padding: 0 48px 28px 0;
  color: var(--ink-2);
  max-width: 44em;
}

.faq-answer p:has(+ .faq-more) {
  padding-bottom: 4px;
}

.faq-answer .faq-more {
  padding-bottom: 20px;
}

/* Help-center guide link closing an answer: hairline-underlined, quieter than body */
.guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--thread);
  transition: color 0.2s var(--ease), text-decoration-thickness 0.2s var(--ease);
}

.guide-link:hover {
  color: var(--thread);
  text-decoration-thickness: 2px;
}

/* Closing band: the thread meets tomorrow morning ------------------------ */
.cta {
  --cta-pad: clamp(64px, 9vw, 112px);
  background: var(--thread);
  color: var(--on-thread);
  padding: var(--cta-pad) 0;
}

/* The thread arrives in the band and ends at tomorrow's first stop */
.cta-inner {
  position: relative;
  padding-left: var(--gut);
}

.cta-inner::before {
  content: "";
  position: absolute;
  left: calc(var(--gut) / 2 - 1.5px);
  top: calc(var(--cta-pad) * -1);
  height: calc(var(--cta-pad) + 22px);
  width: 3px;
  background: var(--on-thread);
}

.cta-inner::after {
  content: "Tomorrow" / "";
  position: absolute;
  left: calc(var(--gut) / 2 - 38px);
  top: 6px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-thread);
  white-space: nowrap;
}

.cta-node {
  position: absolute;
  left: calc(var(--gut) / 2 - 8px);
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--thread);
  border: 3px solid var(--on-thread);
}

@media (max-width: 56.25em) {
  .cta-inner::after {
    display: none;
  }
}

.cta h2 {
  font-size: var(--fs-display);
  line-height: 1.06;
  color: var(--on-thread);
  margin: 0 0 20px;
  max-width: 20ch;
}

.cta p {
  font-size: var(--fs-lead);
  max-width: 32em;
  margin: 0 0 36px;
  color: var(--on-thread);
}

.cta .btn-primary {
  background: var(--on-thread);
  color: var(--thread-deep);
  --notch: var(--thread);
  min-height: 60px;
  padding: 12px 48px 12px 36px;
  font-size: var(--fs-body-lg);
}

.cta .btn-primary:hover {
  background: var(--ground);
}

.cta :focus-visible {
  outline-color: var(--on-thread);
}

/* Footer ---------------------------------------------------------------- */
.site-footer {
  background: var(--ground-deep);
  padding: 72px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer-brand p {
  color: var(--ink-2);
  margin-top: 14px;
  max-width: 340px;
}

.footer-col h2 {
  font-family: var(--sans);
  font-size: var(--fs-small);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration-color: var(--thread);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--rule-strong);
  font-size: var(--fs-small);
  color: var(--ink-3);
}

.footer-bottom .text-link {
  min-height: 44px;
}

@media (max-width: 48em) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

/* Setup page ------------------------------------------------------------ */
/* Pull the first strip's drawings into the first viewport */
.setup-hero {
  padding-bottom: 8px;
}

.setup-first {
  padding-top: 40px;
}

.setup-first::before {
  top: 54px;
}

.setup-first .setup-strip {
  margin-top: 36px;
}

.setup-jump {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}

.setup-jump .text-link {
  min-height: 44px;
}

.setup-need {
  font-size: var(--fs-title-sm);
  line-height: 1.2;
  margin-bottom: 18px;
}

.setup-head .lead {
  max-width: 36em;
}

/* Each setup is a strip of drawn steps; ring nodes on a short thread mark the order */
.setup-strip {
  --g: clamp(24px, 2.6vw, 36px);
  --node: 38px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--g);
  margin-top: 48px;
}

.setup-step {
  position: relative;
  padding-top: calc(var(--node) + 20px);
}

.setup-node {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: var(--node);
  height: var(--node);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ground);
  border: 3px solid var(--thread);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1;
  color: var(--thread);
  font-variant-numeric: lining-nums;
}

.setup-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc((var(--node) - 3px) / 2);
  left: var(--node);
  width: calc(100% + var(--g) - var(--node));
  height: 3px;
  background: var(--thread);
}

.setup-art {
  width: 100%;
  height: auto;
  aspect-ratio: 240 / 170;
  margin-bottom: 20px;
}

.setup-step h3 {
  font-size: var(--fs-title-sm);
  line-height: 1.2;
  margin-bottom: 8px;
}

.setup-step p {
  color: var(--ink-2);
}

.setup-step strong {
  color: var(--ink);
}

.setup-more {
  margin-top: 28px;
}

.setup-help {
  margin-top: 40px;
}

.setup-help .setup-more {
  margin-top: 8px;
}

.setup-contact {
  margin-top: 40px;
  font-size: var(--fs-body-lg);
  color: var(--ink-2);
}

/* Drawing palette: shell tokens only */
.art-dev { fill: var(--ground); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.art-dev-thin { stroke-width: 2; }
.art-scr { fill: var(--paper); }
.art-ground { fill: var(--ground); }
.art-panel { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1; }
.art-field { fill: var(--ground); stroke: var(--rule-strong); stroke-width: 1.5; }
.art-field-strong { stroke: var(--ink); }
.art-board { fill: var(--ground-deep); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.art-port { fill: var(--ground); stroke: var(--ink); stroke-width: 1.5; }
.art-ink { fill: var(--ink); }
.art-soft { fill: var(--thread-track); }
.art-soft-dark { fill: var(--rule-strong); }
.art-thread { fill: var(--thread); }
.art-white { fill: var(--on-thread); }
.art-ring { stroke: var(--ground); stroke-width: 3; }
.art-faint { opacity: 0.35; }
.art-thread-ln { fill: none; stroke: var(--thread); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-white-ln { fill: none; stroke: var(--on-thread); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.art-rule-ln { fill: none; stroke: var(--rule-strong); stroke-width: 1.5; }
.art-thin { stroke-width: 2.2; }
.art-cursor { fill: var(--ink); stroke: var(--on-thread); stroke-width: 1.2; stroke-linejoin: round; }
.art-mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.art-mono-quiet { fill: var(--ink-3); }
.art-mono-thread { fill: var(--thread); }

@media (max-width: 68.75em) {
  .setup-strip {
    grid-template-columns: minmax(0, 1fr);
    --g: 40px;
  }

  .setup-step {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0 32px;
    padding: 0 0 0 calc(var(--node) + 16px);
  }

  .setup-art {
    grid-row: 1 / span 2;
    margin-bottom: 0;
  }

  .setup-step h3 {
    padding-top: 4px;
  }

  /* Vertical strips run beside the page thread: keep their connector on the track colour */
  .setup-step:not(:last-child)::after {
    top: var(--node);
    left: calc((var(--node) - 3px) / 2);
    width: 3px;
    height: calc(100% + var(--g) - var(--node));
    background: var(--thread-track);
  }
}

@media (max-width: 37.5em) {
  .setup-step {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    padding-left: calc(var(--node) + 12px);
  }

  .setup-art {
    grid-row: auto;
    max-width: 340px;
    margin-bottom: 16px;
  }
}

/* Legal pages & 404 ----------------------------------------------------- */
.legal {
  max-width: 760px;
}

.legal-header {
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 3px solid var(--ink);
}

.legal-header h1 {
  font-size: var(--fs-page-title);
  line-height: 1.06;
  margin-bottom: 14px;
}

.legal-header p {
  color: var(--ink-3);
  font-size: var(--fs-ui);
}

.legal-content h2 {
  font-size: var(--fs-title);
  line-height: 1.2;
  margin: 44px 0 16px;
}

.legal-content p,
.legal-content ul {
  color: var(--ink-2);
  font-size: var(--fs-body-lg);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 68ch;
}

.legal-content ul {
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 10px;
}

.legal-content strong {
  color: var(--ink);
}

.legal-content a {
  color: var(--thread);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.lost {
  min-height: 52vh;
}

.lost h1 {
  font-size: var(--fs-page-title);
  line-height: 1.04;
  margin-bottom: 20px;
  max-width: 12em;
}

.lost .lead {
  margin-bottom: 36px;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    /* Infinite loops would otherwise keep cycling at an arbitrary phase */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
