:root {
  --canvas: #070b16;
  --raised: #131c30;
  --accent: #45c2ff;
  --accent-deep: #2d7cff;
  --action: #a866fa;
  --action-deep: #7b3fe0;
  --paper: #0b1120;
  --ink: #eaf0ff;
  --ink-soft: #a3afcc;
  --tint: #0e1527;
  --rule: rgba(234, 240, 255, .1);
  --on-canvas: #eaf0ff;
  --on-canvas-soft: #a3afcc;
  --on-canvas-line: rgba(234, 240, 255, .14);
  --display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --radius: 18px;
  --wrap: 1200px;
}
/*
 * Theme "neon" — a fully dark site: night canvas, electric cyan accent with a soft glow, glass
 * cards with hairline borders, Space Grotesk titles, cyan→blue pill buttons with dark text.
 * Signature: the rarity spectrum (common → uncommon → rare → epic → legendary) as a thin line
 * under the hero and the page headers and on the top edge of the cards.
 * Tokens on :root come from theme.json, overridden by project.json → theme.tokens.
 * Every surface is dark: --paper is the page background, --ink the light text.
 */

:root {
    --gutter: clamp(16px, 4vw, 44px);
    --spectrum: linear-gradient(90deg, #9fa8bc 0%, #4ccb72 25%, #3f99fb 50%, #a866fa 75%, #fbc02d 100%);
    --glass: color-mix(in srgb, var(--raised) 72%, transparent);
    --glass-line: var(--on-canvas-line);
    --glow: color-mix(in srgb, var(--accent) 32%, transparent);
    color-scheme: dark;
}

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

body.ap {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.65 var(--body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
.ap img { max-width: 100%; height: auto; }
.ap a { color: var(--accent); text-underline-offset: 3px; }
.ap a:hover { color: var(--ink); }
.ap :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ap ::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }
.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(--accent); color: var(--canvas) !important; padding: 10px 16px; border-radius: 999px;
    font-weight: 600; text-decoration: none;
}
.ap-skip:focus { top: 8px; }

.ap-h2 {
    font: 700 clamp(30px, 4.2vw, 48px)/1.08 var(--display);
    letter-spacing: -0.025em;
    margin: 0 0 18px;
    max-width: 22ch;
}
.ap-lead { font-size: 19px; color: var(--ink-soft); max-width: 58ch; margin: 0 0 28px; }

/* Pill button: cyan→blue gradient, dark text (AA on both ends), soft cyan glow. */
.ap-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 15px/1.1 var(--display); text-align: center; letter-spacing: .005em;
    color: var(--canvas) !important; text-decoration: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border: 0; border-radius: 999px;
    padding: 13px 22px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent), 0 8px 26px var(--glow);
    transition: box-shadow .2s ease, filter .2s ease;
}
.ap-btn:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px var(--accent), 0 10px 34px color-mix(in srgb, var(--accent) 48%, transparent); }
.ap-btn--accent { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); }

/* ===== Header: glass bar over the night canvas ===== */
.ap-top {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--canvas) 82%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--glass-line);
}
.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(--on-canvas) !important; text-decoration: none;
    font: 700 22px/1 var(--display); letter-spacing: -0.02em;
}
.ap-brand img { border-radius: 9px; box-shadow: 0 0 0 1px var(--glass-line), 0 0 18px var(--glow); }
.ap-nav { display: flex; gap: 24px; }
.ap-nav a { color: var(--on-canvas-soft); text-decoration: none; font-weight: 500; font-size: 15px; }
.ap-nav a:hover, .ap-nav a[aria-current="page"] { color: var(--on-canvas); }
.ap-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.ap-top__end { margin-inline-start: auto; }

