:root {
    --surface: #12151b;
    --surface-container-lowest: #0b0d11;
    --surface-container-low: #171a21;
    --surface-container: #1c2028;
    --surface-container-high: #252a33;
    --surface-bright: #333945;
    --surface-variant: #2e343e;
    --surface-tint: #b9c2d0;
    --on-surface: #e7eaf0;
    --on-surface-variant: #a5aebc;
    --outline: #7e8794;
    --outline-variant: #3b424c;
    --primary: #f1f4f9;
    --on-primary: #151920;
    --primary-container: #dde4ee;
    --accent: #86d3e2;
    --accent-strong: #a7b8f0;
    --error: #ff9d92;
    --success: #8fe0b4;
    --background: #0e1116;

    --font-display: "Space Grotesk", "Segoe UI", sans-serif;
    --font-body: "Geist", "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Mono", monospace;

    --container-max: 1440px;
    --gutter: 24px;
    --margin-page: 20px;
    --stack-sm: 8px;
    --stack-md: 24px;
    --stack-lg: 48px;

    --glass-fill: rgba(255, 255, 255, 0.045);
    --glass-fill-strong: rgba(255, 255, 255, 0.075);
    --ghost-border: rgba(255, 255, 255, 0.1);
    --nav-height: 64px;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-soft: 0 18px 48px rgba(6, 9, 14, 0.45);

    --safe-left: 0px;
    --safe-right: 0px;
    --safe-bottom: 0px;
}

@media (min-width: 768px) {
    :root {
        --nav-height: 72px;
    }
}

@media (min-width: 480px) {
    :root {
        --margin-page: 24px;
    }
}

@media (min-width: 768px) {
    :root {
        --margin-page: 40px;
    }
}

@media (min-width: 1100px) {
    :root {
        --margin-page: 64px;
    }
}

@supports (padding: env(safe-area-inset-left)) {
    :root {
        --safe-left: env(safe-area-inset-left);
        --safe-right: env(safe-area-inset-right);
        --safe-bottom: env(safe-area-inset-bottom);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--background);
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary);
    color: var(--background);
}

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

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

/* Typography */

