:root {
    color-scheme: light;
    --radius: .75rem;
    --background: oklch(.985 .002 80);
    --foreground: oklch(.16 .01 60);
    --card: oklch(1 0 0);
    --card-foreground: oklch(.16 .01 60);
    --primary: oklch(.68 .22 45);
    --primary-foreground: oklch(.99 .005 80);
    --secondary: oklch(.955 .006 70);
    --muted-foreground: oklch(.5 .015 60);
    --border: oklch(.9 .008 65);
    --neon: oklch(.7 .23 45);
    --neon-soft: oklch(.7 .23 45 / .35);
}

.dark {
    color-scheme: dark;
    --background: oklch(.13 .004 60);
    --foreground: oklch(.95 .005 70);
    --card: oklch(.165 .005 60);
    --card-foreground: oklch(.95 .005 70);
    --primary: oklch(.74 .21 48);
    --primary-foreground: oklch(.14 .01 50);
    --secondary: oklch(.2 .005 60);
    --muted-foreground: oklch(.62 .01 60);
    --border: oklch(.24 .006 60);
    --neon: oklch(.78 .2 50);
    --neon-soft: oklch(.78 .2 50 / .4);
}

*, *::before, *::after {
    box-sizing: border-box;
    border-color: var(--border);
}

html {
    scroll-behavior: smooth;
    background: var(--background);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}

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

button, input, textarea, select {
    font: inherit;
}

button {
    color: inherit;
}

