@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&family=Caveat:wght@500;600;700&display=swap');

:root {
  --paper: #FEFDFB;
  --backdrop: #F5F2ED;
  --backdrop-deep: #EAE6DB;
  --ink: #163056;
  --ink-soft: #9C978A;
  --rule: rgba(22, 48, 86, 0.08);
  --rule-soft: rgba(22, 48, 86, 0.04);
  --accent: #C4536B;
  --accent-deep: #A63F56;

  --hl-1: #C4536B; /* rose */
  --hl-2: #B57E1F; /* amber */
  --hl-3: #4E8C5A; /* green */
  --hl-4: #3C7EA8; /* blue */
  --hl-5: #7A5FA8; /* purple */
  --hl-6: #2F8A82; /* teal */

  --paper-shadow: 0 1px 0 rgba(22,48,86,0.04), 0 8px 24px rgba(22,48,86,0.07);
  --hover-tint: rgba(22, 48, 86, 0.06);
  --max: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #293A5C;
    --backdrop: #1B2740;
    --backdrop-deep: #223251;
    --ink: #EAF0FC;
    --ink-soft: #9BB0DA;
    --rule: rgba(234, 240, 252, 0.12);
    --rule-soft: rgba(234, 240, 252, 0.06);
    --accent: #C4536B;
    --accent-deep: #E08FA1;

    --hl-1: #E08FA1;
    --hl-2: #D9AE72;
    --hl-3: #8FC49A;
    --hl-4: #82B7DB;
    --hl-5: #B79AE0;
    --hl-6: #6FC7BC;

    --paper-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.35);
    --hover-tint: rgba(234, 240, 252, 0.10);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--backdrop);
  background-image: radial-gradient(var(--rule-soft) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Manrope', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.15; font-weight: 700; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header ---------- */
header { padding: 26px 0 10px; }
header .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-weight: 800;
  font-size: 21px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .dot { color: var(--accent); }
.logo-mark {
  width: 24px; height: 24px;
  border-radius: 7px;
  flex: none;
  object-fit: cover;
  background: var(--paper);
}
nav { display: flex; align-items: center; gap: 26px; }
nav a { color: var(--ink-soft); font-weight: 600; font-size: 15px; }
nav a:hover { color: var(--accent); text-decoration: none; }
.nav-store {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
  color: var(--paper) !important;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 100px;
}
.nav-store:hover { text-decoration: none; opacity: 0.88; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--backdrop);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 3px;
}
.lang-switch a, .lang-switch span {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lang-switch a { color: var(--ink-soft); }
.lang-switch a:hover { color: var(--accent); text-decoration: none; }
.lang-switch span.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 48, 86, 0.08);
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hl-word { color: var(--accent); }
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  max-width: 16ch;
  letter-spacing: -0.01em;
}
.hero p.lede { margin-top: 18px; max-width: 46ch; font-size: 19px; color: var(--ink-soft); }
.hero-actions { margin-top: 30px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.try-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 7px 14px;
  border-radius: 100px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
}
.try-hint .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  flex: none;
  animation: try-pulse 1.6s ease-in-out infinite;
}
@keyframes try-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .try-hint .dot { animation: none; }
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-deep); }
.btn-primary:hover { text-decoration: none; transform: translateY(1px); box-shadow: 0 3px 0 var(--accent-deep); }

/* ---------- Notebook demo (hero visual) ---------- */
.demo {
  position: relative;
  margin-top: 56px;
  background: var(--paper);
  background-image: radial-gradient(var(--rule) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 22px;
  box-shadow: var(--paper-shadow);
  border: 1px solid var(--rule-soft);
  overflow: hidden;
}
.demo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px dashed var(--rule);
}
.demo-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.demo-lang {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--backdrop);
  border: 1px solid var(--rule);
  padding: 5px 12px;
  border-radius: 100px;
}
.demo-body { position: relative; padding: 22px 0; }
.demo-rule { position: absolute; top: 14px; bottom: 14px; right: 176px; border-left: 1.5px dashed rgba(196, 83, 107, 0.55); pointer-events: none; }
.demo-row { display: flex; align-items: flex-start; padding: 6px 32px; gap: 0; position: relative; }
.demo-row-text { flex: 1; min-width: 0; font-size: 20px; line-height: 2; padding-right: 16px; }
.demo-row-text .word { border-radius: 6px; padding: 1px 3px; cursor: pointer; }
.demo-row-text .word:hover:not(.tag) { background: var(--hover-tint); }
.demo-row-text .tag { border-radius: 7px; padding: 2px 3px; cursor: pointer; }
.demo-row-text .tag.pop { animation: popw 0.32s ease-out; }
.tag-rose { background: color-mix(in srgb, var(--hl-1) 18%, transparent); }
.tag-mustard { background: color-mix(in srgb, var(--hl-2) 20%, transparent); }
.tag-sage { background: color-mix(in srgb, var(--hl-3) 18%, transparent); }
.tag-blue { background: color-mix(in srgb, var(--hl-4) 18%, transparent); }
.tag-lavender { background: color-mix(in srgb, var(--hl-5) 18%, transparent); }
.tag-teal { background: color-mix(in srgb, var(--hl-6) 18%, transparent); }
@keyframes popw { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.demo-row-margin { width: 144px; flex-shrink: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; min-height: 30px; position: relative; }
.margin-note {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
  color: var(--ink);
  animation: noteIn 0.22s ease-out;
}
@keyframes noteIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .margin-note, .demo-row-text .tag.pop { animation: none; }
}
.margin-note .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-rose { background: var(--hl-1); }
.dot-mustard { background: var(--hl-2); }
.dot-sage { background: var(--hl-3); }
.dot-blue { background: var(--hl-4); }
.dot-lavender { background: var(--hl-5); }
.dot-teal { background: var(--hl-6); }

