/* Marko landing page. Colours: docs/brand.md (Ultraviolet) and the app's neutrals (packages/shared/src/theme.ts). */

:root {
  color-scheme: light dark;
  --radius: 20px;
  --gutter: clamp(16px, 5vw, 40px);
  --max: 1160px;
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* The system font (docs/brand.md, "Type", Brand #64): SF Pro on Apple devices, nothing embedded. SF Pro tracks
     itself by size, so the headings carry no negative letter spacing, as in the apps. */
  font-family: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--active-ink);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* No lime lines on violet (docs/brand.md, "Lime and violet together"): on a brand surface the ring takes the
   control's own colour, white or the lime button's dark label. */
.closing :focus-visible,
.hero .store-badge:focus-visible {
  outline-color: currentColor;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: 10px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* Header and footer */

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

.site-header {
  padding-top: 28px;
  padding-bottom: 8px;
}

.logo {
  display: inline-block;
  line-height: 0;
}

.logo img {
  height: 34px;
  width: auto;
}

.site-footer {
  padding-top: 40px;
  padding-bottom: 48px;
  color: var(--text-tertiary);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.site-footer a {
  color: inherit;
}

/* The app's living mesh (docs/brand.md, "Textures: mesh and wave"): public/mesh.js draws it, generated from the
   recipe. It stays Dark's and Light's own violet behind white text; without WebGL the section's flat violet shows. */

.mesh {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s;
}

.mesh.is-live {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mesh {
    transition: none;
  }
}

/* Hero: full bleed under the header, as the app's welcome screen. The form and the example week keep their surfaces. */

.page-home .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
}

main > section.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
  max-width: none;
  padding-top: 118px;
  padding-bottom: 72px;
  padding-left: max(var(--gutter), calc((100% - var(--max)) / 2));
  padding-right: max(var(--gutter), calc((100% - var(--max)) / 2));
  color: #fff;
  background: var(--violet-deep);
}

.eyebrow {
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(44px, 7.2vw, 76px);
  line-height: 1;
}

.lede {
  margin-top: 22px;
  max-width: 34em;
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.5;
}

@media (min-width: 960px) {
  main > section.hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 64px;
    padding-top: 128px;
    padding-bottom: 112px;
  }
}

/* The waitlist form */

.waitlist {
  margin-top: 32px;
  max-width: 460px;
  display: grid;
  gap: 14px;
  padding: 20px;
  color: var(--text);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.waitlist input[type='email'] {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.waitlist input[type='email']::placeholder {
  color: var(--text-tertiary);
}

.waitlist input[type='email']:focus {
  border-color: var(--active-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--active-focus) 22%, transparent);
}

.waitlist [aria-invalid='true'] {
  border-color: var(--danger) !important;
  outline-color: var(--danger);
}

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--active-ink);
  cursor: pointer;
}

.waitlist button,
.simple button,
.button-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s;
}

.waitlist button,
.simple button {
  color: var(--on-active);
  background: var(--active);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--active-ink) 55%, transparent);
}

.waitlist button:hover,
.simple button:hover,
.button-light:hover {
  filter: brightness(1.06);
}

.waitlist button:active,
.simple button:active,
.button-light:active {
  transform: scale(0.98);
}

.waitlist button:disabled {
  cursor: progress;
  filter: saturate(0.6);
}

