:root {
  --canvas: #3b2a22;
  --raised: #4a3826;
  --accent: #e0a63a;
  --accent-deep: #c98a22;
  --action: #c9442a;
  --action-deep: #a8361f;
  --paper: #2e211b;
  --ink: #f4eee3;
  --ink-soft: #cfc3b4;
  --tint: #34261f;
  --rule: rgba(244, 238, 227, .1);
  --on-canvas: #f4eee3;
  --on-canvas-soft: #d6cabb;
  --on-canvas-line: rgba(244, 238, 227, .16);
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Apple SD Gothic Neo', 'Noto Sans SC', 'Noto Sans KR', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Apple SD Gothic Neo', 'Noto Sans SC', 'Noto Sans KR', sans-serif;
  --radius: 18px;
  --wrap: 1200px;
}
/*
 * Theme "rosewood" — FretKai's brand (FretKai docs/BRAND.md): a dark rosewood field (#3B2A22),
 * ivory text (#F4EEE3), bright brass (#E0A63A) for filled buttons with dark ink on them, brass text
 * (#F0B95A) for links, one vermillion dot (#C9442A, the root note) as the badge marker.
 * Signature: six thin strings (two wound, four plain) under the hero and the page headers, and a
 * nickel-and-brass phone frame like the store screenshots. Light app screenshots sit on the wood.
 * Titles Bricolage Grotesque, body Manrope; CJK falls back to the system fonts.
 * 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);
    --brass-text: #f0b95a;
    --ink-dark: #211b17;
    --strings:
        linear-gradient(#b8a58a, #b8a58a) 0 1px / 100% 2px no-repeat,
        linear-gradient(#b8a58a, #b8a58a) 0 7px / 100% 2px no-repeat,
        linear-gradient(#d8cfbf, #d8cfbf) 0 13px / 100% 1px no-repeat,
        linear-gradient(#d8cfbf, #d8cfbf) 0 18px / 100% 1px no-repeat,
        linear-gradient(#d8cfbf, #d8cfbf) 0 23px / 100% 1px no-repeat,
        linear-gradient(#d8cfbf, #d8cfbf) 0 28px / 100% 1px no-repeat;
    --brass-line: linear-gradient(90deg, transparent, var(--accent) 20%, var(--brass-text) 50%, var(--accent) 80%, transparent);
    --card: color-mix(in srgb, var(--raised) 70%, transparent);
    --card-line: var(--on-canvas-line);
    --warm: color-mix(in srgb, var(--accent) 22%, transparent);
    --grain: repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 7px, rgba(255, 255, 255, .015) 7px 9px, transparent 9px 15px);
    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(--brass-text); 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) 45%, 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(--ink-dark) !important; padding: 10px 16px; border-radius: 999px;
    font-weight: 700; 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; }

/* Button: bright brass with dark ink (BRAND.md: never white on bright brass), like a tuning peg. */
.ap-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 700 15px/1.1 var(--body); text-align: center; letter-spacing: .005em;
    color: var(--ink-dark) !important; text-decoration: none;
    background: linear-gradient(180deg, var(--brass-text), var(--accent) 55%, var(--accent-deep));
    border: 0; border-radius: 999px;
    padding: 13px 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .35);
    transition: filter .2s ease, transform .2s ease;
}
.ap-btn:hover { filter: brightness(1.06); transform: translateY(-1px); color: var(--ink-dark) !important; }
.ap-btn--accent { background: linear-gradient(180deg, var(--brass-text), var(--accent) 55%, var(--accent-deep)); }

/* ===== Header: a dark wood bar ===== */
.ap-top {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--canvas) 90%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%);
    border-bottom: 1px solid var(--card-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: 800 22px/1 var(--display); letter-spacing: -0.02em;
}
.ap-brand img { border-radius: 9px; box-shadow: 0 0 0 1px var(--card-line); }
.ap-nav { display: flex; gap: 24px; }
.ap-nav a { color: var(--on-canvas-soft); text-decoration: none; font-weight: 600; 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: rosewood with grain, a warm light behind the phone, six strings along the bottom ===== */
.ap-hero {
    position: relative;
    background:
        radial-gradient(55% 70% at 78% 45%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        var(--grain),
        var(--canvas);
    color: var(--on-canvas);
    padding: clamp(44px, 6vw, 84px) 0 calc(clamp(52px, 7vw, 100px) + 30px);
    overflow: hidden;
}
.ap-hero::after {
    content: ''; position: absolute; inset-inline: 0; bottom: 14px; height: 30px;
    background: var(--strings); opacity: .55;
    transform-origin: left center;
    animation: ap-rosewood-strum 1s cubic-bezier(.2, .7, .2, 1) .2s both;
}
[dir="rtl"] .ap-hero::after { transform-origin: right center; }
@keyframes ap-rosewood-strum { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: .55; } }

.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: 600; font-size: 14px;
    color: var(--on-canvas); background: var(--card); padding: 6px 14px 6px 10px; border-radius: 999px;
    border: 1px solid var(--card-line);
}
/* the root dot: vermillion with an ivory ring, as on the app's fretboard */
.ap-hero__badge::before {
    content: ''; width: 10px; height: 10px; border-radius: 50%; flex: none;
    background: var(--action); box-shadow: 0 0 0 1.5px var(--ink);
}
.ap-hero__title {
    font: 800 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(--brass-text); }
