:root {
    color-scheme: light dark;
    --bg: #f6f8fb;
    --panel: #ffffff;
    --fg: #1f2328;
    --muted: #57606a;
    --border: #d0d7de;
    --primary: #0969da;
    --primary-hover: #0550ae;
    --success: #1a7f37;
    --danger: #cf222e;
    --input-bg: #ffffff;
    --page-glow: rgba(9, 105, 218, 0.1);
    --nav-border: rgba(208, 215, 222, 0.9);
    --nav-bg: rgba(246, 248, 251, 0.88);
    --card-bg: linear-gradient(180deg, #ffffff, #f6f8fb);
    --card-shadow: 0 14px 28px rgba(31, 35, 40, 0.08);
    --secondary-hover-bg: rgba(208, 215, 222, 0.35);
    --secondary-hover-border: #8c959f;
    --feature-visual-border: rgba(9, 105, 218, 0.26);
    --feature-visual-bg:
        radial-gradient(circle at top left, rgba(9, 105, 218, 0.14), transparent 0, transparent 50%),
        linear-gradient(180deg, #f7fbff, #eef5ff);
    --feature-icon-color: #218bff;
    --feature-icon-shadow: drop-shadow(0 10px 26px rgba(9, 105, 218, 0.22));
    --feature-item-bg: rgba(234, 238, 242, 0.76);
    --flash-bg: rgba(234, 238, 242, 0.9);
    --flash-success-border: rgba(26, 127, 55, 0.35);
    --flash-success-bg: rgba(26, 127, 55, 0.12);
    --flash-success-fg: #116329;
    --flash-error-border: rgba(207, 34, 46, 0.35);
    --flash-error-bg: rgba(207, 34, 46, 0.11);
    --flash-error-fg: #9a1c24;
    --plan-border: rgba(9, 105, 218, 0.3);
    --plan-bg:
        radial-gradient(circle at top left, rgba(9, 105, 218, 0.12), transparent 0, transparent 48%),
        linear-gradient(180deg, #f7fbff, #eef5ff);
    --helper-border: rgba(9, 105, 218, 0.28);
    --helper-bg: rgba(9, 105, 218, 0.08);
    --detail-bg: rgba(234, 238, 242, 0.8);
    --text-link: #0550ae;
    --placeholder: #6e7781;
    --focus-ring: rgba(9, 105, 218, 0.2);
    --video-border: rgba(9, 105, 218, 0.26);
    --video-bg:
        linear-gradient(135deg, rgba(9, 105, 218, 0.12), transparent 35%),
        radial-gradient(circle at bottom right, rgba(9, 105, 218, 0.12), transparent 0, transparent 42%),
        linear-gradient(180deg, #f7fbff, #eef5ff);
    --video-grid-line: rgba(31, 35, 40, 0.06);
    --play-btn-bg: rgba(9, 105, 218, 0.14);
    --play-btn-border: rgba(33, 139, 255, 0.38);
    --play-btn-shadow: 0 12px 26px rgba(9, 105, 218, 0.16);
    --play-icon: #1f2328;
    --status-loading-ring: rgba(31, 35, 40, 0.22);
    --status-loading-top: #1f2328;
    --browser-card-shadow: 0 0 0 1px var(--primary), 0 8px 28px rgba(9, 105, 218, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --panel: #161b22;
        --fg: #e6edf3;
        --muted: #9aa4b2;
        --border: #30363d;
        --primary: #1f6feb;
        --primary-hover: #388bfd;
        --success: #2ea043;
        --danger: #f85149;
        --input-bg: #0b1220;
        --page-glow: rgba(56, 139, 253, 0.12);
        --nav-border: rgba(48, 54, 61, 0.92);
        --nav-bg: rgba(13, 17, 23, 0.82);
        --card-bg: linear-gradient(180deg, rgba(22, 27, 34, 0.98), rgba(15, 23, 35, 0.96));
        --card-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
        --secondary-hover-bg: rgba(177, 186, 196, 0.08);
        --secondary-hover-border: #8b949e;
        --feature-visual-border: rgba(56, 139, 253, 0.22);
        --feature-visual-bg:
            radial-gradient(circle at top left, rgba(56, 139, 253, 0.18), transparent 0, transparent 50%),
            linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(13, 17, 23, 0.98));
        --feature-icon-color: #7cc0ff;
        --feature-icon-shadow: drop-shadow(0 10px 30px rgba(31, 111, 235, 0.25));
        --feature-item-bg: rgba(11, 18, 32, 0.7);
        --flash-bg: rgba(11, 18, 32, 0.88);
        --flash-success-border: rgba(46, 160, 67, 0.38);
        --flash-success-bg: rgba(46, 160, 67, 0.14);
        --flash-success-fg: #c9f8d1;
        --flash-error-border: rgba(248, 81, 73, 0.35);
        --flash-error-bg: rgba(248, 81, 73, 0.12);
        --flash-error-fg: #ffd7d5;
        --plan-border: rgba(56, 139, 253, 0.28);
        --plan-bg:
            radial-gradient(circle at top left, rgba(56, 139, 253, 0.16), transparent 0, transparent 48%),
            linear-gradient(180deg, rgba(11, 18, 32, 0.95), rgba(13, 17, 23, 0.98));
        --helper-border: rgba(124, 192, 255, 0.24);
        --helper-bg: rgba(31, 111, 235, 0.1);
        --detail-bg: rgba(11, 18, 32, 0.72);
        --text-link: #7cc0ff;
        --placeholder: #7d8590;
        --focus-ring: rgba(31, 111, 235, 0.18);
        --video-border: rgba(56, 139, 253, 0.24);
        --video-bg:
            linear-gradient(135deg, rgba(31, 111, 235, 0.14), transparent 35%),
            radial-gradient(circle at bottom right, rgba(56, 139, 253, 0.14), transparent 0, transparent 42%),
            linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(13, 17, 23, 1));
        --video-grid-line: rgba(255, 255, 255, 0.03);
        --play-btn-bg: rgba(31, 111, 235, 0.18);
        --play-btn-border: rgba(124, 192, 255, 0.35);
        --play-btn-shadow: 0 14px 34px rgba(31, 111, 235, 0.2);
        --play-icon: #e6edf3;
        --status-loading-ring: rgba(230, 237, 243, 0.22);
        --status-loading-top: #e6edf3;
        --browser-card-shadow: 0 0 0 1px var(--primary), 0 8px 28px rgba(31, 111, 235, 0.18);
    }
}

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

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

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background:
        radial-gradient(circle at top, var(--page-glow), transparent 0, transparent 42%),
        var(--bg);
    color: var(--fg);
}

h1 {
    font-size: 18px;
}

h2 {
    font-size: 16px;
}

p {
    color: var(--muted);
}

button,
input,
a {
    font: inherit;
}

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

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    text-align: center;
}

