/* ============================================================================
   Photon download page — design tokens pulled verbatim from the WPF theme
   (Themes/DarkTheme.xaml) and SplashWindow.xaml. These are the REAL app values,
   not approximations. See the token report in the accompanying PR/notes.
   ========================================================================== */
:root {
    /* Backgrounds (DarkTheme: BgDeep / BgBase / BgSurface / BgRaised / BgHover) */
    --bg-deep:    #111113;  /* BgDeep / titlebar — page backdrop */
    --bg-base:    #1C1C1E;  /* BgBase — window/base surface */
    --panel:      #2C2C2E;  /* BgSurface / BgCard — rounded panels */
    --raised:     #3A3A3C;  /* BgRaised / BgInput — inset fields, code */
    --hover:      #48484A;  /* BgHover — hover fills */

    /* Text (DarkTheme: TextPrimary / TextSecond / TextMuted / TextFaint) */
    --text-primary: #FFFFFF;
    --text-second:  #CACACF;
    --text-muted:   #8D8D94;
    --text-faint:   #4D4D52;

    /* Borders (DarkTheme: BorderSubtle / BorderMid / DialogBorder) */
    --border-subtle: #2C2C2E;
    --border-mid:    #3A3A3C;
    --border-strong: #48484A;

    /* Accent (DarkTheme: Accent / AccentDark) — drives the primary CTA (BtnAmber) */
    --accent:      #0A84FF;
    --accent-dark: #0070E8;  /* BtnAmber hover background */
    --green:       #30D158;
    --coral:       #FF453A;

    /* Radius: 12px panels/cards (MainWindow root chrome CR12), 8px buttons/inputs
       (DarkTheme BtnBase template CornerRadius=8) */
    --radius-panel: 12px;
    --radius-ctl:   8px;

    /* Typography — Photon uses "Segoe UI Variable Text, Segoe UI" (a Windows
       system font; not self-hostable, resolves natively on the target Windows
       machines). Web-safe system fallbacks follow so it degrades cleanly. */
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
            "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

/* app.js shows/hides the loading/error/loaded states (and optional publishedAt /
   checksum elements) via the HTML `hidden` attribute. Author `display` rules below
   (e.g. .state { display: flex }) outrank hidden's low-specificity UA default, so
   without this all states would render at once. Make `hidden` authoritative. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg-deep);
    color: var(--text-second);
    font-family: var(--font);
    font-size: 13px;              /* DarkTheme base FontSize=13 */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    padding: 48px 20px;
}

.shell {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Masthead: pinwheel logo + wordmark (mirrors SplashWindow) ─────────────── */
.masthead {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 2px;
}

.logo {
    flex: 0 0 auto;
    display: block;
}

.wordmark h1 {
    margin: 0;
    font-size: 26px;             /* Splash "Photon" FontSize=26 */
    font-weight: 500;            /* Splash FontWeight=Medium */
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.wordmark .byline {
    margin: 4px 0 0;
    font-size: 12px;             /* Splash byline FontSize=12 */
    letter-spacing: 1.5px;
    color: var(--text-muted);    /* Splash byline TextMuted */
}

/* ── Card / panel (BgSurface, 12px radius, subtle border) ──────────────────── */
.card {
    background: var(--panel);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-panel);
    padding: 28px;
    /* MainWindow chrome uses a soft drop shadow; approximate it restrained */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ── States ────────────────────────────────────────────────────────────────── */
.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 8px;
    text-align: center;
}

.muted { color: var(--text-muted); }

.error-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.spinner {
    width: 26px;
    height: 26px;
    border: 2px solid var(--raised);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2s; }
}

/* ── Loaded release ────────────────────────────────────────────────────────── */
.release-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.version {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.published {
    margin: 4px 0 0;
    font-size: 12px;
}

/* Primary CTA — matches DarkTheme BtnAmber exactly:
   bg Accent #0A84FF, white text, SemiBold, radius 8, padding 14x7, hover AccentDark */
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #FFFFFF;
    font-weight: 600;            /* SemiBold */
    font-size: 13px;
    text-decoration: none;
    padding: 9px 22px;           /* BtnBase 14,7 scaled up slightly for a lead CTA */
    border: 1px solid transparent;
    border-radius: var(--radius-ctl);
    cursor: pointer;
    transition: background-color 0.12s ease, opacity 0.12s ease;
    white-space: nowrap;
}

.btn-primary:hover  { background: var(--accent-dark); }   /* BtnAmber hover #0070E8 */
.btn-primary:active { opacity: 0.7; }                     /* BtnBase pressed opacity */
.btn-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Notes + verify blocks ─────────────────────────────────────────────────── */
.notes-block, .verify-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.section-label {
    margin: 0 0 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.notes {
    margin: 0;
    color: var(--text-second);
    white-space: pre-wrap;       /* preserve manifest line breaks; still plain text */
    word-wrap: break-word;
}

.verify-hint { margin: 0 0 10px; font-size: 12px; }

.inline-cmd {
    font-family: var(--mono);
    background: var(--raised);
    color: var(--text-second);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.sha {
    display: block;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-second);
    background: var(--bg-base);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-ctl);
    padding: 10px 12px;
    word-break: break-all;
    user-select: all;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.foot {
    text-align: center;
    padding: 4px 8px;
}

.foot p { margin: 0; font-size: 12px; }
