@import url("tokens.css");

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--sol-night) var(--sol-day); accent-color: var(--sol-night); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; position: relative; overflow-x: clip;
  background: var(--sol-night); color: var(--sol-text);
  font-family: var(--font-body); font-size: clamp(17px, 1.05rem + .2vw, 20px); line-height: 1.6;
  caret-color: var(--sol-night);
}
::selection { background: var(--sol-sun); color: var(--sol-night); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sol-night); outline-offset: 3px; border-radius: 6px; }
.band-night :focus-visible, .promise-band :focus-visible, .foot :focus-visible { outline-color: var(--sol-sun); }
.band-night form :focus-visible { outline-color: var(--sol-night); }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; position: relative; z-index: 2; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.03em; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); margin-bottom: .6em; }
h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); }
p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--sol-sun); color: var(--sol-night); padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem;
  text-decoration: none; cursor: pointer; border: 4px solid var(--sol-night); border-radius: 999px; padding: 14px 30px;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1);
}
.btn-sun { background: var(--sol-sun); color: var(--sol-night); }
.btn:hover { background: #F8D466; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Sun path (signature) ---------- */
.sunpath { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.sunpath-line { fill: none; stroke: var(--sol-sun); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 12; }
.sunpath-sun { fill: var(--sol-sun); stroke: var(--sol-night); stroke-width: 4; }
.sunpath-moon { fill: var(--sol-bg); stroke: var(--sol-night); stroke-width: 3; opacity: 0; }
.sunpath.is-night .sunpath-sun { opacity: 0; }
.sunpath.is-night .sunpath-moon { opacity: 1; }
.sunpath-sun, .sunpath-moon { transition: opacity .6s ease-out; }

/* ---------- Cover ---------- */
.cover { background: var(--sol-day); position: relative; padding-bottom: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-heading); font-weight: 800; font-size: 1.35rem; text-decoration: none; }
.brand img { border-radius: 12px; }
.topnav { display: flex; gap: 22px; font-weight: 700; font-size: 1rem; flex-wrap: wrap; }
.topnav a { text-decoration: none; padding: 6px 2px; text-decoration-thickness: 3px; text-underline-offset: .35em; }
.topnav a:hover { text-decoration-line: underline; }
.topnav a.lang:hover { text-decoration-line: none; background: rgb(31 42 77 / .08); }
.topnav .lang { border: 3px solid var(--sol-night); border-radius: 999px; padding: 4px 14px; }
.cover-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(24px, 4vw, 56px) clamp(40px, 6vw, 80px); }
.book-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(3.4rem, 2rem + 6vw, 6rem); line-height: .95; letter-spacing: -.035em; margin: 0 0 36px; color: var(--sol-night); }
.book-title span { display: block; font-family: var(--font-heading); font-weight: 700; font-size: .36em; letter-spacing: 0; margin-top: .3em; color: var(--sol-night); }
.cover h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); margin-bottom: .5em; max-width: 20ch; }
.subhead { font-size: 1.1em; }
.also { font-size: .95em; padding-left: 16px; border-left: 1px solid rgb(31 42 77 / .5); }
.cover-actions { margin-top: 26px; }
.cover-plate { position: relative; }
.plate-art { width: 100%; height: auto; }
.plate-word, .plate-caption, .plate-tag { font-family: var(--font-heading); font-weight: 800; fill: var(--sol-night); }
.plate-tag { fill: var(--sol-bg); font-size: 18px; }
.plate-caption { font-size: 26px; fill: var(--sol-night); }
.cover .seal { position: absolute; width: clamp(110px, 16vw, 168px); right: -12px; top: -28px; transform: rotate(12deg); }
.seal-ring { font-family: var(--font-heading); font-weight: 800; fill: var(--sol-night); }
.promise-band .wrap { display: block; }
.promise-band { margin: 0; background: var(--sol-night); color: var(--sol-bg); font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.1rem, .9rem + .9vw, 1.6rem); padding-block: 18px; max-width: none; text-align: center; position: relative; z-index: 2; }

