/* Franki website. Strictly monochrome, like the app: every tone is ink at a lower
   opacity on paper, so the palette inverts cleanly between light and dark.
   Tokens mirror Franki/DesignSystem/Theme.swift. */

:root {
  color-scheme: light dark;
  --ink: #000;
  --paper: #fff;
  --ink2: rgba(0, 0, 0, .72);
  --ink3: rgba(0, 0, 0, .56);
  --hair: rgba(0, 0, 0, .12);
  --surface: #f3f3f3;
  --surface2: #e6e6e6;
  --sans: 'Geist', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --spring: cubic-bezier(.2, .8, .2, 1);
  --content: 1240px;
}

/* The stats band is always the opposite of the page. */
.inv {
  --ink: #fff;
  --paper: #000;
  --ink2: rgba(255, 255, 255, .7);
  --ink3: rgba(255, 255, 255, .52);
  --hair: rgba(255, 255, 255, .16);
  --surface: #131313;
  --surface2: #222;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #fff;
    --paper: #000;
    --ink2: rgba(255, 255, 255, .7);
    --ink3: rgba(255, 255, 255, .52);
    --hair: rgba(255, 255, 255, .16);
    --surface: #131313;
    --surface2: #222;
  }
  .inv {
    --ink: #000;
    --paper: #fff;
    --ink2: rgba(0, 0, 0, .72);
    --ink3: rgba(0, 0, 0, .56);
    --hair: rgba(0, 0, 0, .12);
    --surface: #f3f3f3;
    --surface2: #e6e6e6;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  /* clip, not hidden: hidden would make body a scroll container and stop the
     scroll-driven reveals from ever running. */
  overflow-x: clip;
}

img { max-width: 100%; }

a { color: var(--ink); text-decoration: none; }
a:not(.btn):hover { color: var(--ink2); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn:focus-visible { border-radius: 999px; }
.cta :focus-visible { outline-color: var(--paper); }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.skip:focus { top: 16px; }
.skip:hover { color: var(--paper); }

.wrap { max-width: var(--content); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

h1, h2, h3, p { margin: 0; }

/* Small uppercase monospaced labels, as in the app. */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink2);
}
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink3);
}

.display {
  font-size: clamp(44px, 6vw, 80px);
  line-height: .98;
  font-weight: 800;
  letter-spacing: -.04em;
}

