/*
 * apps.tywys.xyz — neutral Tywys shell. Each app tints the page with its own
 * accent (--accent, set from apps.json at runtime), so one stylesheet serves
 * every app's landing page.
 */

:root {
    --bg: #14161B;
    --bg-deep: #0E1014;
    --accent: #DD923E;             /* overridden per app */
    --accent-ink: #14161B;         /* text on the accent */

    --surface: rgba(255, 255, 255, 0.07);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --hairline: rgba(255, 255, 255, 0.14);

    --text: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.70);
    --text-faint: rgba(255, 255, 255, 0.46);

    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --gutter: 22px;
    --measure: 520px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 56px 40px; }
.centred { text-align: center; }

h1 { font-size: clamp(28px, 7.5vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -0.4px; margin: 18px 0 0; }
.lede { color: var(--text-muted); font-size: clamp(16px, 4.2vw, 18px); margin: 14px auto 0; max-width: 40ch; }
.faint { color: var(--text-faint); font-size: 13px; }
.faint a { color: var(--text-muted); }

.app-icon {
    width: min(34vw, 132px);
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 26%;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--hairline);
}

.eyebrow {
    display: inline-block;
    margin: 26px 0 0;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--hairline);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* ---------------------------------------------------------- buttons --- */

.btn {
    display: block;
    padding: 2px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, white), var(--accent));
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--bg-deep);
}
.btn--solid > span { background: transparent; color: var(--accent-ink); }
.btn--quiet { background: var(--surface); }
.btn--quiet > span { background: transparent; color: var(--text-muted); font-weight: 500; }
.btn[aria-disabled="true"] { pointer-events: none; opacity: 0.6; }

.store-glyph { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.store-badge { display: none; }
.btn--badge { background: transparent; padding: 0; }
.btn--badge > span { display: none; }
.btn--badge .store-badge { display: block; height: 54px; width: auto; margin: 0 auto; }

.store-row { display: grid; gap: 12px; margin-top: 30px; align-items: center; }
@media (min-width: 480px) { .store-row { grid-template-columns: 1fr 1fr; } }
.buttons { display: grid; gap: 12px; margin-top: 12px; }

/* ----------------------------------------------------------- footer --- */

.footer { padding: 26px var(--gutter) 34px; text-align: center; }
.footer img { width: 104px; height: auto; opacity: 0.85; }
.footer p { margin: 8px 0 0; }

@media (prefers-reduced-motion: no-preference) {
    .fade-in { animation: fade-in 0.45s ease-out both; }
    @keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
