/* ===== Base / Reset ===== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: var(--lh-normal);
}

/* Typography system */
h1, h2, h3 {
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--text-4xl);
    line-height: var(--lh-tight);
    margin-bottom: 16px;
}

h2 {
    font-size: var(--text-2xl);
    margin-bottom: 12px;
}

h3 {
    font-size: var(--text-xl);
    margin-bottom: 8px;
}

p {
    margin: 0;
    font-size: var(--text-lg);
    line-height: var(--lh-normal);
}

strong {
    font-weight: 700;
}

.muted {
    color: var(--color-text-muted);
}

.mono {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.measure {
    max-width: 75ch;
}

.text-strong {
    color: var(--color-text);
}

.text-highlight {
    color: var(--color-highlight);
}

a {
    color: var(--color-secondary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

/* ===== Layout ===== */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 88px 0;
}

.section--alt {
    background: color-mix(in srgb, var(--color-surface) 22%, transparent);
}

/* ===== Motion ===== */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Header ===== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.site-header__inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.brand__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--color-secondary);
    box-shadow: 0 0 18px rgba(45, 212, 191, .35);
}

.brand__emblem {
    width: 44px;
    height: 44px;
    margin-right: 12px;
    display: inline-block;
    flex: 0 0 auto;
}


.site-nav {
    display: flex;
    gap: 22px;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.site-nav .nav-cv {
    margin-left: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9em;
    opacity: 0.85;
    border: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
}

.site-nav .nav-cv:hover {
    opacity: 1;
    text-decoration: none;
}


/* ===== Surfaces ===== */

.glass {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03)),
    var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(
            circle at 50% 30%,
            rgba(255, 255, 255, .10) 0%,
            rgba(255, 255, 255, .05) 35%,
            rgba(255, 255, 255, 0) 70%
    );
    transform: rotate(8deg);
    pointer-events: none;
}

.card {
    padding: 24px;
    background: color-mix(in srgb, var(--color-surface) 65%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card--lg {
    border-radius: var(--radius-lg);
}

/* ===== UI Components ===== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;

    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
    border-radius: 999px;

    color: var(--color-text);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.badge__dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--color-secondary);
}

/* ===== Status Card (Hero right) ===== */

.status-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.status-header__title {
    font-weight: 700;
}

.status-header__subtitle {
    font-size: var(--text-sm);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 18px rgba(34, 197, 94, .25);
}

.status-table {
    margin-top: 18px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.status-row:last-child {
    border-bottom: 0;
}

.status-accent {
    color: var(--color-secondary);
}

.status-link {
    color: var(--color-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
}

.status-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .03);
    font-size: var(--text-sm);
    color: var(--color-text);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.status-dot--ok {
    background: #22c55e;
    box-shadow: 0 0 18px rgba(34, 197, 94, .25);
}

.status-dot--down {
    background: #ef4444;
    box-shadow: 0 0 18px rgba(239, 68, 68, .25);
}

.status-dot--unknown {
    background: #f59e0b;
    box-shadow: 0 0 18px rgba(245, 158, 11, .25);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);

    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(180deg, rgba(45, 212, 191, .18), rgba(45, 212, 191, .10));
    border: 1px solid rgba(45, 212, 191, .35);
    color: var(--color-text);
}

.btn-primary:hover {
    background: linear-gradient(180deg, rgba(14, 165, 233, .22), rgba(14, 165, 233, .14));
    border-color: rgba(14, 165, 233, .6);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(45, 212, 191, .35);
    color: var(--color-secondary);
}

.btn-ghost:hover {
    background: rgba(14, 165, 233, .08);
    border-color: rgba(14, 165, 233, .6);
    color: var(--color-primary);
}

/* ===== Hero ===== */

.hero {
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;

    min-height: 92vh;
    padding-top: 80px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(
            ellipse at center,
            rgba(255, 255, 255, 0.04) 0%,
            rgba(255, 255, 255, 0.02) 35%,
            rgba(0, 0, 0, 0.2) 70%,
            rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 48px;
    align-items: center;
}

.hero__title {
    margin-top: 18px;
}

.hero__lede {
    max-width: 60ch;
    margin-top: 12px;
}

.hero__sublede {
    max-width: 60ch;
    margin-top: 14px;
    font-size: var(--text-md);
}

.hero__cta {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

/* ===== Projects ===== */

.section-head {
    margin-bottom: 26px;
}

.section-head--spaced {
    margin-top: 32px;
}


.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.bento > * {
    grid-column: span 12;
}

/* ===== Project Cards ===== */

.project-card {
    border-radius: 16px;
}

.project-card__title {
    margin: 0;
}

.project-card__summary {
    margin: 10px 0 14px;
    color: var(--color-text-muted);
    font-size: var(--text-md);
    line-height: var(--lh-normal);
}

.project-card__tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-card__links {
    margin-top: 12px;
}

.project-card__link {
    font-size: 0.9em;
    opacity: 0.85;
    text-decoration: none;
}

.project-card__link:hover {
    opacity: 1;
    text-decoration: underline;
}


.tag {
    display: inline-flex;
    align-items: center;

    font-size: var(--text-xs);
    padding: 6px 10px;

    border-radius: 999px;
    border: 1px solid var(--border);

    color: rgba(255, 255, 255, .70);
    background: rgba(255, 255, 255, .02);
}

.project-card__footer {
    margin-top: 16px;
}

.project-card__link {
    font-size: 0.9rem;
    color: var(--color-secondary);
    text-decoration: none;
}

.project-card__link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.project-card--spotlight {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
    background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--color-surface) 96%, transparent),
            color-mix(in srgb, var(--color-surface) 88%, transparent)
    );
}


.project-card__spotlight-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    font-family: var(--font-mono, monospace);

    background: transparent;
    border: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
    color: color-mix(in srgb, var(--color-text) 70%, transparent);
}