.fine {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.form-status:empty {
  display: none;
}

.form-status {
  font-size: 15px;
  font-weight: 500;
}

.form-status[data-state='error'] {
  color: var(--danger);
}

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

.waitlist-done {
  padding: 20px 22px;
  font-size: 17px;
  font-weight: 500;
  outline: none;
}

.submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.offer {
  font-size: 15px;
  font-weight: 500;
}

.offer .price {
  display: block;
  font-weight: 400;
  opacity: 0.8;
}

.waitlist .price {
  color: var(--text-secondary);
  opacity: 1;
}

.hero .price {
  opacity: 1;
}

.when {
  margin-top: 28px;
  font-size: 14px;
}

@media (max-width: 599px) {
  .waitlist button {
    width: 100%;
  }
}

/* The launch-day page: Apple's badge in place of the form (src/launch.ts) */

.download {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

/* Apple's badge, unchanged: at least 40 px high, with clear space of a quarter of its height around it. */
.store-badge {
  display: inline-block;
  padding: 13px;
  margin: -13px;
  border-radius: 20px;
}

.store-badge img {
  display: block;
  width: 156px;
  height: 52px;
}

.store-badge:focus-visible {
  outline: 2px solid var(--active-focus);
  outline-offset: -4px;
}

.closing .store-badge {
  margin-top: 19px;
}

/* The example week */

.example {
  position: relative;
  margin: 0 auto;
  color: var(--text);
  width: 100%;
  max-width: 400px;
  padding-bottom: 56px;
}

.week {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px 18px 18px;
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}

.week-header {
  display: grid;
  gap: 2px;
  padding: 0 6px 14px;
}

.week-kicker {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.week-title {
  font-size: 24px;
  font-weight: 700;
}

.days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.day {
  display: grid;
  grid-template-columns: 38px 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 15px;
}

.day-name {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.day-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-meta {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.run { background: var(--run); }
.dot.ride { background: var(--ride); }
.dot.strength { background: var(--strength); }
.dot.rest { background: var(--rest); }

.day-past {
  opacity: 0.5;
}

.day-rest .day-title {
  color: var(--text-secondary);
  font-weight: 500;
}

.day-moved {
  background: var(--change);
}

.day-today {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'label label'
    'title title'
    'meta meta'
    'chart chart'
    'start start';
  gap: 4px;
  margin: 6px 0;
  padding: 18px;
  border-radius: 20px;
  color: var(--on-violet);
  background: var(--accent-fill);
}

.today-label {
  grid-area: label;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

.today-title {
  grid-area: title;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.today-meta {
  grid-area: meta;
  font-size: 14px;
  opacity: 0.9;
}

.today-chart {
  grid-area: chart;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 44px;
  margin: 12px 0 14px;
}

.seg {
  border-radius: 4px 4px 2px 2px;
  background: currentColor;
}

.seg-warm { flex: 15; height: 30%; opacity: 0.45; }
.seg-on { flex: 12; height: 88%; opacity: 0.95; }
.seg-off { flex: 4; height: 36%; opacity: 0.45; }
.seg-cool { flex: 12; height: 24%; opacity: 0.45; }

.today-start {
  grid-area: start;
  justify-self: start;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-active);
  background: var(--active);
}

/* Marko speaking */

.bubble {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.45;
}

.avatar {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 50%;
  background: var(--accent-fill);
}

.example .bubble {
  position: absolute;
  left: -12px;
  right: 24px;
  bottom: 0;
}

@media (min-width: 960px) {
  .example .bubble {
    left: -48px;
    right: 48px;
  }
}

/* The six sections */

.features {
  display: grid;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 88px;
}

.feature {
  padding: 32px 28px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature h2 {
  font-size: clamp(26px, 3vw, 32px);
}

.feature p {
  margin-top: 14px;
  color: var(--text-secondary);
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .feature {
    padding: 36px 32px;
  }
}

/* Questions */

.questions {
  display: grid;
  gap: 32px;
  padding-top: 64px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
}

.questions h2 {
  font-size: clamp(32px, 4.4vw, 48px);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

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

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: '+';
  color: var(--active-ink);
  font-weight: 500;
}

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

.faq details p {
  padding-bottom: 20px;
  max-width: 40em;
  color: var(--text-secondary);
}

@media (min-width: 960px) {
  .questions {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 64px;
    padding-top: 96px;
  }
}

/* The closing call to action */

.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 88px !important;
  padding-top: 72px !important;
  padding-bottom: 72px !important;
  text-align: center;
  color: #fff;
  background: var(--violet-deep);
  border-radius: 32px;
  width: calc(100% - 2 * var(--gutter)) !important;
  max-width: var(--max) !important;
}

.closing-copy {
  display: grid;
  justify-items: center;
}

.closing-mark {
  width: 72px;
  height: auto;
  margin-bottom: 24px;
}

.closing h2 {
  font-size: clamp(34px, 5vw, 56px);
}

.closing p {
  margin-top: 16px;
  max-width: 32em;
  font-size: 18px;
  opacity: 0.92;
}

/* A lime button on the violet surface, with its dark label: allowed, one per surface (docs/brand.md). */
.button-light {
  margin-top: 32px;
  color: var(--on-active);
  background: var(--active);
}

/* The press page */

.button-download {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  font-weight: 600;
  color: var(--on-active);
  text-decoration: none;
  background: var(--active);
  border-radius: 14px;
}

/* Privacy and the simple pages */

.prose,
.simple {
  max-width: calc(720px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 48px var(--gutter) 40px;
}

.prose h1,
.simple h1 {
  font-size: clamp(36px, 5vw, 52px);
}

.prose h1 + p {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}

.prose h2 {
  margin-top: 44px;
  font-size: 24px;
  letter-spacing: -0.015em;
}

.prose p,
.prose ul {
  margin-top: 14px;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 8px;
}

.prose li::marker {
  color: var(--violet-ink);
}

.simple {
  padding-top: 96px;
  padding-bottom: 120px;
}

.simple form {
  margin-top: 28px;
}

.simple p {
  margin-top: 18px;
  font-size: 19px;
  color: var(--text-secondary);
}

.page-prose .site-footer,
.page-simple .site-footer {
  max-width: calc(720px + 2 * var(--gutter));
}
