:root {
    --pf-bg: #06080f;
    --pf-bg-soft: #0a0e1a;
    --pf-surface: rgba(255, 255, 255, 0.03);
    --pf-surface-2: rgba(255, 255, 255, 0.05);
    --pf-border: rgba(148, 163, 184, 0.14);
    --pf-border-strong: rgba(148, 163, 184, 0.28);
    --pf-text: #e7ecf5;
    --pf-text-2: #9aa7bd;
    --pf-text-3: #64748b;
    --pf-indigo: #818cf8;
    --pf-cyan: #22d3ee;
    --pf-violet: #a78bfa;
    --pf-gradient: linear-gradient(135deg, var(--pf-indigo), var(--pf-cyan));
    --pf-radius: 16px;
    --pf-radius-sm: 10px;
    --pf-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --pf-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --pf-header-h: 72px;
    --pf-container: 1120px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--pf-header-h) + 16px);
    overflow-x: hidden;
}

body {
    background-color: var(--pf-bg);
    color: var(--pf-text);
    font-family: var(--pf-font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: rgba(129, 140, 248, 0.35);
}

/* Slim, themed scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--pf-bg); }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    border: 2px solid var(--pf-bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(900px 600px at 12% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
        radial-gradient(800px 500px at 92% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
        radial-gradient(1000px 700px at 50% 115%, rgba(167, 139, 250, 0.08), transparent 60%),
        var(--pf-bg);
}

.backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 10%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 10%, transparent 75%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: float 18s ease-in-out infinite;
}

.orb-indigo { width: 480px; height: 480px; top: -160px; left: -120px; background: rgba(99, 102, 241, 0.22); }
.orb-cyan { width: 380px; height: 380px; top: 10%; right: -140px; background: rgba(34, 211, 238, 0.14); animation-delay: -6s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.06); }
}

.container {
    max-width: var(--pf-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* grid children must be able to shrink below content size */
.hero-grid > *,
.contact-grid > * {
    min-width: 0;
}

/* pre elements must not expand their container */
pre {
    overflow-x: auto;
    max-width: 100%;
}

.section {
    padding: 96px 0;
    position: relative;
}

@media (max-width: 768px) {
    .section { padding: 64px 0; }
}

.gradient-text {
    background: var(--pf-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.eyebrow {
    font-family: var(--pf-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pf-cyan);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--pf-gradient);
}

.section-title {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 14px 0 0;
}

.section-subtitle {
    color: var(--pf-text-2);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 620px;
    margin: 16px 0 0;
}

.mono { font-family: var(--pf-mono); }

.glass-card {
    background: var(--pf-surface);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease,
                box-shadow 0.35s ease,
                background 0.35s ease;
}

.glass-card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--pf-border-strong);
    background: var(--pf-surface-2);
    box-shadow:
        0 20px 50px -20px rgba(0, 0, 0, 0.6),
        0 0 50px -16px rgba(99, 102, 241, 0.28);
}

.tech-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid var(--pf-border);
    background: rgba(148, 163, 184, 0.06);
    font-family: var(--pf-mono);
    font-size: 0.78rem;
    color: var(--pf-text-2);
    white-space: nowrap;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.tech-chip::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pf-gradient);
    opacity: 0.85;
}

.tech-chip:hover {
    border-color: rgba(129, 140, 248, 0.5);
    color: var(--pf-text);
    background: rgba(99, 102, 241, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.btn-primary {
    background: var(--pf-gradient);
    color: #0a0e1a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -10px rgba(99, 102, 241, 0.55);
}

.btn-ghost {
    border-color: var(--pf-border-strong);
    color: var(--pf-text);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--pf-indigo);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--pf-header-h);
    display: flex;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    background: rgba(6, 8, 15, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--pf-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    font-family: var(--pf-mono);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--pf-text);
    letter-spacing: -0.04em;
}

.logo span { color: var(--pf-cyan); }

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--pf-text-2);
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: var(--pf-font);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover { color: var(--pf-text); background: rgba(148, 163, 184, 0.08); }
.nav-link.active { color: var(--pf-text); background: rgba(99, 102, 241, 0.14); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 860px) {
    .nav { display: none; }
    .header {
        background: rgba(6, 8, 15, 0.88);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom-color: var(--pf-border);
    }
}