/* ===== Hero: night canvas, cyan glow behind the phone, spectrum line along the bottom ===== */
.ap-hero {
    position: relative;
    background:
        radial-gradient(60% 70% at 80% 40%, color-mix(in srgb, var(--accent-deep) 22%, transparent), transparent 70%),
        radial-gradient(40% 50% at 10% 0%, color-mix(in srgb, var(--action) 10%, transparent), transparent 70%),
        var(--canvas);
    color: var(--on-canvas);
    padding: clamp(44px, 6vw, 84px) 0 clamp(52px, 7vw, 100px);
    overflow: hidden;
}
.ap-hero::after {
    content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 2px;
    background: var(--spectrum);
    transform-origin: left center;
    animation: ap-neon-charge 1.1s cubic-bezier(.2, .7, .2, 1) .2s both;
}
[dir="rtl"] .ap-hero::after { transform-origin: right center; }
@keyframes ap-neon-charge { from { transform: scaleX(0); opacity: .4; } to { transform: scaleX(1); opacity: 1; } }

.ap-hero__in {
    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); }
.ap-hero__badge {
    display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px;
    font-weight: 500; font-size: 14px;
    color: var(--on-canvas); background: var(--glass); padding: 6px 14px 6px 12px; border-radius: 999px;
    border: 1px solid var(--glass-line);
}
.ap-hero__badge::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.ap-hero__title {
    font: 700 clamp(40px, 5.4vw, 70px)/1.02 var(--display);
    letter-spacing: -0.035em;
    margin: 0 0 22px;
    overflow-wrap: break-word; hyphens: auto;
}
.ap-hero__title em {
    display: block; font-style: normal; color: var(--accent);
    text-shadow: 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent);
}
.ap-hero__sub { font-size: 19px; color: var(--on-canvas-soft); margin: 0 0 30px; max-width: 48ch; }
.ap-hero__chips {
    list-style: none; padding: 0; margin: 30px 0 0;
    display: flex; flex-wrap: wrap; gap: 10px;
}
.ap-hero__chips li {
    font-weight: 500; font-size: 14px; color: var(--on-canvas);
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 6px 14px;
}

/* Store badges */
.ap-stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ap-stores a { display: block; height: 52px; border-radius: 10px; }
.ap-stores img { display: block; height: 100%; width: auto; }
.ap-stores--center { justify-content: center; }