.site-footer nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--muted);
    font-size: 13px;
}

.site-footer a:hover {
    color: var(--fg);
}

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--nav-border);
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
}

.landing-nav-inner {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.main-content {
    flex: 1;
    padding: 36px 24px 56px;
}

.landing-main {
    display: block;
}

.auth-main {
    display: grid;
    place-items: center;
}

.page-panel {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.auth-panel {
    width: min(100%, 440px);
}

.card {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.stack {
    display: grid;
    gap: 10px;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.primary,
.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    font-weight: 600;
}

.primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.secondary {
    background: transparent;
    color: var(--fg);
}

.secondary:hover {
    background: var(--secondary-hover-bg);
    border-color: var(--secondary-hover-border);
}

.brand-copy,
.brand-lockup {
    display: grid;
    gap: 4px;
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: stretch;
    min-height: 340px;
    isolation: isolate;
}

.hero-copy {
    position: relative;
    z-index: 2;
    display: grid;
    align-content: center;
    gap: 14px;
    padding: 16px 0;
}

.hero-visual {
    position: absolute;
    top: 50%;
    right: -18px;
    width: min(460px, 45vw);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 12% 8% 14% 14%;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 139, 253, 0.22), transparent 0, transparent 62%);
    filter: blur(18px);
    opacity: 0.95;
}

.hero-calendar-art {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    opacity: 0.88;
    transform: translateX(22px);
    filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.32));
}

.hero-title {
    font-size: clamp(2.7rem, 6vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    max-width: 12ch;
}

.lead {
    max-width: 60ch;
    font-size: 1.05rem;
    color: var(--muted);
}

.features-section {
    margin-top: 28px;
    display: grid;
    gap: 18px;
}

.section-heading {
    display: grid;
    gap: 8px;
    max-width: 780px;
}

.section-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.1;
}

