/* ===========================================================================
   Tidal Wave Dev — deep-ocean theme
   A dark, single-surface site: one ambient background, translucent "glass"
   chrome floating on top of it, and a cyan/violet accent reserved for the
   things that are actually interactive.
   =========================================================================== */

:root {
    /* Ground -------------------------------------------------------------- */
    --twd-bg: #061320;
    --twd-bg-deep: #030b14;

    /* Panels sit on the ground as translucent glass rather than solid fills,
       so the ambient glows behind them still read through. */
    --twd-panel: rgba(255, 255, 255, 0.045);
    --twd-panel-hover: rgba(255, 255, 255, 0.07);
    --twd-border: rgba(255, 255, 255, 0.09);
    --twd-border-strong: rgba(255, 255, 255, 0.16);

    /* Ink ----------------------------------------------------------------- */
    --twd-ink: #f2f8fc;
    --twd-ink-2: #b6cddd;
    --twd-muted: #86a3b8;

    /* Accent -------------------------------------------------------------- */
    --twd-accent: #4fb6ff;
    --twd-accent-soft: #8ed2ff;
    --twd-violet: #7b6bff;
    --twd-amber: #f2952f;

    --twd-radius-sm: 0.75rem;

    --twd-page-max: 78rem;
    --twd-page-pad: 1.5rem;
}

html {
    background-color: var(--twd-bg);
    color-scheme: dark;
}

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: transparent;
    color: var(--twd-ink);
    -webkit-font-smoothing: antialiased;
}

/* Ambient light. Fixed so the glows stay put while the page scrolls past
   them, which is what makes the surface read as one continuous space. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(58rem 34rem at 18% -6%, rgba(28, 96, 158, 0.55), transparent 62%),
        radial-gradient(46rem 30rem at 96% 4%, rgba(196, 104, 44, 0.30), transparent 60%),
        radial-gradient(52rem 36rem at 88% 62%, rgba(24, 84, 140, 0.38), transparent 64%),
        radial-gradient(40rem 28rem at 4% 78%, rgba(20, 70, 120, 0.34), transparent 66%),
        linear-gradient(175deg, var(--twd-bg) 0%, var(--twd-bg-deep) 100%);
}

a {
    color: var(--twd-accent);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--twd-accent-soft);
}

h1, h2, h3, h4 {
    color: var(--twd-ink);
    letter-spacing: -0.015em;
}

/* Bootstrap ships these against a light page; re-point them at the dark one. */
.text-muted {
    color: var(--twd-muted) !important;
}

code {
    color: var(--twd-accent-soft);
}

hr {
    border-color: var(--twd-border);
}

::selection {
    background: rgba(79, 182, 255, 0.28);
}

:focus-visible {
    outline: 2px solid var(--twd-accent);
    outline-offset: 3px;
}

/* Routing focuses the page heading on every navigation for screen readers.
   That is not a sighted user asking for focus, so it draws no ring. */
h1:focus,
h1:focus-visible {
    outline: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(79, 182, 255, 0.45);
}

/* Shared page rhythm ------------------------------------------------------ */
.twd-wrap {
    width: 100%;
    max-width: var(--twd-page-max);
    margin-inline: auto;
    padding-inline: var(--twd-page-pad);
}

.twd-section-title {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* ===========================================================================
   Hero
   =========================================================================== */
.twd-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    padding: 3.5rem 0 4rem;
}

.twd-hero h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(2.1rem, 4.4vw, 3.35rem);
    line-height: 1.14;
    font-weight: 400;
}

.twd-hero-accent {
    font-weight: 700;
    /* Set in sentence case in the markup and shouted here, so screen readers
       are not handed an acronym to spell out. */
    text-transform: uppercase;
    color: var(--twd-accent);
}

.twd-hero-lead {
    max-width: 34rem;
    margin: 0 0 2rem;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--twd-ink-2);
}

.twd-hero-art {
    justify-self: center;
    width: 100%;
    max-width: 34rem;
}

/* Call to action ---------------------------------------------------------- */
.twd-cta {
    display: inline-block;
    padding: 0.9rem 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: linear-gradient(100deg, var(--twd-violet) 0%, #3f7fe0 46%, var(--twd-accent) 100%);
    box-shadow: 0 0 0 1px rgba(79, 182, 255, 0.18), 0 0.75rem 2.25rem rgba(63, 127, 224, 0.45);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.twd-cta:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(79, 182, 255, 0.32), 0 1rem 2.75rem rgba(63, 127, 224, 0.6);
}

.twd-cta:active {
    transform: translateY(0);
}

/* ===========================================================================
   Featured apps
   The stats panel is a sibling of the cards, not a card itself, so it can keep
   a narrower column while the cards reflow around it.
   =========================================================================== */
.twd-featured {
    padding-bottom: 3.5rem;
}

.twd-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 0.62fr);
    align-items: stretch;
    gap: 1.25rem;
}

