/* ==========================================================================
   Foxbyte Labs — design tokens
   ========================================================================== */

:root {
    --color-bg: #0c1410;
    --color-bg-deep: #08100c;
    --color-surface: #152019;
    --color-surface-raised: #1c2a22;
    --color-border: rgba(242, 239, 232, 0.09);
    --color-border-strong: rgba(242, 239, 232, 0.16);
    --color-text: #f2efe8;
    --color-text-muted: #a3b0a8;
    --color-text-soft: #7f8f86;
    --color-accent: #e08a45;
    --color-accent-hover: #eba05f;
    --color-accent-soft: #c9a06a;
    --color-forest: #2f4a3c;
    --color-live: #8fad9a;
    --color-beta: #c9a06a;
    --color-dev: #9aaba2;
    --color-experiment: #a89b84;

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Figtree", "Segoe UI", sans-serif;

    --radius-sm: 0.5rem;
    --radius-md: 0.9rem;
    --radius-lg: 1.15rem;

    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.22);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.16);

    --space-section: clamp(3.5rem, 7vw, 5.5rem);
    --content-width: 68rem;
    --nav-height: 4rem;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--color-text);
    background:
        radial-gradient(ellipse 70% 45% at 12% -8%, rgba(47, 74, 60, 0.4), transparent 55%),
        radial-gradient(ellipse 50% 35% at 88% 4%, rgba(224, 138, 69, 0.07), transparent 48%),
        linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-deep) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-accent-soft);
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

p {
    margin: 0;
}

.site-shell {
    position: relative;
    min-height: 100vh;
}

.lab-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image:
        linear-gradient(rgba(242, 239, 232, 0.9) 1px, transparent 1px),
        linear-gradient(90deg, rgba(242, 239, 232, 0.9) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

main {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--nav-height);
    border-bottom: 1px solid transparent;
    transition: background 200ms var(--ease), border-color 200ms var(--ease), backdrop-filter 200ms var(--ease);
}

.site-nav--solid {
    background: rgba(12, 20, 16, 0.86);
    border-bottom-color: var(--color-border);
    backdrop-filter: blur(12px);
}

.site-nav__inner {
    width: min(100%, var(--content-width));
    height: 100%;
    margin: 0 auto;
    padding: 0 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
}

.site-nav__logo {
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    object-fit: cover;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.site-nav__links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 160ms var(--ease);
}

.site-nav__links a:hover {
    color: var(--color-text);
}

.site-nav__links .ext {
    font-size: 0.75em;
    opacity: 0.7;
}

.site-nav__toggle {
    display: none;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 0.55rem;
    background: transparent;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.35rem;
}

.site-nav__toggle span {
    display: block;
    width: 1rem;
    height: 1.5px;
    background: var(--color-text-muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 1.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn--primary {
    background: var(--color-accent);
    color: #1a1008;
    box-shadow: 0 8px 20px rgba(224, 138, 69, 0.18);
}

.btn--primary:hover {
    background: var(--color-accent-hover);
    color: #1a1008;
}

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

.btn--ghost:hover {
    border-color: var(--color-accent-soft);
    color: var(--color-accent-soft);
}

/* ==========================================================================
   Living lab details
   ========================================================================== */

.pulse-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 0 rgba(224, 138, 69, 0.45);
    animation: pulse 2.4s ease-out infinite;
}

.pulse-dot--sm {
    width: 0.38rem;
    height: 0.38rem;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(224, 138, 69, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(224, 138, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 138, 69, 0); }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    min-height: calc(100vh - var(--nav-height));
    display: grid;
    place-items: center;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem 3.5rem;
    overflow: hidden;
}

.hero__atmosphere {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 16%, rgba(224, 138, 69, 0.1), transparent 30%),
        radial-gradient(ellipse at 50% 100%, rgba(47, 74, 60, 0.32), transparent 55%);
    pointer-events: none;
}

.hero__glow {
    position: absolute;
    width: min(28rem, 80vw);
    height: min(28rem, 80vw);
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(224, 138, 69, 0.12), transparent 68%);
    pointer-events: none;
    filter: blur(8px);
}

.hero__atmosphere::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 7rem;
    background: linear-gradient(to bottom, transparent, var(--color-bg-deep));
}

.hero__content {
    position: relative;
    z-index: 1;
    width: min(100%, 40rem);
    text-align: center;
}

.hero__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.hero__logo {
    width: clamp(5.5rem, 14vw, 7.25rem);
    height: clamp(5.5rem, 14vw, 7.25rem);
    border-radius: 1.15rem;
    object-fit: cover;
    box-shadow:
        0 0 0 1px rgba(201, 160, 106, 0.18),
        0 16px 36px rgba(0, 0, 0, 0.28);
}

.hero__pulse-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent-soft);
}

.hero__title {
    font-size: clamp(2.6rem, 7.5vw, 4.25rem);
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.hero__tagline {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    font-weight: 500;
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.hero__lede {
    color: var(--color-text-muted);
    max-width: 33rem;
    margin: 0 auto 1.85rem;
    font-size: 1.02rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Reveal motion */
.reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: reveal-up 700ms var(--ease) forwards;
}

.reveal--delay-1 { animation-delay: 70ms; }
.reveal--delay-2 { animation-delay: 140ms; }
.reveal--delay-3 { animation-delay: 210ms; }
.reveal--delay-4 { animation-delay: 280ms; }

@keyframes reveal-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .reveal,
    .pulse-dot {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
    padding: var(--space-section) 1.5rem;
}

.section__inner {
    width: min(100%, var(--content-width));
    margin: 0 auto;
}

.section__header {
    max-width: 34rem;
    margin-bottom: 2rem;
}

.section__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-soft);
    margin-bottom: 0.65rem;
}

