/* ============================================================
   OnTrack — Site Styles
   Light, photo-forward, neutral. Inter only.
   ============================================================ */

:root {
    /* Color tokens */
    --black: #000000;
    --off-black: #1F2937;
    --navy: #111827;
    --slate: #2D2934;
    --gray-text: #4B5563;
    --gray-medium: #6B7280;
    --gray-border: #D1D5DB;
    --gray-surface: #E5E7EB;
    --gray-pale: #F3F4F6;
    --white: #FFFFFF;
    --error: #EF4444;
    --accent: #60A5FA;

    /* Semantic tokens (theme-switchable) */
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --btn-primary-active: #0F172A;
    --btn-secondary-hover: #C6C6C6;
    --green-check: #10B981;
    --star-orange: #FF8A00;
    --star-amber: #F59E0B;

    /* Type */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Radii */
    --r-pill: 9999px;
    --r-card: 16px;
    --r-card-sm: 12px;
    --r-image: 30px;

    /* Shadows */
    --shadow-sm: rgba(0, 0, 0, 0.06) 0px 2px 4px -1px, rgba(0, 0, 0, 0.04) 0px 1px 2px -1px;
    --shadow-md: rgba(0, 0, 0, 0.08) 0px 10px 15px -3px, rgba(0, 0, 0, 0.06) 0px 4px 6px -4px;
    --shadow-lg: rgba(0, 0, 0, 0.18) 0px 25px 50px -12px;

    /* Layout */
    --container: 1240px;
    --gutter: 40px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--black);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--off-black);
    color: var(--white);
}

/* ---------- Reusable ---------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gray-medium);
}

.section-title {
    font-size: clamp(36px, 5vw, 52px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--black);
    text-wrap: balance;
}

.section-sub {
    margin-top: 16px;
    font-size: 18px;
    line-height: 1.5;
    color: var(--gray-text);
    max-width: 580px;
    text-wrap: pretty;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 56px;
}

.section-header.center {
    align-items: center;
    text-align: center;
}

.section-header.center .section-sub {
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    border-radius: var(--r-pill);
    padding: 12px 28px;
    transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--off-black);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--navy);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    background: var(--btn-primary-active);
}

.btn-secondary {
    background: var(--gray-border);
    color: var(--black);
    font-weight: 400;
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--black);
    padding: 12px 0;
    font-weight: 500;
}

.btn-ghost:hover {
    color: var(--gray-medium);
}

/* App Store badge - official asset */
.appstore-badge {
    display: inline-flex;
    align-items: center;
    transition: transform 200ms ease, opacity 200ms ease;
    flex-shrink: 0;
}

.appstore-badge:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.appstore-badge img {
    display: block !important;
    height: 48px !important;
    width: auto !important;
    max-width: none !important;
}

.nav-cta .appstore-badge img {
    height: 38px !important;
}

.final-cta .appstore-badge img,
.ratings-cta .appstore-badge img {
    height: 56px !important;
}

/* ---------- Navbar ---------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--navbar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}

.navbar.scrolled {
    border-bottom-color: var(--gray-pale);
}

.navbar-inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--black);
}

.brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-links {
    display: none;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--black);
    border-radius: var(--r-pill);
    transition: background 150ms ease, color 150ms ease;
}

.nav-links a:hover {
    background: var(--gray-pale);
}

.nav-cta {
    display: inline-flex;
}

.nav-cta .appstore-badge {
    box-shadow: none;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    padding: 56px 0 72px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero {
        padding: 72px 0 96px;
    }

    .hero-grid {
        grid-template-columns: 1.05fr 1fr;
        gap: 56px;
    }
}

.hero-trust {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--gray-pale);
    border-radius: var(--r-pill);
    padding: 6px 16px 6px 6px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.hero-avatars {
    display: flex;
}

.hero-avatars img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--white);
    object-fit: cover;
}

.hero-avatars img + img {
    margin-left: -10px;
}

.hero-trust span {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-text);
}

.hero-trust strong {
    color: var(--black);
    font-weight: 600;
}

.hero h1 {
    font-size: clamp(40px, 6.4vw, 64px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--black);
    text-wrap: balance;
    isolation: isolate;
}

.hero h1 .accent {
    display: inline-block;
    position: relative;
    color: var(--black);
    z-index: 0;
}

.hero h1 .accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 10px;
    background: var(--gray-surface);
    z-index: -1;
    border-radius: 4px;
}

.hero-sub {
    margin-top: 24px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--gray-text);
    max-width: 520px;
    text-wrap: pretty;
}

.hero-ctas {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.hero-meta {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 14px;
    color: var(--gray-text);
}

.hero-meta strong {
    color: var(--black);
    font-weight: 600;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-meta svg {
    width: 16px;
    height: 16px;
    color: var(--green-check);
    flex-shrink: 0;
}

/* Hero phones - side-by-side, uncropped, transparent PNG with phone bezel baked in */
.hero-phones {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    padding: 8px 0 24px;
}

