:root {
  --canvas: #38b6e8;
  --raised: #fdf3dc;
  --accent: #ffc93c;
  --accent-deep: #b7791f;
  --action: #33c46b;
  --action-deep: #1f8a49;
  --paper: #f3fbfe;
  --ink: #2a2232;
  --ink-soft: #544a5e;
  --tint: #dff4fc;
  --rule: #2a2232;
  --on-canvas: #ffffff;
  --on-canvas-soft: #ffffff;
  --on-canvas-line: rgba(42, 34, 50, .9);
  --display: 'Fredoka', 'Arial Rounded MT Bold', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --radius: 18px;
  --wrap: 1160px;
}
/*
 * Theme "arcade" — Ear Hop's game look (BRAND.md in the EarHop repo). Sky gradient hero with a
 * pixel ground strip at its foot, cream panels with a thick ink outline and a hard ink shadow
 * (no blur), gold pill buttons that move down when pressed, Fredoka titles; hero titles are
 * white / gold with an ink stroke (the game's score look).
 * Same markup as every theme (src/render/sections.ts); tokens from theme.json + project.json.
 * The hero `.ap-phone` is a framed game window: the picture as it is, no bezel, no island.
 */

:root {
    --gutter: clamp(16px, 4vw, 40px);
    --sky-bottom: #b9ebf8;
    --grass: #7ed957;
    --grass-deep: #4fae35;
    --dirt: #b8743a;
    --dirt-deep: #8a5326;
    --line: 3px;
    --hard: 0 5px 0 var(--ink);
    --hard-sm: 0 4px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.ap { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
.ap img { max-width: 100%; height: auto; }
.ap a { color: var(--ink); text-decoration-color: var(--accent-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ap a:hover { color: var(--action-deep); }
.ap :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.ap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.ap-skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50; background: var(--ink); color: #fff !important; padding: 10px 16px; border-radius: 8px; }
.ap-skip:focus { top: 8px; }

.ap-h2 { font: 700 clamp(30px, 3.8vw, 46px)/1.1 var(--display); letter-spacing: -0.01em; margin: 0 0 14px; max-width: 24ch; }
.ap-lead { font-size: 18px; color: var(--ink-soft); max-width: 60ch; margin: 0 0 28px; }

/* Buttons: the game's PixelButton — gold, ink outline, hard shadow; pressed = moves down. */
.ap-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 17px/1.1 var(--display); text-align: center; letter-spacing: .01em;
    color: var(--ink) !important; text-decoration: none;
    background: var(--accent); border: var(--line) solid var(--ink); border-radius: 14px; padding: 11px 22px;
    box-shadow: var(--hard-sm); transition: transform .08s, box-shadow .08s;
}
.ap-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.ap-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ap-btn--accent { background: var(--accent); }
.ap-btn--action { background: var(--action); }
@media (prefers-reduced-motion: reduce) { .ap-btn { transition: none; } .ap-btn:hover, .ap-btn:active { transform: none; } }

/* Header: sky-tinted glass with an ink rule. */
.ap-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: var(--line) solid var(--ink); }
.ap-top__in { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.ap-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink) !important; text-decoration: none; font: 700 24px/1 var(--display); }
.ap-brand img { border-radius: 10px; border: 2px solid var(--ink); }
.ap-nav { display: flex; gap: 24px; }
.ap-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 15px; }
.ap-nav a:hover, .ap-nav a[aria-current="page"] { color: var(--ink); }
.ap-top__end { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

/* Hero: the game's sky, a pixel ground strip at the foot, the picture in a game window. */
.ap-hero {
    position: relative; overflow: hidden; padding: clamp(40px, 6vw, 80px) 0 calc(clamp(56px, 7vw, 96px) + 44px);
    background:
        linear-gradient(180deg, var(--canvas), var(--sky-bottom));
}
/* Ground: grass with a dark edge, then dirt with pixel stones. */
.ap-hero::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
    background:
        radial-gradient(circle at 4px 4px, var(--dirt-deep) 3px, transparent 3.5px) 0 22px / 46px 14px repeat-x,
        linear-gradient(180deg, var(--grass) 0 12px, var(--grass-deep) 12px 16px, var(--ink) 16px 18px, var(--dirt) 18px);
    border-top: var(--line) solid var(--ink);
}
.ap-hero__in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.ap-hero__in--solo { grid-template-columns: minmax(0, 1fr); text-align: center; }
.ap-hero__badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; font: 600 15px/1.2 var(--display); color: var(--ink); background: var(--raised); border: var(--line) solid var(--ink); padding: 6px 14px; border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.ap-hero__badge::before { content: '♪'; font-size: 16px; line-height: 1; }
.ap-hero__title {
    font: 700 clamp(42px, 6vw, 74px)/1.02 var(--display); letter-spacing: -0.01em; margin: 0 0 20px; overflow-wrap: break-word;
    color: var(--on-canvas); -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink);
}
.ap-hero__title em { display: block; font-style: normal; color: var(--accent); }
.ap-hero__sub { font-size: 19px; font-weight: 600; color: var(--ink); margin: 0 0 28px; max-width: 48ch; }
.ap-hero__chips { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ap-hero__chips li { font-weight: 700; font-size: 14px; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; }

.ap-stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ap-stores a { display: block; height: 54px; border-radius: 10px; box-shadow: var(--hard-sm); transition: transform .08s, box-shadow .08s; }
.ap-stores a:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ap-stores img { display: block; height: 100%; width: auto; }
.ap-stores--center { justify-content: center; }

.ap-phone { position: relative; justify-self: center; width: min(400px, 82vw); transform: rotate(2deg); }
.ap-phone__screen { position: relative; border: 5px solid var(--ink); border-radius: 26px; overflow: hidden; background: var(--canvas); box-shadow: 0 9px 0 var(--ink); }
.ap-phone__screen img { display: block; width: 100%; height: auto; image-rendering: auto; }
.ap-phone__island { display: none; }
@media (prefers-reduced-motion: no-preference) {
    .ap-phone { animation: ap-hover 3.2s ease-in-out infinite alternate; }
    @keyframes ap-hover { from { transform: rotate(2deg) translateY(0); } to { transform: rotate(1deg) translateY(-10px); } }
}

.ap-section { padding: clamp(56px, 7vw, 104px) 0; }

/* Screenshots: a strip of framed shots. */
.ap-shots { background: var(--tint); }
.ap-shots__strip { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) 24px; scrollbar-width: thin; }
.ap-shots__item { flex: 0 0 auto; margin: 0; scroll-snap-align: start; width: clamp(200px, 22vw, 250px); }
.ap-shots__item img { display: block; width: 100%; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--hard); }

