/* ---------- Fonts ---------- */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Italic.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Italic.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --paper: #FAFAF7;
  --ink: #000000;
  --ink-muted: rgba(0, 0, 0, 0.5);
  --ink-faint: rgba(0, 0, 0, 0.2);
  --screen-inset: 32px;
  --phone-w: 340px;
  --phone-radius: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15140F;
    --ink: #FAFAF7;
    --ink-muted: rgba(250, 250, 247, 0.5);
    --ink-faint: rgba(250, 250, 247, 0.2);
  }
}

/* ---------- Reset ---------- */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
sup { font-size: 0.7em; vertical-align: super; line-height: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scrolly layout ---------- */

.scrolly {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1400px;
  margin: 0 auto;
}

.text-column {
  position: relative;
}

/* Sticky pane that holds all stop texts; only the active one is visible. */
.text-pane {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 64px;
  z-index: 2;
  pointer-events: none;
}

.text-pane-inner {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 420px;
}

.text-stop {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  /* opacity is driven inline by JS as a function of scroll progress; no
     CSS transition here, otherwise every scroll tick would animate. */
}

.text-stop.is-active {
  pointer-events: auto;
}

/* Subtle scroll affordance shown only on the cover stop.
   Fixed to the viewport so it sits at the bottom-center of the whole page,
   not just the text column. */
.scroll-hint {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-muted);
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
  z-index: 10;
}

body:has(.text-stop[data-text="0"].is-active) .scroll-hint {
  opacity: 1;
  animation: scroll-hint-bounce 2.2s ease-in-out infinite;
}

/* Hide the chevron once the user has scrolled at all. Beats the cover-stop
   rule above on specificity, so the fade-out still wins while stop 0 is
   technically still active mid-animation. */
body.has-scrolled:has(.text-stop[data-text="0"].is-active) .scroll-hint {
  opacity: 0;
  animation: none;
}

@keyframes scroll-hint-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.text-stop[data-text="0"].is-active) .scroll-hint {
    animation: none;
  }
}

/* Scroll-length providers. The pane already contributes 100vh of flow space;
   the negative margin removes that so total scroll height = N * 100vh + tail. */
.text-spacers {
  margin-top: -100vh;
}

.text-spacer {
  height: 100vh;
}

/* Extra room at the bottom so the sticky pane stays pinned through the last
   stop's full viewport instead of unsticking mid-stop. */
.text-tail {
  height: 100vh;
}

.stop-kicker {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px 0;
}

.stop-title {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 24px 0;
}

.stop-body {
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}

.stop-body em {
  font-style: italic;
  color: var(--ink);
}

/* Cover stop */
.wordmark-icon {
  width: 72px;
  height: 72px;
  border-radius: 22%;
  display: block;
  margin: 0 0 24px 0;
}

.wordmark {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 32px 0;
}


.lede {
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  line-height: 1.35;
  margin: 0 0 16px 0;
  max-width: 420px;
}

.lede-sub {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-muted);
  margin: 0 0 48px 0;
  max-width: 420px;
}

.lede-sub a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--ink-faint);
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

.lede-sub a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.cta { margin-top: 32px; }
.cta-end { margin-top: 40px; }

.cta-sub {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 16px 0 0 0;
}

/* ---------- App Store badge (CTA) ---------- */
/* Inline SVG rendition for now; swap for Apple's official localized badge
   asset before launch (see TODO comments in index.html). */

.app-store-badge {
  display: inline-block;
  width: 165px;
  height: 55px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 200ms ease, opacity 200ms ease;
}

.app-store-badge:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.app-store-badge:active {
  transform: translateY(0);
}

.app-store-badge svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Phone column ---------- */

.phone-column {
  position: relative;
}

.phone-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-frame {
  position: relative;
  width: var(--phone-w);
  aspect-ratio: 1206 / 2622;
  border-radius: var(--phone-radius);
  background: var(--paper);
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--ink-faint),
    0 30px 60px -20px rgba(0, 0, 0, 0.18);
}

.phone-screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  /* opacity is driven inline by JS as a function of scroll progress. */
}

.phone-screen.is-active {
  pointer-events: auto;
}

/* Screenshot-backed screens: the image fills the whole frame. */
.phone-screen-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Inline mobile phone (per stop) ---------- */
/* Each text-stop carries its own phone-shaped image for mobile, where the
   pinned phone-column is hidden. Hidden on desktop. */

