/* ============================================================
   Kai à la Mode — the public site.
   A picture book you scroll: painted spreads edge to edge,
   quiet paper pages between them, wide bold type like the cover.
   Loaded only on the public pages; style.css carries the private books.
   ============================================================ */

.public-site {
  --paper: #FFFCF7;
  --ink: #2B2622;
  --ink-soft: #6B5F55;
  --rule: rgba(43, 38, 34, 0.14);
  --butterfly: #3A6FA8;      /* the blue butterfly: buttons and links */
  --butterfly-deep: #2C577F;
  --sky: #8DBBE1;            /* the rainbow's blue */
  --poppy: #E5854F;          /* the meadow poppies */
  --rain: #F3E7AA;           /* the rainbow's yellow, creamy */
  --rain-light: #FAF3D2;
  --meadow: #A9D18E;
  --font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Nunito", "Segoe UI", Verdana, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --measure: 62ch;

  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: 18px; line-height: 1.6; font-weight: 500;
  overflow-x: hidden; overflow-y: auto; height: auto;
  -webkit-font-smoothing: antialiased;
}
.public-site::before { display: none; }           /* no paper grain overlay here */
.public-site h1, .public-site h2, .public-site h3 { font-family: var(--font-head); font-weight: 800; color: var(--ink); line-height: 1.02; letter-spacing: -0.02em; margin: 0; font-variation-settings: normal; }
.public-site h1 { font-size: clamp(48px, 7.4vw, 104px); }
.public-site h2 { font-size: clamp(34px, 4.6vw, 60px); }
.public-site h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.01em; }
.public-site p { margin: 0; }
.public-site a { color: var(--butterfly); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.public-site a:hover { color: var(--butterfly-deep); }
.public-site :focus-visible { outline: 3px solid var(--butterfly); outline-offset: 3px; }
.wrap { width: min(1240px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.lede { font-size: clamp(19px, 1.5vw, 22px); line-height: 1.55; max-width: var(--measure); }
.soft { color: var(--ink-soft); }
.measure { max-width: var(--measure); }

/* ---------- buttons: printed stickers ---------- */
.public-site .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-text); font-weight: 800; font-size: 17px; line-height: 1; color: #fff; background: var(--butterfly); text-decoration: none; padding: 16px 26px; border: 0; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 0 var(--butterfly-deep); transition: transform .12s ease, box-shadow .12s ease, background .2s; }
.public-site .btn:hover { background: var(--butterfly-deep); color: #fff; transform: translateY(1px); box-shadow: 0 3px 0 #1F3F5E; }
.public-site .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1F3F5E; }
.public-site .btn.big { font-size: 19px; padding: 19px 32px; border-radius: 16px; }
.public-site .btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--rule), 0 4px 0 var(--rule); }
.public-site .btn.ghost:hover { background: #fff; color: var(--butterfly); box-shadow: inset 0 0 0 2px var(--butterfly), 0 3px 0 var(--butterfly); }
.public-site .btn.small { font-size: 15px; padding: 12px 18px; border-radius: 12px; }
.public-site .link { font-weight: 800; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }

/* ---------- header ---------- */
.sh { position: fixed; left: 0; right: 0; top: 0; z-index: 40; height: 86px; display: flex; align-items: center; transition: background .25s, box-shadow .25s; }
/* the blur lives on a pseudo-element: a blurred header would become the positioning box for the fixed phone menu */
.sh::before { content: ""; position: absolute; inset: 0; z-index: -1; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .25s; pointer-events: none; }
.sh.solid, .public-site:not(.site-home) .sh { background: rgba(255,252,247,0.94); box-shadow: 0 1px 0 var(--rule); }
.sh.solid::before, .public-site:not(.site-home) .sh::before { opacity: 1; }
.public-site .sh.open::before { opacity: 0; }
.sh-in { width: min(1320px, calc(100% - 2 * var(--gutter))); margin-inline: auto; display: flex; align-items: center; gap: 28px; }
.sh-logo { display: block; flex: none; }
.sh-logo img { height: 66px; width: auto; display: block; filter: drop-shadow(0 1px 0 rgba(255,255,255,.6)); }
.sh-nav { margin-left: auto; }
.sh-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.public-site .sh-nav a { display: inline-block; font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.public-site .sh-nav a:hover { background: rgba(255,255,255,.7); color: var(--butterfly); }
.public-site .sh-nav li.current-menu-item a, .sh-nav a[aria-current="page"] { color: var(--butterfly); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; }
.sh-buy { flex: none; font-size: 15px; padding: 13px 20px; border-radius: 12px; }
.sh-toggle { display: none; }
@media (max-width: 1060px) {
  .sh { height: 68px; }
  .sh-logo img { height: 52px; }
  .sh-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-family: var(--font-text); font-weight: 800; font-size: 15px; color: var(--ink); background: #fff; border: 2px solid var(--rule); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
  .sh-toggle i { width: 18px; height: 2px; background: currentColor; position: relative; display: block; }
  .sh-toggle i::before, .sh-toggle i::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
  .sh-toggle i::before { top: -6px; } .sh-toggle i::after { top: 6px; }
  .sh-buy { order: 3; margin-left: 0; }
  .sh-nav { position: fixed; inset: 68px 0 0 0; background: var(--paper); display: none; padding: 24px var(--gutter); overflow: auto; margin: 0; }
  .sh.open .sh-nav { display: block; }
  .public-site .sh.open { background: var(--paper); box-shadow: 0 1px 0 var(--rule); }
  .sh-nav ul { flex-direction: column; gap: 0; }
  .public-site .sh-nav a { display: block; font-family: var(--font-head); font-weight: 800; font-size: 34px; letter-spacing: -0.02em; padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--rule); }
  .public-site .sh-nav a:hover { background: none; color: var(--butterfly); }
  .public-site .sh-nav li.current-menu-item a, .public-site .sh-nav a[aria-current="page"] { text-decoration: none; color: var(--butterfly); }
}

/* ---------- the opening spread (home) ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 42% 28%; }
.hero-mist { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(ellipse 64% 78% at 16% 96%, rgba(255,252,247,0.97) 0%, rgba(255,252,247,0.9) 40%, rgba(255,252,247,0) 72%),
  linear-gradient(180deg, rgba(255,252,247,0) 72%, var(--paper) 100%); }
.hero-copy { position: relative; padding: 140px 0 clamp(56px, 8vh, 96px); max-width: 680px; }
@media (max-width: 1500px) and (min-width: 761px) { .hero-copy { max-width: 520px; } .hero h1 { font-size: clamp(52px, 6.2vw, 88px); } .hero-mist { background: radial-gradient(ellipse 70% 82% at 12% 96%, rgba(255,252,247,0.97) 0%, rgba(255,252,247,0.9) 44%, rgba(255,252,247,0) 74%), linear-gradient(180deg, rgba(255,252,247,0) 72%, var(--paper) 100%); } }
.hero h1 { font-size: clamp(52px, 7vw, 100px); }
.public-site .hero h1 span { display: block; font-weight: 600; font-size: clamp(22px, 3vw, 40px); letter-spacing: 0; margin-top: 10px; color: var(--ink); }
.hero .lede { margin: 24px 0 30px; }
.hero .meta { margin-top: 26px; font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.hero-bfly { position: absolute; z-index: 1; pointer-events: none; }
.hero-bfly img { width: 100%; height: auto; }
.hero-bfly.one { width: clamp(44px, 5vw, 86px); right: 9%; top: 23%; animation: drift 9s ease-in-out infinite; }
.hero-bfly.two { width: clamp(30px, 3.2vw, 54px); right: 21%; top: 38%; animation: drift 12s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-18px, -26px) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .hero-bfly { animation: none !important; } }
@media (max-width: 760px) {
  /* phones: the whole painting first, then the words on paper */
  .hero { min-height: 0; display: block; padding-top: 68px; }
  .hero-art { position: relative; inset: auto; height: auto; }
  .hero-art img { position: static; width: 100%; height: auto; aspect-ratio: 1; object-position: center; }
  .hero-mist { top: 68px; bottom: auto; height: 100vw; background: linear-gradient(180deg, rgba(255,252,247,0) 62%, var(--paper) 100%); }
  .hero-copy { padding: 0 0 40px; max-width: none; }
  .hero h1 { font-size: clamp(40px, 12.5vw, 64px); }
  .hero .lede { margin: 16px 0 22px; }
  .hero-bfly { display: none; }
}
@media (max-width: 480px) { .public-site .sh-buy { display: none; } .stickybuy .btn { white-space: nowrap; } }

