/*
 * getrapha.co. Quiet black like the app, one teal accent, and the real app screens carry the
 * color. Layout after wabi.ai: a centered serif headline, one phone per idea, no boxes.
 */
:root {
  --bg: #0a0a0b;
  --raised: #1c1c1e;
  --fg: #ededed;
  --fg-2: #a1a1a6;
  --fg-3: #85858b;
  --line: rgba(237, 237, 237, 0.08);
  --accent: #2ee6c8;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

/* Lenis smooth scrolling */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

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

/* ---------- Navigation: wordmark, one link, one button ---------- */
.nav {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: linear-gradient(var(--bg) 40%, rgba(10, 10, 11, 0));
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 15px;
}

.nav-links a:not(.btn) {
  color: var(--fg-2);
  text-decoration: none;
  transition: color 150ms var(--ease);
}

.nav-links a:not(.btn):hover {
  color: var(--fg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 24px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms var(--ease),
    transform 150ms var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--fg);
  color: #0a0a0b;
}

.btn--primary:hover {
  background: #fff;
}

.btn--secondary {
  border: 1px solid var(--line);
  background: var(--raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

.btn--secondary:hover {
  background: #232325;
}

.btn--sm {
  min-height: 36px;
  border-radius: 18px;
  padding: 0 16px;
  font-size: 14px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Hero ---------- */
.hero {
  padding: 152px 24px 0;
  text-align: center;
}

h1,
h2 {
  margin: 0;
  font-weight: 400;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 6.4vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero .sub {
  max-width: 34rem;
  margin: 20px auto 32px;
  color: var(--fg-2);
  font-size: 19px;
  line-height: 1.55;
}

.badges {
  width: auto;
  height: 44px;
  margin: 0 auto 32px;
}

.proof {
  display: flex;
  margin-top: 20px;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  color: var(--fg-3);
  font-size: 14px;
}

.proof span + span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 20px 3px 0;
  border-radius: 50%;
  background: var(--fg-3);
}

/* Three phones: today's home screen in front, the lesson and chat behind it, out of focus */
.stage {
  position: relative;
  display: flex;
  max-width: 900px;
  margin: 64px auto 0;
  justify-content: center;
}

.stage .phone {
  position: relative;
  z-index: 1;
  width: min(340px, 74vw);
}

.stage .behind {
  position: absolute;
  top: 48px;
  width: min(290px, 60vw);
  filter: blur(6px) brightness(0.55);
}

.stage .behind--left {
  right: 56%;
}

.stage .behind--right {
  left: 56%;
}

.phone {
  width: min(320px, 74vw);
  margin: 0 auto;
}

/* ---------- Sections: a centered heading, then one phone ---------- */
.section {
  padding: 128px 32px 0;
  text-align: center;
}

.section h2 {
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.section .lede {
  max-width: 32rem;
  margin: 16px auto 0;
  color: var(--fg-2);
  font-size: 18px;
  line-height: 1.55;
}

.section .phone {
  margin-top: 48px;
}

/* How it works: the section pins while the page scrolls through eight steps. The rail fills
   continuously, and the text and the phone's screen move with the scroll itself (site.js),
   rather than switching on a timer. */
.scrolly {
  position: relative;
  height: calc(var(--steps) * 70vh + 30vh);
}

.scrolly-pin {
  position: sticky;
  top: 0;
  display: grid;
  max-width: 1144px;
  height: 100vh;
  margin: 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 72px;
  padding: 72px 32px 0;
}

/* The phone holds the center: the text sits against its left side, the rail against its right */
.copies {
  order: 1;
  justify-self: end;
  width: min(100%, 380px);
}

.scrolly-phone {
  order: 2;
}

.rail {
  order: 3;
  justify-self: start;
  width: 168px;
}

/* The rail: a hairline track with a dot per step, and a teal fill that follows the scroll */
.rail {
  position: relative;
}

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

.rail-line {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 4px;
  width: 2px;
  border-radius: 1px;
  background: var(--raised);
}

.rail-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--fill, 0) * 100%);
  border-radius: 1px;
  background: var(--accent);
}

.rail-step {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  padding: 0 0 0 24px;
  color: var(--fg-3);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: color 200ms var(--ease);
}

.rail-step::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border: 2px solid var(--raised);
  border-radius: 50%;
  background: var(--bg);
  transition:
    border-color 200ms var(--ease),
    background-color 200ms var(--ease),
    transform 200ms var(--ease);
}

.rail-step .num {
  color: var(--fg-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rail-step:hover {
  color: var(--fg-2);
}

.rail-step.done {
  color: var(--fg-2);
}

.rail-step.done::before {
  border-color: var(--accent);
  background: var(--accent);
}

.rail-step.on {
  color: var(--fg);
}

.rail-step.on::before {
  border-color: var(--accent);
  background: var(--bg);
  transform: scale(1.3);
}

.rail-step.on .num {
  color: var(--accent);
}

/* Every step's text sits in the same spot; site.js fades and slides it with the scroll */
.copies {
  display: grid;
}

.copy {
  text-align: left;
}

.copy {
  grid-area: 1 / 1;
  align-self: center;
  opacity: 0;
  will-change: opacity, transform;
}

.copy .kicker {
  display: none;
  margin: 0 0 8px;
  color: var(--fg-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.copy h2 {
  text-wrap: balance;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.copy p:not(.kicker) {
  max-width: 26rem;
  margin: 16px 0 0;
  color: var(--fg-2);
  font-size: 18px;
  line-height: 1.55;
}

.scrolly-phone {
  display: grid;
}

.scrolly-phone img {
  grid-area: 1 / 1;
  width: auto;
  height: min(78vh, 700px);
  opacity: 0;
  will-change: opacity, transform;
}

.scrolly-phone img:first-child {
  opacity: 1;
}

/* Small, quiet facts */
.facts {
  display: flex;
  max-width: 760px;
  margin: 48px auto 0;
  justify-content: center;
  gap: 16px 48px;
  flex-wrap: wrap;
  color: var(--fg-2);
  font-size: 15px;
}

.facts b {
  display: block;
  color: var(--fg);
  font-size: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- Section layout, after swaygrowth.com: a wide container, a split head with a
   numbered label, then content laid out across the width ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  text-align: left;
}

.head {
  display: grid;
  margin-bottom: 64px;
  grid-template-columns: 1.15fr 1fr;
  align-items: end;
  gap: 48px;
}

.label {
  margin: 0 0 16px;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 13px;
}

.label b {
  color: var(--accent);
  font-weight: 400;
}

.head h2 {
  text-wrap: balance;
}

.head > p {
  margin: 0;
  border-left: 1px solid var(--line);
  padding: 4px 0 4px 24px;
  color: var(--fg-2);
  font-size: 17px;
  line-height: 1.6;
}

.section--head {
  padding-bottom: 0;
}

.section--head .head {
  margin-bottom: 0;
}

/* A phone beside its selling points */
.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 96px;
}

.feature .phone {
  width: 300px;
  margin: 0;
}

.feature--flip .phone {
  order: 2;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.num {
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
}

.list h3,
.cells h3 {
  margin: 0 0 4px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 500;
}

.list p,
.cells p {
  margin: 0;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.5;
}

/* Three cells in a hairline grid */
.cells {
  display: grid;
  margin: 112px 0 0;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.cells li {
  padding: 24px;
}

.cells li + li {
  border-left: 1px solid var(--line);
}

.cells .num {
  display: block;
  margin-bottom: 24px;
}

/* The Daily Verse widget, rebuilt from the app's own layout and backgrounds. Sizes are in
   container units so it scales as one piece. */
.widgets {
  position: relative;
  display: flex;
  max-width: 900px;
  margin: 112px auto 0;
  justify-content: center;
}

.widget {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(520px, 100%);
  aspect-ratio: 364 / 170;
  margin: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  container-type: inline-size;
  border-radius: 32px;
  background-position: center;
  background-size: cover;
  padding: 0 5.5cqw;
  text-align: center;
}

.widget img {
  width: 13.7cqw;
  margin-bottom: 2.75cqw;
}

.widget blockquote {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 4.12cqw;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: -0.03em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.widget figcaption {
  margin-top: 2.75cqw;
  color: #aaa;
  font-size: 3.57cqw;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.widget--behind {
  position: absolute;
  z-index: 0;
  width: min(400px, 80%);
  border-radius: 26px;
  filter: blur(5px) brightness(0.5);
}

.widget--left {
  top: -48px;
  right: 50%;
}

.widget--right {
  bottom: -48px;
  left: 50%;
}

/* ---------- Closing ---------- */
.final {
  padding: 160px 24px 128px;
  text-align: center;
}

.final h2 {
  margin-bottom: 32px;
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.final .sub {
  margin: 16px auto 32px;
  color: var(--fg-2);
  font-size: 18px;
}

/* ---------- Footer: two halves of equal height. Links on the left, the wordmark on the right,
   each closing on a quiet line at the same baseline ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 32px 48px;
  color: var(--fg-3);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  max-width: 1080px;
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.footer-half {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-half--mark {
  align-items: flex-end;
}

.footer-meta {
  margin-top: auto;
  font-size: 13px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 144px);
  gap: 32px;
}

.footer-links div {
  display: grid;
  align-content: start;
  gap: 12px;
}

.footer-links h3 {
  margin: 0 0 4px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
}

.site-footer a:not(.btn) {
  color: var(--fg-2);
  text-decoration: none;
  transition: color 150ms var(--ease);
}

.site-footer a.footer-meta {
  color: var(--fg-3);
}

.site-footer a:not(.btn):hover {
  color: var(--fg);
}

.footer-mark {
  display: block;
  width: 100%;
  max-width: 440px;
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}

/* ---------- Entrance ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 500ms var(--ease),
    transform 500ms var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Legal and support pages ---------- */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 144px 24px 64px;
}

.doc h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.doc .updated {
  margin: 12px 0 40px;
  color: var(--fg-3);
  font-size: 14px;
}

.doc h2 {
  margin: 48px 0 12px;
  font-size: 22px;
  font-weight: 500;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 17px;
  font-weight: 500;
}

.doc p,
.doc li {
  color: var(--fg-2);
}

.doc strong {
  color: var(--fg);
  font-weight: 500;
}

.doc ul {
  padding-left: 20px;
}

.doc li {
  margin: 8px 0;
}

.doc a {
  color: var(--accent);
}

.callout {
  margin: 24px 0;
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 20px;
}

.callout p {
  margin: 0;
}

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

.faq summary {
  cursor: pointer;
  color: var(--fg);
  font-size: 17px;
  font-weight: 500;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  float: right;
  color: var(--fg-3);
}

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

.faq details p {
  margin: 12px 0 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .nav {
    padding: 16px 20px;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .hero {
    padding-top: 112px;
  }

  .hero .sub {
    font-size: 17px;
  }

  .badges {
    height: 36px;
    margin-bottom: 24px;
  }

  .stage .behind {
    display: none;
  }

  .section {
    padding: 96px 20px 0;
  }

  .head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
  }

  .head > p {
    border-left: 0;
    padding: 0;
  }

  .feature {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0;
  }

  /* On phones the points come first, as a 2 by 2 grid right under the heading, then the phone */
  .feature .phone,
  .feature--flip .phone {
    order: 2;
    width: min(280px, 72vw);
    margin: 0 auto;
  }

  .list {
    display: grid;
    order: 1;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--line);
  }

  .list li {
    display: block;
    padding: 16px 0;
    border-bottom: 0;
  }

  .list li:nth-child(odd) {
    padding-right: 16px;
    border-right: 1px solid var(--line);
  }

  .list li:nth-child(even) {
    padding-left: 16px;
  }

  .list li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .list .num {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 16px;
  }

  .list h3 {
    font-size: 15px;
  }

  .list p {
    font-size: 13px;
  }

  .cells {
    grid-template-columns: 1fr;
  }

  .cells li + li {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .cells .num {
    margin-bottom: 12px;
  }

  .widget {
    border-radius: 22px;
  }

  .widget--behind {
    display: none;
  }

  /* Starts under the heading; the pin's own top padding already clears the nav */
  .scrolly {
    height: calc(var(--steps) * 60vh + 40vh);
    margin-top: -48px;
  }

  /* Bar, text and phone sit together in the middle of the space under the nav */
  .scrolly-pin {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 24px;
    padding: 80px 20px 24px;
    text-align: center;
  }

  /* On phones the rail turns into a thin horizontal bar, and each step shows its own label */
  .rail,
  .copies,
  .scrolly-phone {
    order: 0;
    justify-self: stretch;
  }

  .scrolly-phone {
    justify-self: center;
  }

  .rail {
    width: 100%;
    height: 2px;
  }

  .copies {
    width: auto;
  }

  .copy {
    text-align: center;
  }

  .rail ol {
    display: none;
  }

  .rail-line {
    top: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: 2px;
  }

  .rail-fill {
    width: calc(var(--fill, 0) * 100%);
    height: 100%;
  }

  .copy .kicker {
    display: block;
  }

  .copy h2 {
    font-size: 28px;
  }

  .copy p:not(.kicker) {
    margin: 8px auto 0;
    font-size: 15px;
  }

  .scrolly-phone img {
    height: min(calc(100svh - 340px), 520px);
  }

  .facts {
    gap: 24px 32px;
  }

  .site-footer {
    padding: 48px 20px 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .footer-half--mark {
    align-items: stretch;
    gap: 16px;
  }

  .footer-mark {
    max-width: none;
  }

  .widgets {
    margin-top: 40px;
  }

  .cells {
    margin-top: 40px;
  }

  .final {
    padding: 112px 20px 96px;
  }

  .section--head {
    padding-bottom: 0;
  }
}

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

  .reveal {
    opacity: 1;
  }
}