.stop-phone {
  display: none;
}

/* Footer that takes the phone's place on the last stop.
   Absolutely positioned within .phone-sticky so it sits in the same
   right-column area. Opacity is driven inline by JS. */
.right-footer {
  position: absolute;
  right: 64px;
  bottom: 56px;
  text-align: right;
  opacity: 0;
  font-family: "Inter", system-ui, sans-serif;
}

.right-footer a {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.right-footer a:hover {
  color: var(--ink);
}

.footer-copyright {
  font-size: 11px;
  color: var(--ink-faint);
  margin: 16px 0 0 0;
}

/* ---------- Phone: shared elements ---------- */

.screen-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 24px;
}

.toolbar-spacer { flex: 1; }
.toolbar-icon { font-size: 16px; opacity: 0.7; }
.toolbar-text {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
}

.title-row {
  font-family: "Newsreader", Georgia, serif;
  font-size: 36px;
  line-height: 1;
  margin-bottom: 16px;
}

.title-active { color: var(--ink); }
.title-inactive { color: var(--ink-faint); }
.title-divider { color: var(--ink-faint); }

.filter-pills {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  color: var(--ink-muted);
  flex-wrap: nowrap;
  overflow: hidden;
}

.pill { white-space: nowrap; }

.pill.is-active {
  color: var(--ink);
  font-weight: 500;
  position: relative;
}

.pill.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--ink);
}

.primary-rule {
  height: 1px;
  background: var(--ink);
  margin: 16px 0;
}

/* ---------- Phone: notes list rows ---------- */

.note-list { flex: 1; overflow: hidden; }

.note-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-faint);
}

.note-row:last-child { border-bottom: none; }

.note-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.note-top .kind {
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.note-top .person { font-weight: 400; }

.note-top .due {
  margin-left: auto;
  font-weight: 400;
}

.note-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}

/* ---------- Phone: detail (note + person) ---------- */

.detail-body {
  flex: 1;
  overflow: hidden;
}

.kind-label {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.kind-label-muted { color: var(--ink-muted); }

.big-name {
  font-family: "Newsreader", Georgia, serif;
  font-size: 44px;
  line-height: 1;
  margin-bottom: 24px;
}

.big-name-first {
  display: block;
  color: var(--ink);
}

.big-name-last {
  display: block;
  color: var(--ink-muted);
}

.detail-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 32px 0;
}

.detail-meta {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
}

.meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-faint);
}

.meta-row:last-child { border-bottom: none; }

.meta-label {
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.meta-value {
  font-family: "Newsreader", Georgia, serif;
  font-size: 14px;
  color: var(--ink);
}

.person-context-italic {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.about-preview {
  margin: 16px 0;
}

.about-preview-body {
  font-family: "Newsreader", Georgia, serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archived-link {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  color: var(--ink-muted);
  padding: 16px 0;
}

/* ---------- Phone: people list ---------- */

.stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.stat { flex: 1; }
.stat-right { text-align: right; }

.stat-label {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  color: var(--ink);
}

.people-list { flex: 1; overflow: hidden; }

.person-row {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-faint);
}

.person-row:last-child { border-bottom: none; }

.person-left { flex: 1; }
.person-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.person-name {
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.person-context {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 2px;
  min-height: 1em;
}

.person-status {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 11px;
  color: var(--ink-muted);
}

.kc {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "Newsreader", Georgia, serif;
}

.kc-label { font-size: 13px; color: var(--ink); }
.kc-count {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  color: var(--ink-muted);
}

/* ---------- Phone: about list ---------- */

.about-list { margin-top: 8px; }

.about-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-faint);
}

.about-row:last-child { border-bottom: none; }

.about-text {
  font-family: "Newsreader", Georgia, serif;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.about-date {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  color: var(--ink-muted);
}

/* ---------- Phone: pill (inside phone) ---------- */

.phone-pill {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  margin: 16px 0 24px 0;
  border-radius: 22px;
  border: 1px solid var(--ink-faint);
  background: var(--paper);
}

.phone-pill-complete {
  background: var(--ink);
  border-color: var(--ink);
}

.phone-pill-circle {
  width: 36px;
  height: 36px;
  margin-left: 4px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.phone-pill-circle-invert {
  background: var(--paper);
  color: var(--ink);
}

.phone-pill-label {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-muted);
  pointer-events: none;
}

.phone-pill-label-invert { color: var(--paper); }

/* ---------- Phone: launch + install ---------- */

.launch {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.launch-mark {
  font-family: "Newsreader", Georgia, serif;
  font-size: 42px;
  letter-spacing: -0.01em;
}

.install-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 24px;
}

.install-tag {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: var(--ink-muted);
  margin: 0;
}

.appstore-badge {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 8px;
}

.install-req {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}

/* ---------- About page (long-form) ---------- */

.page-about {
  min-height: 100vh;
  padding: 32px 32px 80px 32px;
  display: flex;
  flex-direction: column;
}

.long-form {
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.page-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  margin: 0 0 48px 0;
}

.page-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 22%;
  display: block;
}

.page-brand-name {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.long-form-kicker {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: auto 0 16px 0;
}

.long-form-title {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 48px 0;
}

.prose {
  font-family: "Newsreader", Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: auto;
}

.prose p {
  margin: 0 0 24px 0;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose em {
  font-style: italic;
  color: var(--ink-muted);
}

.prose h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 56px 0 16px 0;
}

.prose h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  margin: 32px 0 12px 0;
}

.prose ul {
  margin: 0 0 24px 0;
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 8px;
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose strong {
  font-weight: 600;
}

.prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--ink-faint);
  transition: text-decoration-color 200ms ease;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose a.brandlink {
  text-decoration: none;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--ink-faint);
  margin: 40px 0;
}

