/*
    The brand, as Bootstrap variables rather than as overrides fighting it.
    The palette is the Android app's, taken from
    src/SCR.App.Android/Resources/values/colors.xml so the two heads cannot
    drift into looking like different products.
*/
:root,
[data-bs-theme="dark"] {
    --scr-navy: #0a2230;
    --scr-teal: #123e51;
    --scr-gold: #f2b33d;
    --scr-cream: #f7e4bd;
    --scr-caramel: #b97e3a;

    --bs-body-bg: var(--scr-navy);
    --bs-body-color: var(--scr-cream);
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: rgba(247, 228, 189, 0.72);
    --bs-border-color: rgba(247, 228, 189, 0.18);

    --bs-primary: var(--scr-gold);
    --bs-primary-rgb: 242, 179, 61;
    --bs-link-color: var(--scr-gold);
    --bs-link-color-rgb: 242, 179, 61;
    --bs-link-hover-color: #ffd076;

    --bs-code-color: var(--scr-gold);
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--scr-navy);
}

/*
    The app's own backdrop, not an imitation of it: brand/vector-sources/
    bg-landscape.svg is the same file build.py composites behind the mascot for
    the Android TV banner and the splash screen. Fixed, so it behaves as a
    backdrop rather than scrolling away, and mirrored so the concentric rings —
    centred left in a 16:9 television frame — land under the mascot on the right
    where a web layout puts it.
*/
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url("../img/bg-landscape.svg") center / cover no-repeat;
    transform: scaleX(-1);
}

main {
    flex: 1 0 auto;
}

/* ---------- Navigation ---------- */

.scr-nav {
    background: rgba(10, 34, 48, 0.86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--bs-border-color);
}

.scr-brand {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--scr-cream);
}

.scr-brand:hover { color: #ffffff; }

.scr-nav .nav-link {
    color: rgba(247, 228, 189, 0.78);
}

.scr-nav .nav-link:hover,
.scr-nav .nav-link:focus-visible {
    color: var(--scr-cream);
}

.scr-nav .nav-link.active {
    color: var(--scr-gold);
}

/* ---------- Call to action ---------- */

.btn-scr {
    background: var(--scr-gold);
    border: 1px solid var(--scr-gold);
    color: var(--scr-navy);
    font-weight: 650;
}

.btn-scr:hover,
.btn-scr:focus-visible {
    background: #ffd076;
    border-color: #ffd076;
    color: var(--scr-navy);
}

.btn-scr-outline {
    border: 1px solid rgba(247, 228, 189, 0.32);
    color: var(--scr-cream);
}

.btn-scr-outline:hover,
.btn-scr-outline:focus-visible {
    border-color: var(--scr-gold);
    color: var(--scr-gold);
}

/* Visible focus everywhere: this project's other head is driven by a D-pad,
   and keyboard users deserve the same courtesy here. */
a:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--scr-gold);
    outline-offset: 2px;
}

/* Except where the focus was not the reader's doing. FocusOnNavigate puts the
   focus on the heading after every navigation so a screen reader starts at the
   top of the new page — a real courtesy, and one that drew a box around the
   heading of every page until the reader clicked something. tabindex="-1" is
   the mark of an element focused by the application rather than reached by
   keyboard, so silencing the ring there takes nothing away from anybody
   navigating with one. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
    outline: none;
}

/* ---------- Surfaces ---------- */

