/* Japan Stamp Book — il sito. Colori e tipografia dal file Figma
   (kSJfohccVKQg9ND9mpgvzk, nodo 493:5320): Background #FDF8F2, 900 #171717,
   700 #595959, DM Sans e Gowun Batang Bold. */

@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gowun Batang";
  src: url("/assets/fonts/gowun-batang-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fdf8f2;
  --ink: #171717;
  --ink-2: #595959;
  --line: rgba(23, 23, 23, 0.1);
  --card: #f4ede4;
  --red: #c7303a;
  --blue: #24498a;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Gowun Batang", "Iowan Old Style", Georgia, serif;
  --jp: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/22px var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.stamp-jp { font-family: var(--jp); }

/* ---- Il marchio e il bottone ---------------------------------------- */

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 600; font-size: 18px; line-height: normal;
  text-decoration: none; color: #000;
}
.brand img { width: 36px; height: 36px; border-radius: 8px; }

.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 16px 32px; border-radius: 40px;
  background: #000; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 16px; line-height: 22px; white-space: nowrap;
}
.btn-download .apple { position: relative; width: 24px; height: 24px; }
.btn-download .apple img { position: absolute; inset: 4.17% 16.67% 16.67% 16.67%; width: 16px; height: 19px; }
.btn-download[aria-disabled="true"] { cursor: default; }
a.btn-download[href]:hover { background: #262626; }
.soon { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.soon[hidden] { display: none; }

/* ---- Hero ----------------------------------------------------------- */

.hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px 0;
  overflow-x: clip;
}
.hero-text {
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  width: 100%; max-width: 414px; text-align: center;
}
.hero-text .copy { display: flex; flex-direction: column; gap: 8px; width: 100%; color: #000; }
.hero h1 { margin: 0; font: 700 32px/normal var(--serif); text-wrap: balance; }
.hero .lead { margin: 0; font-size: 16px; line-height: 22px; }
.cta { display: flex; flex-direction: column; align-items: center; }

/* ---- Il libro --------------------------------------------------------
   Misure del nodo a 1x (un px del disegno = 1 --u). Il libro è 614 × 420:
   copertina posteriore, dorso da 20, copertina; sopra la pagina sinistra a
   10 dal bordo e la destra, con cinque fogli dietro che sporgono di un
   pixel l'uno. Il timbro di legno, 280, a destra: il suo centro è 766 dal
   bordo sinistro del libro e 85 sotto il bordo alto. */

.stage {
  --u: min(1px, calc((100vw - 32px) / 1200));
  --rest-x: 626;
  --rest-y: -55;
  position: relative;
  width: calc(614 * var(--u));
  height: calc(420 * var(--u));
  margin: 150px auto 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.stage:focus-visible { outline-offset: 12px; border-radius: 20px; }

@media (max-width: 760px) {
  .stage {
    --u: min(1px, calc((100vw - 32px) / 620));
    --rest-x: 300;
    --rest-y: -250;
    margin-top: calc(250 * var(--u) + 40px);
  }
}

.book {
  position: absolute; inset: 0;
  perspective: calc(2200 * var(--u));
}

.cover {
  position: absolute; top: 0; height: calc(420 * var(--u));
  background: #202020;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.5);
}
.cover-back { left: 0; width: calc(297 * var(--u)); border-radius: calc(16 * var(--u)) 0 0 calc(16 * var(--u)); }
.spine { left: calc(297 * var(--u)); width: calc(20 * var(--u)); border-radius: 0; }
.cover-front { left: calc(317 * var(--u)); width: calc(297 * var(--u)); border-radius: 0 calc(16 * var(--u)) calc(16 * var(--u)) 0; }

.sheets { position: absolute; top: 0; left: calc(308 * var(--u)); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25)); }
.sheets span {
  position: absolute; top: 0;
  width: calc(297 * var(--u)); height: calc(420 * var(--u));
  background: #ddd url("/assets/figma/page-shade.png") no-repeat left top / calc(8 * var(--u)) 100%;
  border-right: 0.5px solid rgba(0, 0, 0, 0.25);
  border-radius: 0 calc(16 * var(--u)) calc(16 * var(--u)) 0;
}
.sheets span:nth-child(1) { left: 0; z-index: 5; }
.sheets span:nth-child(2) { left: calc(1 * var(--u)); z-index: 4; }
.sheets span:nth-child(3) { left: calc(2 * var(--u)); z-index: 3; }
.sheets span:nth-child(4) { left: calc(3 * var(--u)); z-index: 2; }
.sheets span:nth-child(5) { left: calc(4 * var(--u)); z-index: 1; }

/* pagina sx: l'SVG del nodo, 313 × 436, con l'ombra dentro. */
.page-left {
  position: absolute;
  left: calc(2 * var(--u)); top: calc(-4 * var(--u));
  width: calc(313 * var(--u)); height: calc(436 * var(--u));
  max-width: none;
}

.page {
  position: absolute; top: 0; left: calc(307 * var(--u));
  width: calc(297 * var(--u)); height: calc(420 * var(--u));
  background: #fff;
  border-right: 0.5px solid rgba(0, 0, 0, 0.25);
  border-radius: 0 calc(16 * var(--u)) calc(16 * var(--u)) 0;
  overflow: hidden;
}
.page .shade {
  position: absolute; left: 0; top: 0; width: calc(8 * var(--u)); height: 100%;
  opacity: 0.25;
  background: url("/assets/figma/page-shade.png") no-repeat 0 0 / 100% 100%;
}
.page .stitch {
  position: absolute; left: 0; width: 1px; height: calc(55 * var(--u));
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0 1px 1px 0;
  background: linear-gradient(180deg, #d2d2d2 0%, #fff 20%, #fff 80%, #d2d2d2 100%);
}
.page .stitch:nth-of-type(2) { top: calc(40 * var(--u)); }
.page .stitch:nth-of-type(3) { top: calc(135 * var(--u)); }
.page .stitch:nth-of-type(4) { top: calc(230 * var(--u)); }
.page .stitch:nth-of-type(5) { top: calc(325 * var(--u)); }

.imprint {
  position: absolute;
  left: calc(50% + 0.75 * var(--u)); top: 50%;
  width: calc(250 * var(--u)); height: calc(250 * var(--u));
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  opacity: 0.92;
}
.imprint.red { color: var(--red); }
.imprint.blue { color: var(--blue); }
.imprint[hidden] { display: none; }

/* Il foglio che gira: davanti la pagina destra, dietro il retro bianco
   sporco della pagina sinistra. Lo crea book.js e lo toglie a fine giro. */
.turning {
  position: absolute; top: 0; left: calc(307 * var(--u));
  width: calc(297 * var(--u)); height: calc(420 * var(--u));
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 3;
}
.turning .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.turning .front { left: 0; }
.turning .front .page { left: 0; }
.turning .back {
  background: #f2f1f1;
  border-radius: calc(16 * var(--u)) 0 0 calc(16 * var(--u));
  transform: rotateY(180deg);
}
.turning .tint { position: absolute; inset: 0; background: #000; opacity: 0; border-radius: inherit; pointer-events: none; }
.turning .front .tint { border-radius: 0 calc(16 * var(--u)) calc(16 * var(--u)) 0; }

/* Il timbro di legno, visto dall'alto. */
.prop {
  position: absolute; z-index: 4;
  left: calc(var(--rest-x) * var(--u)); top: calc(var(--rest-y) * var(--u));
  width: calc(280 * var(--u)); height: calc(280 * var(--u));
  will-change: transform;
}
.prop img { position: absolute; inset: 0; width: 100%; height: 100%; }
.prop-shadow {
  position: absolute; inset: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(60, 35, 10, 0.32), rgba(60, 35, 10, 0) 100%);
  transform: translate(4%, 7%) scale(1.04);
  opacity: 0;
}
.stage-hint {
  margin: 36px 0 0; text-align: center;
  font-size: 14px; line-height: 20px; color: var(--ink-2);
}

/* ---- Le sezioni ----------------------------------------------------- */

main { display: block; }

.features { max-width: 1040px; margin: 0 auto; padding: 120px 16px 40px; }

.feature {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 480px);
  justify-content: center; align-items: center; gap: 96px;
  padding: 56px 0;
}
.feature:nth-child(even) { grid-template-columns: minmax(0, 480px) minmax(0, 300px); }
.feature:nth-child(even) .phone { order: 2; }

.eyebrow {
  margin: 0 0 12px; font-weight: 600; font-size: 13px; line-height: 16px;
  letter-spacing: 0.08em; text-transform: uppercase; color: #9e2b2b;
}
.feature h2, .faq h2, .closing h2 { margin: 0 0 16px; font: 700 32px/1.25 var(--serif); }
.feature p { margin: 0 0 14px; font-size: 18px; line-height: 28px; color: #3d3d3d; }
.feature p:last-child { margin-bottom: 0; }

.phone {
  width: 100%; max-width: 300px; margin: 0 auto;
  padding: 9px; border-radius: 46px;
  background: #171717;
  box-shadow: 0 30px 60px -24px rgba(40, 25, 10, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.phone img { width: 100%; height: auto; border-radius: 37px; background: #eee; }

@media (max-width: 760px) {
  .features { padding-top: 72px; }
  .feature, .feature:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 0; }
  .feature:nth-child(even) .phone { order: 0; }
  .feature .phone { max-width: 250px; }
  .feature h2, .faq h2, .closing h2 { font-size: 28px; }
  .feature p { font-size: 17px; line-height: 26px; }
}

/* La notifica d'esempio della sezione Pro: testo vero, non un'immagine. */
.notice {
  display: flex; align-items: center; gap: 12px;
  max-width: 360px; margin: 4px 0 18px; padding: 12px 14px;
  border-radius: 20px; background: #fff;
  box-shadow: 0 10px 30px -12px rgba(40, 25, 10, 0.3), 0 1px 3px rgba(0, 0, 0, 0.08);
}
.notice img { flex: none; width: 36px; height: 36px; border-radius: 9px; }
.feature .notice p { margin: 0; font-size: 15px; line-height: 20px; }
.feature .notice .notice-title { font-weight: 600; color: var(--ink); }

/* ---- Le altre cose, in quattro righe ---------------------------------- */

.extras {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  max-width: 1040px; margin: 0 auto; padding: 32px 16px 40px;
}
.extras h3 { margin: 0 0 8px; font: 700 20px/1.3 var(--serif); }
.extras p { margin: 0; font-size: 16px; line-height: 25px; color: #3d3d3d; }
.extras .langs span { white-space: nowrap; }
@media (max-width: 900px) { .extras { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .extras { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* ---- FAQ ------------------------------------------------------------ */

.faq { max-width: 720px; margin: 0 auto; padding: 56px 16px 32px; }
.faq h2 { text-align: center; margin-bottom: 32px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 18px; line-height: 24px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(3px) rotate(225deg); }
.faq details p { margin: 0 0 20px; font-size: 16px; line-height: 26px; color: #3d3d3d; }

.closing { text-align: center; padding: 72px 16px 24px; }
.closing p { margin: 0 auto 28px; max-width: 460px; font-size: 18px; line-height: 28px; color: #3d3d3d; }

/* ---- Pagine di testo ------------------------------------------------ */

.site-header { display: flex; justify-content: center; padding: 32px 16px 0; }

.doc { max-width: 680px; margin: 0 auto; padding: 56px 16px 32px; }
.doc h1 { margin: 0 0 8px; font: 700 36px/1.2 var(--serif); }
.doc .updated { margin: 0 0 40px; font-size: 14px; color: var(--ink-2); }
.doc h2 { margin: 40px 0 12px; font: 700 22px/1.3 var(--serif); }
.doc h3 { margin: 24px 0 8px; font-weight: 600; font-size: 17px; line-height: 24px; }
.doc p, .doc li { font-size: 16px; line-height: 26px; color: #2e2e2e; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc .note {
  padding: 16px 20px; border-radius: 16px; background: var(--card);
  font-size: 15px; line-height: 24px;
}
.doc .placeholder { background: #fff3c4; padding: 0 4px; border-radius: 4px; }
.doc .feature-credit {
  margin: 0 0 32px; padding: 28px; border-radius: 24px; background: var(--card);
}
.doc .feature-credit h2 { margin-top: 0; }
.doc .feature-credit .big-link { font-weight: 600; font-size: 18px; }
@media (max-width: 760px) { .doc h1 { font-size: 30px; } }

/* ---- Footer: crediti brevi e i quattro link ------------------------- */

.site-footer {
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  max-width: 609px; margin: 0 auto; padding: 72px 16px 48px; text-align: center;
}
.site-footer .credits { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.site-footer nav ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px;
  margin: 0; padding: 0; list-style: none;
  font-weight: 500; font-size: 14px; line-height: 20px; color: var(--ink);
}
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover, .site-footer .credits a:hover { text-decoration: underline; }
.site-footer .copyright { margin: -16px 0 0; font-size: 12px; color: var(--ink-2); }