.feature-showcase {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.feature-wide {
    grid-column: 1 / -1;
}

.feature-visual {
    min-height: 220px;
    border-radius: 10px;
    border: 1px solid var(--feature-visual-border);
    background: var(--feature-visual-bg);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.feature-icon {
    width: 88px;
    height: 88px;
    color: var(--feature-icon-color);
    filter: var(--feature-icon-shadow);
}

.feature-body {
    display: grid;
    gap: 6px;
}

.feature-body h3 {
    font-size: 1.2rem;
    line-height: 1.2;
}

.feature-item {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--feature-item-bg);
}

.field {
    display: grid;
    gap: 6px;
}

.auth-stack {
    display: grid;
    gap: 14px;
}

.flash-list {
    display: grid;
    gap: 8px;
}

.flash {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--flash-bg);
    color: var(--fg);
}

.flash.success {
    border-color: var(--flash-success-border);
    background: var(--flash-success-bg);
    color: var(--flash-success-fg);
}

.flash.error {
    border-color: var(--flash-error-border);
    background: var(--flash-error-bg);
    color: var(--flash-error-fg);
}

.inline-note {
    margin-top: 6px;
    color: var(--muted);
}

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

.text-link:hover {
    text-decoration: underline;
}

label {
    color: var(--fg);
    font-weight: 500;
}

input {
    background: var(--input-bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

input::placeholder {
    color: var(--placeholder);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.feature-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--fg);
}

.showcase-section {
    margin-top: 28px;
    display: grid;
    gap: 18px;
}

.showcase-card {
    padding: 14px;
}

.video-stage {
    min-height: 360px;
    border-radius: 12px;
    border: 1px solid var(--video-border);
    background: var(--video-bg);
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.video-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--video-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--video-grid-line) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.35;
}

.video-overlay {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
    max-width: 520px;
    padding: 24px;
}

.play-button {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--play-btn-bg);
    border: 1px solid var(--play-btn-border);
    box-shadow: var(--play-btn-shadow);
}

.play-button svg {
    width: 28px;
    height: 28px;
    color: var(--play-icon);
    margin-left: 2px;
}

.video-copy {
    display: grid;
    gap: 6px;
}

.video-copy strong {
    font-size: 1.15rem;
    color: var(--fg);
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.status-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex: 0 0 18px;
}

.status-icon.loading {
    background: transparent;
    border: 2px solid var(--status-loading-ring);
    border-top-color: var(--status-loading-top);
    animation: spin 0.8s linear infinite;
}

.status-icon.success {
    background: var(--success);
}

.status-icon.success::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.status-icon.error {
    background: var(--danger);
}

.status-icon.error::before,
.status-icon.error::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 3px;
    width: 2px;
    height: 12px;
    background: #fff;
    border-radius: 999px;
}

.status-icon.error::before {
    transform: rotate(45deg);
}

.status-icon.error::after {
    transform: rotate(-45deg);
}

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

@media (max-width: 900px) {
    .hero-grid,
    .feature-showcase {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        min-height: auto;
    }

    .hero-visual {
        display: none;
    }

    .feature-wide {
        grid-column: auto;
    }

    .hero-title {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .landing-nav-inner,
    .nav-links,
    .topbar,
    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .main-content {
        padding: 20px 16px 36px;
    }

    .video-stage {
        min-height: 260px;
    }

    .primary,
    .secondary {
        width: 100%;
    }
}

/* -------- Download page -------- */
.download-page {
    display: grid;
    gap: 48px;
    padding-top: 24px;
}

.download-hero {
    display: grid;
    gap: 12px;
    max-width: 640px;
}

.download-note {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel) 84%, var(--bg));
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.download-note strong {
    color: var(--fg);
}

.download-note a {
    color: var(--primary);
}

.download-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--fg);
}

.browser-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.browser-card {
    display: grid;
    gap: 14px;
    padding: 24px 20px;
    text-align: center;
    justify-items: center;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.browser-card.recommended {
    border-color: var(--primary);
    box-shadow: var(--browser-card-shadow);
}

.browser-icon {
    width: 72px;
    height: 72px;
}

.browser-icon svg {
    width: 100%;
    height: 100%;
}

.browser-name {
    font-size: 1.05rem;
    color: var(--fg);
}

.browser-desc {
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 26ch;
}

.browser-download-btn {
    width: 100%;
    justify-content: center;
}

.recommended-badge {
    display: none;
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.browser-card.recommended .recommended-badge {
    display: block;
}

@media (max-width: 700px) {
    .browser-grid {
        grid-template-columns: 1fr;
    }
}