.lede { font-size: 19px; line-height: 1.5; color: var(--ink2); }
.body { font-size: 17px; line-height: 1.5; color: var(--ink2); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-quiet { border: 1px solid var(--hair); background: var(--surface); color: var(--ink); }
.btn-small { gap: 10px; min-height: 44px; padding: 0 22px; font-size: 15px; }
.btn-large { min-height: 60px; padding: 0 28px; font-size: 18px; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 24px;
  padding-bottom: 24px;
}
.mark { display: flex; align-items: center; gap: 12px; }
.mark svg { display: block; flex: none; }
.wordmark { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.navlinks { display: flex; gap: 32px; font-size: 15px; font-weight: 500; }
@media (max-width: 760px) { .navlinks { display: none; } }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px;
  padding-top: 56px;
  padding-bottom: 96px;
}
.hero .eyebrow { font-weight: 500; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 {
  font-size: clamp(64px, 9vw, 132px);
  line-height: .92;
  font-weight: 800;
  letter-spacing: -.045em;
}
.hero-lede { max-width: 520px; font-size: 21px; line-height: 1.45; color: var(--ink2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.fineprint { font-family: var(--mono); font-size: 13px; color: var(--ink3); }

/* The two phones. --s scales the whole stage on narrow screens. */
.stage {
  --s: 1;
  flex: 1 1 420px;
  min-width: 0;
  position: relative;
  height: calc(640px * var(--s));
}
.stage .phone-in { position: absolute; }
.stage .back { top: calc(40px * var(--s)); left: calc(50% - 250px * var(--s)); }
.stage .front { top: 0; left: calc(50% - 90px * var(--s)); }
.phone {
  display: block;
  height: auto;
  border: 9px solid #000;
  background: #000;
}
.stage .back .phone {
  width: calc(270px * var(--s));
  border-radius: calc(42px * var(--s));
  border-width: calc(9px * var(--s));
  transform: rotate(-8deg);
  opacity: .9;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .18);
}
.stage .front .phone {
  width: calc(296px * var(--s));
  border-radius: calc(46px * var(--s));
  border-width: calc(10px * var(--s));
  transform: rotate(5deg);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .22);
}
@media (max-width: 600px) { .stage { --s: .74; } }
/* Black phone frames vanish on a black page; a hairline keeps their edge. */
@media (prefers-color-scheme: dark) {
  .stage .back .phone { box-shadow: 0 0 0 1px var(--hair), 0 30px 60px rgba(0, 0, 0, .18); }
  .stage .front .phone { box-shadow: 0 0 0 1px var(--hair), 0 40px 80px rgba(0, 0, 0, .22); }
}
@media (max-width: 380px) { .stage { --s: .62; } }

/* ---------- At a glance ---------- */

.glance { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.glance-item { padding: 36px 24px; display: flex; flex-direction: column; gap: 8px; }
.glance-item:first-child { padding-left: 0; }
.glance-item:last-child { padding-right: 0; }
.glance-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.glance-note { font-size: 15px; color: var(--ink2); }
@media (max-width: 520px) { .glance-item { padding-left: 0; padding-right: 0; } }

/* ---------- Sections ---------- */

.section-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }

.tile {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 32px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.tile h3 { font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
@media (max-width: 420px) { .tile { padding: 28px; border-radius: 28px; } }

/* How it works */
.how { padding-top: 128px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 56px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.step { padding: 36px; gap: 16px; min-height: 260px; }
.step h3 { font-size: 30px; line-height: normal; }
.step-number { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink3); }
@media (max-width: 420px) { .step { padding: 28px; } }

.grades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  justify-items: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
}
.grades > span { display: inline-block; white-space: nowrap; }
.deck { display: block; padding: 6px 0; perspective: 600px; }
.card {
  position: relative;
  display: block;
  width: 72px;
  height: 92px;
  transform-style: preserve-3d;
}
.face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
}
.face.answer {
  transform: rotateY(180deg);
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

/* Features */
.features { padding-top: 64px; padding-bottom: 128px; display: flex; flex-direction: column; gap: 56px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; }
/* Franki Cloud's three tiles sit in one row, or stack, never 2 + 1. */
.cloud-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .cloud-grid { grid-template-columns: minmax(0, 1fr); } }
.feature-wide { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 32px; align-items: center; }
.feature-wide-copy { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.notes-demo { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.note {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 20px;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink2);
}
.arrow { font-family: var(--mono); font-size: 15px; color: var(--ink3); text-align: center; }
.made-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.made-card-q { font-size: 17px; font-weight: 700; }
.made-card-a { font-size: 15px; opacity: .72; }

.feature-widget { padding-bottom: 0; overflow: hidden; }
.widget-shot {
  display: block;
  width: 100%;
  max-width: 300px;
  height: 300px;
  align-self: center;
  margin-top: 12px;
  border-radius: 36px 36px 0 0;
  border: 8px solid #000;
  border-bottom: 0;
  object-fit: cover;
  object-position: top;
  background: #000;
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--hair); font-size: 15px; font-weight: 500; }

/* Stats band */
.stats-band { background: var(--paper); color: var(--ink); }
.stats {
  padding-top: 128px;
  padding-bottom: 128px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px;
}
.stats-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.heatmap {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 5px;
  max-width: 460px;
  padding-top: 8px;
}
.cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--ink);
  /* The resting state shows each day's level, so the map still reads with motion off. */
  opacity: var(--lv);
}
.figures { display: flex; flex-wrap: wrap; gap: 24px 40px; padding-top: 12px; }
.figure { font-size: 72px; line-height: 1; font-weight: 800; letter-spacing: -.05em; }
.figure + .label { padding-top: 8px; }
.stats-shot { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
.stats-shot .phone {
  width: 280px;
  border-radius: 44px;
  box-shadow: 0 0 0 1px var(--hair);
}

/* Starter decks */
.decks { padding-top: 128px; padding-bottom: 128px; display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.decks-copy { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.big-number { font-size: clamp(120px, 16vw, 220px); line-height: .85; font-weight: 800; letter-spacing: -.06em; }
.decks-lede { max-width: 420px; font-size: 21px; line-height: 1.45; color: var(--ink2); }
.deck-kinds { flex: 1 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.deck-kind { border: 1px solid var(--hair); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.deck-kind h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.deck-kind p { font-size: 15px; color: var(--ink2); }

.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 22px 0;
}
/* Two identical lists; each carries its own trailing gap so -50% lands exactly on the seam. */
.marquee { display: flex; width: max-content; }
.marquee ul { display: flex; gap: 12px; margin: 0; padding: 0 12px 0 0; list-style: none; }
.marquee li {
  flex: none;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hair);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

/* Privacy */
.privacy-section { border-top: 1px solid var(--hair); }
.privacy {
  padding-top: 128px;
  padding-bottom: 128px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 48px;
}
.privacy-head { display: flex; flex-direction: column; gap: 16px; }
.privacy-head h2 { font-size: clamp(44px, 5vw, 64px); }
.privacy-points { display: flex; flex-direction: column; gap: 10px; }
.privacy-points h3 { font-size: 22px; font-weight: 700; }
.privacy-points h3 + p + h3 { margin-top: 16px; }

/* Download */
.download { padding: 0 24px 96px; }
.cta {
  max-width: var(--content);
  margin: 0 auto;
  background: var(--ink);
  color: var(--paper);
  border-radius: 40px;
  padding: clamp(48px, 8vw, 112px) clamp(28px, 6vw, 88px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.cta-copy { display: flex; flex-direction: column; gap: 20px; flex: 1 1 480px; min-width: 0; }
.cta h2 { font-size: clamp(56px, 8vw, 120px); line-height: .9; font-weight: 800; letter-spacing: -.045em; }
.cta p { max-width: 520px; font-size: 19px; line-height: 1.5; opacity: .72; }
.btn-cta { min-height: 64px; padding: 0 32px; font-size: 19px; background: var(--paper); color: var(--ink); }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding-top: 32px;
  padding-bottom: 56px;
  border-top: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink3);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .wordmark { font-size: 18px; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }

/* Narrow screens: the display type would otherwise overflow 320 px. */
@media (max-width: 720px) {
  .hero h1 { font-size: clamp(40px, 13vw, 64px); }
  .cta h2 { font-size: clamp(32px, 10.5vw, 56px); }
  .how, .stats, .decks, .privacy { padding-top: 96px; padding-bottom: 96px; }
  .hero { padding-bottom: 64px; }
  .cta { border-radius: 32px; }
}
@media (max-width: 420px) {
  .display { font-size: clamp(36px, 11vw, 44px); }
  .privacy-head h2 { font-size: clamp(36px, 11vw, 44px); }
  .figure { font-size: 60px; }
  /* Full-width pills; on the very narrowest screens the label may wrap inside the pill. */
  .hero-actions .btn, .btn-cta { flex: 1 1 100%; width: 100%; justify-content: center; gap: 10px; padding: 12px 20px; font-size: 16px; white-space: normal; text-align: center; }
  .cta { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 360px) {
  .hero-actions .btn { font-size: 15px; }
}

/* ---------- Simple pages (privacy, support) ---------- */

.page { padding-top: 56px; padding-bottom: 128px; }
.page-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; padding-bottom: 56px; }
.prose { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.prose h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; padding-top: 32px; }
.prose h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; padding-top: 12px; }
.prose p, .prose li { font-size: 17px; line-height: 1.55; color: var(--ink2); }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair); }
.contact-tile { margin-top: 8px; }
.prose .contact-title { padding-top: 0; }
.faq details { border-top: 1px solid var(--hair); padding: 20px 0; }
.faq details:last-child { border-bottom: 1px solid var(--hair); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); font-weight: 500; color: var(--ink3); }
.faq details[open] summary::after { content: '−'; }
.faq details > p, .faq details > ul { margin-top: 12px; }

/* ---------- Motion: calm and springy, like the app. All of it stops under Reduce Motion. ---------- */

@keyframes fk-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fk-float { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@keyframes fk-phone-in { from { opacity: 0; transform: translateY(80px); } to { opacity: 1; transform: none; } }

.rise { animation: fk-rise .9s var(--spring) both; }
.word { display: inline-block; animation: fk-rise .9s var(--spring) both; }
.phone-in { animation: fk-phone-in 1.1s var(--spring) both; }
.float { animation: fk-float 5s ease-in-out infinite alternate; }
.float.slow { animation-duration: 6.5s; animation-delay: -2s; }
.press { transition: transform .18s var(--spring), opacity .18s; }
.press:hover { transform: translateY(-2px); }
.press:active { transform: scale(.96); }
.mark .top { transition: transform .4s var(--spring); transform-origin: 47px 40px; }
.mark:hover .top { transform: rotate(8deg) translate(4px, -3px); }

/* The study card: flip, then a swipe for each grade, in turn. */
@keyframes fk-card {
  0% { transform: none; opacity: 1; }
  5%, 14% { transform: rotateY(180deg); opacity: 1; }
  20% { transform: translateX(90px) rotate(14deg) rotateY(180deg); opacity: 0; }
  21% { transform: none; opacity: 0; }
  25% { transform: none; opacity: 1; }
  30%, 39% { transform: rotateY(180deg); opacity: 1; }
  45% { transform: translateX(-90px) rotate(-14deg) rotateY(180deg); opacity: 0; }
  46% { transform: none; opacity: 0; }
  50% { transform: none; opacity: 1; }
  55%, 64% { transform: rotateY(180deg); opacity: 1; }
  70% { transform: translateY(-80px) rotateY(180deg); opacity: 0; }
  71% { transform: none; opacity: 0; }
  75% { transform: none; opacity: 1; }
  80%, 89% { transform: rotateY(180deg); opacity: 1; }
  95% { transform: translateY(80px) rotateY(180deg); opacity: 0; }
  96% { transform: none; opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes fk-good { 0%, 12%, 24%, 100% { opacity: .35; transform: none; } 15%, 21% { opacity: 1; transform: scale(1.12); } }
@keyframes fk-again { 0%, 37%, 49%, 100% { opacity: .35; transform: none; } 40%, 46% { opacity: 1; transform: scale(1.12); } }
@keyframes fk-easy { 0%, 62%, 74%, 100% { opacity: .35; transform: none; } 65%, 71% { opacity: 1; transform: scale(1.12); } }
@keyframes fk-hard { 0%, 87%, 99%, 100% { opacity: .35; transform: none; } 90%, 96% { opacity: 1; transform: scale(1.12); } }
.card { animation: fk-card 12s cubic-bezier(.4, 0, .2, 1) infinite; }
.g-good { animation: fk-good 12s infinite; }
.g-again { animation: fk-again 12s infinite; }
.g-easy { animation: fk-easy 12s infinite; }
.g-hard { animation: fk-hard 12s infinite; }

/* Notes becoming a card. */
@keyframes fk-nudge { 0%, 100% { transform: translateY(-3px); opacity: .45; } 50% { transform: translateY(4px); opacity: 1; } }
@keyframes fk-pop { 0%, 8% { opacity: 0; transform: translateY(10px) scale(.97); } 18%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.nudge { animation: fk-nudge 1.8s ease-in-out infinite; }
.pop { animation: fk-pop 6s var(--spring) infinite; }

/* The activity heatmap fills in a slow wave. */
@keyframes fk-fill { 0% { opacity: .07; } 12%, 82% { opacity: var(--lv); } 100% { opacity: .07; } }
.cell { animation: fk-fill 9s ease-in-out infinite both; }

/* Deck names drift past. */
@keyframes fk-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { animation: fk-marquee 60s linear infinite; }
.marquee-wrap:hover .marquee { animation-play-state: paused; }

/* Sections rise in as they scroll into view, where the browser can tie motion to scrolling. */
@supports (animation-timeline: view()) {
  .reveal { animation: fk-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