svg {
    display: block;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklch, var(--background) 80%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    width: 100%;
    max-width: 56rem;
    height: 4rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.brand {
    color: var(--foreground);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.025em;
}

.brand span {
    color: var(--primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-nav > a {
    color: var(--muted-foreground);
    font-size: .875rem;
    font-weight: 500;
    transition: color .2s ease;
}

.header-nav > a:hover {
    color: var(--primary);
}

.theme-toggle,
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

.theme-toggle:hover,
.social-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 16px -2px var(--neon-soft);
}

.theme-icon {
    display: inline-flex;
}

.theme-icon-sun,
.dark .theme-icon-moon {
    display: none;
}

.dark .theme-icon-sun {
    display: inline-flex;
}

.content-container {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.profile-hero {
    display: flex;
    padding: 4rem 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar-wrap {
    position: relative;
}

.avatar-glow {
    position: absolute;
    inset: -.375rem;
    border-radius: 9999px;
    background: color-mix(in oklch, var(--primary) 30%, transparent);
    filter: blur(16px);
}

.avatar {
    position: relative;
    display: flex;
    width: 7rem;
    height: 7rem;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    border-radius: 9999px;
    background: var(--card);
    color: var(--primary);
    font-size: 2.25rem;
    font-weight: 700;
}

.profile-hero h1 {
    margin: 1.5rem 0 0;
    color: var(--foreground);
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    letter-spacing: -.025em;
}

.profile-hero > p {
    max-width: 28rem;
    margin: .75rem 0 0;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.social-links {
    display: flex;
    margin-top: 1.5rem;
    align-items: center;
    gap: .75rem;
}

.social-links a {
    width: 2.5rem;
    height: 2.5rem;
}

.neon-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon), transparent);
}

.hub-section {
    padding: 3.5rem 0;
    scroll-margin-top: 6rem;
}

.section-title {
    margin: 0;
    color: var(--primary);
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-align: center;
    text-transform: uppercase;
}

.links-panel {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent);
    border-radius: 1rem;
    background: color-mix(in oklch, var(--card) 50%, transparent);
    box-shadow: 0 0 40px -20px var(--neon-soft);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.neon-card {
    border: 1px solid var(--border);
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

.neon-card:hover {
    border-color: var(--neon);
    box-shadow: 0 0 0 1px var(--neon-soft), 0 0 24px -4px var(--neon-soft);
    transform: translateY(-2px);
}

.project-link {
    display: flex;
    padding: 1rem;
    align-items: center;
    gap: 1rem;
    border-radius: .75rem;
    background: var(--card);
}

.project-icon {
    display: flex;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: var(--secondary);
    color: var(--primary);
    transition: border-color .2s ease;
}

.project-link:hover .project-icon {
    border-color: color-mix(in oklch, var(--primary) 50%, transparent);
}

.project-copy {
    min-width: 0;
    flex: 1;
}

.project-copy strong,
.project-copy > span {
    display: block;
}

.project-copy strong {
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 600;
}

.project-copy > span {
    overflow: hidden;
    margin-top: .125rem;
    color: var(--muted-foreground);
    font-size: .875rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.project-arrow {
    flex: 0 0 auto;
    color: var(--muted-foreground);
    transition: color .2s ease, transform .2s ease;
}

.project-link:hover .project-arrow {
    color: var(--primary);
    transform: translate(1px, -1px);
}

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

.blog-card {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    border-radius: .75rem;
    background: var(--card);
}

.blog-card-featured {
    grid-column: span 2;
}

.blog-card-visual {
    display: flex;
    height: 8rem;
    flex: 0 0 8rem;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklch, var(--secondary) 60%, transparent);
    color: color-mix(in oklch, var(--primary) 60%, transparent);
}

.blog-card-body {
    display: flex;
    padding: 1.25rem;
    flex: 1;
    flex-direction: column;
}

.category-pill {
    display: inline-flex;
    width: fit-content;
    padding: .125rem .625rem;
    border: 1px solid color-mix(in oklch, var(--primary) 40%, transparent);
    border-radius: 9999px;
    background: color-mix(in oklch, var(--primary) 10%, transparent);
    color: var(--primary);
    font-size: .75rem;
    line-height: 1rem;
    font-weight: 500;
}

.blog-card h3 {
    margin: .75rem 0 0;
    color: var(--foreground);
    font-size: 1.125rem;
    line-height: 1.375;
    font-weight: 600;
    transition: color .2s ease;
}

.blog-card:hover h3 {
    color: var(--primary);
}

.blog-card p {
    margin: .5rem 0 0;
    flex: 1;
    color: var(--muted-foreground);
    font-size: .875rem;
    line-height: 1.625;
}

.blog-card small {
    margin-top: 1rem;
    color: var(--muted-foreground);
    font-size: .75rem;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.status-line {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted-foreground);
    font-size: .875rem;
}

.status-dot {
    position: relative;
    display: flex;
    width: .5rem;
    height: .5rem;
}

.status-dot::before,
.status-dot span {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: #10b981;
    content: "";
}

.status-dot::before {
    animation: status-ping 1.5s cubic-bezier(0, 0, .2, 1) infinite;
    opacity: .75;
}

.footer-inner p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: .75rem;
    text-align: center;
}

.article-main {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted-foreground);
    font-size: .875rem;
    transition: color .2s ease;
}

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

.article {
    margin-top: 2rem;
}

.article > .category-pill {
    padding: .25rem .75rem;
}

.article h1 {
    margin: 1.25rem 0 0;
    color: var(--foreground);
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.025em;
}

.article-meta {
    display: flex;
    margin-top: 1rem;
    align-items: center;
    gap: 1.25rem;
    color: var(--muted-foreground);
    font-size: .875rem;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.article-rule {
    margin-top: 2rem;
}

.article-copy {
    display: flex;
    margin-top: 2rem;
    flex-direction: column;
    gap: 1.5rem;
}

.article-copy p {
    margin: 0;
    color: color-mix(in oklch, var(--foreground) 90%, transparent);
    line-height: 1.625;
}

.article-copy .article-lead {
    font-size: 1.125rem;
}

.article-rule-bottom {
    margin-top: 2.5rem;
}

.newsletter-card {
    margin: 2rem 0 0;
    padding: 1.25rem;
    border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent);
    border-radius: .75rem;
    background: var(--card);
    color: var(--muted-foreground);
    font-size: .875rem;
    line-height: 1.625;
}

.newsletter-card a {
    color: var(--primary);
    font-weight: 500;
    text-underline-offset: 4px;
}

.newsletter-card a:hover {
    text-decoration: underline;
}

.not-found {
    display: flex;
    min-height: calc(100vh - 12rem);
    padding: 4rem 1.5rem;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.not-found-inner {
    max-width: 28rem;
}

.not-found h1 {
    margin: 0;
    font-size: 4.5rem;
    line-height: 1;
}

.not-found h2 {
    margin: 1rem 0 0;
    font-size: 1.25rem;
}

.not-found p {
    margin: .5rem 0 0;
    color: var(--muted-foreground);
    font-size: .875rem;
}

.home-button {
    display: inline-flex;
    margin-top: 1.5rem;
    padding: .625rem 1rem;
    border-radius: .5rem;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: .875rem;
    font-weight: 600;
    transition: filter .2s ease, transform .2s ease;
}

.home-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

h1:focus {
    outline: none;
}

#blazor-error-ui {
    position: fixed;
    z-index: 1000;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    display: none;
    max-width: 38rem;
    margin: 0 auto;
    padding: .875rem 3rem .875rem 1rem;
    border: 1px solid #ef4444;
    border-radius: .75rem;
    background: #7f1d1d;
    color: white;
    box-shadow: 0 16px 40px rgb(0 0 0 / .3);
}

#blazor-error-ui .reload {
    margin-left: .5rem;
    color: white;
    font-weight: 700;
    text-decoration: underline;
}

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

@keyframes status-ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}

@media (max-width: 639px) {
    .header-inner,
    .content-container,
    .footer-inner {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .header-nav {
        gap: 1rem;
    }

    .links-panel {
        padding: 1rem;
    }

    .project-link {
        gap: .75rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-featured {
        grid-column: auto;
    }

    .article h1 {
        font-size: 1.875rem;
    }

    .article-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: .625rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
