/* ==========================================================================
   Inkwell page (/inkwell/)
   Its own look, separate from the Fernlight home page: paper whites,
   serif headlines (Fraunces), Instrument Sans text, and one ink-blue accent
   drawn as brush strokes.
   ========================================================================== */

:root {
  --paper: #FBFAF7;
  --white: #FFFFFF;
  --band: #F1F0EC;
  --ink: #1A1D29;
  --ink-2: #4A4E5C;
  --ink-3: #5C6070;
  --blue: #2F44B5;
  --blue-deep: #1F2E80;
  --blue-soft: #EEF0FA;
  --blue-mist: #E9EBF6;
  --line: #E4E2DC;
  --line-2: #DCDAD3;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow-lg: 0 1px 0 rgba(26, 29, 41, .06), 0 30px 60px -20px rgba(26, 29, 41, .28);
  --shadow-sheet: 0 18px 40px -24px rgba(26, 29, 41, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--mono); font-size: .9em; background: var(--blue-soft); color: var(--blue-deep); border-radius: 5px; padding: 1px 5px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 980px; }

/* Type */
.serif, .h1, .h2, .h3 { font-family: var(--serif); font-optical-sizing: auto; letter-spacing: -0.01em; }
.h1 { font-size: clamp(44px, 6.4vw, 84px); line-height: 1.02; font-weight: 400; margin: 0; }
.h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.06; font-weight: 400; margin: 0; }
.h3 { font-size: 22px; line-height: 1.25; font-weight: 500; margin: 0; }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.body { color: var(--ink-2); margin: 0; }
.meta { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0; }
.kick { font-size: 14px; color: var(--ink-3); }
.center { text-align: center; }
.head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 52px; max-width: 700px; }
.head.center { margin-left: auto; margin-right: auto; align-items: center; }

/* Hand-drawn ink underline */
.under { position: relative; display: inline-block; white-space: nowrap; }
.under svg { position: absolute; left: -2%; bottom: -0.16em; width: 104%; height: 0.32em; overflow: visible; pointer-events: none; }
.under path { stroke-dasharray: 520; stroke-dashoffset: 0; }