/* ===== Phone: rounded dark frame, hairline cyan rim, cyan glow ===== */
.ap-phone {
    position: relative; justify-self: center;
    width: min(310px, 76vw); aspect-ratio: 9 / 19.5;
    padding: 10px; border-radius: 50px;
    background: linear-gradient(160deg, #1a2540, #0b1120 55%, #131c30);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
        0 0 0 1px rgba(0, 0, 0, .6),
        0 0 60px color-mix(in srgb, var(--accent) 34%, transparent),
        0 30px 90px color-mix(in srgb, var(--accent-deep) 30%, transparent);
}
.ap-phone::before {
    content: ''; position: absolute; inset-inline-end: -2px; top: 26%;
    width: 2px; height: 13%; border-radius: 0 2px 2px 0; background: color-mix(in srgb, var(--accent) 50%, #1a2540);
}
.ap-phone__screen {
    position: relative; width: 100%; height: 100%;
    border-radius: 40px; overflow: hidden; background: var(--canvas);
}
.ap-phone__screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: bottom; }
.ap-phone__island {
    position: absolute; top: 11px; left: 50%; transform: translateX(-50%); z-index: 1;
    width: 31%; height: 26px; border-radius: 999px; background: #000;
}

/* ===== Sections ===== */
.ap-section { padding: clamp(60px, 8vw, 112px) 0; }
.ap-section + .ap-section { border-top: 1px solid var(--rule); }

.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;
    scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
    scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.ap-shots__item { flex: 0 0 auto; margin: 0; scroll-snap-align: start; width: clamp(200px, 24vw, 256px); }
.ap-shots__item img {
    display: block; width: 100%; border-radius: 22px;
    border: 1px solid var(--glass-line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.ap-points__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.ap-points__list { display: grid; position: relative; padding-top: 2px; }
.ap-points__list::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 2px; background: var(--spectrum); }
.ap-points__item { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.ap-points__item h3 { font: 600 22px/1.25 var(--display); letter-spacing: -0.01em; margin: 0 0 8px; }
.ap-points__item p { margin: 0; color: var(--ink-soft); }

/* Features: glass cards, a hairline spectrum edge on top, a glowing icon tile. */
.ap-features {
    background:
        radial-gradient(50% 60% at 50% 0%, color-mix(in srgb, var(--accent-deep) 12%, transparent), transparent 70%),
        var(--canvas);
    color: var(--on-canvas);
}
.ap-features .ap-lead { color: var(--on-canvas-soft); }
.ap-features__list {
    list-style: none; margin: 36px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px;
}
.ap-feature {
    position: relative; overflow: hidden;
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
    padding: 26px 24px 24px;
}
.ap-feature::before {
    content: ''; position: absolute; inset-inline: 0; top: 0; height: 2px;
    background: var(--spectrum); opacity: .75;
}
.ap-feature__icon {
    display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px;
    border-radius: 14px; font-size: 22px; line-height: 1;
    background: color-mix(in srgb, var(--action) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--action) 50%, transparent);
    box-shadow: 0 0 22px color-mix(in srgb, var(--action) 28%, transparent);
}
.ap-feature--accent .ap-feature__icon {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow: 0 0 22px var(--glow);
}
.ap-feature h3 { font: 600 20px/1.3 var(--display); letter-spacing: -0.01em; margin: 0 0 6px; }
.ap-feature p { margin: 0; color: var(--on-canvas-soft); font-size: 16px; }

.ap-band { background: var(--tint); }
.ap-band__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.ap-band .ap-lead { margin: 0; }

.ap-faq__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.ap-faq__list { display: grid; gap: 10px; }
.ap-faq__item {
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px;
    padding: 0 20px;
}
.ap-faq__item[open] { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ap-faq__item summary {
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; gap: 16px;
    padding: 17px 0; font: 600 17px/1.4 var(--display);
}
.ap-faq__item summary::-webkit-details-marker { display: none; }
.ap-faq__item summary::after { content: '+'; font: 500 24px/0.95 var(--display); color: var(--accent); flex: none; }
.ap-faq__item[open] summary::after { content: '–'; }
.ap-faq__item p { margin: 0 0 20px; color: var(--ink-soft); max-width: 68ch; }

/* Download: the closing moment — night canvas, a cyan bloom and a short spectrum line on top. */
.ap-download {
    position: relative;
    background:
        radial-gradient(55% 75% at 50% 100%, color-mix(in srgb, var(--accent-deep) 26%, transparent), transparent 70%),
        var(--canvas);
    color: var(--on-canvas); text-align: center; padding: clamp(64px, 8vw, 108px) 0;
    border-top: 1px solid var(--rule);
}
.ap-download::before {
    content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
    width: min(320px, 60%); height: 2px; background: var(--spectrum);
}
.ap-download__in { display: flex; flex-direction: column; align-items: center; }
.ap-download__icon {
    border-radius: 22px; margin-bottom: 22px;
    box-shadow: 0 0 0 1px var(--glass-line), 0 0 44px var(--glow), 0 18px 40px rgba(0, 0, 0, .5);
}
.ap-download .ap-h2 { margin-inline: auto; }
.ap-download .ap-lead { color: var(--on-canvas-soft); margin-inline: auto; }

/* Text pages (about, contact, legal, 404): a header on the night canvas, prose on the page. */
.ap-page {
    position: relative;
    background:
        radial-gradient(50% 90% at 85% 0%, color-mix(in srgb, var(--accent-deep) 16%, transparent), transparent 70%),
        var(--canvas);
    color: var(--on-canvas); padding: clamp(48px, 7vw, 96px) 0;
}
.ap-page::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--spectrum); opacity: .7; }
.ap-page__title { font: 700 clamp(36px, 5vw, 60px)/1.06 var(--display); letter-spacing: -0.03em; margin: 0 0 18px; overflow-wrap: break-word; }
.ap-page__lead { font-size: 20px; color: var(--on-canvas-soft); max-width: 52ch; margin: 0; }
.ap-page__action { margin: 28px 0 0; }
.ap-prose { max-width: calc(68ch + 2 * var(--gutter)); }
.ap-prose h2 { font: 700 28px/1.25 var(--display); letter-spacing: -0.015em; margin: 44px 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(--accent); }
.ap-prose strong { color: var(--ink); font-weight: 600; }
.ap-note {
    font-size: 15px; color: var(--ink-soft);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    border: 1px solid var(--rule); border-inline-start: 3px solid var(--accent); border-radius: 10px;
    padding: 12px 16px;
}
.ap-note--legal { margin-bottom: 32px; }

/* ===== Footer ===== */
.ap-foot { background: var(--canvas); color: var(--on-canvas-soft); padding: 28px 0 36px; font-size: 14px; border-top: 1px solid var(--glass-line); }
.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(--on-canvas) !important; text-decoration: none; }
.ap-foot a:hover { color: var(--accent) !important; }