/* Points: numbered steps, gold number discs. */
.ap-points { background: var(--tint); }
.ap-points__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.ap-points__list { display: grid; gap: 16px; counter-reset: ap-step; }
.ap-points__item { position: relative; padding: 20px 22px 20px 78px; background: var(--raised); border: var(--line) solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard); counter-increment: ap-step; }
.ap-points__item::before { content: counter(ap-step); position: absolute; inset-inline-start: 20px; top: 18px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); border: var(--line) solid var(--ink); color: var(--ink); font: 700 19px/1 var(--display); }
[dir="rtl"] .ap-points__item { padding: 20px 78px 20px 22px; }
.ap-points__item h3 { font: 600 21px/1.3 var(--display); margin: 0 0 6px; }
.ap-points__item p { margin: 0; color: var(--ink-soft); }

/* Features: cream cards, ink outline, hard shadow; the icon in a gold (accent) or green tile. */
.ap-features { background: var(--paper); }
.ap-features__list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.ap-feature { background: var(--raised); border: var(--line) solid var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: var(--hard); transition: transform .12s, box-shadow .12s; }
.ap-feature:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--ink); }
@media (prefers-reduced-motion: reduce) { .ap-feature { transition: none; } .ap-feature:hover { transform: none; } }
.ap-feature__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 14px; border: var(--line) solid var(--ink); background: color-mix(in srgb, var(--action) 35%, #fff); font-size: 25px; line-height: 1; }
.ap-feature--accent .ap-feature__icon { background: var(--accent); }
.ap-feature h3 { font: 600 21px/1.3 var(--display); margin: 0 0 6px; }
.ap-feature p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* Band: a sky panel. */
.ap-band__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(24px, 4vw, 44px); border-radius: calc(var(--radius) + 6px); background: linear-gradient(180deg, var(--canvas), var(--sky-bottom)); border: var(--line) solid var(--ink); box-shadow: var(--hard); }
.ap-band .ap-lead { margin: 0; color: var(--ink); font-weight: 600; }

/* FAQ */
.ap-faq { background: var(--tint); }
.ap-faq__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.ap-faq__list { display: grid; gap: 12px; }
.ap-faq__item { background: var(--raised); border: var(--line) solid var(--ink); border-radius: 16px; padding: 0 20px; box-shadow: var(--hard-sm); }
.ap-faq__item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font: 600 19px/1.35 var(--display); }
.ap-faq__item summary::-webkit-details-marker { display: none; }
.ap-faq__item summary::after { content: '▼'; flex: none; font-size: 14px; line-height: 1.9; color: var(--ink); transition: transform .15s; }
.ap-faq__item[open] summary::after { transform: rotate(180deg); }
.ap-faq__item p { margin: 0 0 18px; color: var(--ink-soft); max-width: 68ch; }