/* Buttons */
.pill, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.pill { background: var(--ink); color: var(--paper); border: 0; }
.pill:hover { background: var(--blue); color: #fff; }
.ghost { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.ghost:hover { border-color: var(--blue); color: var(--blue); }
.pill svg { flex: 0 0 auto; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(251, 250, 247, 0); transition: background-color .25s, box-shadow .25s; }
.nav.scrolled { background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 32px; max-width: 1280px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; gap: 28px; font-size: 15px; font-weight: 500; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: var(--ink); text-decoration: none; }
.nav-links a:hover { color: var(--blue); }
.nav .pill { min-height: 42px; }

/* Hero */
.hero { text-align: center; padding: 64px 0 0; }
.hero-copy { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.hero .lede { max-width: 580px; }
.hero-stage { position: relative; margin-top: 64px; }
.hero-band { position: absolute; left: 0; right: 0; top: 46%; bottom: 0; background: var(--band); }
.ribbon { position: absolute; left: 0; top: 30%; width: 100%; height: 62%; }
.hero-shot { position: relative; max-width: 1040px; padding-bottom: 96px; }

.frame { border-radius: 14px; overflow: hidden; background: var(--white); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.frame-bar { display: flex; gap: 7px; padding: 12px 14px; background: #F6F5F2; border-bottom: 1px solid var(--line); }
.frame-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }

/* Statement + sheets */
.statement { padding: 120px 0 112px; overflow: hidden; }
.sheets { display: flex; gap: 20px; justify-content: center; margin: 0; padding: 0; list-style: none; }
.sheet { flex: 0 0 250px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 26px 24px 30px; box-shadow: var(--shadow-sheet); min-height: 330px; }
.sheet h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.2; margin: 10px 0 12px; }
.sheet p, .sheet li { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin: 0 0 8px; }
.sheet ul { padding-left: 18px; margin: 0 0 8px; }
.sheet .meta { font-size: 11px; }
.tag { display: inline-block; font-size: 12px; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 2px 7px; }
.hl { background: #FCEFB4; padding: 0 2px; }
.wl { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.points { display: flex; gap: 48px; flex-wrap: wrap; margin-top: 56px; }
.point { display: flex; gap: 14px; align-items: flex-start; flex: 1 1 320px; margin: 0; font-size: 18px; line-height: 1.5; }
.star { flex: 0 0 auto; width: 22px; height: 22px; color: var(--blue); margin-top: 2px; }

/* Write the way you think */
.write { padding: 0 0 120px; }
.split { display: flex; gap: 28px; flex-wrap: wrap; align-items: stretch; }
.panel { flex: 1 1 460px; min-width: 0; background: var(--band); border-radius: 20px; padding: 56px; }
.panel > .body { margin-top: 18px; font-size: 17px; }
.feat-list { display: flex; flex-direction: column; gap: 26px; margin: 36px 0 40px; padding: 0; list-style: none; }
.feat-list .h3 { margin-bottom: 4px; }
.art { flex: 1 1 460px; min-width: 0; border-radius: 20px; background: var(--blue-mist); display: flex; align-items: center; justify-content: center; padding: 56px 24px; position: relative; overflow: hidden; }
.art-swash { position: absolute; width: 120%; left: -10%; top: 8%; }
.phone { width: 280px; max-width: 100%; border-radius: 40px; padding: 10px; background: var(--ink); box-shadow: 0 40px 80px -30px rgba(26, 29, 41, .5); position: relative; }
.phone img { width: 100%; border-radius: 31px; }

/* Trio */
.keep { padding: 120px 0; background: var(--band); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.card-art { height: 240px; background: var(--band); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-art-dark { background: #1F2330; align-items: flex-start; justify-content: flex-start; }
.card-art-dark img { width: 150%; max-width: none; margin: 30px 0 0 40%; border-radius: 10px; }
.card-body { padding: 24px 26px 30px; display: flex; flex-direction: column; gap: 6px; }
.mini-share { width: 210px; background: var(--white); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 16px 30px -18px rgba(26, 29, 41, .4); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mini-share .app { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.mini-share .app img { width: 28px; height: 28px; }
.mini-share hr { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.mini-share .sub { font-size: 13px; color: var(--ink-2); }
.mini-history { width: 230px; display: flex; flex-direction: column; gap: 8px; }
.mini-history div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; display: flex; justify-content: space-between; color: var(--ink-2); }
.mini-history .now { color: var(--ink); }
.mini-history .now b { color: var(--blue); font-weight: 600; }
.mini-history .pick { border-color: var(--blue); color: var(--ink); }

/* Install */
.install { padding: 120px 0; }
.steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.steps > li { display: flex; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.num { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--blue); flex: 0 0 56px; font-style: italic; }
.step-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.code { position: relative; margin-top: 4px; }
.code pre { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.7; background: var(--ink); color: #E8E9F0; border-radius: 10px; padding: 16px 96px 16px 18px; overflow-x: auto; }
.code code { background: none; color: inherit; padding: 0; font-size: inherit; }
.copy-btn { position: absolute; top: 10px; right: 10px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: #C9CFEE; color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; }
.copy-btn:hover { background: #fff; }
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.note { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.note .h3 { font-size: 19px; }
.note p { font-size: 15px; }
.note .code pre { padding-right: 18px; padding-top: 48px; }

/* Letter (kept for later, see the comment in the HTML) */
.letter-wrap { padding: 120px 0; background: var(--band); }
.letter { max-width: 720px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 64px 72px; box-shadow: 0 24px 50px -30px rgba(26, 29, 41, .35); }
.letter p { font-size: 18px; line-height: 1.7; color: #2C3040; margin: 0 0 18px; }

/* FAQ */
.faq-wrap { padding: 120px 0; }
.faq { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; font-family: var(--serif); font-size: 22px; line-height: 1.3; cursor: pointer; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--blue); }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 28px; line-height: 1; color: var(--blue); flex: 0 0 auto; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 48px 26px 0; display: flex; flex-direction: column; gap: 12px; }

/* Closing + signup */
.closing { padding: 40px 0 120px; text-align: center; }
.closing-in { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.closing-icon { width: 64px; height: 64px; }
.signup { margin-top: 56px; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.form { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.input { flex: 1 1 240px; min-width: 0; min-height: 46px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--white); padding: 0 20px; font: 16px var(--sans); color: var(--ink); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form .pill { flex: 0 0 auto; }
.form-status { min-height: 1.4em; font-size: 15px; color: var(--ink); margin: 0; }
.form-note { font-size: 14px; color: var(--ink-3); margin: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer-in { display: flex; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; padding: 40px 32px; max-width: 1280px; margin: 0 auto; font-size: 14px; color: var(--ink-3); }
.footer-in p { margin: 0; }
.footer-in a { color: var(--ink); text-decoration: none; }
.footer-in a:hover { color: var(--blue); }
.footer-links { display: flex; gap: 10px 22px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }

/* Reveal on scroll (js/main.js adds .in) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal .under path, .js .hero .under path { stroke-dashoffset: 520; transition: stroke-dashoffset 1.1s cubic-bezier(.6, .1, .2, 1) .35s; }
.js .reveal.in .under path { stroke-dashoffset: 0; }
.js .hero .under path { animation: ink-draw 1.1s cubic-bezier(.6, .1, .2, 1) .45s forwards; }
.js .hero-copy > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.js .hero-copy > :nth-child(2) { animation-delay: .06s; }
.js .hero-copy > :nth-child(3) { animation-delay: .14s; }
.js .hero-copy > :nth-child(4) { animation-delay: .2s; }
.js .hero-copy > :nth-child(5) { animation-delay: .26s; }
.js .hero-stage { animation: rise 1s cubic-bezier(.2, .7, .2, 1) .3s both; }
.js .ribbon path:first-child { stroke-dasharray: 3200; stroke-dashoffset: 3200; animation: ink-draw 1.8s cubic-bezier(.5, .1, .2, 1) .6s forwards; }
@keyframes ink-draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .hero-copy > *, .js .hero-stage { opacity: 1; transform: none; animation: none; transition: none; }
  .js .under path, .js .ribbon path { animation: none !important; transition: none !important; stroke-dashoffset: 0 !important; }
}

/* Responsive */
@media (max-width: 960px) {
  .trio, .notes { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 40px 28px; }
  .letter { padding: 40px 28px; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .nav-in { padding: 14px 20px; }
  .hero { padding-top: 40px; }
  .h1 { font-size: clamp(34px, 10.4vw, 44px); }
  .code pre { padding: 50px 18px 16px; }
  .hero-stage { margin-top: 44px; }
  .hero-shot { padding-bottom: 56px; }
  .frame-bar { padding: 8px 10px; }
  .frame-bar span { width: 8px; height: 8px; }
  .statement, .keep, .install, .faq-wrap, .letter-wrap { padding: 80px 0; }
  .write { padding-bottom: 80px; }
  .sheet { flex-basis: 230px; }
  .steps > li { gap: 16px; }
  .num { flex-basis: 36px; font-size: 32px; }
  .art { padding: 40px 20px; }
  .phone { width: 240px; }
  .faq summary { font-size: 19px; }
  .faq .a { padding-right: 0; }
  .closing { padding-bottom: 80px; }
  .form .pill { width: 100%; }
}
