/* MeloPan's website (tools/site.py). The app's colours (qml/ui/Theme.qml), light and dark. */
:root {
    --canvas: #f8f9fe;
    --surface: #ffffff;
    --surface-alt: #eef0fa;
    --border: #e4e7f2;
    --text: #151b36;
    --muted: #5d6482;
    --primary: #2158f0;
    --primary-hover: #1a4ad6;
    --primary-soft: #e4ebff;
    --on-primary: #ffffff;
    --warning-soft: #fff4dc;
    --warning-text: #8a5a00;
    --hero-from: #6b5cff;
    --hero-to: #3d6bff;
    --shadow: 0 1px 2px rgb(21 27 54 / 6%), 0 8px 24px rgb(21 27 54 / 8%);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --canvas: #11152a;
        --surface: #1b2038;
        --surface-alt: #161b31;
        --border: #2c3352;
        --text: #e8ebf8;
        --muted: #a3aac6;
        --primary: #5b84ff;
        --primary-hover: #7396ff;
        --primary-soft: #1f2b57;
        --on-primary: #ffffff;
        --warning-soft: #3a2e12;
        --warning-text: #ffd27a;
        --hero-from: #3d33a8;
        --hero-to: #2446b8;
        --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 760px; margin: 0 auto; padding: 32px 16px 56px; }
.todo {
    background: var(--warning-soft);
    color: var(--warning-text);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 600;
}

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.top nav a:hover { background: var(--surface-alt); }
.top nav .nav-buy { color: var(--primary); }
.top nav .lang { color: var(--muted); font-size: 14px; border: 1px solid var(--border); padding: 4px 8px; }

/* Hero, with the "Get it" row */
.hero {
    background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
    color: #ffffff;
    padding: 40px 0 48px;
}
.hero h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
.hero p.lead { font-size: clamp(17px, 2.4vw, 20px); margin: 0 0 24px; max-width: 640px; opacity: 0.95; }
.hero .get-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; font-weight: 700; opacity: 0.85; margin: 0 0 10px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.hero-shot { border-radius: 14px; box-shadow: 0 12px 40px rgb(0 0 0 / 30%); display: block; }
@media (min-width: 880px) {
    .hero { padding: 64px 0 72px; }
    .hero-grid { grid-template-columns: 1.05fr 1fr; }
}

.gets { display: flex; flex-wrap: wrap; gap: 10px; }
.get {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 56px; padding: 8px 16px 8px 12px;
    border-radius: 12px;
    background: #0e1226; color: #ffffff; text-decoration: none;
    border: 1px solid rgb(255 255 255 / 25%);
}
.get:hover { background: #1b2140; color: #ffffff; }
.get span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 18px; }
.get small { font-weight: 400; font-size: 12px; opacity: 0.8; }
.get-soon { opacity: 0.65; }
.get-soon small { font-style: italic; }
/* Not on a dark hero (the download page): the same buttons on the canvas. */
.gets.light .get { border-color: transparent; }

/* Sections */
section { padding: 48px 0; }
section.alt { background: var(--surface-alt); }
h2 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 19px; margin: 0 0 6px; }
.section-lead { color: var(--muted); max-width: 680px; margin: 0 0 28px; font-size: 18px; }

.features { display: grid; gap: 20px; }
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .features { grid-template-columns: 1fr 1fr 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.feature img { display: block; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--surface-alt); width: 100%; }
.feature div { padding: 16px 18px 20px; }
.feature p { margin: 0; color: var(--muted); }

.points { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; }
@media (min-width: 720px) { .points { grid-template-columns: 1fr 1fr; } }
.points li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.points strong { display: block; }

/* Buttons */
.primary, a.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 10px 22px;
    border: 0; border-radius: 12px;
    background: var(--primary); color: var(--on-primary);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.primary:hover, a.button:hover { background: var(--primary-hover); color: var(--on-primary); }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }
a.button.ghost { background: var(--primary-soft); color: var(--primary); }
.note { color: var(--muted); font-size: 15px; }