.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: 600; font-size: 14px; color: var(--on-canvas);
    background: var(--card); border: 1px solid var(--card-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: nickel-and-brass rim, black bezel, the light app screen ===== */
.ap-phone {
    position: relative; justify-self: center;
    width: min(310px, 76vw); aspect-ratio: 9 / 19.5;
    padding: 11px; border-radius: 52px;
    background: #000;
    box-shadow:
        0 0 0 3px #a89a78,
        0 0 0 5px #6f6248,
        0 30px 80px rgba(0, 0, 0, .55),
        0 0 90px color-mix(in srgb, var(--accent) 14%, transparent);
}
.ap-phone::before {
    content: ''; position: absolute; inset-inline-end: -7px; top: 26%;
    width: 3px; height: 13%; border-radius: 0 2px 2px 0; background: #a89a78;
}
.ap-phone__screen {
    position: relative; width: 100%; height: 100%;
    border-radius: 41px; overflow: hidden; background: #faf7f2;
}
.ap-phone__screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ap-phone__island {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1;
    width: 30%; height: 25px; 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(--grain), 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: 18px;
    border: 1px solid var(--card-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; counter-reset: ap-step; }
.ap-points__list::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 2px; background: var(--brass-line); }
.ap-points__item { padding: 22px 0 22px 56px; border-bottom: 1px solid var(--rule); position: relative; counter-increment: ap-step; }
[dir="rtl"] .ap-points__item { padding: 22px 56px 22px 0; }
.ap-points__item::before {
    content: counter(ap-step); position: absolute; inset-inline-start: 0; top: 22px;
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ink); color: var(--ink-dark); font: 700 16px/1 var(--display);
}
.ap-points__item:first-child::before { background: var(--action); color: #fff; box-shadow: 0 0 0 2px var(--ink); }
.ap-points__item h3 { font: 700 22px/1.25 var(--display); letter-spacing: -0.01em; margin: 0 0 8px; }
.ap-points__item p { margin: 0; color: var(--ink-soft); }

/* Features: wood cards with a brass fret line on top, an ivory icon tile. */
.ap-features {
    background:
        radial-gradient(50% 60% at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
        var(--grain),
        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;
}
@media (min-width: 1000px) {
    .ap-features__list:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
    .ap-features__list:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); }
    .ap-features__list:has(> :nth-child(5):last-child) .ap-feature { padding: 22px 18px 20px; }
}
@media (min-width: 640px) and (max-width: 999px) {
    .ap-features__list:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
}
.ap-feature {
    position: relative; overflow: hidden;
    background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
    padding: 26px 24px 24px;
}
.ap-feature::before {
    content: ''; position: absolute; inset-inline: 0; top: 0; height: 2px;
    background: var(--brass-line); opacity: .8;
}
.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) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--action) 55%, transparent);
}
.ap-feature--accent .ap-feature__icon {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.ap-feature h3 { font: 700 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(--card); border: 1px solid var(--card-line); border-radius: 14px;
    padding: 0 20px;
}
.ap-faq__item[open] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ap-faq__item summary {
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; gap: 16px;
    padding: 17px 0; font: 700 17px/1.4 var(--display);
}
.ap-faq__item summary::-webkit-details-marker { display: none; }
.ap-faq__item summary::after { content: '+'; font: 600 24px/0.95 var(--display); color: var(--brass-text); flex: none; }
.ap-faq__item[open] summary::after { content: '–'; }
.ap-faq__item p { margin: 0 0 20px; color: var(--ink-soft); max-width: 68ch; }
.ap-faq__more { margin: 20px 0 0; }

/* Download: the closing moment — the wood, a warm light from below, a brass fret line on top. */
.ap-download {
    position: relative;
    background:
        radial-gradient(55% 75% at 50% 100%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%),
        var(--grain),
        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(--brass-line);
}
.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(--card-line), 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 (support, delete account, 404): a wood header with strings, prose on the page. */
.ap-page {
    position: relative;
    background:
        radial-gradient(50% 90% at 85% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
        var(--grain),
        var(--canvas);
    color: var(--on-canvas); padding: clamp(48px, 7vw, 96px) 0 calc(clamp(48px, 7vw, 96px) + 24px);
}
.ap-page::after { content: ''; position: absolute; inset-inline: 0; bottom: 10px; height: 30px; background: var(--strings); opacity: .4; }
.ap-page__title { font: 800 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: 700 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); font-weight: 700; }
.ap-prose strong { color: var(--ink); font-weight: 700; }
.ap-note {
    font-size: 15px; color: var(--ink-soft);
    background: color-mix(in srgb, var(--accent) 8%, 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(--card-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(--brass-text) !important; }

/* Language switcher: a wood pill; the list is a raised dark panel. */
.ap-langs { position: relative; }
.ap-langs summary {
    cursor: pointer; list-style: none; color: var(--on-canvas); font-weight: 600;
    background: var(--card); border: 1px solid var(--card-line); border-radius: 999px; padding: 6px 14px;
}
.ap-langs summary:hover, .ap-langs[open] summary { border-color: color-mix(in srgb, var(--accent) 55%, 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, #2c2219 96%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--card-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) 14%, transparent); }
.ap-langs li a[aria-current] { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--brass-text) !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, :lang(ko) .ap-page__title { word-break: keep-all; } /* Korean breaks at spaces */
:lang(zh) .ap-hero__title, :lang(ko) .ap-hero__title { letter-spacing: -0.01em; line-height: 1.12; }

/* 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(2, minmax(130px, 1fr)); max-height: none; } }

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

/* QR code under the store badges: for a desktop visitor only — a phone uses the badges. */
.ap-qr { margin: 28px auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; z-index: 1; }
.ap-qr__code { display: block; width: 148px; height: 148px; padding: 8px; background: #fff; border-radius: 14px; box-sizing: content-box; box-shadow: 0 0 0 3px #a89a78; }
.ap-qr__label { margin: 0; max-width: 240px; font-size: 14px; line-height: 1.4; color: var(--on-canvas-soft); }
@media (max-width: 760px), (hover: none) and (pointer: coarse) { .ap-qr { display: none; } }