.display-lg {
    font-family: var(--font-display);
    font-size: clamp(36px, 7.5vw, 62px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0;
}

.headline-lg {
    font-family: var(--font-display);
    font-size: clamp(26px, 4.5vw, 38px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.01em;
    margin: 0;
}

.headline-sm {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    margin: 0;
}

.body-md {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.label-caps {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.data-point {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.text-dim {
    color: var(--on-surface-variant);
}

/* Glass surfaces */

.glass-panel {
    position: relative;
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 55%);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    border: 1px solid var(--ghost-border);
    box-shadow: var(--shadow-soft);
}

.glass-interactive {
    position: relative;
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 60%);
    backdrop-filter: blur(26px) saturate(125%);
    -webkit-backdrop-filter: blur(26px) saturate(125%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-soft);
    transition: background 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.glass-interactive:hover {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05) 60%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Vector accents */

.vector-line-h {
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.vector-line-v {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.hud-frame {
    position: relative;
}

.hud-frame::before,
.hud-frame::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    pointer-events: none;
    opacity: 0.55;
}

.hud-frame::before {
    top: -1px;
    left: -1px;
    border-top: 1px solid var(--accent);
    border-left: 1px solid var(--accent);
    border-top-left-radius: var(--radius-lg);
}

.hud-frame::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 1px solid var(--accent);
    border-right: 1px solid var(--accent);
    border-bottom-right-radius: var(--radius-lg);
}

.chip {
    display: inline-block;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    color: var(--on-surface-variant);
}

/* Background layers */

.backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.backdrop-base {
    z-index: -5;
    background:
        linear-gradient(168deg, #10151d 0%, #0d1218 42%, #0b0f14 72%, #0e1219 100%);
}

.backdrop-aurora {
    z-index: -4;
    background:
        radial-gradient(58% 46% at 14% 6%, rgba(96, 140, 196, 0.3), transparent 68%),
        radial-gradient(52% 44% at 88% 12%, rgba(139, 112, 191, 0.24), transparent 70%),
        radial-gradient(64% 50% at 72% 92%, rgba(72, 152, 158, 0.24), transparent 70%),
        radial-gradient(48% 40% at 24% 78%, rgba(86, 116, 178, 0.18), transparent 72%);
    filter: blur(6px);
    animation: aurora-drift 26s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-2%, 2%, 0) scale(1.08); }
}

.backdrop-dots {
    z-index: -3;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.32;
}

.backdrop-grid {
    z-index: -3;
    background-image: linear-gradient(to right, #ffffff 1px, transparent 1px),
        linear-gradient(to bottom, #ffffff 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: 0.022;
}

.backdrop-glow {
    z-index: -2;
    background-image: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.04) 0%, transparent 66%);
}

.backdrop-vignette {
    z-index: -1;
    background: radial-gradient(122% 88% at 50% 42%, transparent 52%, rgba(6, 8, 12, 0.6) 100%);
}

/* Shell */

.shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.route-view {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    animation: route-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes route-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.page {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: calc(var(--nav-height) + var(--stack-lg))
             calc(var(--margin-page) + var(--safe-right))
             calc(var(--stack-lg) + var(--safe-bottom))
             calc(var(--margin-page) + var(--safe-left));
}

.page-header {
    margin-bottom: var(--stack-lg);
    position: relative;
    border-left: 2px solid var(--accent);
    padding-left: var(--stack-md);
}

.page-header p {
    max-width: 60ch;
    margin: var(--stack-sm) 0 0;
    color: var(--on-surface-variant);
}

/* Navigation */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 calc(var(--margin-page) + var(--safe-right)) 0 calc(var(--margin-page) + var(--safe-left));
    background: rgba(14, 17, 22, 0.62);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 50;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 0;
    font-family: var(--font-display);
    font-size: clamp(15px, 4vw, 28px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

.nav-link {
    position: relative;
    color: var(--on-surface-variant);
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

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

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    color: var(--primary);
    padding: 8px;
    cursor: pointer;
}

.nav .nav-cta {
    display: none;
}

@media (min-width: 900px) {
    .nav .nav-toggle {
        display: none;
    }

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

.nav-drawer {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--stack-md);
    padding: var(--stack-md) var(--margin-page);
    background: rgba(13, 16, 21, 0.96);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    z-index: 49;
}

@media (min-width: 900px) {
    .nav-drawer {
        display: none;
    }
}

/* Buttons */

.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 12px 26px;
    min-height: 46px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #ffffff, #d9e2f2);
    color: var(--on-primary);
    border: none;
    box-shadow: 0 10px 26px rgba(140, 170, 220, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ffffff, #c7d5ee);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover,
.btn-secondary:disabled:hover {
    transform: none;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.nav-link:focus-visible,
.btn-ghost:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.btn-secondary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
    transform: translateX(-100%);
    pointer-events: none;
}

.btn-secondary:hover::before {
    animation: sheen 0.7s ease forwards;
}

@keyframes sheen {
    to { transform: translateX(100%); }
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow,
.btn-secondary:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-block {
    width: 100%;
}

/* Hero */

.hero {
    min-height: calc(100dvh - var(--nav-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: var(--stack-lg) var(--margin-page);
}

.hero-rule {
    position: absolute;
    top: 12%;
    bottom: 12%;
    display: none;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18) 35%, rgba(255, 255, 255, 0.18) 65%, transparent);
    transform-origin: top;
    animation: rule-draw 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@media (min-width: 768px) {
    .hero-rule {
        display: block;
    }
}

@keyframes rule-draw {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

.hero-rule-left {
    left: var(--margin-page);
}

.hero-rule-right {
    right: var(--margin-page);
}

.hero-sweep {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-sweep::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.07) 50%, transparent 60%);
    transform: translateX(-100%);
    animation: hero-sweep 2.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes hero-sweep {
    to { transform: translateX(100%); }
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 860px;
    width: 100%;
    padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
    position: relative;
}

.hero-brand {
    margin: 0;
    width: 100%;
}

.hero-logo {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    filter: invert(1) grayscale(1) contrast(1.1);
    mix-blend-mode: screen;
    animation: hero-logo-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hero-logo-in {
    from { opacity: 0; transform: scale(1.06); filter: invert(1) grayscale(1) contrast(1.1) blur(6px); }
    to   { opacity: 0.94; transform: none; filter: invert(1) grayscale(1) contrast(1.1) blur(0); }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: clamp(28px, 5vw, 44px);
    animation: hero-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

@keyframes hero-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

.hero-scroll {
    margin-top: clamp(28px, 5vw, 44px);
    color: rgba(255, 255, 255, 0.42);
    animation: hero-appear 0.6s ease 1.1s both, hero-bounce 2s 1.7s infinite;
}

@keyframes hero-appear {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes hero-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Home feature sections */

.feature {
    position: relative;
    padding: var(--stack-lg) var(--margin-page);
    width: 100%;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
    align-items: stretch;
}

@media (min-width: 900px) {
    .feature-grid {
        grid-template-columns: 5fr 7fr;
    }

    .feature-grid.is-reversed .feature-copy {
        order: 2;
    }

    .feature-grid.is-reversed .feature-media {
        order: 1;
    }
}

.feature-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
}

@media (min-width: 768px) {
    .feature-copy {
        padding: 48px;
    }
}

.feature-copy h2 {
    margin: 0 0 var(--stack-md);
    color: var(--primary);
}

.feature-copy p {
    color: var(--on-surface-variant);
    margin: 0 0 var(--stack-lg);
    max-width: 46ch;
}

.feature-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    min-height: 320px;
}

@media (min-width: 900px) {
    .feature-media {
        min-height: 520px;
    }
}

.feature-media img,
.pane-art {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 1s ease;
}

.feature-media img {
    opacity: 0.72;
}

.feature-media:hover img,
.feature-media:hover .pane-art {
    transform: scale(1.04);
}

/* Cards */

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
}

@media (min-width: 700px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.app-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 400px;
    transition: background 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.app-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.28);
}

.app-card-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.app-card:hover .app-card-media img {
    transform: scale(1.05);
}

.app-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 24px;
}

.app-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--stack-sm);
}

.app-card-body h2 {
    color: var(--primary);
    margin: 0 0 var(--stack-sm);
}

.app-card-body p {
    color: var(--on-surface-variant);
    flex-grow: 1;
    margin: 0 0 var(--stack-md);
}

/* Bento */

.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
}

.bento > * {
    grid-column: span 12;
    padding: 32px;
}

@media (min-width: 900px) {
    .bento-8 { grid-column: span 8; }
    .bento-4 { grid-column: span 4; }
    .bento-6 { grid-column: span 6; }
}

.bento h2 {
    color: var(--primary);
    margin: 0 0 var(--stack-md);
}

.bento p {
    color: var(--on-surface-variant);
    margin: 0;
}

.spec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--on-surface-variant);
    opacity: 0.8;
}

.spec-list li {
    padding: 4px 0;
}

.spec-list li::before {
    content: "> ";
    color: var(--primary);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: var(--stack-lg);
}

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

.stat-tile {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
    padding: 18px 10px;
    text-align: center;
    color: var(--on-surface-variant);
    min-width: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.stat-tile:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
}

.stat-tile .label-caps {
    display: block;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}

@media (min-width: 480px) {
    .stat-tile {
        padding: 16px;
    }

    .stat-tile .label-caps {
        letter-spacing: 0.15em;
    }
}

.stat-tile .material-symbols-outlined {
    color: var(--accent);
    margin-bottom: 8px;
}

/* Auth modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--margin-page);
    background: rgba(9, 12, 16, 0.76);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: backdrop-in 0.25s ease forwards;
}

.modal-panel {
    width: 100%;
    max-width: 460px;
    max-height: calc(100dvh - 2 * var(--margin-page));
    overflow-y: auto;
    padding: clamp(20px, 5vw, 32px);
    background: linear-gradient(160deg, rgba(38, 44, 55, 0.95), rgba(22, 26, 33, 0.95));
    animation: modal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.stagger-in {
    opacity: 0;
    animation: stagger-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stagger-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: none; }
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.gate-icon {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.4);
}

.pulse {
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-4px); }
}

.fade-up {
    animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

.modal-panel h2 {
    color: var(--primary);
}

.modal-error {
    border-left: 2px solid var(--error);
    border-radius: var(--radius-sm);
    background: rgba(255, 157, 146, 0.09);
    color: var(--error);
    padding: 12px 14px;
    margin-bottom: var(--stack-md);
}

.provider-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: var(--stack-md);
}

.provider-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
}

.provider-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    width: 100%;
    background: none;
    border: none;
    border-radius: var(--radius-pill);
    color: var(--on-surface-variant);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 10px;
    cursor: pointer;
}

.btn-ghost:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Signed-in identity */

.nav-identity {
    display: none;
    align-items: center;
    gap: 12px;
}

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

.nav-identity-name {
    color: var(--on-surface-variant);
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--surface-container-high);
}

.avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    letter-spacing: 0;
}

.gate-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(32px, 6vw, 56px);
    gap: var(--stack-md);
}

/* Footer */

.footer {
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(9, 12, 16, 0.55));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 20;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--stack-lg)
             calc(var(--margin-page) + var(--safe-right))
             calc(var(--stack-lg) + var(--safe-bottom))
             calc(var(--margin-page) + var(--safe-left));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--stack-md);
    text-align: center;
}

@media (min-width: 900px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--on-surface-variant);
}

.footer-links a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    color: var(--on-surface-variant);
    opacity: 0.6;
    font-size: 14px;
}

@media (min-width: 900px) {
    .footer-copy {
        align-items: flex-end;
    }
}

.footer-version {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* Spinner */

.spinner {
    display: inline-block;
    flex-shrink: 0;
    width: var(--spinner-size, 20px);
    height: var(--spinner-size, 20px);
    border-radius: var(--radius-pill);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.75s linear infinite;
}

.spinner-sm {
    --spinner-size: 16px;
}

.spinner-lg {
    --spinner-size: 40px;
    border-width: 3px;
}

.spinner-on-primary {
    border-color: rgba(21, 25, 32, 0.25);
    border-top-color: var(--on-primary);
}

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

.load-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--stack-md);
    padding: clamp(32px, 6vw, 56px);
    text-align: center;
    color: var(--on-surface-variant);
}