.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--pf-header-h) + 40px) 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
}

@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--pf-border);
    background: var(--pf-surface);
    font-family: var(--pf-mono);
    font-size: 0.78rem;
    color: var(--pf-text-2);
    max-width: 100%;
}

.hero-status-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-status-sm { display: none; }

@media (max-width: 640px) {
    .hero-status-full { display: none; }
    .hero-status-sm { display: inline; }
}

.hero-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 26px 0 0;
}

.hero-lede {
    color: var(--pf-text-2);
    font-size: 1.12rem;
    line-height: 1.75;
    max-width: 540px;
    margin: 24px 0 0;
}

.hero-lede strong { color: var(--pf-text); font-weight: 600; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

/* Terminal-style card */
.terminal {
    border-radius: var(--pf-radius);
    border: 1px solid var(--pf-border);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    overflow: hidden;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 0 60px -20px rgba(99, 102, 241, 0.25);
    font-family: var(--pf-mono);
    font-size: 0.82rem;
    line-height: 1.75;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--pf-border);
    background: rgba(148, 163, 184, 0.04);
}

.terminal-dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal-dot-r { background: #f87171; }
.terminal-dot-y { background: #fbbf24; }
.terminal-dot-g { background: #34d399; }

.terminal-title {
    margin-left: 8px;
    color: var(--pf-text-3);
    font-size: 0.75rem;
}

.terminal-body { padding: 20px 22px; overflow-x: auto; }
.terminal-body pre { margin: 0; font-family: inherit; }

.tk-kw { color: #c4b5fd; }
.tk-type { color: #67e8f9; }
.tk-prop { color: #e7ecf5; }
.tk-str { color: #86efac; }
.tk-num { color: #fca5a5; }
.tk-cm { color: #64748b; font-style: italic; }
.tk-punc { color: #94a3b8; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 960px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }

/* Stretch Reveal wrappers so the glass card inside can fill the row height */
.stats-grid .reveal {
    display: flex;
    flex-direction: column;
}

.stat-card {
    padding: 28px;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.stat-card-value {
    font-family: var(--pf-mono);
    font-size: clamp(2rem, 3.4vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card-label {
    margin-top: 12px;
    color: var(--pf-text-2);
    font-size: 0.92rem;
    line-height: 1.5;
}

.stat-card-hint {
    margin-top: 4px;
    color: var(--pf-text-3);
    font-size: 0.78rem;
    font-family: var(--pf-mono);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 48px;
}

@media (max-width: 960px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .skills-grid { grid-template-columns: 1fr; } }

.skills-grid .reveal {
    display: flex;
    flex-direction: column;
}

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

.skill-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.25);
    color: var(--pf-indigo);
    flex-shrink: 0;
}

.skill-group-title { font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em; }

.skill-group-blurb { color: var(--pf-text-2); font-size: 0.88rem; line-height: 1.6; margin: 0; }

.skill-group-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline {
    margin-top: 48px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding-left: 28px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(to bottom, rgba(129, 140, 248, 0.5), rgba(34, 211, 238, 0.2), transparent);
}

.timeline-entry { position: relative; }

.timeline-entry::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 7px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--pf-bg);
    border: 2px solid var(--pf-indigo);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.55);
}

.timeline-entry-period {
    font-family: var(--pf-mono);
    font-size: 0.78rem;
    color: var(--pf-cyan);
    letter-spacing: 0.06em;
}

.timeline-entry-role {
    font-size: 1.18rem;
    font-weight: 650;
    margin: 8px 0 0;
    letter-spacing: -0.015em;
}

.timeline-entry-org { color: var(--pf-indigo); font-weight: 500; }

.timeline-entry-bullets {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: var(--pf-text-2);
    font-size: 0.94rem;
    line-height: 1.65;
    max-width: 680px;
}

.timeline-entry-bullets li {
    padding-left: 20px;
    position: relative;
}

.timeline-entry-bullets li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--pf-cyan);
    font-size: 0.8rem;
    top: 2px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 48px;
}

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

.projects-grid .reveal {
    display: flex;
    flex-direction: column;
}

.project-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--pf-gradient);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.project-card:hover::before { opacity: 1; }

.project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    color: var(--pf-cyan);
}

.project-card-metric {
    font-family: var(--pf-mono);
    font-size: 0.75rem;
    color: var(--pf-cyan);
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: rgba(34, 211, 238, 0.07);
}

.project-card-title { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; margin: 0; }

.project-card-context {
    font-family: var(--pf-mono);
    font-size: 0.76rem;
    color: var(--pf-text-3);
    margin-top: -10px;
}

.project-card-desc {
    color: var(--pf-text-2);
    font-size: 0.93rem;
    line-height: 1.7;
    margin: 0;
    flex-grow: 1;
}

.project-card-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.project-card-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--pf-indigo);
    text-decoration: none;
    width: fit-content;
    transition: gap 0.25s ease, color 0.25s ease;
}

.project-card-link:hover { color: var(--pf-cyan); gap: 11px; }

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 56px;
    margin-top: 8px;
}

.about-grid .reveal {
    display: flex;
    flex-direction: column;
}

@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }

