/* Courtly landing page. Tokens follow DESIGN.md. */
:root {
  --paper: #ffffff;
  --charcoal: #1f2025;
  --ink: #222326;
  --cloud: #ebf0f8;
  --gray: #747679;
  --gold: #ffca00;
  --coral: #ffab94;
  --green: #31ce01;
  --blue: #415eee;
  --lilac: #b9a6ff;
  --sky: linear-gradient(#d2e5ff, #fff9ee);
  --font: -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif;
  --shadow-md: rgba(0, 0, 0, 0.25) 0 0 16px -8px;
  --shadow-md-2: rgba(0, 0, 0, 0.15) 0 2px 16px 0;
  --gap: 80px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

/* ---------- Type ---------- */
.hero-title {
  font-size: clamp(44px, 7.4vw, 80px);
  font-weight: 600; line-height: 1; letter-spacing: -0.03em;
  /* line-height: 1 leaves no room for descenders; iOS Safari clips them while .rise is filtered. */
  padding-bottom: 0.14em;
}
.display {
  font-size: clamp(34px, 5.6vw, 64px);
  font-weight: 600; line-height: 1; letter-spacing: -0.03em;
  text-align: center;
}
.display.left { text-align: left; }
.lede {
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.3; color: var(--gray); font-weight: 400;
  max-width: 34em;
}
.lede.center { margin: 16px auto 0; text-align: center; }
.label { font-size: 24px; font-weight: 600; line-height: 0.9; letter-spacing: -0.24px; text-align: center; }
.caption { font-size: 12px; line-height: 1.1; color: var(--gray); }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 128px;
  background: var(--charcoal); color: var(--cloud);
  font-size: 16px; line-height: 1.4; font-weight: 500; white-space: nowrap;
  box-shadow: rgba(255, 255, 255, 0.36) 0 1px 0 0 inset;
  transition: transform 0.25s var(--ease), background 0.25s;
}
.pill svg { width: 18px; height: 18px; }
.pill:hover { transform: translateY(-2px); background: #2c2e35; }
.pill:active { transform: scale(0.97); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 16px; left: 50%; z-index: 50;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  padding: 8px 8px 8px 16px; border-radius: 32px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: box-shadow 0.3s, background 0.3s;
}
.nav.scrolled { background: rgba(255, 255, 255, 0.86); box-shadow: var(--shadow-md-2); }
.nav-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 500; letter-spacing: 0.162px; }
.nav-brand img, .footer-brand img { border-radius: 50%; }
.nav-links { display: flex; gap: 16px; margin: 0 8px; }
.nav-links a { font-size: 16px; font-weight: 500; color: var(--gray); white-space: nowrap; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 8px; padding: 120px 16px 0;
  border-radius: 32px; background: var(--sky);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px;
}
.hero .lede { max-width: 26em; }
.hero .cta-row { margin-top: 8px; }

.aurora { position: absolute; inset: 0; pointer-events: none; }
.aurora i {
  position: absolute; left: -20%; right: -20%; height: 220px; top: 58%;
  border-radius: 50%; filter: blur(48px); opacity: 0.55;
  background: linear-gradient(90deg, transparent, var(--lilac), #9db4ff, #9be8c8, #ffe9a6, var(--coral), transparent);
  animation: drift 14s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) { top: 66%; height: 140px; opacity: 0.4; animation-duration: 19s; animation-direction: alternate-reverse; transform: rotate(-4deg); }
.aurora i:nth-child(3) { top: 50%; height: 120px; opacity: 0.3; animation-duration: 23s; transform: rotate(5deg); }
@keyframes drift {
  from { translate: -6% 0; scale: 1 1; }
  to { translate: 6% -18px; scale: 1.08 1.25; }
}

.hero-stage {
  position: relative; width: 100%; max-width: 900px;
  margin-top: 32px; padding-bottom: 64px;
  display: flex; justify-content: center;
  perspective: 1400px;
}
.hero-phone { --pw: clamp(220px, 24vw, 300px); transform-style: preserve-3d; will-change: transform; }

/* ---------- Phone frame ---------- */
.phone {
  /* --pw must be a length (px, vw, svh), never a percentage: every other
     dimension of the frame is derived from it. */
  --pw: 280px;
  --bezel: calc(var(--pw) * 0.032);
  position: relative; flex: none;
  width: var(--pw); height: calc(var(--pw) * 2.103);
  border-radius: calc(var(--pw) * 0.17);
  background: linear-gradient(145deg, #3a3c44, #121317 40%, #2b2d33);
  box-shadow:
    0 0 0 1.5px #5d6068,
    0 0 0 3px #17181c,
    rgba(255, 255, 255, 0.36) 0 1px 0 0 inset,
    0 40px 60px -30px rgba(31, 32, 37, 0.45);
}
.phone::before {
  content: ""; position: absolute; z-index: 3;
  top: calc(var(--pw) * 0.058); left: 50%; translate: -50% 0;
  width: 29%; height: calc(var(--pw) * 0.078);
  border-radius: 99px; background: #0b0b0d;
}
.phone::after {
  content: ""; position: absolute; z-index: 4; inset: var(--bezel);
  border-radius: calc(var(--pw) * 0.14); pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 28%);
}
.screen {
  position: absolute; inset: var(--bezel); overflow: hidden;
  border-radius: calc(var(--pw) * 0.14); background: #e6f3f4;
  /* Own layer, so the rounded corners also clip video on iOS Safari. */
  transform: translateZ(0);
}
.screen > * {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  opacity: 0; transform: scale(1.04); filter: blur(6px);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease), filter 0.6s;
}
.screen > .on { opacity: 1; transform: none; filter: none; }
.screen > :only-child { opacity: 1; transform: none; filter: none; }

/* ---------- Floating chips ---------- */
.chip {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md), rgb(255, 255, 255) 0 1px 0 0 inset;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  animation: bob 6s ease-in-out infinite;
}
.chip svg { width: 18px; height: 18px; color: #c79a00; }
.chip-a { left: 6%; top: 18%; rotate: -6deg; }
.chip-b { right: 3%; top: 8%; rotate: 5deg; animation-delay: -2s; }
.chip-c { right: 8%; top: 52%; rotate: -4deg; animation-delay: -3.500s; }
.chip-d { left: 2%; top: 62%; rotate: 4deg; animation-delay: -1s; }
@keyframes bob { 50% { translate: 0 -12px; } }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.g { background: var(--green); } .dot.b { background: var(--blue); }
.tag { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 600; margin-right: -4px; }
.tag.s5 { background: #e9e1fb; color: #6b4fc4; } .tag.s3 { background: #fbf0dc; color: #9a6a16; } .tag.s1 { background: #dff3e8; color: #1e8a5a; margin-right: 0; }

/* ---------- Sections ---------- */
.wrap { max-width: 1232px; margin: 0 auto; padding: var(--gap) 16px 0; }
.works { padding: var(--gap) 16px 0; }
.wordmarks { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 32px; margin-top: 24px; }
.wordmarks li { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--charcoal); }
.wordmarks li:nth-child(n+4) { font-weight: 500; font-style: italic; }

.statement { padding-top: 160px; }
.strip {
  display: flex; justify-content: center; gap: 24px;
  max-width: 1232px; margin: 48px auto 0; padding: 16px;
}
.strip img, .strip video {
  flex: 0 1 200px; min-width: 0; width: 200px; aspect-ratio: 9 / 16;
  object-fit: cover; object-position: top;
  border-radius: 16px; box-shadow: var(--shadow-md);
}
.strip img.in:hover, .strip video.in:hover { transform: translateY(-8px); transition-delay: 0s; transition-duration: 0.4s; }

/* ---------- Cloud feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 48px; }
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 32px 32px 0; border-radius: 24px; background: var(--cloud);
  height: 620px;
}
.card::before, .wide::before {
  content: ""; position: absolute; inset: 40% 0 0; pointer-events: none;
  background: linear-gradient(transparent, var(--wash));
}
.wash-coral { --wash: rgba(255, 171, 148, 0.55); }
.wash-lilac { --wash: rgba(185, 166, 255, 0.6); }
.wash-green { --wash: rgba(49, 206, 1, 0.32); }
.wash-sky { --wash: rgba(157, 180, 255, 0.5); }
.wash-peach { --wash: rgba(255, 171, 148, 0.4); }
.card h3, .wide h3 { font-size: clamp(30px, 3.2vw, 40px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.card p, .wide p { font-size: clamp(17px, 1.600vw, 20px); line-height: 1.3; color: var(--gray); position: relative; }
.card .phone { --pw: min(270px, 64vw); margin: 32px auto 0; transition: transform 0.7s var(--ease); }
.card:hover .phone { transform: translateY(-20px); }

/* ---------- Tour ---------- */
.tour-wrap { padding-top: 160px; }
.tour { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; align-items: start; }
.tour-stage {
  grid-column: 2; grid-row: 1;
  position: sticky; top: max(88px, calc(50vh - 340px));
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 24px 0; border-radius: 32px;
  background: var(--sky);
}
.tour-phone { --pw: min(290px, 34vh); }
.tour-meter { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--gray); font-variant-numeric: tabular-nums; }
.tour-bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(31, 32, 37, 0.12); overflow: hidden; }
.tour-bar i { display: block; height: 100%; width: 8%; border-radius: 4px; background: var(--charcoal); transition: width 0.5s var(--ease); }
.tour-steps { grid-column: 1; grid-row: 1; padding: 12vh 0 20vh; }
.tour-steps li {
  min-height: 44vh; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding-left: 32px; border-left: 2px solid var(--cloud);
  opacity: 0.28; transition: opacity 0.5s, border-color 0.5s, transform 0.6s var(--ease);
  transform: translateX(-8px); cursor: pointer;
}
.tour-steps li.on { opacity: 1; border-color: var(--charcoal); transform: none; }
.phase { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray); }
.tour-steps h3 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.tour-steps p { font-size: clamp(17px, 1.800vw, 24px); line-height: 1.3; color: var(--gray); max-width: 22em; }