.load-state-inline {
    flex-direction: row;
    padding: 14px 0;
    gap: 12px;
}

/* Skills */

.skill-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
}

@media (min-width: 760px) {
    .skill-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.skill-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 26px;
}

.skill-card h3 {
    margin: 0;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.tech-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 13.5px;
    letter-spacing: 0;
    text-transform: none;
    padding: 7px 13px 7px 9px;
    color: var(--on-surface);
}

.tech-icon {
    display: block;
    flex-shrink: 0;
}

.stat-tile .tech-icon {
    margin: 0 auto 10px;
}

.intro-panel {
    padding: clamp(20px, 3.5vw, 28px);
    margin-bottom: var(--stack-lg);
}

.intro-highlights {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

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

.intro-highlight {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: var(--on-surface-variant);
    font-size: 15px;
}

.intro-highlight .material-symbols-outlined {
    color: var(--accent);
    font-size: 22px;
}

/* Forms */

.form-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
    align-items: start;
}

@media (min-width: 1000px) {
    .form-layout {
        grid-template-columns: 7fr 5fr;
    }
}

.form-panel {
    padding: clamp(26px, 5vw, 44px);
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: field-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes field-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--on-surface);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.field-label .material-symbols-outlined {
    font-size: 18px;
    color: var(--accent);
}

.field-hint {
    color: var(--on-surface-variant);
    font-size: 13px;
    opacity: 0.85;
}

.field-input,
.field-textarea,
.field-select {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.field-textarea {
    min-height: 128px;
    resize: vertical;
}

.field-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--on-surface-variant) 50%),
        linear-gradient(135deg, var(--on-surface-variant) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 44px;
    cursor: pointer;
}

.field-select option {
    background: var(--surface-container);
    color: var(--on-surface);
}