.twd-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.25rem 1.35rem;
    border: 1px solid var(--twd-border);
    border-radius: var(--twd-radius-sm);
    background: var(--twd-panel);
    backdrop-filter: blur(14px);
    transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.twd-card:hover {
    transform: translateY(-3px);
    border-color: var(--twd-border-strong);
    background: var(--twd-panel-hover);
}

.twd-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
}

.twd-card-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.65rem;
    border: 1px solid var(--twd-border);
    background: linear-gradient(150deg, rgba(79, 182, 255, 0.22), rgba(123, 107, 255, 0.14));
    font-size: 1.5rem;
}

.twd-card-icon-idle {
    background: rgba(255, 255, 255, 0.06);
    color: var(--twd-muted);
}

.twd-card-titles {
    flex: 1;
    min-width: 0;
}

.twd-card-title {
    margin: 0;
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.25;
}

.twd-card-platform {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--twd-ink-2);
}

.twd-card-flag {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--twd-amber);
}

.twd-card-mark {
    flex: none;
    color: var(--twd-ink-2);
    opacity: 0.75;
}

.twd-card-text {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--twd-ink-2);
}

/* Pins the store link to the bottom edge, so cards with unequal copy still
   line their links up with one another. */
.twd-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.twd-card-link {
    font-size: 0.9375rem;
    color: var(--twd-accent);
}

.twd-card-pending {
    font-size: 0.875rem;
    color: var(--twd-muted);
}

.twd-card-chip {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--twd-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--twd-ink-2);
}

.twd-support-note {
    margin: 1.75rem 0 0;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--twd-muted);
}

/* ===========================================================================
   About
   =========================================================================== */
.twd-about {
    padding-bottom: 3.5rem;
}

.twd-about-panel {
    max-width: 52rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--twd-border);
    border-radius: var(--twd-radius-sm);
    background: var(--twd-panel);
    backdrop-filter: blur(14px);
    color: var(--twd-ink-2);
    line-height: 1.7;
}

.twd-about-panel p:last-child {
    margin-bottom: 0;
}

.twd-about-panel strong {
    color: var(--twd-ink);
}

/* ===========================================================================
   Visitor stats panel
   =========================================================================== */
.twd-stats {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.15rem 1rem;
    border: 1px solid var(--twd-border);
    border-radius: var(--twd-radius-sm);
    background: var(--twd-panel);
    backdrop-filter: blur(14px);
}

.twd-stats-list {
    margin: 0;
}

.twd-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.twd-stat:last-of-type {
    border-bottom: 0;
}

.twd-stat dt {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--twd-ink-2);
}

.twd-stat dd {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--twd-ink);
}

.twd-spark {
    display: block;
    width: 100%;
    height: auto;
    margin-top: auto;
    padding-top: 0.75rem;
}

.twd-stats-note {
    margin: 0.65rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--twd-muted);
}

/* The same numbers, without relying on the sparkline shape or its color. */
.twd-tableview {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--twd-ink-2);
}

.twd-tableview > summary {
    cursor: pointer;
    color: var(--twd-muted);
}

.twd-tableview table {
    width: 100%;
    margin-top: 0.6rem;
    border-collapse: collapse;
}

.twd-tableview th,
.twd-tableview td {
    padding: 0.3rem 0.5rem 0.3rem 0;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.twd-tableview td,
.twd-tableview thead th {
    font-variant-numeric: tabular-nums;
}

.twd-tableview thead th {
    color: var(--twd-muted);
    font-weight: 600;
}

.twd-tableview tbody th {
    font-weight: 400;
}

/* ===========================================================================
   Interior pages (privacy, error, 404)
   =========================================================================== */
.twd-page {
    max-width: 48rem;
    margin-inline: auto;
    padding: 3rem 0 3.5rem;
    color: var(--twd-ink-2);
    line-height: 1.7;
}

.twd-page h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

.twd-page h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.6rem;
    font-size: 1.25rem;
    color: var(--twd-accent-soft);
}

.twd-page h3 {
    margin-top: 1.75rem;
    font-size: 1.0625rem;
}

.twd-page li {
    margin-bottom: 0.4rem;
}

.twd-page strong {
    color: var(--twd-ink);
}

.twd-page-lede {
    color: var(--twd-muted);
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ===========================================================================
   Breakpoints
   =========================================================================== */
@media (max-width: 1100px) {
    /* Cards drop to two-up first; the stats panel takes a full row of its own
       rather than being squeezed into a card-width column. */
    .twd-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .twd-stats {
        grid-column: 1 / -1;
    }

    .twd-spark {
        max-height: 5rem;
    }
}

@media (max-width: 900px) {
    .twd-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        padding: 2.25rem 0 3rem;
        text-align: center;
    }

    .twd-hero-lead {
        margin-inline: auto;
    }

    .twd-hero-art {
        order: -1;
        max-width: 26rem;
    }
}

@media (max-width: 640px) {
    :root {
        --twd-page-pad: 1.15rem;
    }

    .twd-featured-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .twd-card,
    .twd-cta {
        transition: none;
    }

    .twd-card:hover,
    .twd-cta:hover {
        transform: none;
    }
}