/* ---------- Bands (one sky color each) ---------- */
.band { position: relative; padding-block: clamp(56px, 7vw, 104px); }
.band-paper + .band-paper { padding-top: 0; }
.band-paper + .band-paper > .wrap:first-child { border-top: 1px solid rgb(31 42 77 / .25); padding-top: clamp(56px, 7vw, 104px); }
.band-sun { background: var(--sol-sun); }
.band-dawn { background: var(--sol-dawn); }
.band-paper { background: var(--sol-bg); }
.band-dusk { background: var(--sol-dusk); }
.band-night { background: var(--sol-night); color: var(--sol-text-on-night); }
.band-night a { color: var(--sol-sun); }
.band-night form a { color: var(--sol-night); }

/* Pillars: three ruled columns, like the premium list */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.pillar { border-top: 3px solid var(--sol-night); padding-top: 20px; }
.pillar h3 { font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); margin: 18px 0 .4em; }

.pillar-pict { width: 72px; height: 72px; }
.pillar img.pillar-pict { margin-top: calc(clamp(96px, 10vw, 120px) - 72px); }
.pillar-crop { height: clamp(96px, 10vw, 120px); width: auto; max-width: 100%; border-radius: 16px; border: 4px solid var(--sol-night); }

/* How it works */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px clamp(24px, 4vw, 56px); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; font-size: 1.05em; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--sol-night); background: var(--sol-bg); font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; }
/* Three devices on one dawn-colored stage: the tablet in the middle, a phone at each front corner */
.devices { position: relative; margin: clamp(48px, 6vw, 80px) 0 0; background: var(--sol-dawn); border-radius: 40px; padding: clamp(28px, 4vw, 56px) 19% clamp(56px, 7vw, 96px); }
.dev { position: relative; background: var(--sol-night); overflow: hidden; }
.dev img { display: block; width: 100%; height: auto; }
.dev-ipad { border: 14px solid var(--sol-night); border-radius: 34px; }
.dev-iphone, .dev-android { position: absolute; bottom: clamp(40px, 5vw, 64px); width: 17%; }
.dev-iphone { left: 6%; border: 8px solid var(--sol-night); border-radius: 30px; }
.dev-android { right: 6%; border: 7px solid var(--sol-night); border-radius: 22px; }
.dev-iphone::before { content: ""; position: absolute; z-index: 1; top: 1.6%; left: 50%; translate: -50% 0; width: 32%; height: 2.4%; background: var(--sol-night); border-radius: 999px; }
.dev-android::before { content: ""; position: absolute; z-index: 1; top: 1.4%; left: 50%; translate: -50% 0; width: 6%; aspect-ratio: 1; background: var(--sol-night); border-radius: 50%; }
.devices figcaption { position: absolute; left: 0; right: 0; bottom: clamp(14px, 2vw, 24px); text-align: center; font-size: .95rem; font-weight: 700; padding-inline: 24px; }
.free { margin-top: clamp(56px, 7vw, 96px); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; }
.checklist li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.check-star { width: 30px; height: 30px; margin-top: 1px; }

/* Potty */
.lead { font-size: 1.15em; }
.potty-steps { list-style: none; padding: 0; margin: 8px 0 36px; display: flex; flex-wrap: wrap; gap: 0; align-items: center; }
.potty-steps li { display: flex; align-items: center; }
.potty-steps li + li::before { content: ""; width: clamp(14px, 3vw, 40px); height: 4px; background: var(--sol-night); border-radius: 2px; margin-inline: 6px; }
.potty-pict { width: clamp(64px, 9vw, 104px); height: auto; background: var(--sol-bg); border: 4px solid var(--sol-night); border-radius: 22px; padding: 10px; }
.potty ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; }
.potty ul li { border-top: 1px solid rgb(31 42 77 / .3); padding-top: 10px; }
.potty > p:last-child { font-weight: 700; margin-top: 1.2em; }

/* Premium */
.premium-list { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; }
.premium-list li { padding-top: 14px; border-top: 3px solid var(--sol-night); }
.note { font-weight: 700; }

