:root {
  --paper: #faf8f3;
  --paper-2: #f2eee4;
  --surface: #ffffff;
  --ink: #1d2230;
  --ink-2: #4a5163;
  --muted: #6b7184;
  --line: #e4dfd3;
  --accent: #2f5bd3;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfb;
  --highlight: #fff1a8;
  --deep: #1d2a4d;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(29, 34, 48, .06), 0 8px 24px rgba(29, 34, 48, .08);
  --shadow-lg: 0 2px 4px rgba(29, 34, 48, .05), 0 24px 60px rgba(29, 34, 48, .14);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 128px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow { max-width: 780px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 16px/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #2549b0; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: var(--paper); color: var(--deep); }
.btn-light:hover { background: #fff; }
.btn-light:focus-visible { outline-color: var(--paper); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 21px/1 var(--font-serif);
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand-mark {
  width: 14px; height: 26px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, .18);
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 26px; }
.site-nav ul a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 2px;
  transition: color .2s ease;
}
.site-nav ul a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 10px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle:hover { background: var(--paper-2); }
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  position: absolute;
  left: 11px;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 7vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(42px, 5.6vw, 72px);
  letter-spacing: -.025em;
  line-height: 1.04;
  max-width: 12ch;
}
.lead {
  margin-top: 24px;
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--ink-2);
  max-width: 34ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.small-print { margin-top: 16px; font-size: 15px; color: var(--muted); }

/* App window (hero visual) */
.hero-visual { position: relative; padding-bottom: 36px; }
.app-window {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}
.app-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: #d9d3c5; }
.app-bar-title { margin-left: 12px; font-size: 13px; color: var(--muted); font-weight: 500; }
.app-body { display: grid; grid-template-columns: 170px 1fr; min-height: 340px; }
.app-side {
  background: #fbfaf6;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  font-size: 14px;
}
.side-label { font-size: 12px; color: var(--muted); padding: 0 10px 8px; font-weight: 500; }
.app-side li { padding: 7px 10px; border-radius: 8px; color: var(--ink-2); }
.app-side li.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.app-page { padding: 26px 28px 84px; font-size: 15px; line-height: 1.6; }
.app-page p + p { margin-top: 4px; }
.note-meta { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.note-h { font-weight: 700; font-size: 17px; margin-top: 14px !important; }
.note-meta + .note-h { margin-top: 0 !important; }
.caret {
  display: inline-block;
  width: 2px; height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.link-chip {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--deep);
  font-size: 13px;
}
.float-card {
  position: absolute;
  right: -12px;
  bottom: 0;
  width: 230px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  transform: rotate(2deg);
}
.float-card-label { font-size: 12px; font-weight: 600; color: var(--accent); }
.float-card-q { margin-top: 4px; font-family: var(--font-serif); font-size: 19px; font-weight: 500; line-height: 1.25; }

/* Sections */
.section { padding: var(--section) 0; }
.section-tint { background: var(--paper-2); }
.section-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 46px);
  letter-spacing: -.02em;
  max-width: 22ch;
  margin-bottom: clamp(36px, 5vw, 56px);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px 32px;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 20px;
}
.step h3, .feature h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.step p, .feature p { margin-top: 10px; color: var(--ink-2); }

/* Demo */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: center;
}
.note-sheet {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sheet-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.sheet-tab { font-weight: 600; }
.sheet-saved { color: var(--muted); }
.sheet-body { padding: 26px 28px 30px; font-size: 16px; }
.sheet-body p + p { margin-top: 6px; }
.sheet-body mark {
  background: linear-gradient(transparent 55%, var(--highlight) 55%);
  color: inherit;
  padding: 0 2px;
}
.demo-arrow { color: var(--muted); }

.cards-hint { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.card-list { display: grid; gap: 14px; }
.flashcard {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  perspective: 1000px;
  border-radius: var(--radius);
}
.flashcard-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.flashcard[aria-pressed="true"] .flashcard-inner { transform: rotateY(180deg); }
.face {
  grid-area: 1 / 1;
  display: block;
  min-height: 92px;
  padding: 16px 20px;
  border-radius: var(--radius);
  backface-visibility: hidden;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
}
.face.front {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family: var(--font-serif);
  font-size: 20px;
}
.face.back {
  background: var(--deep);
  color: #f3f1ea;
  transform: rotateY(180deg);
}
.face-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.face.back .face-label { color: #a9bdf5; }
.flashcard:hover .face.front { border-color: #c9c2b2; }

.demo-caption {
  margin-top: 36px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(19px, 2vw, 23px);
  color: var(--ink);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 30px 34px;
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

/* Pricing */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 380px));
  gap: 24px;
}
.plan {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.plan-featured { border: 2px solid var(--accent); }
.plan-name { font-size: 20px; font-weight: 600; }
.plan-price { margin-top: 10px; }
.amount { font-family: var(--font-serif); font-size: 52px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.per { color: var(--muted); font-size: 17px; }
.plan-list { margin: 22px 0 30px; display: grid; gap: 10px; flex: 1; }
.plan-list li { position: relative; padding-left: 28px; color: var(--ink-2); }
.plan-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: .45em;
  width: 12px; height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plans-note { margin-top: 28px; color: var(--ink-2); max-width: 60ch; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 4px;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { padding: 0 4px 24px; color: var(--ink-2); max-width: 62ch; }

/* CTA */
.cta { background: var(--deep); color: #f6f4ee; padding: clamp(72px, 9vw, 112px) 0; }
.cta-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 32px; }
.cta h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 4.4vw, 56px);
  letter-spacing: -.02em;
  max-width: 18ch;
}

/* Footer */
.site-footer { padding: 40px 0 48px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-line { width: 100%; font-size: 14px; color: var(--muted); }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
  .steps { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-arrow { justify-self: center; transform: rotate(90deg); }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 12px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(29, 34, 48, .10);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 12px 0; font-size: 17px; }
  .site-nav .btn { width: 100%; min-height: 48px; }
  .features { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .app-body { grid-template-columns: 1fr; min-height: 0; }
  .app-side { display: none; }
  .float-card { right: 8px; width: 200px; }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .flashcard-inner { transform: none !important; }
  .flashcard .face.back { transform: none; display: none; }
  .flashcard[aria-pressed="true"] .face.back { display: block; }
  .flashcard[aria-pressed="true"] .face.front { display: none; }
}