.hero-phone {
    display: block;
    width: auto;
    max-width: 50%;
    height: auto;
    max-height: 540px;
    object-fit: contain;
    filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.20)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.08));
    transition: transform 400ms ease;
}

.hero-phone-1 {
    transform: translateY(0) rotate(-3deg);
    z-index: 2;
}

.hero-phone-2 {
    transform: translateY(28px) rotate(3deg);
    z-index: 1;
}

.hero-phone-1:hover {
    transform: translateY(-8px) rotate(-3deg) scale(1.04);
    z-index: 3;
}

.hero-phone-2:hover {
    transform: translateY(20px) rotate(3deg) scale(1.04);
    z-index: 3;
}

/* ---------- Stats Strip ---------- */

.stats-strip {
    background: var(--gray-pale);
    padding: 48px 0;
    border-top: 1px solid var(--gray-pale);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
    text-align: center;
}

.stat-num {
    font-size: clamp(36px, 4vw, 52px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--black);
}

.stat-label {
    margin-top: 10px;
    font-size: 14px;
    color: var(--gray-text);
    font-weight: 500;
}

.stat-rating {
    display: flex;
    justify-content: center;
}

.apple-stars {
    display: inline-flex;
    gap: 2px;
}

.apple-stars svg {
    width: clamp(28px, 3.5vw, 40px);
    height: clamp(28px, 3.5vw, 40px);
    fill: var(--star-orange);
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- Why OnTrack (feature cards) ---------- */

.why {
    padding: 96px 0;
    background: var(--white);
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.why-card {
    background: var(--white);
    border: 1px solid var(--gray-pale);
    border-radius: var(--r-card);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.why-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.why-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gray-pale);
    display: grid;
    place-items: center;
    color: var(--off-black);
    margin-bottom: 24px;
}

.why-card-icon svg {
    width: 22px;
    height: 22px;
}

.why-card h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--black);
}

.why-card p {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-text);
}

@media (min-width: 768px) {
    .why-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Phone Showcase (alternating rows) ---------- */

.showcase {
    padding: 96px 0;
    background: var(--gray-pale);
}

.showcase-rows {
    display: flex;
    flex-direction: column;
    gap: 96px;
    margin-top: 24px;
}

.showcase-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

.showcase-copy h3 {
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--black);
    margin-top: 16px;
    text-wrap: balance;
}

.showcase-copy p {
    margin-top: 18px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--gray-text);
    max-width: 480px;
    text-wrap: pretty;
}

.showcase-bullets {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.showcase-bullet {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    color: var(--gray-text);
}

.showcase-bullet svg {
    width: 18px;
    height: 18px;
    color: var(--off-black);
    flex-shrink: 0;
    margin-top: 3px;
}

.showcase-phone {
    display: flex;
    justify-content: center;
    position: relative;
}

.showcase-phone-img {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 25px 40px rgba(0, 0, 0, 0.18));
}

@media (min-width: 900px) {
    .showcase-row {
        grid-template-columns: 1fr 1fr;
        gap: 64px;
    }

    .showcase-row.reverse .showcase-phone {
        order: -1;
    }

    .showcase-phone-img {
        max-width: 360px;
    }
}

/* ---------- How It Works ---------- */

.how {
    padding: 96px 0;
    background: var(--white);
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.how-step {
    background: var(--gray-pale);
    border-radius: var(--r-card);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.how-step-num {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-medium);
    letter-spacing: 0.08em;
}

.how-step h3 {
    margin-top: 56px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--black);
}

.how-step p {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-text);
}

.how-step-icon {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    display: grid;
    place-items: center;
    color: var(--off-black);
    box-shadow: var(--shadow-sm);
}

.how-step-icon svg {
    width: 22px;
    height: 22px;
}

@media (min-width: 768px) {
    .how-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Testimonials (dark section) ---------- */

.testimonials {
    background: var(--navy);
    color: #FFFFFF;
    padding: 96px 0;
    position: relative;
}

.testimonials .section-title {
    color: #FFFFFF;
}

.testimonials .section-sub {
    color: rgba(255, 255, 255, 0.6);
}

.testimonials .eyebrow {
    color: rgba(255, 255, 255, 0.55);
}

.t-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.t-card {
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-card);
    padding: 28px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 15px 40px;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.t-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.t-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4B5563, #1F2937);
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.t-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
}

