@font-face { font-family: Poppins; font-weight: 300; font-display: swap; src: url(/assets/fonts/Poppins-Light.ttf) format('truetype'); }
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(/assets/fonts/Poppins-Regular.ttf) format('truetype'); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(/assets/fonts/Poppins-Medium.ttf) format('truetype'); }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(/assets/fonts/Poppins-Bold.ttf) format('truetype'); }
:root {
  --night: #17213a; --deep: #0f1628; --paper: #f2f4f8; --white: #ffffff; --stone: #f9c74f; --coral: #f3722c; --teal: #43aa8b; --slate: #577590;
  --ink: #1a1f2e; --muted: #5d6680; --line: #d9dee9; --on-night: #e8ecf5; --on-night-muted: #aab3c8;
  --step--1: .875rem; --step-0: 1.0625rem; --step-1: 1.33rem; --step-2: 1.66rem; --step-3: 2.07rem; --step-4: clamp(2.3rem, 5vw, 3.6rem);
  --wrap: 1120px; --r-s: 10px; --r-m: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font: 400 var(--step-0)/1.6 Poppins, system-ui, sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img, video, canvas { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--stone); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--stone); color: var(--night); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: var(--step-4); font-weight: 700; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0 0 1em; max-width: 64ch; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(23, 33, 58, .94); backdrop-filter: blur(8px); color: var(--on-night); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-weight: 700; letter-spacing: .08em; text-decoration: none; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.brand svg { width: 22px; height: 22px; }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: var(--step--1); }