.field-input::placeholder,
.field-textarea::placeholder {
    color: var(--on-surface-variant);
    opacity: 0.55;
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(134, 211, 226, 0.16);
}

.field-input:disabled,
.field-textarea:disabled,
.field-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.field.has-error .field-input,
.field.has-error .field-textarea,
.field.has-error .field-select {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(255, 157, 146, 0.14);
}

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--error);
    font-size: 13px;
    animation: field-in 0.25s ease both;
}

.field-error .material-symbols-outlined {
    font-size: 16px;
}

.choice-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 560px) {
    .choice-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--on-surface-variant);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.choice:hover {
    background: rgba(255, 255, 255, 0.06);
}

.choice.is-selected {
    border-color: var(--accent);
    background: rgba(134, 211, 226, 0.1);
    color: var(--on-surface);
}

.choice-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: var(--radius-pill);
    border: 2px solid rgba(255, 255, 255, 0.28);
    transition: border-color 0.25s ease;
}

.choice.is-selected .choice-mark {
    border-color: var(--accent);
}

.choice.is-selected .choice-mark::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: var(--radius-pill);
    background: var(--accent);
}

.choice-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.choice-title {
    font-weight: 500;
    color: inherit;
}

.choice-note {
    font-size: 13px;
    opacity: 0.75;
    overflow-wrap: anywhere;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: var(--stack-sm);
}

.form-note {
    color: var(--on-surface-variant);
    font-size: 13px;
    opacity: 0.8;
}

.form-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    margin-bottom: var(--stack-md);
    animation: field-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-status .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}

.form-status.is-error {
    border: 1px solid rgba(255, 157, 146, 0.35);
    background: rgba(255, 157, 146, 0.1);
    color: var(--error);
}

.form-status.is-success {
    border: 1px solid rgba(143, 224, 180, 0.35);
    background: rgba(143, 224, 180, 0.1);
    color: var(--success);
}

/* Booking aside */

.book-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: clamp(24px, 4vw, 34px);
}

.book-aside h2 {
    margin: 0;
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 600;
}

.book-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.book-step {
    display: flex;
    gap: 14px;
    color: var(--on-surface-variant);
    font-size: 15px;
}

.book-step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(134, 211, 226, 0.35);
    background: rgba(134, 211, 226, 0.1);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 13px;
}

.book-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--stack-md);
    padding: clamp(36px, 7vw, 64px);
    text-align: center;
    animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.book-done-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(143, 224, 180, 0.35);
    background: rgba(143, 224, 180, 0.12);
    color: var(--success);
    animation: pop-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.book-done-icon .material-symbols-outlined {
    font-size: 38px;
}

@keyframes pop-in {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: none; }
}

.book-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin-top: var(--stack-sm);
    text-align: left;
}

.book-summary-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.book-summary-key {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.book-summary-value {
    color: var(--on-surface-variant);
    font-size: 15px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* Scroll reveal */

html.reveal-enabled .reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

html.reveal-enabled .reveal-up.active {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    html.reveal-enabled .reveal-up {
        opacity: 1;
        transform: none;
        transition: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .stagger-in,
    .fade-up,
    .field,
    .form-status,
    .book-done,
    .book-done-icon {
        opacity: 1;
        transform: none;
    }

    .spinner {
        animation-duration: 0.9s !important;
        animation-iteration-count: infinite !important;
    }

    .app-card:hover,
    .glass-interactive:hover,
    .stat-tile:hover {
        transform: none;
    }
}

/* Blazor error UI */

#blazor-error-ui {
    background: var(--surface-container-high);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--on-surface);
    border-top: 1px solid var(--error);
    bottom: 0;
    display: none;
    left: 0;
    padding: 16px var(--margin-page);
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 14px;
}

.loading-progress {
    position: fixed;
    display: block;
    width: 8rem;
    height: 8rem;
    top: calc(50vh - 4rem);
    left: calc(50vw - 4rem);
}

.loading-progress circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 0.5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    top: calc(50vh - 0.8rem);
    width: 100%;
    color: var(--on-surface-variant);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "LOADING");
}