/* Night: story, pros, faq */
.story { text-align: center; display: grid; justify-items: center; }
.story-moon { width: 96px; height: 96px; margin-bottom: 16px; }
.story-text { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.05rem + 1.2vw, 2rem); line-height: 1.35; max-width: 34ch; }
.pros, .faq { margin-top: clamp(56px, 7vw, 96px); max-width: 860px; }
.pros h2, .faq h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); }
details { border-top: 1px solid rgb(255 248 238 / .3); padding-block: 6px; }
details:last-of-type { border-bottom: 1px solid rgb(255 248 238 / .3); }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 14px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 22px; height: 22px; background: var(--sol-sun); -webkit-mask: url("/assets/plus.svg") center / contain no-repeat; mask: url("/assets/plus.svg") center / contain no-repeat; }
details[open] summary::after { -webkit-mask-image: url("/assets/minus.svg"); mask-image: url("/assets/minus.svg"); }
summary h3 { font-size: 1.2rem; }

/* Back cover form */
.back-cover { padding-top: 0; }
.back-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; border-top: 1px solid rgb(255 248 238 / .3); padding-top: clamp(56px, 7vw, 96px); }
.back-grid .seal { width: clamp(150px, 20vw, 240px); transform: rotate(-8deg); }
form { background: var(--sol-bg); color: var(--sol-text); border: 6px solid var(--sol-sun); border-radius: 28px; padding: clamp(22px, 4vw, 40px); max-width: 620px; }
form h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); margin-bottom: .3em; }
.promise-small { font-weight: 700; }
form label { display: block; font-weight: 700; margin-bottom: 8px; }
input[type=email] { width: 100%; font: inherit; padding: 14px 16px; border: 4px solid var(--sol-night); border-radius: 16px; background: #fff; color: var(--sol-night); }
input[type=email]::placeholder { color: #5b6585; }
.check { display: grid !important; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin: 16px 0 20px; font-weight: 400 !important; }
.check input { width: 24px; height: 24px; margin-top: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { margin: 14px 0 0; font-weight: 700; min-height: 1.6em; }
.fine { font-size: .9rem; margin-top: 10px; }
form a { color: var(--sol-night); }

/* Footer */
.foot { background: var(--sol-night); color: var(--sol-text-on-night); padding-block: 28px 40px; border-top: 1px solid rgb(255 248 238 / .2); }
.foot-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; font-size: .95rem; }
.foot-row img { margin-right: auto; }

/* Simple pages (thanks, privacy, support) */
.simple { background: var(--sol-day); min-height: 100vh; }
.simple main { padding-block: 32px 80px; }
.simple .card { background: var(--sol-bg); border: 4px solid var(--sol-night); border-radius: 28px; padding: clamp(22px, 4vw, 44px); max-width: 780px; }
.simple h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); margin-bottom: .5em; }
.simple h2 { font-size: 1.4rem; margin: 1.4em 0 .4em; }

/* One printed line weight for every drawing */
.plate-art [stroke], .seal [stroke] { vector-effect: non-scaling-stroke; stroke-width: 4px; }
.plate-art .plate-frame { stroke-width: 6px; }
.seal .fine-line { stroke-width: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cover-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .devices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 6%; padding: 24px 8% 20px; }
  .dev-ipad { grid-column: 1 / -1; border-width: 9px; border-radius: 22px; }
  .dev-iphone, .dev-android { position: relative; left: auto; right: auto; bottom: auto; width: auto; }
  .devices figcaption { position: static; grid-column: 1 / -1; padding: 0; }
  .cover .seal { right: 4px; top: -18px; }
  .pillars, .potty ul { grid-template-columns: 1fr; }
  .checklist, .premium-list { grid-template-columns: 1fr; }
  .back-grid { grid-template-columns: 1fr; justify-items: center; }
  .topnav a:not(.lang) { display: none; }
}
@media (max-width: 600px) {
  .potty-steps { flex-wrap: nowrap; }
  .potty-pict { width: 52px; border-radius: 14px; padding: 5px; }
  .potty-steps li + li::before { width: 12px; margin-inline: 3px; }
  .cover .seal { width: 124px; right: -6px; top: -64px; }
}