.section__title {
    font-size: clamp(1.8rem, 3.8vw, 2.4rem);
    margin-bottom: 0.65rem;
}

.section__subtitle {
    color: var(--color-text-muted);
}

/* ==========================================================================
   Projects
   ========================================================================== */

.projects {
    background: linear-gradient(180deg, transparent, rgba(21, 32, 25, 0.5) 18%, rgba(21, 32, 25, 0.5) 82%, transparent);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: rgba(28, 42, 34, 0.88);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.3rem 1.2rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    transition: transform 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(224, 138, 69, 0.26);
    background: rgba(32, 48, 39, 0.95);
}

.project-card:hover .project-card__arrow {
    transform: translateX(3px);
    color: var(--color-accent);
}

.project-card--active {
    border-color: rgba(224, 138, 69, 0.16);
}

.project-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.project-card__title {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--color-text);
}

.project-card__description {
    color: var(--color-text-muted);
    font-size: 0.96rem;
    flex: 1;
}

.project-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
}

.project-card__category {
    color: var(--color-text-soft);
    letter-spacing: 0.02em;
}

.project-card__updated {
    color: var(--color-text-soft);
}

.project-card__arrow {
    color: var(--color-text-soft);
    font-size: 1.05rem;
    transition: transform 180ms var(--ease), color 180ms var(--ease);
}

.projects-state {
    padding: 1.5rem;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    text-align: center;
}

.projects-state a {
    display: inline-block;
    margin-top: 0.5rem;
}

.projects-den-link {
    margin-top: 1.75rem;
    text-align: center;
}

.projects-den-link a {
    color: var(--color-accent-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
}

.projects-den-link a:hover {
    color: var(--color-accent);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status--live {
    color: var(--color-live);
    background: rgba(143, 173, 154, 0.1);
    border-color: rgba(143, 173, 154, 0.22);
}

.status--beta {
    color: var(--color-beta);
    background: rgba(201, 160, 106, 0.1);
    border-color: rgba(201, 160, 106, 0.24);
}

.status--dev {
    color: var(--color-dev);
    background: rgba(154, 171, 162, 0.1);
    border-color: rgba(154, 171, 162, 0.22);
}

.status--experiment {
    color: var(--color-experiment);
    background: rgba(168, 155, 132, 0.1);
    border-color: rgba(168, 155, 132, 0.22);
}

.status--default {
    color: var(--color-text-soft);
    background: rgba(242, 239, 232, 0.05);
    border-color: var(--color-border);
}

/* ==========================================================================
   About
   ========================================================================== */

.about__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(1.25rem, 3.5vw, 3rem);
    align-items: start;
}

.about .section__header {
    margin-bottom: 0;
}

.about__copy {
    display: grid;
    gap: 0.95rem;
    color: var(--color-text-muted);
    font-size: 1.04rem;
    max-width: 36rem;
}

.about__copy p:first-child {
    color: var(--color-text);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    position: relative;
    z-index: 1;
    padding: 2.25rem 1.5rem 2.75rem;
    border-top: 1px solid var(--color-border);
}

.site-footer__inner {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    text-align: center;
    display: grid;
    gap: 0.55rem;
}

.site-footer__text,
.site-footer__links {
    color: var(--color-text-soft);
    font-size: 0.9rem;
}

.site-footer__links {
    display: inline-flex;
    justify-content: center;
    gap: 0.55rem;
}

.site-footer__links a {
    color: var(--color-text-soft);
    text-decoration: none;
}

.site-footer__links a:hover {
    color: var(--color-accent-soft);
}

/* ==========================================================================
   Not found
   ========================================================================== */

.not-found {
    min-height: 70vh;
    display: grid;
    place-items: center;
    text-align: center;
}

.not-found .section__inner {
    display: grid;
    justify-items: center;
    gap: 1rem;
}

.not-found .section__subtitle {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Boot / Blazor chrome
   ========================================================================== */

.boot {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
}

.boot__logo {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 0.85rem;
    opacity: 0.9;
}

.loading-progress {
    display: block;
    width: 4.5rem;
    height: 4.5rem;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(242, 239, 232, 0.12);
    stroke-width: 0.55rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--color-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 {
    text-align: center;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading the den…");
}

#blazor-error-ui {
    background: #3a2214;
    color: var(--color-text);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.85rem;
    top: 0.55rem;
}

.blazor-error-boundary {
    background: #7a2d1f;
    padding: 1rem 1.25rem;
    color: white;
    border-radius: var(--radius-md);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
    .site-nav__toggle {
        display: inline-flex;
    }

    .site-nav__links {
        display: none;
        position: absolute;
        top: calc(var(--nav-height) - 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 1rem 1rem;
        background: rgba(12, 20, 16, 0.96);
        border-bottom: 1px solid var(--color-border);
        backdrop-filter: blur(12px);
    }

    .site-nav__links.is-open {
        display: flex;
    }

    .site-nav__links a {
        padding: 0.85rem 0.4rem;
        border-bottom: 1px solid var(--color-border);
    }

    .site-nav__links a:last-child {
        border-bottom: 0;
    }
}

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

    .about__inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero {
        min-height: auto;
        padding-top: 2.25rem;
        padding-bottom: 2.75rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}