.project-card--spotlight .project-card__title {
    font-size: 1.25rem;
}

.project-card--spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;

    /* subtle top-edge accent wash */
    background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--color-accent) 4%, transparent),
            transparent 48%
    );
    opacity: 0.9;
}


/* ===== Blockquote ===== */

blockquote {
    margin: 0;
    padding: 28px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius);
    color: var(--color-text);
}

.blockquote-meta {
    margin-top: 16px;
    color: var(--color-text-muted);
}

/* ===== Footer ===== */

.footer {
    text-align: center;
}

.footer__links {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--color-text-muted);
}

.footer__meta {
    margin-top: 18px;
    color: rgba(255, 255, 255, .35);
    font-size: var(--text-sm);
}

.footer__disclaimer {
    font-size: 0.8em;
    opacity: 0.65;
}


/* ===== Principles ===== */

.principles {
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--color-text-muted);
    max-width: 80ch;
}

.principles li {
    margin: 10px 0;
}

.principles strong {
    color: var(--color-text);
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .bento .span-8 {
        grid-column: span 8;
    }

    .bento .span-4 {
        grid-column: span 4;
    }
}

/* ===== Chat UI ===== */

.chatbot {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chatbot__fab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    cursor: pointer;
    order: 1;
    margin-top: 0;
}

.chatbot__fab:hover {
    border-color: rgba(148, 163, 184, 0.28);
}

.chatbot__fab-icon {
    width: 22px;
    height: 22px;
}

.chatbot__fab-label {
    font-weight: 600;
    color: var(--color-text);
}

.chatbot__panel {
    width: min(440px, calc(100vw - 40px));
    height: min(600px, calc(100vh - 140px));
    margin-top: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    order: 0;
}

.chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.chatbot__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot__mark {
    width: 20px;
    height: 20px;
    opacity: 0.95;
}

.chatbot__title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chatbot__subtitle {
    font-size: 12px;
}

.chatbot__close {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.82;
}

.chatbot__close:hover {
    opacity: 1;
}

.chatbot__body {
    padding: 14px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot__msg {
    display: flex;
}

.chatbot__msg--bot {
    justify-content: flex-start;
}

.chatbot__msg--user {
    justify-content: flex-end;
}

.chatbot__bubble {
    max-width: 85%;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: color-mix(in srgb, var(--color-surface) 32%, transparent);
    border-radius: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot__msg--user .chatbot__bubble {
    background: color-mix(in srgb, var(--color-primary-soft) 68%, transparent);
}

.chatbot__footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.chatbot__form {
    display: flex;
    gap: 10px;
}

.chatbot__input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: color-mix(in srgb, var(--color-surface) 22%, transparent);
    color: var(--color-text);
}

.chatbot__input::placeholder {
    color: var(--color-text-muted);
}

.chatbot__meta {
    margin-top: 8px;
    font-size: 12px;
}

@media (max-width: 420px) {
    .chatbot__fab-label {
        display: none;
    }
}

.chatbot--open .chatbot__fab-label {
    display: none;
}

.chatbot__panel {
    display: none;
}

.chatbot.chatbot--open .chatbot__panel {
    display: flex;
}