.top nav a { text-decoration: none; opacity: .85; }
.top nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.lang { font-size: var(--step--1); display: flex; gap: 4px; }
.lang a, .lang span { padding: 4px 8px; border-radius: 6px; text-decoration: none; }
.lang span { background: rgba(255, 255, 255, .14); font-weight: 600; }
@media (max-width: 820px) { .top nav { display: none; } .lang { margin-left: auto; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font: inherit; font-weight: 600; line-height: 1.2; }
.btn-main { background: var(--stone); color: var(--night); }
.btn-main:hover { background: #ffd66e; }
.btn-line { border-color: currentColor; background: transparent; }
.btn-line:hover { background: rgba(255, 255, 255, .08); }
.on-paper .btn-line:hover { background: rgba(23, 33, 58, .06); }
.btn-small { padding: 9px 16px; font-size: var(--step--1); }

/* hero */
.hero { position: relative; background: linear-gradient(180deg, #1b2747 0%, var(--deep) 100%); color: var(--on-night); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 210px; }
.hero h1 { color: var(--white); }
.hero .lead { font-size: var(--step-1); line-height: 1.55; color: var(--on-night); font-weight: 300; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 22px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--on-night-muted); font-size: var(--step--1); }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts li::before { content: ''; width: 10px; height: 10px; background: var(--stone); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.book { position: relative; justify-self: center; width: min(420px, 100%); aspect-ratio: 1; transform: rotate(-3deg); }
.book img { width: 100%; height: 100%; border-radius: 4px; box-shadow: -14px 18px 0 -6px #0b1120, 0 30px 60px rgba(0, 0, 0, .45); }
.book::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 18px; background: linear-gradient(90deg, rgba(0, 0, 0, .3), transparent); border-radius: 4px 0 0 4px; }
#pile { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 190px; cursor: pointer; }
.pile-hint { position: absolute; right: 24px; bottom: 168px; font-size: .75rem; color: var(--on-night-muted); pointer-events: none; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 180px; } .book { width: min(320px, 80%); } }

/* sections */
section { padding: 88px 0; }
.on-night { background: var(--night); color: var(--on-night); }
.on-night h2 { color: var(--white); }
.on-paper { background: var(--paper); }
.on-white { background: var(--white); }
.intro { max-width: 60ch; margin-bottom: 36px; color: var(--muted); }
.on-night .intro { color: var(--on-night-muted); }

/* trailer */
.film { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; }
.film video { width: 100%; aspect-ratio: 16/9; border-radius: var(--r-m); background: #0b1120; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
@media (max-width: 860px) { .film { grid-template-columns: 1fr; } }

/* try it */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.canvas-frame { background: var(--white); border-radius: var(--r-m); box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(23, 33, 58, .10); padding: 14px; }
#paint { width: 100%; aspect-ratio: 1; cursor: crosshair; touch-action: manipulation; }
.tools h3 { font-size: var(--step-0); margin: 0 0 10px; }
.motifs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.motifs button { aspect-ratio: 1; border: 2px solid var(--line); border-radius: var(--r-s); background: var(--white); padding: 4px; cursor: pointer; }
.motifs button[aria-pressed=true] { border-color: var(--night); }
.motifs canvas { width: 100%; height: 100%; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 24px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button[aria-pressed=true] { box-shadow: 0 0 0 3px var(--night); }
.swatches .erase { background: conic-gradient(#fff 0 25%, #e3e7ef 0 50%, #fff 0 75%, #e3e7ef 0) 0 0 / 12px 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.note { font-size: var(--step--1); color: var(--muted); }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } }

/* levels */
.levels { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.levels img { border-radius: var(--r-m); box-shadow: 0 18px 40px rgba(23, 33, 58, .14); }
.levels dl { margin: 0; }
.levels dt { font-weight: 700; font-size: var(--step-1); display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.levels dt::before { content: ''; width: 18px; height: 18px; flex: none; background: var(--sw, var(--stone)); border: 2px solid var(--night); }
.levels dt.l-stone::before { --sw: var(--teal); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); border: 0; }
.levels dt.l-core::before { --sw: var(--coral); border-radius: 50%; border: 0; }
.levels dt.l-grout::before { --sw: #f8d6a8; border-radius: 3px; border: 0; }
.levels dd { margin: 4px 0 0 30px; color: var(--muted); }
@media (max-width: 860px) { .levels { grid-template-columns: 1fr; } }

/* styles */
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.styles .canvas-frame { max-width: 520px; }
#style-canvas { width: 100%; aspect-ratio: 1; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 4px; margin: 10px 0 18px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--on-night); font: inherit; font-size: var(--step--1); padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--stone); color: var(--night); font-weight: 600; }
#style-text { min-height: 3.2em; color: var(--on-night-muted); }
@media (max-width: 860px) { .styles { grid-template-columns: 1fr; } }

/* inside the book */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 28%); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 22px; }
.strip button { scroll-snap-align: start; border: 0; padding: 0; background: var(--white); cursor: zoom-in; box-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(23, 33, 58, .10); }
.strip figcaption { font-size: var(--step--1); color: var(--muted); padding: 8px 2px 0; text-align: left; background: var(--paper); }
dialog.zoom { border: 0; padding: 0; background: transparent; max-width: min(92vw, 860px); }
dialog.zoom::backdrop { background: rgba(15, 22, 40, .82); }
dialog.zoom img { width: 100%; background: #fff; }
dialog.zoom form { text-align: right; margin-top: 10px; }

/* chapters */
.chapters { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.chapters li { display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: center; padding: 20px 18px 20px 0; border-bottom: 1px solid var(--line); }
.chapters canvas { width: 76px; height: 76px; }
.chapters b { display: block; }
.chapters span { font-size: var(--step--1); color: var(--muted); }
@media (max-width: 900px) { .chapters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .chapters { grid-template-columns: 1fr; } }

/* who / free page */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.free { background: var(--night); color: var(--on-night); border-radius: var(--r-m); padding: 34px; display: grid; grid-template-columns: 140px 1fr; gap: 26px; align-items: center; }
.free img { background: #fff; border-radius: 4px; transform: rotate(-3deg); }
.free h3 { color: var(--white); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .free { grid-template-columns: 1fr; } .free img { width: 140px; } }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; max-width: 780px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: var(--step-0); list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::after { content: '+'; font-weight: 300; font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* footer */
footer { background: var(--deep); color: var(--on-night-muted); padding: 44px 0 56px; font-size: var(--step--1); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { color: var(--on-night); }
.studio-mark { font-weight: 600; color: var(--white); text-decoration: none; }

/* forms & simple pages */
.page { padding: 64px 0 88px; }
.page h1 { font-size: var(--step-3); }
.form { max-width: 640px; display: grid; gap: 18px; }
.form label { font-weight: 600; display: grid; gap: 6px; font-size: var(--step--1); }
.form small { font-weight: 400; color: var(--muted); }
.form input[type=text], .form input[type=email], .form select, .form textarea { font: inherit; padding: 12px 14px; border: 1px solid #c3cada; border-radius: var(--r-s); background: #fff; color: var(--ink); }
.form textarea { min-height: 150px; resize: vertical; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 5px; width: 18px; height: 18px; }
.hp { position: absolute; left: -5000px; }
.status { padding: 14px 16px; border-radius: var(--r-s); display: none; }
.status.ok { display: block; background: #e4f4ee; color: #1c5c47; }
.status.err { display: block; background: #fde8e4; color: #8a2f1c; }
.legal { max-width: 760px; }
.legal h2 { font-size: var(--step-1); margin-top: 1.8em; }
.gift-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 26px 0 30px; }
.gift-grid figure { margin: 0; background: #fff; border-radius: var(--r-s); padding: 8px; box-shadow: 0 1px 0 var(--line); }
.gift-grid figcaption { font-size: .8rem; text-align: center; color: var(--muted); }
@media (max-width: 700px) { .gift-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .pile-hint { display: none; } }
