@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #23304A;
  --soft: #5C667C;
  --paper: #FFFFFF;
  --wash: #F3F7FB;
  --line: #BFD8EE;
  --margin: #F0A0A0;
  --berry: #E8618C;
  --berry-dark: #C9466F;
  --sun: #FFC93C;
  --mint: #5FB894;
  --sky: #5AA9E6;
  --grape: #8C7AE6;
  --radius: 22px;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: "Andika", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img, svg, iframe { max-width: 100%; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
p { margin: 0 0 1em; max-width: 62ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.logo { font-family: var(--display); font-weight: 600; font-size: 1.9rem; text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; }
.logo-o { display: inline-block; width: .74em; height: .74em; border: .17em solid var(--sun); border-radius: 50%; margin-left: .04em; }
.logo.small { font-size: 1.5rem; margin: 0 0 4px; }
.top nav { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.top nav a { text-decoration: none; font-weight: 700; font-size: .95rem; }
.top nav a:hover { color: var(--berry-dark); }
.nav-cta { border: 2px solid var(--ink); padding: 6px 14px; border-radius: 999px; }
@media (max-width: 640px) { .top nav a:not(.nav-cta) { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: 999px; font: 700 1rem var(--body); text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: background-color .15s, transform .15s; }
.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--wash); }
.btn-wide { width: 100%; }

/* ---------- hero ---------- */
.hero { max-width: 1240px; margin: 0 auto; padding: clamp(24px, 5vw, 64px) clamp(16px, 5vw, 64px) clamp(48px, 7vw, 96px); display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.lead { font-size: 1.15rem; color: var(--soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.tagline { font-family: var(--display); font-weight: 600; color: var(--berry-dark); font-size: 1.1rem; }

/* the notebook sheet: the page's one signature element */
.sheet { margin: 0; background:
    linear-gradient(90deg, transparent 54px, var(--margin) 54px, var(--margin) 56px, transparent 56px),
    repeating-linear-gradient(180deg, var(--paper) 0 31px, #DCEAF6 31px 32px);
  border-radius: var(--radius); padding: 22px 22px 18px 74px; box-shadow: 0 1px 0 #E3EAF2, 0 18px 40px -22px rgba(35, 48, 74, .35); transform: rotate(-1.6deg); border: 1px solid #E3EAF2; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--berry); color: #fff; border-radius: 16px; padding: 12px 14px 12px 18px; }
.sheet-title { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.sheet-name { background: #fff; color: var(--ink); border-radius: 10px; padding: 4px 12px; font-weight: 700; line-height: 1.2; }
.sheet-name small { display: block; font-weight: 400; font-size: .68rem; color: var(--soft); }
.trace { display: block; width: 100%; height: auto; margin: 14px 0 6px; background: var(--paper); border-radius: 14px; }
.trace .guides line { stroke: var(--line); stroke-width: 1.5; }
.trace .guides .mid { stroke-dasharray: 6 6; }
.trace text { font-family: var(--body); font-size: 150px; }
.trace .small { font-size: 64px; }
.trace .ghost { fill: #EEF1F6; stroke: #9AA6BC; stroke-width: 1.6; stroke-dasharray: 5 4; }
.trace .ink { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: trace 2.6s .4s ease-in-out forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .trace .ink { animation: none; stroke-dashoffset: 0; } }
.sheet figcaption { font-size: .9rem; color: var(--soft); }

/* ---------- sections ---------- */
main > section { padding-left: clamp(16px, 5vw, 64px); padding-right: clamp(16px, 5vw, 64px); }
.why-now { max-width: 1240px; margin: 0 auto; padding-bottom: clamp(48px, 7vw, 96px); display: grid; grid-template-columns: 1fr 1fr; gap: 8px clamp(24px, 5vw, 72px); }
.why-now h2 { grid-row: span 2; }

/* maker */
.maker { background: var(--wash); padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); }
.maker-inner { max-width: 1112px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px clamp(24px, 4vw, 56px); align-items: start; }
.maker-intro { grid-column: 1 / -1; }
.field { display: block; border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.field > span, .field legend { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }
.hint { font-weight: 400; color: var(--soft); font-size: .92rem; }
input[type=text], input[type=email], input[type=tel], select { width: 100%; min-height: 50px; border: 2px solid #D5DEEA; border-radius: 14px; padding: 0 14px; font: 1rem var(--body); color: var(--ink); background: #fff; }
input:focus, select:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px rgba(90, 169, 230, .25); }
.field-row { display: grid; grid-template-columns: 1fr 140px; gap: 14px; }
.letters { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.letters button { aspect-ratio: 1; min-height: 40px; border: 2px solid #D5DEEA; background: #fff; border-radius: 12px; font: 700 1.15rem var(--body); color: var(--ink); cursor: pointer; padding: 0; }
.letters button:hover { border-color: var(--ink); }
.letters button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; }
.chips span { display: inline-block; padding: 9px 16px; border: 2px solid #D5DEEA; border-radius: 999px; background: #fff; font-weight: 700; font-size: .95rem; cursor: pointer; }
.chips input:checked + span { background: var(--sun); border-color: var(--sun); }
.chips input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.form-error { color: var(--berry-dark); font-weight: 700; min-height: 1.6em; margin: 10px 0 0; }

.result { background:
    linear-gradient(90deg, transparent 44px, var(--margin) 44px, var(--margin) 46px, transparent 46px),
    repeating-linear-gradient(180deg, var(--paper) 0 31px, #DCEAF6 31px 32px);
  border-radius: var(--radius); border: 1px solid #E3EAF2; padding: 22px 22px 22px 62px; min-height: 420px; display: flex; }
.result > div { width: 100%; }
.result-empty { align-self: center; color: var(--soft); }
.result-empty p:first-child { font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--ink); }
.result-ready { display: flex; flex-direction: column; gap: 12px; }
.result-ready[hidden] { display: none; }
.mode { margin: 0; font-weight: 700; font-size: .95rem; }
#preview { width: 100%; height: 520px; border: 0; border-radius: 12px; background: #fff; }
@media (max-width: 700px) { #preview { height: 380px; } }

/* steps */
.steps, .why, .story, .waitlist { max-width: 1240px; margin: 0 auto; padding-top: clamp(56px, 8vw, 104px); }
.steps ol { list-style: none; counter-reset: s; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.steps li { counter-increment: s; padding-top: 18px; border-top: 3px solid var(--ink); }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 600; font-size: 2.4rem; color: var(--berry); display: block; line-height: 1; margin-bottom: 10px; }
.steps strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }

/* why */
.why dl { margin: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px clamp(24px, 5vw, 72px); }
.why dt { font-family: var(--display); font-weight: 600; font-size: 1.25rem; display: flex; align-items: center; gap: 12px; }
.why dd { margin: 6px 0 0 30px; color: var(--soft); max-width: 46ch; }
.dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: none; }
.c-berry { background: var(--berry); } .c-sky { background: var(--sky); } .c-mint { background: var(--mint); }
.c-sun { background: var(--sun); } .c-grape { background: var(--grape); } .c-ink { background: var(--ink); }

/* story */
.story blockquote { margin: 0; }
.story blockquote p { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.22; max-width: 26ch; }
.story-lines { color: var(--soft); }

/* waitlist */
.waitlist { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); padding-bottom: clamp(56px, 8vw, 104px); }
.waitlist-form { background: var(--wash); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.field span small { font-weight: 400; color: var(--soft); }

/* footer */
.foot { border-top: 1px solid #E3EAF2; padding: 32px clamp(16px, 5vw, 64px) 40px; max-width: 1240px; margin: 0 auto; }
.foot p { margin: 0 0 4px; }
.fine { color: var(--soft); font-size: .88rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero, .why-now, .waitlist { grid-template-columns: 1fr; }
  .why-now h2 { grid-row: auto; }
  .sheet { transform: none; }
  .maker-inner { grid-template-columns: 1fr; }
  .steps ol, .why dl { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .sheet { padding-left: 22px; background: repeating-linear-gradient(180deg, var(--paper) 0 31px, #DCEAF6 31px 32px); }
  .result { padding-left: 22px; background: var(--paper); }
  .letters { grid-template-columns: repeat(7, 1fr); }
  .field-row { grid-template-columns: 1fr 110px; }
  .hero-actions .btn { width: 100%; }
}