.t-card-meta {
    margin-top: 2px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.t-card-stars {
    color: var(--star-orange);
    letter-spacing: 1px;
}

.t-card-title {
    margin: 16px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.3;
}

.t-card blockquote {
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.t-placeholder-note {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .t-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .t-grid > .t-card:nth-child(4),
    .t-grid > .t-card:nth-child(5) {
        grid-column: span 1;
    }
}

/* ---------- Ratings / Trust ---------- */

.ratings {
    background: var(--white);
    padding: 96px 0;
    text-align: center;
}

.ratings-stars {
    display: inline-flex;
    gap: 4px;
    color: var(--star-amber);
    margin-bottom: 8px;
}

.ratings-stars svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ratings h2 {
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--black);
    margin-top: 6px;
    text-wrap: balance;
}

.ratings-meta {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    color: var(--gray-text);
}

.ratings-meta strong {
    color: var(--black);
    font-weight: 600;
}

.ratings-cta {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

/* ---------- Final CTA ---------- */

.final-cta {
    background: var(--gray-pale);
    padding: 120px 0;
    text-align: center;
}

.final-cta h2 {
    font-size: clamp(40px, 6.4vw, 72px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--black);
    text-wrap: balance;
}

.final-cta p {
    margin-top: 20px;
    font-size: 19px;
    color: var(--gray-text);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.final-cta-btns {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* ---------- Footer ---------- */

.footer {
    background: var(--white);
    padding: 56px 0 32px;
    border-top: 1px solid var(--gray-pale);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-brand-col p {
    font-size: 13px;
    color: var(--gray-medium);
    max-width: 320px;
    line-height: 1.55;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--black);
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a {
    font-size: 14px;
    color: var(--gray-text);
    transition: color 150ms ease;
}

.footer-col a:hover {
    color: var(--black);
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-pale);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-medium);
}

@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 48px;
    }
}

/* ---------- Legal pages ---------- */

.legal-hero {
    background: var(--gray-pale);
    padding: 96px 0 72px;
    border-bottom: 1px solid var(--gray-pale);
}

.legal-hero .eyebrow {
    margin-bottom: 14px;
}

.legal-hero h1 {
    font-size: clamp(40px, 5vw, 56px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--black);
}

.legal-hero .updated {
    margin-top: 18px;
    font-size: 14px;
    color: var(--gray-medium);
    font-weight: 500;
}

.legal-body {
    padding: 64px 0 96px;
    background: var(--white);
}

.legal-body .container {
    max-width: 760px;
}

.legal-body section {
    margin-bottom: 40px;
}

.legal-body h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--black);
    margin: 32px 0 12px;
    line-height: 1.3;
}

.legal-body p {
    font-size: 16px;
    line-height: 1.65;
    color: var(--gray-text);
    margin-bottom: 14px;
}

.legal-body ul {
    margin: 0 0 16px 22px;
    color: var(--gray-text);
    font-size: 16px;
    line-height: 1.65;
}

.legal-body li {
    margin-bottom: 8px;
}

.legal-body strong {
    color: var(--black);
    font-weight: 600;
}

.legal-body a {
    color: var(--off-black);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-body a:hover {
    color: var(--accent);
}

.legal-body .intro p {
    font-size: 17px;
    color: var(--black);
}

/* ---------- Reveal animation ---------- */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
                transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ---------- Dark mode ---------- */

[data-theme="dark"] {
    --black: #F9FAFB;
    --off-black: #E5E7EB;
    --navy: #0A0C10;
    --slate: #E2E0E5;
    --gray-text: #9CA3AF;
    --gray-medium: #9CA3AF;
    --gray-border: #2D333B;
    --gray-surface: #1E2028;
    --gray-pale: #161820;
    --white: #111318;
    --error: #F87171;
    --accent: #60A5FA;

    --navbar-bg: rgba(17, 19, 24, 0.85);
    --btn-primary-active: #E2E8F0;
    --btn-secondary-hover: #2A2D35;
    --green-check: #34D399;
    --star-orange: #FF8A00;
    --star-amber: #FBBF24;

    --shadow-sm: rgba(0, 0, 0, 0.20) 0px 2px 4px -1px, rgba(0, 0, 0, 0.15) 0px 1px 2px -1px;
    --shadow-md: rgba(0, 0, 0, 0.30) 0px 10px 15px -3px, rgba(0, 0, 0, 0.20) 0px 4px 6px -4px;
    --shadow-lg: rgba(0, 0, 0, 0.50) 0px 25px 50px -12px;
}

[data-theme="dark"] .hero-trust {
    border-color: var(--gray-border);
}

[data-theme="dark"] .hero-avatars img {
    border-color: var(--white);
}

[data-theme="dark"] .btn-primary {
    background: #E5E7EB;
    color: #111318;
}

[data-theme="dark"] .btn-primary:hover {
    background: #F3F4F6;
}

[data-theme="dark"] ::selection {
    background: #60A5FA;
    color: #111318;
}

/* Theme transition (only applied on toggle, not page load) */

html[data-theme-transition] *,
html[data-theme-transition] *::before,
html[data-theme-transition] *::after {
    transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease, box-shadow 300ms ease, fill 300ms ease !important;
}

/* ---------- Theme toggle button ---------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--black);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    flex-shrink: 0;
    margin-right: 8px;
    padding: 0;
    font: inherit;
    -webkit-appearance: none;
}

.theme-toggle:hover {
    background: var(--gray-pale);
    color: var(--gray-medium);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle-sun { display: none; }
.theme-toggle-moon { display: block; }

[data-theme="dark"] .theme-toggle-sun { display: block; }
[data-theme="dark"] .theme-toggle-moon { display: none; }