/* Download: a sky card standing on the ground. */
.ap-download { padding: clamp(56px, 7vw, 96px) 0; }
.ap-download__in {
    position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: clamp(36px, 6vw, 60px) var(--gutter) calc(clamp(36px, 6vw, 60px) + 30px); border-radius: calc(var(--radius) + 10px);
    background: linear-gradient(180deg, var(--canvas), var(--sky-bottom)); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink);
}
.ap-download__in::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: linear-gradient(180deg, var(--grass) 0 10px, var(--grass-deep) 10px 14px, var(--ink) 14px 16px, var(--dirt) 16px); border-top: var(--line) solid var(--ink); }
.ap-download__icon { border-radius: 22px; border: 4px solid var(--ink); margin-bottom: 20px; box-shadow: var(--hard); }
.ap-download .ap-h2 { margin-inline: auto; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); font-size: clamp(34px, 4.4vw, 52px); }
.ap-download .ap-lead { margin: 0 auto 26px; color: var(--ink); background: var(--raised); border: var(--line) solid var(--ink); border-radius: 14px; padding: 10px 18px; font-size: 17px; font-weight: 600; }

/* Inner pages */
.ap-page { background: linear-gradient(180deg, var(--canvas), var(--sky-bottom)); border-bottom: var(--line) solid var(--ink); padding: clamp(44px, 6vw, 80px) 0 clamp(32px, 4vw, 52px); }
.ap-page__title { font: 700 clamp(36px, 5vw, 60px)/1.05 var(--display); margin: 0 0 14px; overflow-wrap: break-word; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.ap-page__lead { font-size: 19px; font-weight: 600; color: var(--ink); max-width: 58ch; margin: 0; }
.ap-page__action { margin: 26px 0 0; }
.ap-prose { max-width: calc(72ch + 2 * var(--gutter)); }
.ap-prose h2 { font: 600 28px/1.25 var(--display); margin: 40px 0 10px; }
.ap-prose h3 { font: 600 21px/1.3 var(--display); margin: 28px 0 8px; }
.ap-prose p { margin: 0 0 16px; }
.ap-prose ul, .ap-prose ol { margin: 0 0 16px; padding-inline-start: 22px; }
.ap-prose li { margin: 0 0 10px; }
.ap-prose li::marker { color: var(--action-deep); }
.ap-note { font-size: 15px; color: var(--ink); background: var(--raised); border: 2px solid var(--ink); border-radius: 12px; padding: 12px 16px; }
.ap-note--legal { margin-bottom: 28px; }

/* Footer + language switcher */
.ap-foot { border-top: var(--line) solid var(--ink); background: var(--raised); color: var(--ink-soft); padding: 28px 0 36px; font-size: 14px; }
.ap-foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.ap-foot__links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.ap-foot a { color: var(--ink); font-weight: 700; text-decoration: none; }
.ap-foot a:hover { text-decoration: underline; }
.ap-langs { position: relative; }
.ap-langs summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; background: #fff; }
.ap-langs summary::-webkit-details-marker { display: none; }
.ap-langs ul { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0; z-index: 30; list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 2px; background: var(--raised); border: var(--line) solid var(--ink); border-radius: 16px; box-shadow: var(--hard); max-height: 70vh; overflow: auto; }
.ap-langs li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink) !important; text-decoration: none; }
.ap-langs li a:hover, .ap-langs li a[aria-current] { background: var(--accent); }
.ap-langs--top summary { padding: 7px 14px; font-size: 14px; white-space: nowrap; }
.ap-langs--top ul { bottom: auto; top: calc(100% + 10px); }
.ap-langs__code { display: none; }
@media (min-width: 561px) { .ap-langs--top ul { grid-template-columns: repeat(3, minmax(130px, 1fr)); max-height: none; } }

@media (max-width: 980px) {
    .ap-nav { display: none; }
    .ap-hero__in, .ap-points__in, .ap-faq__in { grid-template-columns: 1fr; }
    .ap-phone { width: min(340px, 80vw); }
}
@media (max-width: 560px) {
    body.ap { font-size: 16px; }
    .ap-top__in { gap: 12px; }
    .ap-top__end { gap: 8px; }
    .ap-btn { padding: 9px 15px; font-size: 15px; }
    .ap-hero__title { -webkit-text-stroke-width: 6px; text-shadow: 0 4px 0 var(--ink); }
    .ap-stores a { height: 48px; }
    .ap-langs__name { display: none; }
    .ap-langs__code { display: inline; }
    .ap-langs ul { grid-template-columns: minmax(140px, 1fr); inset-inline-end: auto; inset-inline-start: 0; }
    .ap-langs--top ul { inset-inline-start: auto; inset-inline-end: 0; grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .ap-points__item { padding: 18px 18px 18px 68px; }
    .ap-points__item::before { inset-inline-start: 14px; top: 16px; }
    [dir="rtl"] .ap-points__item { padding: 18px 68px 18px 18px; }
}

/* Headings wrap in balanced lines. */
.ap-hero__title, .ap-h2, .ap-page__title { text-wrap: balance; }
:lang(ko) .ap-hero__title, :lang(ko) .ap-h2 { word-break: keep-all; }
