/* Picture Crosswords For Kids — shared styles.
   The palette is lifted straight from the app's Theme.swift so the site and the
   game read as the same thing. Nunito at 800/600 is what the app ships, too. */

:root {
	--ink: #2B1A4D;
	--ink-soft: #6B5B96;
	--cream: #FFF4DC;
	--sun: #FFCC1F;
	--sun-deep: #E09B00;
	--coral: #FF4F6E;
	--grass: #66DA46;
	--grass-deep: #3EAE22;
	--teal: #18DBC6;
	--grape: #A95BF7;
	--grape-deep: #7A2CD1;
	--sky: #2B7FF0;
	--sky-deep: #1547A8;
	--outline: 3px;
	--radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: Nunito, ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
	font-weight: 600;
	font-size: 18px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--cream);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 800; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--sky-deep); text-underline-offset: 3px; }
a:hover { color: var(--coral); }

.wrap { width: min(1060px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }

/* ---- Sky, as on every screen in the game ---- */

.sky {
	background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
	color: #fff;
	padding: 3.5rem 0 4rem;
	position: relative;
	overflow: hidden;
}
.sky::after {
	/* The faint grid of crossword cells drifting behind everything. */
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,.07) 2px, transparent 2px),
		linear-gradient(90deg, rgba(255,255,255,.07) 2px, transparent 2px);
	background-size: 72px 72px;
	pointer-events: none;
}
.sky > * { position: relative; z-index: 1; }

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

.hero { text-align: center; }
.hero img.icon {
	width: 132px; height: 132px;
	border-radius: 29.5px;               /* 22.37% of the side, Apple's own mask */
	border: var(--outline) solid var(--ink);
	display: block; margin: 0 auto 1.6rem;
}
.hero h1 {
	color: #fff;
	text-shadow: -3px 0 var(--ink), 3px 0 var(--ink), 0 -3px var(--ink), 0 3px var(--ink),
	             2px 2px var(--ink), -2px 2px var(--ink), 2px -2px var(--ink), -2px -2px var(--ink);
	letter-spacing: .01em;
}
.hero .tagline {
	font-size: clamp(1.05rem, 2.6vw, 1.3rem);
	max-width: 34ch;
	margin: .2rem auto 1.8rem;
	color: rgba(255,255,255,.92);
}
/* Apple's badge, drawn at its own aspect ratio and never restyled — no border,
   no shadow, no rounded corners of ours. The margin is the clear space their
   guidelines ask for, which is a tenth of the badge height on every side. */
.appstore { display: inline-block; margin: 1.4rem 0 1.6rem; line-height: 0; }
.appstore img { height: 56px; width: auto; display: block; }
.appstore:hover { opacity: .88; }

.badges { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.pill {
	display: inline-block;
	background: rgba(255,255,255,.16);
	border: 2px solid rgba(255,255,255,.4);
	border-radius: 999px;
	padding: .35rem 1rem;
	font-size: .95rem;
}

/* ---- Buttons ---- */

.btn {
	display: inline-block;
	font-weight: 800;
	font-size: 1.05rem;
	text-decoration: none;
	color: var(--ink);
	background: var(--sun);
	border: var(--outline) solid var(--ink);
	border-radius: 18px;
	padding: .8rem 1.6rem;
	box-shadow: 0 5px 0 var(--ink);
	transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { color: var(--ink); transform: translateY(2px); box-shadow: 0 3px 0 var(--ink); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.btn.green { background: var(--grass); }

/* ---- Screenshot slider ---- */

.shots { padding: 3rem 0; }
.slider { position: relative; }
.rail {
	display: flex;
	gap: 1.25rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: .5rem .25rem 1.5rem;
	scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail figure {
	flex: 0 0 auto;
	scroll-snap-align: center;
	margin: 0;
	width: min(260px, 62vw);
	text-align: center;
}
.rail img {
	width: 100%;
	border-radius: 26px;
	border: var(--outline) solid var(--ink);
	display: block;
	background: var(--sky);
}
.rail figcaption {
	font-size: .95rem;
	color: var(--ink-soft);
	margin-top: .7rem;
}
.arrows { display: flex; gap: .75rem; justify-content: center; }
.arrows button {
	font: inherit;
	font-weight: 800;
	width: 52px; height: 52px;
	border-radius: 50%;
	border: var(--outline) solid var(--ink);
	background: var(--cream);
	color: var(--ink);
	cursor: pointer;
	box-shadow: 0 4px 0 var(--ink);
	line-height: 1;
	font-size: 1.4rem;
}
.arrows button:active { transform: translateY(4px); box-shadow: none; }

/* ---- Cards ---- */

.section { padding: 3.25rem 0; }
.section.tint { background: #fff; border-block: var(--outline) solid var(--ink); }
.lead { text-align: center; max-width: 52ch; margin: 0 auto 2.2rem; color: var(--ink-soft); }

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.1rem;
}
.card {
	background: var(--cream);
	border: var(--outline) solid var(--ink);
	border-radius: var(--radius);
	padding: 1.3rem 1.4rem;
	box-shadow: 0 5px 0 var(--ink);
}
.card .emoji { font-size: 2rem; display: block; margin-bottom: .4rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.card h3 { margin-bottom: .3rem; }

/* ---- Free / Premium ---- */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.plan { border-radius: var(--radius); border: var(--outline) solid var(--ink); padding: 1.5rem; box-shadow: 0 6px 0 var(--ink); }
.plan.free { background: var(--cream); }
.plan.premium { background: var(--sun); }
.plan h3 { font-size: 1.5rem; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.plan li { padding-left: 1.9rem; position: relative; margin-bottom: .6rem; font-size: 1rem; }
.plan li::before {
	content: "✓";
	position: absolute; left: 0; top: 0;
	font-weight: 800;
	color: var(--grass-deep);
}
.plan.premium li::before { color: var(--ink); }
.plan .how { margin-top: 1.1rem; font-size: .92rem; color: var(--ink-soft); }
.plan.premium .how { color: rgba(43,26,77,.75); }

/* ---- Long-form pages ---- */

.doc { padding: 2.5rem 0 4rem; }
.doc h2 { margin-top: 2.2rem; }
.doc h2:first-of-type { margin-top: 1rem; }
.doc ul { padding-left: 1.3rem; }
.doc li { margin-bottom: .5rem; }
.stamp { color: var(--ink-soft); font-size: .95rem; }
.callout {
	background: #fff;
	border: var(--outline) solid var(--ink);
	border-radius: var(--radius);
	padding: 1.2rem 1.4rem;
	box-shadow: 0 5px 0 var(--ink);
	margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

details {
	background: #fff;
	border: var(--outline) solid var(--ink);
	border-radius: 18px;
	padding: .9rem 1.2rem;
	margin-bottom: .9rem;
	box-shadow: 0 4px 0 var(--ink);
}
details summary { font-weight: 800; cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " +"; color: var(--coral); }
details[open] summary::after { content: " –"; }
details p { margin: .8rem 0 .2rem; color: var(--ink-soft); font-size: .98rem; }

/* ---- Nav & footer ---- */

.topbar { padding: 1rem 0; }
.topbar nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; font-weight: 800; }
.topbar a:hover { color: var(--sun); }
.topbar .home { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.topbar .home img { width: 38px; height: 38px; border-radius: 9px; border: 2px solid var(--ink); }

footer {
	background: var(--ink);
	color: rgba(255,255,255,.72);
	padding: 2.5rem 0;
	font-size: .95rem;
}
footer a { color: var(--sun); text-decoration: none; }
footer a:hover { color: var(--teal); }
footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn, .arrows button { transition: none; }
}