/* Language switcher: a glass pill; the list is a raised glass panel. */
.ap-langs { position: relative; }
.ap-langs summary {
    cursor: pointer; list-style: none; color: var(--on-canvas); font-weight: 500;
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 6px 14px;
}
.ap-langs summary:hover, .ap-langs[open] summary { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.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: color-mix(in srgb, #1a2540 94%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--glass-line); border-radius: 14px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .55);
    max-height: 70vh; overflow: auto;
}
.ap-langs li a { display: block; padding: 6px 10px; border-radius: 8px; }
.ap-langs li a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ap-langs li a[aria-current] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent) !important; }

/* ===== Responsive ===== */
@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(280px, 72vw); }
}
@media (max-width: 560px) {
    body.ap { font-size: 16px; }
    .ap-lead, .ap-hero__sub { font-size: 17px; }
    .ap-top__in { gap: 12px; }
    .ap-btn { padding: 10px 16px; font-size: 14px; }
    .ap-stores a { height: 46px; }
    .ap-faq__item { padding: 0 16px; }
    .ap-feature { padding: 22px 18px 20px; }
    .ap-langs ul { grid-template-columns: minmax(140px, 1fr); inset-inline-end: auto; inset-inline-start: 0; }
}

/* Headings wrap in balanced lines (CJK titles would otherwise leave one character alone). */
.ap-hero__title, .ap-h2, .ap-page__title { text-wrap: balance; }
:lang(ko) .ap-hero__title, :lang(ko) .ap-h2 { word-break: keep-all; } /* Korean breaks at spaces */

/* Language switcher in the header: opens down, shows the name on wide screens and the code on phones. */
.ap-top__end { display: flex; align-items: center; gap: 12px; }
.ap-langs--top summary { padding: 7px 12px; font-size: 14px; white-space: nowrap; }
.ap-langs--top ul { bottom: auto; top: calc(100% + 10px); }
.ap-langs__code { display: none; }
@media (max-width: 560px) {
    .ap-langs__name { display: none; }
    .ap-langs__code { display: inline; }
    .ap-top__end { gap: 8px; }
    .ap-langs--top ul { inset-inline-start: auto; inset-inline-end: 0; grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
.ap-langs li a { color: var(--on-canvas) !important; text-decoration: none; }
@media (min-width: 561px) { .ap-langs--top ul { grid-template-columns: repeat(3, minmax(130px, 1fr)); max-height: none; } }

/* Reduced motion: no charge-up sweep, no hover transitions. */
@media (prefers-reduced-motion: reduce) {
    .ap-hero::after { animation: none; }
    .ap-btn { transition: none; }
}