.scr-card {
    background: rgba(18, 62, 81, 0.55);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.scr-hero {
    /* padding-block, not the shorthand. This element is also a .container, and
       the shorthand's "0" was overwriting the horizontal padding Bootstrap puts
       there — which exists precisely to cancel the negative margins on the .row
       inside. Without it the row hung 24px off the right of a phone and the
       whole page scrolled sideways. */
    padding-block: clamp(2.5rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3.5rem);
}

.scr-hero h1 {
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.08;
}

.scr-lead {
    color: rgba(247, 228, 189, 0.82);
    max-width: 46ch;
}

/* The address a person types into a downloader with a remote control. It is
   the most important string on the site, so it is set like one. */
.scr-shorturl {
    display: inline-block;
    font-family: var(--bs-font-monospace);
    font-size: clamp(1.1rem, 3.5vw, 1.6rem);
    letter-spacing: 0.02em;
    color: var(--scr-gold);
    background: rgba(10, 34, 48, 0.75);
    border: 1px dashed rgba(242, 179, 61, 0.5);
    border-radius: 0.5rem;
    padding: 0.5rem 0.9rem;
    user-select: all;
}

.scr-step {
    counter-increment: scr-step;
}

.scr-step::before {
    content: counter(scr-step);
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    margin-right: 0.75rem;
    border-radius: 50%;
    background: var(--scr-teal);
    border: 1px solid rgba(242, 179, 61, 0.45);
    color: var(--scr-gold);
    font-weight: 700;
    font-size: 0.95rem;
}

.scr-steps {
    counter-reset: scr-step;
    list-style: none;
    padding-left: 0;
}

.scr-steps > li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* ---------- Footer and consent ---------- */

.scr-footer {
    border-top: 1px solid var(--bs-border-color);
    color: rgba(247, 228, 189, 0.6);
    font-size: 0.9rem;
}

.scr-consent {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1080;
    background: rgba(10, 34, 48, 0.97);
    border-top: 1px solid rgba(242, 179, 61, 0.35);
    backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: no-preference) {
    .scr-consent { animation: scr-rise 220ms ease-out; }
    @keyframes scr-rise {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

/* ---------- Brand mark ---------- */

.scr-mark {
    /* The seal is a light illustration on a dark page; a soft ring keeps it
       from floating and matches the card surfaces. */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.scr-hero-mark {
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
    max-width: 40vw;
    height: auto;
}

/* The character, straight from the vector source — transparent, so it stands on
   the page backdrop instead of inside a frame put there to hide a crop. */
.scr-portrait {
    margin: 0;
    margin-inline: auto;
    max-width: 360px;
}

.scr-portrait img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.5));
}

/* The unknown-sources warning. Caramel rather than red: this is a caution to
   read, not an error to dismiss, and a page that shouts loses the one reader
   who most needs to slow down. */
.scr-caution {
    background: rgba(185, 126, 58, 0.14);
    border: 1px solid var(--scr-caramel);
    border-left-width: 4px;
    border-radius: 0.75rem;
}

/* The terms document. Narrow measure and generous leading, because this is the
   one thing on the site a person is asked to actually read. */
.scr-terms {
    max-height: 26rem;
    overflow-y: auto;
    line-height: 1.65;
}

.scr-terms h1:first-child { margin-top: 0; }
.scr-terms ul { padding-left: 1.25rem; }
.scr-terms li { margin-bottom: 0.35rem; }

/* The Webshare disclosure. Teal rather than the caution's caramel: this is
   context a reader needs, not a warning — it should read as part of the page
   and still be impossible to skim past. */
.scr-disclosure {
    background: rgba(18, 62, 81, 0.62);
    border: 1px solid rgba(247, 228, 189, 0.22);
    border-left: 4px solid var(--scr-gold);
    border-radius: 0.75rem;
}

.scr-disclosure-badge {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--scr-gold);
    text-transform: uppercase;
    font-size: 0.82rem;
}

/* ---------- Announcements ---------- */

.scr-announcement {
    background: rgba(18, 62, 81, 0.72);
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--scr-gold);
    border-radius: 0.75rem;
}

/* Warning takes the caramel the install caution uses, so the two kinds of
   "read this" on the site look like the same family rather than two systems. */
.scr-announcement-warning {
    background: rgba(185, 126, 58, 0.16);
    border-color: var(--scr-caramel);
    border-left-color: var(--scr-caramel);
}

.scr-announcement-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(6, 20, 29, 0.82);
    backdrop-filter: blur(4px);
}

.scr-announcement-backdrop > .scr-announcement {
    max-width: 34rem;
    width: 100%;
    background: var(--scr-navy);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