/* The store */
.offer { display: grid; gap: 24px; align-items: start; }
@media (min-width: 880px) { .offer { grid-template-columns: 1.2fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.card h2 { font-size: 24px; }
.price { font-size: 40px; font-weight: 700; margin: 4px 0 4px; }
.price small { font-size: 15px; font-weight: 400; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 16px 0 20px; }
.checks li { padding-left: 28px; position: relative; margin: 8px 0; }
.checks li::before { content: "✓"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; padding-left: 40px; position: relative; margin: 0 0 14px; }
.steps + h2 { margin-top: 36px; }
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary); font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* The comparison of the tiers ({{features}}): a table, one card per row on a phone */
/* (One card per column; the colours of qml/ui/Theme.qml's plan*, white on them.) */
.compare { --names: #24708a; --offline: #0b7f49; --account: #b0600a; --premium: #5b4be0; --stripe: #e8f0f5; }
.s-handpan { --accent: #be3f7a; }
.s-practice { --accent: #2563eb; }
.s-tutorials { --accent: #0b8887; }
.s-tabs { --accent: #7b61ff; }
.compare table { border-collapse: separate; border-spacing: 10px 0; table-layout: fixed; margin: 0 -10px; width: calc(100% + 20px); }
.compare th, .compare td { padding: 12px 14px; background: var(--surface); text-align: center; vertical-align: middle;
    border: solid var(--border); border-width: 0 1px; }
.compare th.names, .compare th[scope="row"], .compare th[scope="rowgroup"] { text-align: left; }
.compare th.names { width: 38%; }
.compare thead th { color: #fff; font-size: 18px; padding: 20px 14px; border: 0; border-radius: 16px; }
.compare .names { background: var(--names); }
.compare thead .tier-offline, .compare tfoot .tier-offline a { background: var(--offline); }
.compare thead .tier-account, .compare tfoot .tier-account a { background: var(--account); }
.compare thead .tier-premium, .compare tfoot .tier-premium a { background: var(--premium); }
.compare tbody tr:nth-child(even):not(.section) > * { background: var(--stripe); }
.compare tbody tr:last-child > * { border-bottom-width: 1px; border-radius: 0 0 14px 14px; }
.compare tr.gap td { background: none; border: 0; padding: 0; height: 16px; }
.compare tr.section th { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border: 0; border-radius: 14px 14px 0 0;
    padding: 10px 12px; font-size: 21px; font-weight: 700; }
.compare .tile { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-right: 14px; border-radius: 12px;
    background: var(--accent); color: #fff; vertical-align: middle; }
.compare .tile svg { width: 24px; height: 24px; stroke-width: 2; }
.compare td em { color: var(--muted); }
.compare tbody td { font-weight: 700; }
.compare th small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); }
.compare svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; display: block; }
.compare .yes, .compare .no { display: inline-grid; place-items: center; vertical-align: middle; }
.compare .yes { width: 28px; height: 28px; border-radius: 50%; color: #fff; }
.compare .tier-offline .yes { background: var(--offline); }
.compare .tier-account .yes { background: var(--account); }
.compare .tier-premium .yes { background: var(--premium); }
.compare .no { color: var(--muted); opacity: 0.45; }
.compare .no svg { width: 20px; height: 20px; }
.compare tfoot td { padding: 18px 14px; border-width: 1px; border-radius: 16px; }
.compare tfoot .names { background: none; border: 0; }
.compare tfoot strong { display: block; font-size: 20px; margin-bottom: 10px; }
.compare tfoot a { display: block; color: #fff; text-decoration: none; font-weight: 600; padding: 8px 10px; border-radius: 10px; }
.compare tfoot a:hover { filter: brightness(1.1); }
@media (prefers-color-scheme: dark) {
    .compare { --stripe: #232c48; }
}
@media (max-width: 760px) {
    /* A name on its line, its three cells below, the headers staying in sight under the bar. */
    .compare table, .compare thead, .compare tbody, .compare tfoot { display: block; margin: 0; width: auto; }
    .compare tr { display: grid; grid-template-columns: repeat(3, 1fr); }
    .compare thead { position: sticky; top: 61px; z-index: 5; }
    .compare thead .names, .compare tfoot .names, .compare tfoot .gap td:not([colspan]) { display: none; }
    .compare thead th { font-size: 14px; padding: 10px 4px; border-radius: 0; }
    .compare thead th.tier-offline { border-top-left-radius: 12px; }
    .compare thead th.tier-premium { border-top-right-radius: 12px; }
    .compare tbody th, .compare tr.gap td { grid-column: 1 / -1; }
    .compare tbody th[scope="row"] { padding: 10px 12px 2px; }
    .compare tbody td { display: grid; place-items: center; padding: 4px 4px 12px; border: 0; }
    .compare tbody th, .compare tbody tr { border: 0; }
    .compare tbody tr:last-child > * { border-radius: 0; }
    .compare tbody tr:last-child > th { border-bottom: 0; }
    .compare tfoot td { padding: 14px 6px; border-radius: 0; }
    .compare tfoot strong { font-size: 16px; }
    .compare tfoot a { font-size: 14px; padding: 8px 4px; }
}

/* The key, on the thanks page */
.key-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.key {
    font: 600 clamp(20px, 5vw, 28px)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.06em;
    background: var(--surface); border: 2px dashed var(--primary); border-radius: 12px;
    padding: 12px 16px; user-select: all; overflow-wrap: anywhere;
}

/* The contact form */
.contact { display: grid; gap: 6px; margin: 20px 0; }
.contact label { font-weight: 600; margin-top: 8px; }
.contact input, .contact select, .contact textarea {
    font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 12px; width: 100%; }
.contact textarea { resize: vertical; }
.contact button { justify-self: start; margin-top: 6px; }
.contact .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #c4323a; font-weight: 600; margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { .form-error { color: #ff8a8f; } }

/* Pages of text (legal, privacy) */
.prose h1 { font-size: clamp(28px, 5vw, 36px); line-height: 1.2; margin: 0 0 12px; }
.prose h2 { font-size: 22px; margin: 32px 0 8px; }
.prose h3 { font-size: 18px; margin: 24px 0 6px; }
.prose code { font-size: 0.92em; }
.prose .tip { background: var(--surface); border-left: 4px solid var(--primary); padding: 12px 16px; border-radius: 8px; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface); }

/* Footer */
.bottom { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 15px; padding: 24px 0 32px; }
.bottom p { margin: 6px 0; }
.bottom .links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bottom .links a { color: var(--muted); }
.bottom .fine { font-size: 13px; }

@media (max-width: 420px) {
    .brand span { display: none; }
    .top nav a { padding: 8px 6px; font-size: 15px; }
    .top-row, .top nav { gap: 2px; }
}
