@font-face { font-family: "Lora"; src: url("assets/fonts/lora-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
  @font-face { font-family: "Lora"; src: url("assets/fonts/lora-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
  @font-face { font-family: "Playwrite"; src: url("assets/fonts/playwrite-nz-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

  /* Inkput commits to one visual world: paper stays bright, even in dark mode. */
  :root {
    --paper: #F7F1E3;
    --paper-deep: #EFE6D0;
    --taupe: #B9AC9B;        /* the app's writing-screen ground */
    --sheet-hi: #FDFAF2;
    --sheet-lo: #FAF4E6;
    --ink: #2B2620;
    --ink-soft: #6B6255;
    --teal: #2AB0B0;
    --teal-deep: #12716F;
    --gold: #E9C46A;
    --navy: #2F4396;         /* the app's default cover blue */
    --shadow: 43 38 32;
    --line: 34px;
  }

  * { box-sizing: border-box; }
  html { color-scheme: light; }
  body {
    margin: 0;
    font: 400 17px/1.7 "Lora", Georgia, serif;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
      radial-gradient(120vw 80vh at 18% 0%, #FBF6EB 0%, transparent 60%),
      radial-gradient(110vw 70vh at 92% 100%, var(--paper-deep) 0%, transparent 55%),
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="180" height="180"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/><feColorMatrix type="matrix" values="0 0 0 0 0.55 0 0 0 0 0.50 0 0 0 0 0.42 0 0 0 0.05 0"/></filter><rect width="180" height="180" filter="url(%23n)"/></svg>');
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3 { font-weight: 600; line-height: 1.18; margin: 0; text-wrap: balance; }
  p { margin: 0; }
  a { color: var(--teal-deep); text-decoration-color: rgb(42 176 176 / .45); text-underline-offset: 3px; }
  a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
  .notepad-input:focus, .notepad-input:focus-visible { outline: none; } /* the teal caret is the focus cue */

  .eyebrow {
    font: 600 .72rem/1 "Lora", serif;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--teal-deep);
    margin-bottom: 1.1rem;
  }

  main > section { max-width: 41rem; margin: 0 auto; padding: 5.2rem 1.4rem; }

  /* scroll reveals (craft.js adds .js to <html> first thing, then .in per element;
     no .js class (JS blocked/failed) => nothing is hidden; reduced-motion shows everything) */
  .reveal { transition: opacity .7s ease, transform .7s ease; }
  .js .reveal { opacity: 0; transform: translateY(16px); }
  .js .reveal.in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

  /* ---------- header ---------- */
  .site-header { padding: 2.4rem 1.4rem 0; text-align: center; }
  .wordmark { font: 600 1.35rem "Lora", serif; letter-spacing: .04em; }
  .wordmark::after { content: ""; display: block; width: 26px; height: 2px; margin: .55rem auto 0; background: var(--gold); border-radius: 2px; }
  .wordmark a { color: inherit; text-decoration: none; }

  /* ---------- hero ---------- */
  #hero { text-align: center; padding-top: 2.6rem; max-width: 52rem; }
  #hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
  #hero h1 .quiet { display: block; font-weight: 400; font-style: italic; color: var(--ink-soft); font-size: .62em; margin-top: .65rem; letter-spacing: .01em; }

  .hero-stage { position: relative; width: min(340px, 82vw); margin: 3.4rem auto 1.1rem; }
  .hero-stage::before {  /* the app's taupe writing ground, as a desk mat */
    content: ""; position: absolute; inset: -30px -34px -34px;
    background:
      radial-gradient(120% 100% at 30% 10%, rgb(255 255 255 / .10), transparent 55%),
      linear-gradient(160deg, #C1B4A3, var(--taupe) 55%, #AC9F8D);
    border-radius: 22px;
    box-shadow: inset 0 1px 3px rgb(255 255 255 / .35), inset 0 -14px 30px rgb(var(--shadow) / .12), 0 20px 50px rgb(var(--shadow) / .18);
  }
  .sheet-stack { position: relative; aspect-ratio: 1 / 1; }  /* Inkput sheets are square */
  .sheet {
    position: absolute; inset: 0;
    background: linear-gradient(var(--sheet-hi), var(--sheet-lo));
    border-radius: 14px;
    box-shadow: 0 2px 4px rgb(var(--shadow) / .12), 0 16px 40px rgb(var(--shadow) / .22);
  }
  .sheet.under { transform: translateY(5px) rotate(.5deg); filter: brightness(.985); }
  .sheet.top::before {  /* fixed ruling across the whole sheet — text writes on the lines, like the app */
    content: ""; position: absolute; inset: 0; border-radius: 14px;
    background: repeating-linear-gradient(transparent 0, transparent calc(var(--line) - 1px), rgb(107 98 85 / .22) calc(var(--line) - 1px), rgb(107 98 85 / .22) var(--line));
  }
  .notepad-input {
    position: absolute; inset: 0; z-index: 1;
    padding: 42px 22px 14px; border: 0; resize: none; overflow: hidden;
    background: transparent; color: var(--ink);
    font: 400 22px/var(--line) "Playwrite", cursive;
    caret-color: var(--teal-deep);
  }
  .notepad-input::placeholder { color: var(--ink-soft); opacity: .55; }
  .corner-canvas {
    position: absolute; right: 0; bottom: 0; z-index: 2;
    width: 160px; height: 160px;
    pointer-events: none; opacity: 0; transition: opacity .35s ease;
  }
  .corner-canvas.visible { pointer-events: auto; opacity: 1; cursor: pointer; clip-path: circle(115px at 100% 100%); }
  .peel-layer {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    transition: transform .6s cubic-bezier(.3,.7,.2,1), opacity .6s ease;
  }
  .peel-layer.flying { transform: translate(45%, -130%) rotate(var(--tilt, 8deg)) scale(1.04); opacity: 0; }

  .desk-note {  /* the last peeled page rests on the desk, like in the app */
    position: absolute; left: -18px; bottom: -26px; z-index: 4;
    pointer-events: none;   /* decorative — must never block the curl */
    width: 72px; height: 72px; padding: 7px 8px; overflow: hidden;
    background: linear-gradient(var(--sheet-hi), var(--sheet-lo));
    border-radius: 7px;
    box-shadow: 0 4px 12px rgb(var(--shadow) / .3);
    font: 400 10px/1.3 "Playwrite", cursive; color: var(--ink-soft); text-align: left;
    transform: rotate(var(--note-tilt, -7deg)) scale(.6); opacity: 0;
    transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .45s ease;
  }
  .desk-note.show { transform: rotate(var(--note-tilt, -7deg)) scale(1); opacity: 1; }

  .margin-note {
    position: absolute; width: 175px;
    font: 400 1rem/1.55 "Playwrite", cursive;
    color: var(--ink-soft); text-align: left;
  }
  .margin-note svg { display: block; margin-top: .4rem; }
  .note-write { top: 24%; right: -215px; transform: rotate(3deg); }
  .note-write svg { transform: scaleX(-1) rotate(18deg); margin-left: 44px; }
  @media (max-width: 940px) { .margin-note { display: none; } }

  .hero-caption { font-size: .85rem; color: var(--ink-soft); max-width: 27rem; margin: 2.6rem auto 0; }
  .store-cta { margin-top: 2.3rem; }
  .store-badge {
    display: inline-block; padding: .85rem 1.7rem; border-radius: 999px;
    background: var(--ink); color: var(--paper); text-decoration: none;
    font-weight: 600; letter-spacing: .01em;
    box-shadow: 0 7px 20px rgb(var(--shadow) / .26);
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .store-badge:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgb(var(--shadow) / .3); }

  /* ---------- promise ---------- */
  #promise blockquote { margin: 0; border-left: 3px solid var(--gold); padding-left: 1.4rem; }
  #promise p { font-size: clamp(1.3rem, 3vw, 1.65rem); line-height: 1.5; font-style: italic; }

  /* ---------- protocols ---------- */
  .section-lede { color: var(--ink-soft); max-width: 34rem; }
  .protocol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.6rem 2.8rem; margin-top: 2.8rem; }
  @media (max-width: 640px) { .protocol-grid { grid-template-columns: 1fr; } }
  .protocol-grid h3 { font-size: 1.1rem; margin-bottom: .5rem; }
  .protocol-grid h3::after { content: ""; display: block; width: 34px; height: 2px; margin-top: .45rem; background: var(--teal); opacity: .55; border-radius: 2px; }
  .protocol-grid p { font-size: .95rem; color: var(--ink-soft); }
  .protocol-grid strong { color: var(--ink); font-weight: 600; }

  /* ---------- craft ---------- */
  #craft { max-width: 46rem; }
  .craft-item { display: grid; grid-template-columns: 260px 1fr; gap: 2.6rem; align-items: center; margin-top: 4.6rem; }
  .craft-item:nth-child(odd of .craft-item) { grid-template-columns: 1fr 260px; }
  .craft-item:nth-child(odd of .craft-item) .craft-demo { order: 2; }
  @media (max-width: 700px) {
    .craft-item, .craft-item:nth-child(odd of .craft-item) { grid-template-columns: 1fr; gap: 1.7rem; }
    .craft-item .craft-demo, .craft-item:nth-child(odd of .craft-item) .craft-demo { order: 0; justify-self: center; }
  }
  .craft-demo { justify-self: center; }
  .craft-copy h3 { font-size: 1.15rem; margin-bottom: .55rem; }
  .craft-copy p { font-size: .95rem; color: var(--ink-soft); }

  /* mini notebook — top-bound, like the app's covers */
  .mini-notebook { position: relative; width: 168px; height: 252px; margin: 0 auto 1.3rem; }
  .mini-sheet {
    position: absolute; left: 7px; top: 16px; width: 154px; height: 232px;
    border-radius: 10px;
    background-color: var(--sheet-hi);
    box-shadow: 0 3px 10px rgb(var(--shadow) / .16);
    transition: background .25s ease;
  }
  .mini-cover {
    position: absolute; left: 0; top: 0; width: 168px; height: 228px;
    border-radius: 12px;
    padding: 0 16px 16px;
    display: flex; flex-direction: column; justify-content: flex-end;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), inset 0 -10px 24px rgb(0 0 0 / .18), 0 10px 26px rgb(var(--shadow) / .3);
    transition: background-color .3s ease;
    background-image:
      repeating-linear-gradient(45deg, rgb(255 255 255 / .035) 0 1px, transparent 1px 4px),
      repeating-linear-gradient(-45deg, rgb(0 0 0 / .05) 0 1px, transparent 1px 4px),
      radial-gradient(130% 110% at 30% 12%, rgb(255 255 255 / .14), transparent 55%);
  }
  .mini-cover .binding {  /* horizontal grooves near the top: pages flip up */
    position: absolute; left: 0; right: 0; top: 14px; height: 22px;
    background: repeating-linear-gradient(to bottom, transparent 0 5px, rgb(0 0 0 / .16) 5px 6.5px, rgb(255 255 255 / .10) 6.5px 7.5px);
  }
  .mini-cover .cover-icon { width: 26px; height: 26px; margin-bottom: 8px; opacity: .95; }
  .mini-cover .cover-title { font: 600 .92rem/1.25 "Lora", serif; color: #fff; }
  .mini-cover .cover-sub { font: 400 .62rem/1.4 "Lora", serif; color: rgb(255 255 255 / .72); margin-top: 2px; }
  .mini-cover .cover-icon path { stroke: #fff; }

  [data-cover="sienna"]   .mini-cover { background-color: #A85A1F; }
  [data-cover="charcoal"] .mini-cover { background-color: #33322E; }
  [data-cover="navy"]     .mini-cover { background-color: var(--navy); }
  [data-cover="crimson"]  .mini-cover { background-color: #A32C35; }
  [data-cover="tan"]      .mini-cover { background-color: #E3C79B; }
  [data-cover="slate"]    .mini-cover { background-color: #64748F; }
  [data-cover="plum"]     .mini-cover { background-color: #4B2A66; }
  [data-cover="tan"] .mini-cover .cover-title { color: rgb(60 45 25 / .88); }
  [data-cover="tan"] .mini-cover .cover-sub { color: rgb(60 45 25 / .6); }
  [data-cover="tan"] .mini-cover .cover-icon path { stroke: rgb(60 45 25 / .8); }

  /* standalone sheet sample — the app's sheet-style picker as its own object */
  .sheet-sample {
    position: relative; width: 180px; height: 180px; margin: 0 auto 1.3rem;
    border-radius: 12px;
    background-color: var(--sheet-hi);
    box-shadow: 0 2px 4px rgb(var(--shadow) / .1), 0 12px 30px rgb(var(--shadow) / .18);
    transition: background .25s ease;
  }
  .sheet-sample .scribble {
    position: absolute; top: 20px; left: 14px; right: 12px;
    font: 400 14px/20px "Playwrite", cursive; color: var(--ink-soft);
  }
  [data-sheet="plain"].sheet-sample  { background-image: linear-gradient(var(--sheet-hi), var(--sheet-lo)); }
  [data-sheet="stripe"].sheet-sample { background-image:
      repeating-linear-gradient(transparent 0 19px, rgb(107 98 85 / .22) 19px 20px),
      linear-gradient(var(--sheet-hi), var(--sheet-lo)); }
  [data-sheet="grid"].sheet-sample   { background-image:
      repeating-linear-gradient(transparent 0 19px, rgb(107 98 85 / .17) 19px 20px),
      repeating-linear-gradient(90deg, transparent 0 19px, rgb(107 98 85 / .17) 19px 20px),
      linear-gradient(var(--sheet-hi), var(--sheet-lo)); }
  [data-sheet="dotted"].sheet-sample { background-image:
      radial-gradient(rgb(107 98 85 / .33) 1.1px, transparent 1.4px),
      linear-gradient(var(--sheet-hi), var(--sheet-lo));
      background-size: 20px 20px, 100% 100%; }
  [data-sheet="watercolor"].sheet-sample { background-image:
      radial-gradient(60% 50% at 28% 26%, rgb(42 176 176 / .16), transparent 70%),
      radial-gradient(55% 45% at 72% 62%, rgb(233 196 106 / .22), transparent 70%),
      radial-gradient(45% 45% at 60% 20%, rgb(163 44 53 / .09), transparent 70%),
      linear-gradient(var(--sheet-hi), var(--sheet-lo)); }

  .swatch-rows { display: grid; gap: .8rem; justify-items: center; }
  .swatch-row { display: flex; align-items: center; gap: .42rem; justify-content: center; }
  .swatch {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer;
    box-shadow: 0 2px 5px rgb(var(--shadow) / .25); transition: transform .15s ease;
  }
  .swatch:hover { transform: scale(1.14); }
  .swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 2px 5px rgb(var(--shadow) / .25); }
  .sw-sienna { background: #A85A1F; } .sw-charcoal { background: #33322E; }
  .sw-navy { background: var(--navy); } .sw-crimson { background: #A32C35; }
  .sw-tan { background: #E3C79B; } .sw-slate { background: #64748F; } .sw-plum { background: #4B2A66; }

  .thumb { background: none; border: 2px solid transparent; border-radius: 8px; padding: 2px 2px 1px; cursor: pointer; }
  .thumb[aria-pressed="true"] { border-color: var(--ink); }
  .thumb-paper {
    width: 30px; height: 30px; border-radius: 6px; margin: 0 auto;
    background-color: var(--sheet-hi);
    box-shadow: inset 0 0 0 1px rgb(var(--shadow) / .1), 0 1px 3px rgb(var(--shadow) / .15);
  }
  .thumb span { display: block; font: 400 .56rem/1 "Lora", serif; letter-spacing: .04em; color: var(--ink-soft); text-align: center; margin-top: 4px; }
  .tp-stripe { background-image: repeating-linear-gradient(transparent 0 7px, rgb(107 98 85 / .3) 7px 8px); }
  .tp-grid { background-image: repeating-linear-gradient(transparent 0 7px, rgb(107 98 85 / .25) 7px 8px), repeating-linear-gradient(90deg, transparent 0 7px, rgb(107 98 85 / .25) 7px 8px); }
  .tp-dotted { background-image: radial-gradient(rgb(107 98 85 / .45) 1px, transparent 1.3px); background-size: 7px 7px; }
  .tp-watercolor { background-image:
      radial-gradient(60% 50% at 30% 30%, rgb(42 176 176 / .25), transparent 70%),
      radial-gradient(50% 45% at 70% 65%, rgb(233 196 106 / .3), transparent 70%); }

  /* peel triptych */
  .triptych { display: flex; gap: 1.4rem; align-items: flex-end; }
  .beat { text-align: center; }
  .beat-sheet {
    position: relative; width: 84px; height: 84px; border-radius: 7px;
    background:
      repeating-linear-gradient(transparent 0 12px, rgb(107 98 85 / .2) 12px 13px),
      linear-gradient(var(--sheet-hi), var(--sheet-lo));
    box-shadow: 0 3px 9px rgb(var(--shadow) / .16);
  }
  .beat-sheet .scribble { position: absolute; top: 13px; left: 9px; right: 8px; font: 400 10px/13px "Playwrite", cursive; color: var(--ink-soft); text-align: left; }
  .beat.curled .beat-sheet::after {
    content: ""; position: absolute; right: 0; bottom: 0; width: 24px; height: 24px;
    background: linear-gradient(315deg, transparent 49%, #FCF8EE 50%, #EBDFC3 100%);
    border-radius: 0 0 7px 0 ;
    filter: drop-shadow(-3px -3px 4px rgb(var(--shadow) / .28));
    animation: foldbreathe 4.5s ease-in-out infinite;
  }
  @keyframes foldbreathe { 50% { width: 27px; height: 27px; } }
  .beat.flying .beat-sheet { transform: rotate(9deg) translateY(-10px); box-shadow: 0 16px 26px rgb(var(--shadow) / .24); animation: floataway 5.5s ease-in-out infinite; }
  @keyframes floataway { 50% { transform: rotate(11deg) translateY(-16px); } }
  .beat-label { display: block; margin-top: .9rem; font: 400 1.15rem/1 "Playwrite", cursive; color: var(--ink-soft); }

  /* 30-sheet stack — isometric notepad */
  .iso-scene { position: relative; width: 240px; height: 216px; margin: 0 auto; }
  .iso-pad {
    position: absolute; left: 50px; top: 52px; width: 140px; height: 140px;
    transform-style: preserve-3d;
    transform: rotateX(56deg) rotateZ(-42deg);
  }
  .iso-face { position: absolute; }
  .iso-shadow {
    width: 168px; height: 168px; left: -10px; top: -4px;
    transform: translateZ(-16px);
    background: rgb(70 58 40 / .32); border-radius: 16px; filter: blur(10px);
  }
  .iso-top {
    width: 140px; height: 140px; transform: translateZ(30px); border-radius: 10px;
    background:
      repeating-linear-gradient(transparent 0 17px, rgb(107 98 85 / .18) 17px 18px),
      linear-gradient(var(--sheet-hi), var(--sheet-lo));
  }
  .iso-layer {
    position: absolute; width: 140px; height: 140px; border-radius: 10px;
    background: #F2E9D4;
  }
  .iso-layer:nth-child(even) { background: #E3D7BA; }
  .iso-ghost {
    width: 140px; height: 140px; border-radius: 8px;
    border: 1.5px solid rgb(107 98 85 / .4);
  }
  .iso-ghost.g1 { transform: translateZ(88px) rotateZ(-6deg); opacity: .75; animation: isodrift 7s ease-in-out infinite; }
  @keyframes isodrift { 50% { transform: translateZ(98px) rotateZ(-7.5deg); } }
  .pad-count { display: block; margin-top: .4rem; text-align: center; font: 400 1.5rem/1 "Playwrite", cursive; color: var(--ink-soft); transform: rotate(-3deg); }

  /* sphere: one canvas — ink layer drifts inside static glass */
  .sphere-wrap { position: relative; width: 190px; height: 190px; }
  .sphere-wrap::before {  /* contact shadow on the paper */
    content: ""; position: absolute; left: 14%; right: 14%; bottom: -7px; height: 22px;
    background: radial-gradient(50% 50% at 50% 50%, rgb(70 58 40 / .28), transparent 70%);
    border-radius: 50%;
  }
  .sphere-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .sphere-wrap { animation: breathe 6s ease-in-out infinite; }
  @keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.016); } }

  /* ---------- privacy ---------- */
  #privacy { position: relative; }
  #privacy .body { max-width: 34rem; margin-top: .9rem; }
  .note-privacy { top: 46%; right: -130px; transform: rotate(-4deg); width: 120px; }

  /* ---------- story ---------- */
  #story { max-width: 46rem; }
  .story-sheet {
    position: relative; margin-top: 2.4rem;
    background:
      linear-gradient(315deg, transparent 31px, var(--sheet-hi) 31px),
      linear-gradient(180deg, var(--sheet-hi), var(--sheet-lo));
    border-radius: 12px;
    padding: clamp(1.8rem, 5vw, 3.4rem);
    box-shadow: 0 3px 6px rgb(var(--shadow) / .08), 0 22px 54px rgb(var(--shadow) / .16);
  }
  .story-sheet::after {
    content: ""; position: absolute; right: 0; bottom: 0; width: 44px; height: 44px;
    background: linear-gradient(315deg, transparent 49%, #FCF8EE 50%, #EBDFC3 100%);
    border-radius: 0 0 12px 0;
    filter: drop-shadow(-4px -4px 5px rgb(var(--shadow) / .22));
  }
  .story-sheet p { margin: 1.15rem 0; font-size: .98rem; }
  .story-sheet p:first-child { margin-top: 0; }
  .story-signoff { font: 400 1.7rem/1.3 "Playwrite", cursive; color: var(--ink); margin-top: 1.8rem; }
  .story-signoff a { font: 400 .8rem "Lora", serif; color: var(--teal-deep); margin-left: .6rem; }

  /* ---------- legal pages (privacy.html / terms.html) ---------- */
  .legal h1 { margin-bottom: 1rem; }
  .legal h2 { margin: 2rem 0 .6rem; }
  .legal p { margin: 1rem 0; }
  .legal ul { margin: 1rem 0; padding-left: 1.4rem; }
  .legal li { margin: .3rem 0; }

  /* ---------- download & footer ---------- */
  #download { text-align: center; }
  .closing-line { font-size: 1.35rem; font-style: italic; }
  .site-footer { border-top: 1px solid rgb(var(--shadow) / .12); margin-top: 2.5rem; padding: 2.2rem 1.4rem 3.2rem; text-align: center; font-size: .84rem; color: var(--ink-soft); }
  .site-footer nav { margin-bottom: .5rem; }
  .site-footer nav a { margin: 0 .65rem; }

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