@font-face { font-family: "Fredoka"; src: url("fonts/Fredoka-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("fonts/NunitoSans-Variable.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
	--ink: #17384d;
	--ink-soft: #55788d;
	--sky: #dcefff;
	--snow: #f7fbff;
	--ice: #bfe3f7;
	--accent: #2f7fc1;
	--gold: #e9b949;
	--card: #ffffff;
	--line: #d3e6f3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--snow);
	color: var(--ink);
	font: 17px/1.6 "Nunito Sans", system-ui, -apple-system, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.bar { position: absolute; top: 0; left: 0; right: 0; z-index: 30; }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.bar a.home { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: "Fredoka"; font-weight: 600; font-size: 20px; }
.bar a.home img { width: 36px; height: 36px; border-radius: 9px; }
.bar nav a { margin-left: 18px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.bar nav a:hover { color: var(--accent); }
.bar.solid { position: static; background: #fff; border-bottom: 1px solid var(--line); }

/* ============================== Home: full-screen panels that snap.
 * One panel holds the screen at a time, as on Apple's product pages; its
 * pieces arrive in turn when it takes over (.step, staggered). */
html.snap { scroll-snap-type: y mandatory; }
@media (prefers-reduced-motion: reduce) { html.snap { scroll-snap-type: y proximity; } }
.panel { position: relative; min-height: 100vh; min-height: 100svh; scroll-snap-align: start; scroll-snap-stop: always;
	display: flex; align-items: center; justify-content: center; padding: 72px 0 48px; overflow: hidden; }
.panel:nth-child(odd):not(.hero) { background: linear-gradient(180deg, #f7fbff, #eaf4fd); }
.panel:nth-child(even) { background: linear-gradient(180deg, #eef6fe, #f7fbff); }
.panel > .wrap { width: 100%; }

.step { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1); }
.panel.active .step { opacity: 1; transform: none; }
.panel.active .step:nth-child(2) { transition-delay: 0.08s; }
.panel.active .step:nth-child(3) { transition-delay: 0.16s; }
.panel.active .step:nth-child(4) { transition-delay: 0.24s; }
.panel.active .step:nth-child(5) { transition-delay: 0.32s; }
.panel.active .step:nth-child(6) { transition-delay: 0.40s; }
@media (prefers-reduced-motion: reduce) { .step { opacity: 1; transform: none; transition: none; } }

/* Hero: the painting fills the screen; Roly and the snow are drawn over it. */
.panel.hero { padding: 0; align-items: stretch; background: #cfe6fb; }
.scene { position: absolute; inset: 0; background: url("img/hero.jpg") 50% 70% / cover no-repeat; }
.scene canvas.live { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; }
.copy { position: absolute; left: 5%; top: 15%; width: min(40%, 600px); z-index: 3; pointer-events: none; }
.copy .badge, .copy a { pointer-events: auto; }
.copy .wordmark { width: 100%; max-width: 560px; filter: drop-shadow(0 6px 14px rgba(30, 80, 120, 0.18)); }
.copy p.tag { font-family: "Fredoka"; font-weight: 500; font-size: clamp(17px, 2.1vw, 28px); margin: 0.6em 0 1em; text-shadow: 0 1px 10px rgba(255,255,255,0.85); }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(23, 56, 77, 0.45); border-radius: 14px; z-index: 3; pointer-events: none; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: rgba(23, 56, 77, 0.6); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

.badge {
	display: inline-block;
	background: var(--ink); color: #fff; text-decoration: none;
	padding: 12px 22px; border-radius: 14px; font-weight: 800; font-size: clamp(13px, 1.3vw, 16px);
	box-shadow: 0 8px 22px rgba(23, 56, 77, 0.25);
}
.badge small { display: block; font-weight: 600; font-size: 12px; opacity: 0.8; }

/* Panel 2: the words, then Roly's stage. */
.center-stack { text-align: center; max-width: 760px; }
.center-stack h2 { font-size: clamp(30px, 4.6vw, 46px); }
.center-stack h3 { font-size: clamp(22px, 3vw, 30px); margin-top: 0.4em; }
.lead { color: var(--ink-soft); font-size: clamp(17px, 1.8vw, 20px); margin: 0 auto 1.4em; max-width: 640px; }
.mood-roly { display: block; width: min(250px, 56vw, 30vh); aspect-ratio: 1; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; border-radius: 50%; }
.mood-roly:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.mood-caption { font-family: "Fredoka"; font-weight: 600; font-size: 22px; color: var(--ink); margin: 4px 0 0; }
.mood-caption.show { animation: caption-in 0.35s cubic-bezier(.34,1.56,.64,1); }
@keyframes caption-in { from { opacity: 0; transform: translateY(8px) scale(0.92); } to { opacity: 1; transform: none; } }
.hint { text-align: center; color: var(--ink-soft); margin: 2px 0 0; font-size: 15px; }

/* Feature panels: one screenshot and its words. */
.feature { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: center; }
.feature img { border-radius: 18px; box-shadow: 0 18px 40px rgba(23, 56, 77, 0.18); border: 4px solid #fff; }
.feature h2 { font-size: clamp(28px, 3.6vw, 40px); }
.feature p { color: var(--ink-soft); margin: 0; font-size: clamp(16px, 1.6vw, 19px); }
@media (min-width: 820px) {
	.feature { grid-template-columns: 1.5fr 1fr; gap: 44px; }
	.feature.flip { grid-template-columns: 1fr 1.5fr; }
	.feature.flip img { order: 2; }
}

/* The last panel. */
.end-stage { width: min(200px, 44vw, 24vh); aspect-ratio: 1; margin: 0 auto 8px; }
.end footer { border: 0; padding: 30px 0 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }

/* Roly's own layer: over the whole window, never in the way of a click. */
.roly-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }

/* Text pages */
.page { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px clamp(20px, 4vw, 44px); margin: 36px auto 56px; max-width: 780px; }
.page h1 { font-size: clamp(30px, 5vw, 42px); }
.page h2 { font-size: 21px; margin-top: 1.6em; }
.page .meta { color: var(--ink-soft); }
.faq dt { font-weight: 800; margin-top: 1.2em; }
.faq dd { margin: 0.3em 0 0; color: var(--ink-soft); }
.contact { background: var(--sky); border-radius: 14px; padding: 18px 20px; margin-top: 28px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-soft); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }
footer nav a { margin-right: 18px; color: var(--ink-soft); }

/* Footer (text pages) */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-soft); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }
footer nav a { margin: 0 9px; color: var(--ink-soft); }

@media (max-width: 700px) {
	.bar nav a { margin-left: 12px; font-size: 14px; }
	.bar a.home span { display: none; }
	/* Phones: the words at the top over the sky, Roly on the snow below. */
	.scene { background-position: 60% 50%; }
	.copy { left: 0; right: 0; top: 76px; width: auto; padding: 0 22px; text-align: center; }
	.copy .wordmark { max-width: 320px; margin: 0 auto; }
	.copy p.tag { font-size: 18px; }
	.panel { padding: 70px 0 36px; }
}