/* ---------- a split spread: text one side, art bleeding the other ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.split > .text { padding: clamp(56px, 8vw, 120px) clamp(40px, 6vw, 96px) clamp(56px, 8vw, 120px) var(--gutter); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.split > .art { position: relative; min-height: 62vh; }
.split > .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split.flip > .text { order: 2; padding: clamp(56px, 8vw, 120px) var(--gutter) clamp(56px, 8vw, 120px) clamp(40px, 6vw, 96px); }
.split.flip > .art { order: 1; }
.split .text h2 { max-width: 14ch; }
.split .text p { max-width: var(--measure); }
@media (max-width: 860px) {
  .split, .split.flip { grid-template-columns: 1fr; }
  .split > .art, .split.flip > .art { order: 1; min-height: 60vw; }
  .split > .text, .split.flip > .text { order: 2; padding: 40px var(--gutter) 56px; }
}

/* ---------- section rhythm ---------- */
.page { padding: clamp(64px, 9vw, 128px) 0; }
.page.tight { padding-top: clamp(40px, 6vw, 80px); }
.head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(32px, 4vw, 56px); }
.head.center { text-align: center; margin-inline: auto; justify-items: center; }

/* ---------- look inside: a filmstrip of real spreads ---------- */
.strip { padding: clamp(64px, 9vw, 128px) 0 clamp(48px, 6vw, 96px); background: #fff; }
.strip-track { display: flex; gap: clamp(14px, 2vw, 28px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 10px var(--gutter) 26px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.strip-track::-webkit-scrollbar { display: none; }
.public-site .strip-item { flex: 0 0 auto; scroll-snap-align: start; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.public-site .strip-item img { height: min(64vh, 600px); width: auto; box-shadow: 0 18px 40px rgba(43,38,34,0.18), 0 2px 0 rgba(43,38,34,0.06); transition: transform .25s ease; }
.strip-item:hover img { transform: translateY(-6px); }
.public-site .strip-item span { display: block; margin-top: 14px; font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.strip-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.strip-nav { display: flex; gap: 10px; }
.strip-nav button { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--rule); background: #fff; color: var(--ink); font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.strip-nav button:hover { border-color: var(--butterfly); color: var(--butterfly); }
@media (max-width: 760px) { .strip-item img { height: 56vw; } .strip-nav { display: none; } }

/* ---------- the modes: a rainbow-yellow band of watercolor stickers ---------- */
.modes { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--rain-light) 0%, var(--rain) 100%); padding: clamp(64px, 9vw, 128px) 0; }
.modes .bf { position: absolute; pointer-events: none; }
.modes .bf.a { width: clamp(70px, 9vw, 150px); right: 4%; top: 8%; transform: rotate(12deg); }
.modes .bf.b { width: clamp(60px, 7vw, 120px); right: 12%; bottom: 6%; transform: rotate(-10deg); }
.stickers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px) clamp(10px, 2vw, 24px); margin-top: clamp(28px, 4vw, 48px); }
.public-site .badge.sticker { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: 12px; font: inherit; color: inherit; }
.sticker .blob { width: clamp(96px, 11vw, 150px); height: clamp(96px, 11vw, 150px); margin: 0; padding: 0; border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%; background: radial-gradient(circle at 36% 32%, rgba(255,255,255,0.7) 0 10%, rgba(255,255,255,0) 42%), var(--c, #F2BDB4); box-shadow: 0 0 0 6px #fff, 0 10px 22px rgba(43,38,34,0.16); display: grid; place-items: center; text-align: center; transition: transform .25s cubic-bezier(.34,1.4,.64,1), box-shadow .25s; }
.public-site .sticker .blob span { font-family: var(--font-head); font-weight: 800; font-size: clamp(13px, 1.2vw, 17px); line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); padding: 0 12px; }
.sticker .learns { font-size: 14px; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.3; max-width: 16ch; }
.sticker .blob::after { display: none; }
.sticker:nth-child(3n+1) .blob { rotate: -4deg; } .sticker:nth-child(3n+2) .blob { rotate: 3deg; } .sticker:nth-child(3n) .blob { rotate: -1deg; }
.sticker:hover .blob { transform: scale(1.06); }
.badge.sticker.on .blob { transform: scale(1.1); box-shadow: 0 0 0 6px #fff, 0 0 0 10px var(--butterfly), 0 14px 30px rgba(43,38,34,0.2); }
.badge.sticker.on .learns { color: var(--butterfly); }
.badge.sticker.on .learns::before { content: none; }
.mode-line { margin-top: clamp(28px, 4vw, 44px); min-height: 3.2em; font-family: var(--font-head); font-weight: 700; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.01em; color: var(--ink); max-width: 36ch; }
@media (max-width: 1000px) { .stickers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stickers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 8px; } .sticker .blob { width: 92px; height: 92px; } .sticker .learns { display: none; } .modes .bf.a { width: 48px; top: 10px; right: 4%; } }

/* ---------- Kai and the friends ---------- */
.portrait { width: min(100%, 420px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 8px #fff, 0 18px 40px rgba(43,38,34,0.18); }
.says { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.public-site .says li { font-family: var(--font-head); font-weight: 700; font-style: italic; font-size: clamp(19px, 1.8vw, 24px); letter-spacing: -0.01em; color: var(--butterfly); }
.friends { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); margin-top: clamp(28px, 4vw, 48px); }
.public-site .friend { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: 12px; font: inherit; color: inherit; text-align: center; }
.public-site .friend img { width: clamp(110px, 13vw, 170px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: 50% 10%; box-shadow: 0 0 0 6px #fff, 0 12px 26px rgba(43,38,34,0.16); transition: transform .25s cubic-bezier(.34,1.4,.64,1), box-shadow .25s; }
.friend:hover img { transform: translateY(-4px); }
.friend[aria-expanded="true"] img { box-shadow: 0 0 0 6px #fff, 0 0 0 10px var(--butterfly), 0 14px 30px rgba(43,38,34,0.2); }
.public-site .friend b { font-family: var(--font-head); font-weight: 800; font-size: clamp(15px, 1.4vw, 19px); letter-spacing: -0.01em; }
.public-site .friend small { display: block; font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.friend-fact { margin-top: 28px; min-height: 3.4em; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; max-width: 60ch; }
.friend-fact:empty::before { content: "Tap a friend."; color: var(--ink-soft); }
@media (max-width: 760px) { .friends { grid-template-columns: repeat(3, minmax(0, 1fr)); } .friend img { width: 96px; } }

/* ---------- the valley map ---------- */
.valley-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.public-site .valley-grid .map { width: 100%; border-radius: 0; box-shadow: 0 18px 40px rgba(43,38,34,0.16); background: none; }
.public-site .map .region { font-family: var(--font-head); font-weight: 700; font-size: 14px; background: rgba(255,252,247,0.96); box-shadow: 0 4px 12px rgba(43,38,34,0.18); }
.public-site .map .region i { background: var(--butterfly); }
.public-site .map .region.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--butterfly), 0 10px 20px rgba(43,38,34,.25); }
.public-site .legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; font-size: 17px; }
.public-site .legend li { padding: 14px 0; border-bottom: 1px solid var(--rule); border-radius: 0; cursor: pointer; transition: padding-left .2s, background .3s; }
.public-site .legend li.on { background: none; padding-left: 14px; box-shadow: inset 4px 0 0 var(--butterfly); }
.public-site .legend strong { font-family: var(--font-head); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; display: block; margin-bottom: 2px; }
.public-site .legend em { font-style: normal; font-weight: 800; color: var(--butterfly); display: block; margin-top: 2px; }
@media (max-width: 860px) { .valley-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  /* small phones: the signposts become numbered dots, the legend carries the names */
  .public-site .map { counter-reset: pin; }
  .public-site .map .region { counter-increment: pin; padding: 0; background: none; box-shadow: none; border-radius: 50%; gap: 0; }
  .public-site .map .region > span { display: none; }
  .public-site .map .region i { width: 28px; height: 28px; border: 2px solid #fff; background: var(--butterfly); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(43,38,34,.35); }
  .public-site .map .region i::before { content: counter(pin); font-family: var(--font-head); font-weight: 800; font-size: 12px; line-height: 1; color: #fff; }
  .public-site .map .region.on { box-shadow: none; } .public-site .map .region.on i { background: var(--poppy); }
  .public-site .legend { counter-reset: leg; }
  .public-site .legend li { counter-increment: leg; position: relative; padding-left: 42px; }
  .public-site .legend li::before { content: counter(leg); position: absolute; left: 0; top: 15px; width: 28px; height: 28px; border-radius: 50%; background: var(--butterfly); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
  .public-site .legend li.on { padding-left: 42px; box-shadow: none; } .public-site .legend li.on::before { background: var(--poppy); }
}

/* ---------- for grown-ups: three steps, the thunder counter ---------- */
.steps3 { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.steps3 li { counter-increment: s; border-top: 3px solid var(--ink); padding-top: 18px; }
.steps3 li::before { content: counter(s); display: block; font-family: var(--font-head); font-weight: 800; font-size: clamp(56px, 6vw, 88px); line-height: 1; color: var(--poppy); letter-spacing: -0.04em; margin-bottom: 10px; }
.steps3 li b { display: block; font-family: var(--font-head); font-weight: 800; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.01em; line-height: 1.15; margin-bottom: 8px; }
.steps3 li p { color: var(--ink-soft); }
.counter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; margin-top: clamp(48px, 7vw, 96px); }
.counter-figure { display: grid; gap: 14px; }
.counter-figure .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.counter-figure .flash { font-family: var(--font-head); font-weight: 800; font-size: 24px; color: var(--poppy); }
.counter-figure .tick { width: 40px; height: 40px; font-size: 15px; border-radius: 50%; background: var(--sky); color: var(--ink); font-family: var(--font-head); font-weight: 800; display: grid; place-items: center; }
.counter-figure .boom { font-family: var(--font-head); font-weight: 800; font-size: 24px; }
.counter-figure .mile { font-weight: 800; color: var(--ink-soft); }
.printable { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; margin-top: clamp(48px, 7vw, 96px); }
.printable .sheets { position: relative; display: block; aspect-ratio: 1.14; }   /* two sheets, fanned */
.printable .sheets img { position: absolute; width: 78%; height: auto; background: #fff; box-shadow: 0 14px 30px rgba(43,38,34,0.16), 0 0 0 1px var(--rule); transition: transform .25s ease; }
.printable .sheets img:first-child { right: 0; top: 0; transform: rotate(4deg); }
.printable .sheets img:last-child { left: 0; bottom: 0; transform: rotate(-3deg); }
.printable .sheets:hover img:last-child { transform: rotate(-3deg) translateY(-6px); }
@media (max-width: 860px) { .steps3 { grid-template-columns: 1fr; } .counter { grid-template-columns: 1fr; } .printable { grid-template-columns: 1fr; } .printable .sheets { width: min(100%, 320px); } }

/* ---------- the book in hand ---------- */
.inhand { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.shot { perspective: 1800px; display: grid; place-items: center; padding: 30px 0; }
.book3d { position: relative; width: min(100%, 440px); aspect-ratio: 1; transform-style: preserve-3d; transform: rotateY(-22deg) rotateX(3deg); filter: drop-shadow(0 34px 34px rgba(43,38,34,0.32)); }
.book3d .b3-cover { position: absolute; inset: 0; transform: translateZ(16px); background: #fff; box-shadow: inset 3px 0 6px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.10); overflow: hidden; }
.book3d .b3-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255,255,255,0) 58%, rgba(255,255,255,0.18) 70%, rgba(255,255,255,0) 80%); }
.book3d .b3-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book3d .b3-pages { position: absolute; top: 2%; bottom: 2%; left: 2%; right: 0; transform: translateZ(-12px); background: repeating-linear-gradient(180deg, #FFFEFB 0 2px, #E8E3D8 2px 3px); box-shadow: 14px 0 0 -5px #F2EEE6, 20px 0 0 -8px #E6E1D6; }
.book3d .b3-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 32px; transform: rotateY(-90deg) translateZ(16px); transform-origin: left center; background: linear-gradient(90deg, #6FA3D6, #3A6FA8 60%, #2C577F); display: grid; place-items: center; }
.book3d .b3-spine span { writing-mode: vertical-rl; rotate: 180deg; font-family: var(--font-head); font-weight: 800; font-size: 11px; color: #fff; white-space: nowrap; letter-spacing: .02em; }
.specs { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-weight: 700; color: var(--ink-soft); font-size: 16px; }
.also { margin-top: 16px; font-weight: 700; color: var(--ink-soft); font-size: 16px; max-width: var(--measure); }
.also .isbn { white-space: nowrap; }
.specs b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -0.01em; }
@media (max-width: 860px) { .inhand { grid-template-columns: 1fr; } .book3d { width: min(80%, 360px); } }

/* ---------- inner-page opener: the painting edge to edge, the title on a mist beside the character ---------- */
/* height follows the window width (a 2:1 spread, half the painting), capped only by very short windows; never aspect-ratio + max-height, which would shrink the width instead */
.opener { position: relative; display: flex; align-items: flex-end; width: 100%; min-height: clamp(380px, 50vw, 92vh); overflow: hidden; isolation: isolate; }
.opener .hero-art { position: absolute; inset: 0; z-index: -2; }
.opener .hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center 25%); }  /* --pos keeps the character's head in frame */
.opener .hero-mist { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 60% 110% at 8% 100%, rgba(255,252,247,0.98) 0%, rgba(255,252,247,0.92) 42%, rgba(255,252,247,0) 74%), linear-gradient(180deg, rgba(255,252,247,0) 74%, var(--paper) 100%); }
/* the words scale with the screen, so they stay on the same part of the painting at every size */
.opener .hero-copy { position: relative; max-width: min(640px, 44vw); padding: 110px 0 clamp(28px, 4vw, 64px); }
.opener h1 { font-size: clamp(34px, 5.2vw, 80px); }
.opener .lede { margin-top: clamp(12px, 1.4vw, 20px); font-size: clamp(16px, 1.45vw, 22px); }
.opener.right .hero-mist { background: radial-gradient(ellipse 60% 110% at 92% 100%, rgba(255,252,247,0.98) 0%, rgba(255,252,247,0.92) 42%, rgba(255,252,247,0) 74%), linear-gradient(180deg, rgba(255,252,247,0) 74%, var(--paper) 100%); }
.opener.right .hero-copy { margin-left: auto; }
.opener.narrow .hero-copy { max-width: min(540px, 37vw); }   /* when the character sits near the middle of the painting */
.opener.narrow h1 { font-size: clamp(30px, 4.6vw, 70px); }
@media (max-width: 760px) {
  /* phones: same as home, the whole painting first, then the words on paper */
  .opener { display: block; min-height: 0; padding-top: 68px; }
  .opener .hero-art { position: relative; inset: auto; z-index: auto; }
  .opener .hero-art img { position: static; width: 100%; height: auto; aspect-ratio: 1; object-position: center; }
  .opener .hero-mist, .opener.right .hero-mist { position: absolute; left: 0; right: 0; top: 68px; bottom: auto; height: 100vw; z-index: 1; background: linear-gradient(180deg, rgba(255,252,247,0) 62%, var(--paper) 100%); }
  .opener .hero-copy, .opener.right .hero-copy, .opener.narrow .hero-copy { display: block; max-width: none; margin-left: 0; padding: 0 0 40px; }
  .opener h1, .opener.narrow h1 { font-size: clamp(38px, 11.5vw, 60px); }
  .opener .lede { font-size: clamp(19px, 1.5vw, 22px); margin-top: 16px; }
}

/* ---------- the series: twelve jackets ---------- */
.jackets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); }
.public-site .jacket { appearance: none; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: left; display: grid; gap: 12px; }
.public-site .jacket .face { position: relative; aspect-ratio: 1; background: var(--c, #F2BDB4); box-shadow: 0 12px 28px rgba(43,38,34,0.16), inset 0 0 0 1px rgba(0,0,0,0.06); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 8%; transition: transform .25s ease; }
.jacket:hover .face { transform: translateY(-6px); }
.public-site .jacket .face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.public-site .jacket .face .t { font-family: var(--font-head); font-weight: 800; font-size: clamp(18px, 2vw, 26px); line-height: 1.02; letter-spacing: -0.02em; color: var(--ink); }
.public-site .jacket .face .t small { display: block; font-weight: 600; font-size: .62em; letter-spacing: 0; margin-top: 6px; }
.public-site .jacket .face .n { position: absolute; top: 8%; left: 8%; font-family: var(--font-head); font-weight: 800; font-size: 14px; color: var(--ink); opacity: .7; }
.public-site .jacket .face .soon { position: absolute; top: 8%; right: 8%; font-size: 12px; font-weight: 800; color: var(--ink); background: rgba(255,255,255,.7); padding: 4px 8px; }
.public-site .jacket .face .out { position: absolute; top: 6%; left: 6%; font-size: 13px; font-weight: 800; color: #fff; background: var(--butterfly); padding: 6px 10px; box-shadow: 0 3px 0 var(--butterfly-deep); }
.public-site .jacket .cap { font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.jacket[aria-expanded="true"] .face { box-shadow: 0 0 0 4px var(--butterfly), 0 12px 28px rgba(43,38,34,0.2); }
.jacket-story { margin-top: clamp(24px, 3vw, 40px); padding: clamp(24px, 3vw, 40px) 0 0; border-top: 3px solid var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.jacket-story[hidden] { display: none; }
.jacket-story h3 { margin-bottom: 8px; }
.jacket-story p { max-width: var(--measure); }
@media (max-width: 900px) { .jackets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .jackets { grid-template-columns: repeat(2, minmax(0, 1fr)); } .jacket-story { grid-template-columns: 1fr; } }

/* ---------- modes list (The Modes page) ---------- */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.5vw, 32px) clamp(28px, 4vw, 56px); }
.tool { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; align-items: start; padding: 22px 0; border-top: 1px solid var(--rule); }
.tool i { width: 64px; aspect-ratio: 1; border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%; background: radial-gradient(circle at 36% 32%, rgba(255,255,255,0.7) 0 10%, rgba(255,255,255,0) 42%), var(--c); box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(43,38,34,0.14); }
.tool h3 { font-size: 22px; } .tool .learns { font-weight: 700; color: var(--ink-soft); font-size: 15px; margin: 2px 0 8px; }
.tool .how { font-family: var(--font-head); font-weight: 700; font-style: italic; font-size: 18px; letter-spacing: -0.01em; color: var(--butterfly); }
@media (max-width: 760px) { .tools { grid-template-columns: 1fr; } }

/* ---------- gallery of spreads ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; box-shadow: 0 14px 30px rgba(43,38,34,0.14); }
.gallery figcaption { margin-top: 12px; font-weight: 700; color: var(--ink-soft); font-size: 15px; }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- video ---------- */
.public-site .vwrap { position: relative; cursor: pointer; background: #000; box-shadow: 0 18px 40px rgba(43,38,34,0.18); }
.public-site .vwrap video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.public-site .vplay { position: absolute; right: 16px; bottom: 16px; width: 60px; height: 60px; border: 0; border-radius: 50%; background: var(--butterfly); color: #fff; font-size: 22px; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--butterfly-deep); z-index: 2; }
.public-site .vplay .ico-pause { display: none; } .public-site .vwrap.playing .vplay .ico-play { display: none; } .public-site .vwrap.playing .vplay .ico-pause { display: inline; }

/* ---------- polaroid (real Kai) ---------- */
.polaroid { box-sizing: border-box; margin: 0; background: #fff; padding: 16px 16px 48px; box-shadow: 0 18px 40px rgba(43,38,34,0.18), 0 0 0 1px var(--rule); width: min(100%, 420px); transform: rotate(-2.5deg); position: relative; }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid figcaption { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-weight: 700; color: var(--ink-soft); font-size: 15px; }

/* ---------- toast (mode activated) ---------- */
.public-site #toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; font-weight: 800; font-size: 16px; padding: 14px 20px; border-radius: 14px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 50; pointer-events: none; max-width: min(90vw, 560px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.public-site #toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reader (look inside): light, like a tabletop ---------- */
.public-site .reader { background: rgba(255,252,247,0.97); }
.public-site .reader-bar { color: var(--ink); font-family: var(--font-head); }
.public-site .reader-title { font-weight: 800; }
.public-site .reader-count { font-style: normal; font-weight: 700; opacity: .7; font-family: var(--font-text); }
.public-site .reader-close { background: var(--ink); color: #fff; box-shadow: 0 6px 16px rgba(43,38,34,.3); }
.public-site .reader-close:hover { background: var(--butterfly); }
.public-site .reader-nav { background: #fff; color: var(--ink); box-shadow: 0 0 0 2px var(--rule), 0 8px 20px rgba(43,38,34,.18); }
.public-site .reader-nav:hover { background: var(--butterfly); color: #fff; box-shadow: 0 8px 20px rgba(43,38,34,.18); }
.public-site .reader-buy { position: absolute; right: calc(70px + env(safe-area-inset-right, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 6; font-weight: 800; font-size: 15px; background: var(--butterfly); color: #fff; text-decoration: none; padding: 11px 16px; border-radius: 12px; box-shadow: 0 4px 0 var(--butterfly-deep); }
.public-site .rbook { box-shadow: 0 30px 70px rgba(43,38,34,0.25); }

/* ---------- footer: the last page ---------- */
.foot { position: relative; color: var(--ink); background: var(--foot-sky, #EFE0AE); }
.foot-top { padding: clamp(48px, 6vw, 80px) 0 clamp(36px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, .9fr)); gap: 32px; }
.foot-logo img { width: 150px; height: auto; }
.foot p { margin-top: 12px; font-weight: 700; max-width: 36ch; }
.foot small { display: block; margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); font-weight: 700; }
.foot h4 { font-family: var(--font-head); font-weight: 800; font-size: 15px; margin: 8px 0 12px; letter-spacing: .02em; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.public-site .foot a { color: var(--ink); text-decoration: none; font-weight: 700; }
.public-site .foot a:hover { color: var(--butterfly-deep); text-decoration: underline; }
.foot-art { position: relative; height: clamp(360px, 62vw, 900px); overflow: hidden; }
.foot-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.foot-art::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 70px; background: linear-gradient(180deg, var(--foot-sky, #EFE0AE), rgba(239,224,174,0)); z-index: 1; }
.foot-end { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 0 clamp(24px, 4vw, 48px); display: grid; gap: 6px; }
.foot-end .end { font-family: var(--font-head); font-weight: 800; font-size: clamp(28px, 4vw, 52px); letter-spacing: -0.02em; color: #fff; text-shadow: 0 2px 18px rgba(60,40,10,.5); }
.foot-end .line { color: #fff; font-weight: 800; text-shadow: 0 2px 14px rgba(60,40,10,.6); }
@media (max-width: 760px) { .foot-top { grid-template-columns: 1fr; gap: 22px; } .foot-art { height: 80vw; } }

/* ---------- sticky buy on phones (home only) ---------- */
.stickybuy { display: none; }
@media (max-width: 760px) {
  .stickybuy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; transform: translateY(110%); transition: transform .3s ease; align-items: center; justify-content: space-between; gap: 12px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255,252,247,0.96); backdrop-filter: blur(8px); box-shadow: 0 -1px 0 var(--rule), 0 -10px 30px rgba(43,38,34,.08); }
  .stickybuy.show { transform: none; }
  .stickybuy b { font-family: var(--font-head); font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
  .stickybuy .btn { padding: 12px 16px; font-size: 15px; }
  body.site-home .foot { padding-bottom: 80px; }
}