/* ---------- Dark band ---------- */
.dark { margin-top: 160px; padding: 96px 16px; background: var(--charcoal); color: var(--paper); }
.dark .lede { color: #a9acb3; }
.dark .display em { font-style: normal; color: #8b8e96; }
.formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 48px; max-width: 720px; }
.formats span {
  padding: 8px 16px; border-radius: 9999px; font-size: 16px; font-weight: 500;
  color: #8b8e96; background: rgba(255, 255, 255, 0.06);
  transition: color 0.5s, background 0.5s, box-shadow 0.5s, transform 0.5s var(--ease);
}
.formats span.on {
  color: var(--paper); background: rgba(255, 255, 255, 0.16); transform: scale(1.08);
  box-shadow: 0 0 40px rgba(185, 166, 255, 0.45), rgba(255, 255, 255, 0.36) 0 1px 0 0 inset;
}
.wide-cards { max-width: 1200px; margin: 80px auto 0; display: grid; gap: 24px; }
.wide {
  position: relative; overflow: hidden; color: var(--ink);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 32px;
  height: 460px; padding: 0 64px; border-radius: 32px; background: var(--cloud);
}
.wide::before { inset: 0 0 0 40%; background: linear-gradient(90deg, transparent, var(--wash)); }
.wide > div:first-child { display: grid; gap: 12px; position: relative; }
.wide p { max-width: 20em; }
.wide .phone { --pw: 290px; align-self: start; margin: 48px 48px 0 0; transition: transform 0.7s var(--ease); }
.wide:nth-child(2) .phone { align-self: end; margin: 0 48px 48px 0; }
.wide:hover .phone { transform: translateY(-16px); }
.wide:nth-child(2):hover .phone { transform: translateY(16px); }

/* ---------- More ---------- */
.more { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; padding-top: 160px; align-items: start; }
.more-head { display: grid; gap: 16px; position: sticky; top: 120px; }
.more-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.more-list li {
  padding: 24px; border-radius: 24px; background: var(--cloud);
  transition: transform 0.4s var(--ease), background 0.3s;
}
.more-list li:hover { transform: translateY(-4px); background: #e2e9f5; }
.more-list h4 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.more-list p { margin-top: 8px; font-size: 16px; color: var(--gray); }

/* ---------- Privacy ---------- */
.privacy {
  position: relative; overflow: hidden;
  padding: 120px 24px; border-radius: 32px; color: var(--paper);
  background:
    radial-gradient(60% 90% at 0% 100%, rgba(49, 206, 1, 0.28), transparent 70%),
    radial-gradient(60% 90% at 100% 100%, rgba(49, 206, 1, 0.22), transparent 70%),
    linear-gradient(90deg, #1d3a34, var(--charcoal) 30%, var(--charcoal) 70%, #1d3a34);
}
.privacy .display, .privacy .lede { position: relative; }
.privacy .lede { color: #b4b7bd; }
.privacy-lock {
  position: absolute; left: 50%; top: 50%; width: 420px; height: 420px;
  translate: -50% -46%; color: rgba(255, 255, 255, 0.05);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { scale: 1.06; color: rgba(255, 255, 255, 0.08); } }

/* ---------- Final + footer ---------- */
.final { padding: 160px 16px 0; text-align: center; }
.final .cta-row { margin-top: 24px; }
.footer {
  max-width: 1232px; margin: 0 auto; padding: 160px 16px 96px;
  display: grid; grid-template-columns: 1fr auto auto; gap: 80px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 500; align-self: start; }
.footer-group { display: grid; gap: 16px; align-content: start; }
.footer-group h5 { font-size: 16px; font-weight: 500; color: var(--gray); }
.footer-group a { font-size: 18px; font-weight: 500; }
.footer-group a:hover { text-decoration: underline; }

/* ---------- QR card ---------- */
.qr {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: none; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: 16px;
  background: var(--charcoal); color: var(--cloud); box-shadow: var(--shadow-md-2);
  font-size: 12px; line-height: 1.3;
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.qr img { border-radius: 8px; background: #fff; }
.qr b { display: block; font-size: 14px; font-weight: 500; }
.qr.hide { opacity: 0; transform: translateY(16px); pointer-events: none; }
@media (min-width: 1100px) and (hover: hover) { .qr { display: flex; } }

/* ---------- Motion ---------- */
.rise { animation: rise 1s var(--ease) both; }
.d1 { animation-delay: 0.1s; transition-delay: 0.1s; }
.d2 { animation-delay: 0.2s; transition-delay: 0.2s; }
.d3 { animation-delay: 0.35s; }
@keyframes rise { from { opacity: 0; transform: translateY(32px); filter: blur(8px); } }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --gap: 64px; }
  .cards { grid-template-columns: 1fr; }
  /* Six tiles do not fit a phone: swipe through them instead. */
  .strip {
    justify-content: flex-start; gap: 16px; overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none; padding: 16px 24px;
  }
  .strip::-webkit-scrollbar { display: none; }
  .strip img, .strip video { flex: none; width: 180px; scroll-snap-align: center; }
  .card { height: 560px; }
  .statement, .tour-wrap, .more, .final { padding-top: 96px; }
  .dark { margin-top: 96px; padding: 64px 16px; }
  .chip { font-size: 13px; padding: 8px 12px; }
  .chip-a { left: 0; } .chip-b { right: 0; top: 2%; } .chip-c { right: 0; } .chip-d { left: 0; top: 70%; }

  .tour { display: block; }
  .tour-stage {
    top: 0; z-index: 5; gap: 10px;
    margin: 0 -16px; padding: 68px 16px 10px; border-radius: 0 0 24px 24px;
  }
  .tour-phone { --pw: min(220px, 25vh); --pw: min(220px, 25svh); }
  .tour-bar { width: 120px; }
  .tour-steps { padding: 24px 0 48px; }
  /* Each step is about as tall as the space under the pinned phone, so the
     active step's text is always in view. */
  .tour-steps li { min-height: 30vh; min-height: 30svh; justify-content: flex-start; padding: 20px 0 20px 20px; gap: 8px; }

  .wide { grid-template-columns: 1fr; height: auto; padding: 32px 32px 0; gap: 24px; }
  .wide::before { inset: 40% 0 0; background: linear-gradient(transparent, var(--wash)); }
  .wide .phone, .wide:nth-child(2) .phone { --pw: min(240px, 64vw); margin: 0 auto -180px; align-self: auto; }
  .wide:hover .phone, .wide:nth-child(2):hover .phone, .card:hover .phone { transform: none; }
  .more { grid-template-columns: 1fr; }
  .more-head { position: static; }
  .footer { grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 96px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .nav { gap: 8px; padding-left: 12px; max-width: calc(100vw - 16px); }
  .nav-links a:nth-child(2) { display: none; }
  .hero { padding-top: 104px; }
  .more-list { grid-template-columns: 1fr; }
  .chip { display: none; }
  .hero-stage { padding-bottom: 40px; }
  .hero-phone { --pw: min(260px, 70vw); }
  .wordmarks { gap: 12px 24px; }
  .wordmarks li { font-size: 19px; }
  .card, .wide { padding-left: 24px; padding-right: 24px; }
  .privacy { padding: 80px 20px; }
  .privacy-lock { width: 300px; height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.4s; }
.reveal.d5 { transition-delay: 0.5s; }
.reveal.d6 { transition-delay: 0.6s; }
@media (max-width: 380px) {
  .nav-links { display: none; }
  .nav { gap: 16px; }
}