.looking-note { display: flex; align-items: center; gap: 6px; }
.looking-spinner {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--rule-strong, rgba(22,48,86,.18));
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.looking-note span.label { font-family: 'Caveat', cursive; font-size: 16px; color: var(--ink-soft); }

.burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst span { position: absolute; width: 5px; height: 5px; border-radius: 3px; animation: burst-fly 0.55s ease-out forwards; }
@keyframes burst-fly { to { opacity: 0; } }

@media (max-width: 640px) {
  .demo-rule { display: none; }
  .demo-row { flex-direction: column; padding: 10px 24px; gap: 6px; }
  .demo-row-margin { width: auto; padding-left: 0; flex-direction: row; flex-wrap: wrap; }
}

.demo-foot { text-align: center; padding: 14px; font-size: 13px; color: var(--ink-soft); border-top: 1px dashed var(--rule); }

/* ---------- Paper block: a whitish rounded surface, reused across the page ---------- */
.paper-block {
  background: var(--paper);
  background-image: radial-gradient(var(--rule) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 26px;
  box-shadow: var(--paper-shadow);
  border: 1px solid var(--rule-soft);
  padding: 48px 44px;
}
@media (max-width: 640px) {
  .paper-block { padding: 32px 24px; border-radius: 20px; }
}

@media (max-width: 640px) {
  .demo-body { grid-template-columns: 1fr; }
  .demo-text { border-right: none; border-bottom: 1.5px dashed rgba(196, 83, 107, 0.55); }
  .demo-margin { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Section tag: a margin-note pointing at the section, in the app's own tagging language ---------- */
.section-tag {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.section-tag .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.section-tag.hl-1 { color: var(--hl-1); } .section-tag.hl-1 .dot { background: var(--hl-1); }
.section-tag.hl-3 { color: var(--hl-3); } .section-tag.hl-3 .dot { background: var(--hl-3); }
.section-tag.hl-4 { color: var(--hl-4); } .section-tag.hl-4 .dot { background: var(--hl-4); }

/* ---------- How it works ---------- */
.section { padding: 78px 0; }
.section-head { max-width: 56ch; margin-bottom: 44px; }
.section-head h2 { font-size: 32px; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin-top: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { padding-left: 18px; border-left: 2px solid var(--rule); }
.step-label { font-family: 'Caveat', cursive; font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.step-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.step:nth-child(1) { border-left-color: var(--hl-1); }
.step:nth-child(1) .step-label { color: var(--hl-1); }
.step:nth-child(1) .step-label .dot { background: var(--hl-1); }
.step:nth-child(2) { border-left-color: var(--hl-2); }
.step:nth-child(2) .step-label { color: var(--hl-2); }
.step:nth-child(2) .step-label .dot { background: var(--hl-2); }
.step:nth-child(3) { border-left-color: var(--hl-3); }
.step:nth-child(3) .step-label { color: var(--hl-3); }
.step:nth-child(3) .step-label .dot { background: var(--hl-3); }
.step h3 { font-size: 19px; margin-top: 6px; font-weight: 700; }
.step p { color: var(--ink-soft); margin-top: 8px; font-size: 15.5px; }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 30px; }
}

/* ---------- Screenshot gallery (real App Store shots) ---------- */
.gallery { padding: 20px 0 84px; }
.gallery-single {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--paper-shadow);
  border: 1px solid var(--rule-soft);
}
.gallery-single img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Closing CTA ---------- */
.cta-band { padding: 20px 0 90px; }
.cta-band .wrap { display: flex; justify-content: center; }
.cta-band .paper-block { text-align: center; max-width: 640px; }
.cta-band h2 { font-size: 28px; max-width: 22ch; margin: 0 auto; }
.cta-band p { color: var(--ink-soft); margin-top: 12px; }
.cta-band .btn-primary { margin-top: 22px; }

/* ---------- Footer ---------- */
footer { padding: 44px 0 50px; }
footer .wrap { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
footer .brand { font-size: 17px; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-soft); font-weight: 600; font-size: 14.5px; }
.foot-links a:hover { color: var(--accent); }
.foot-meta { color: var(--ink-soft); font-size: 13.5px; margin-top: 6px; }

/* ---------- Legal pages ---------- */
.legal-page main { padding: 50px 0 80px; }
.legal-header { max-width: 68ch; margin-bottom: 40px; }
.legal-header h1 { font-size: 36px; }
.legal-header .eff-date { color: var(--ink-soft); font-size: 14.5px; margin-top: 10px; }
.legal-body {
  max-width: 68ch;
  background: var(--paper);
  background-image: radial-gradient(var(--rule) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid var(--rule-soft);
  border-radius: 22px;
  box-shadow: var(--paper-shadow);
  padding: 44px 48px;
}
.legal-body h2 { font-size: 20px; margin-top: 36px; margin-bottom: 12px; font-weight: 700; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { margin: 0 0 14px; color: var(--ink); }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body ul { padding-left: 22px; margin: 0 0 14px; }
.legal-body li { margin-bottom: 6px; }
.legal-body strong { color: var(--ink); }
.legal-body a { font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-soft); margin-bottom: 22px; font-size: 15px; }
.back-link:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 640px) {
  .legal-body { padding: 30px 24px; border-radius: 18px; }
}