.about-prose {
    color: var(--pf-text-2);
    font-size: 1.02rem;
    line-height: 1.85;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

.about-prose p { margin: 0; }
.about-prose strong { color: var(--pf-text); font-weight: 600; }

.about-facts {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

.fact { display: flex; flex-direction: column; gap: 3px; }
.fact-key { font-family: var(--pf-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pf-text-3); }
.fact-value { font-size: 0.95rem; color: var(--pf-text); }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 48px;
}

.contact-grid .reveal {
    display: flex;
    flex-direction: column;
}

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

.contact-panel { padding: 32px; flex: 1; }

.contact-form { display: flex; flex-direction: column; gap: 6px; }

@keyframes success-enter {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes success-icon-pop {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    55%  { transform: scale(1.2) rotate(3deg);  opacity: 1; }
    75%  { transform: scale(0.92) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes success-ring {
    0%   { transform: scale(1);   opacity: 0.55; }
    100% { transform: scale(2.4); opacity: 0; }
}

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

.contact-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 40px 20px;
    animation: success-enter 0.4s cubic-bezier(0.34, 1.15, 0.64, 1) both;
}

.contact-success-icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #34d399;
    animation: success-icon-pop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) 0.05s both;
}

.contact-success-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(52, 211, 153, 0.55);
    animation: success-ring 0.65s ease-out 0.35s both;
    pointer-events: none;
}

.contact-success > *:nth-child(2) { animation: success-fade-up 0.3s ease-out 0.3s both; }
.contact-success > *:nth-child(3) { animation: success-fade-up 0.3s ease-out 0.42s both; }
.contact-success > *:nth-child(4) { animation: success-fade-up 0.3s ease-out 0.54s both; }

.api-note {
    margin-top: 20px;
    color: var(--pf-text-2);
    font-size: 0.92rem;
    line-height: 1.7;
}

.code-block {
    margin-top: 18px;
    border-radius: var(--pf-radius-sm);
    border: 1px solid var(--pf-border);
    background: rgba(0, 0, 0, 0.35);
    padding: 18px 20px;
    font-family: var(--pf-mono);
    font-size: 0.78rem;
    line-height: 1.8;
    color: var(--pf-text-2);
    overflow-x: auto;
}

.code-block pre { margin: 0; font-family: inherit; }

.footer {
    border-top: 1px solid var(--pf-border);
    padding: 36px 0;
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-meta {
    color: var(--pf-text-3);
    font-size: 0.85rem;
    font-family: var(--pf-mono);
}

.footer-links { display: flex; gap: 8px; }

html.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

html.js .reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js .reveal { opacity: 1; transform: none; transition: none; }
    .orb { animation: none; }
    html { scroll-behavior: auto; }
}

.mud-input-control .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--pf-border);
    border-radius: 12px;
}

.mud-input-control .mud-input.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--pf-border-strong);
}

.mud-snackbar { font-family: var(--pf-font); }