.page-footer {
  max-width: 640px;
  margin: 96px auto 0 auto;
  font-family: "Inter", system-ui, sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: baseline;
  padding-top: 24px;
  border-top: 1px solid var(--ink-faint);
}

.page-footer a {
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: none;
}

.page-footer a:hover { color: var(--ink); }

.page-footer .footer-copyright {
  font-size: 11px;
  color: var(--ink-faint);
  margin: 0;
  margin-left: auto;
}

/* Mobile-only footer that sits at the end of the scrolly flow. Hidden on
   desktop; the .right-footer in .phone-column handles desktop instead. */
.scrolly-footer-mobile {
  display: none;
}

/* ---------- Mobile ---------- */

@media (max-width: 880px) {
  /* Mobile layout: drop the pinned scrolly pattern. Each stop becomes a
     regular flow section, with its phone screen inline below the copy. */
  .scrolly {
    grid-template-columns: 1fr;
  }
  .text-column { padding: 0 24px; }
  .phone-column { display: none; }
  .right-footer { display: none; }

  .text-pane {
    position: static;
    height: auto;
    padding: 0;
    pointer-events: auto;
  }
  .text-pane-inner {
    min-height: 0;
    max-width: 100%;
  }
  .text-stop {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding: 64px 0;
  }
  .text-spacers { display: none; }

  /* Hero stop: generous breathing room at the top. */
  .text-stop[data-text="0"] {
    padding-top: 96px;
  }

  /* Closing stop: room to breathe before the mobile footer. */
  .text-stop[data-text="5"] {
    padding-bottom: 32px;
  }

  .wordmark {
    font-size: 44px;
    margin-bottom: 20px;
  }
  .stop-title { font-size: 32px; }
  .lede-sub { margin-bottom: 24px; }
  .cta { margin-top: 20px; }
  .cta-end { margin-top: 24px; }

  /* Inline phone, shown only on mobile. Sized as a small illustration
     beside the prose, not as a viewport-dominating hero — a phone-shaped
     image on a phone screen reads better small than large. */
  .stop-phone {
    display: block;
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1206 / 2622;
    margin: 24px auto 0;
    border-radius: 24px;
    overflow: hidden;
    background: var(--paper);
    box-shadow:
      0 0 0 1px var(--ink-faint),
      0 12px 28px -12px rgba(0, 0, 0, 0.18);
  }
  .stop-phone img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Hero phone a touch larger to anchor the top of the page. */
  .text-stop[data-text="0"] .stop-phone {
    max-width: 180px;
    margin-top: 32px;
    border-radius: 28px;
  }

  /* Mobile footer at the very bottom of the scrolly. */
  .scrolly-footer-mobile {
    display: flex;
    margin: 24px 24px 48px 24px;
    max-width: none;
  }

  /* About page on mobile */
  .long-form-title { font-size: 36px; }
  .prose { font-size: 17px; }
  .page-footer {
    gap: 16px;
  }
  .page-footer .footer-copyright {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
    text-align: center;
  }
}
