:root {
    /* Dark technical token palette */
    --bg-color: #0b1020;
    --bg-elevated: #121a2d;
    --bg-panel: #0f1728;
    --surface-color: #121a2d;
    --line-color: rgba(148, 163, 184, 0.18);
    --text-primary: #e5eefb;
    --text-secondary: #93a4bf;
    --title-color: #f3f7ff;
    --primary-color: #1fb6ff;
    --primary-light: #42d4ff;
    --secondary-color: #42d4ff;
    --secondary-hover: #1fb6ff;
    --accent-color: #42d4ff;
    --accent-strong: #1fb6ff;
    --accent-soft: rgba(66, 212, 255, 0.14);
    --success-soft: rgba(52, 211, 153, 0.14);
    --border-color: rgba(148, 163, 184, 0.18);
    --shadow: 0 20px 60px rgba(3, 7, 18, 0.45);
    --shadow-lg: 0 20px 60px rgba(3, 7, 18, 0.45);
    --radius: 18px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.site-shell {
    background:
        radial-gradient(circle at top, rgba(31, 182, 255, 0.10), transparent 32%),
        linear-gradient(180deg, #0b1020 0%, #0a0f1d 100%);
    color: var(--text-primary);
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Navigation */
.navbar {
    background-color: var(--surface-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.nav-logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Shell layout */
.page-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    width: 100%;
}

/* Nav link variants */
.nav-link {
    color: var(--text-primary);
}

.nav-admin-link {
    color: var(--accent-color);
    font-weight: bold;
}

.nav-logout-link {
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    color: #fda4af;
    font-size: 0.85rem;
}

/* Site footer */
.site-footer {
    border-top: 1px solid var(--line-color);
    background: rgba(10, 15, 29, 0.9);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Layout Details */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 0;
    gap: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Cards Section */
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img-placeholder {
    height: 200px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    background-image: linear-gradient(45deg, var(--primary-color), var(--primary-light));
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

footer a {
    color: var(--secondary-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--surface-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(6, 184, 207, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--surface-color);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .featured-img-wrapper {
        display: none !important;
    }
}

/* ── Hero command bar ────────────────────────────────────────────────────── */
.hero-command-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 4.5rem 0 3rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--line-color);
    margin-bottom: 3.5rem;
}

.hero-prompt {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.prompt-symbol {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    line-height: 1;
    user-select: none;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* ── Featured build ──────────────────────────────────────────────────────── */
.featured-build {
    margin-bottom: 3.5rem;
}

.featured-build-inner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius);
    padding: 3rem;
    display: flex;
    align-items: center;
    gap: 3rem;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.featured-build-inner::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    right: -60px;
    top: -110px;
    pointer-events: none;
}

.featured-build-content {
    flex: 1;
    z-index: 2;
}

.featured-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    margin-bottom: 1rem;
}

.featured-build-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.85rem;
    line-height: 1.25;
}

.featured-build-desc {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.75rem;
    max-width: 480px;
}

.btn-outline-light {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.75);
    color: white;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
}

.featured-build-image {
    flex: 1;
    z-index: 2;
    min-width: 0;
}

.featured-build-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    object-fit: contain;
    background: white;
}

/* ── Projects panel grid ─────────────────────────────────────────────────── */
.projects-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-panel {
    background: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-panel-thumb {
    height: 200px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.project-panel-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--surface-color);
}

.project-panel-initials {
    color: white;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.project-panel-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.panel-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.panel-desc {
    color: var(--text-secondary);
    font-size: 0.93rem;
    flex: 1;
    margin-bottom: 1.25rem;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* ── Notes list ──────────────────────────────────────────────────────────── */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.note-item {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 1.5rem 1.75rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--line-color);
    transition: background 0.2s ease;
}

.note-item:last-child {
    border-bottom: none;
}

.note-item:hover {
    background: var(--bg-elevated);
}

.note-item-meta {
    min-width: 90px;
    padding-top: 0.25rem;
}

.note-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    white-space: nowrap;
}

.note-item-body {
    flex: 1;
    min-width: 0;
}

.note-item-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}

.note-item-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.note-read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
}

.note-read-more:hover {
    color: var(--primary-color);
}

/* ── Project archive (full listing page) ─────────────────────────────────── */
.project-archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ── Notes archive (full blog listing page) ──────────────────────────────── */
.notes-archive {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.note-entry {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 1.75rem 2rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--line-color);
    transition: background 0.2s ease;
}

.note-entry:last-child {
    border-bottom: none;
}

.note-entry:hover {
    background: var(--bg-elevated);
}

.note-entry-meta {
    min-width: 90px;
    padding-top: 0.25rem;
}

.note-entry-body {
    flex: 1;
    min-width: 0;
}

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

    .note-entry {
        flex-direction: column;
        gap: 0.4rem;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

/* ── Contact direct surface ──────────────────────────────────────────────── */

.contact-direct-panel,
.reader-shell {
    max-width: 880px;
    margin: 0 auto;
    border: 1px solid var(--line-color);
    border-radius: calc(var(--radius) + 4px);
    background: rgba(15, 23, 40, 0.82);
    box-shadow: var(--shadow);
}

.contact-direct-panel {
    padding: 2rem;
}

.contact-intro {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.contact-channels {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-channel {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line-color);
    border-radius: 14px;
    background: rgba(11, 16, 32, 0.75);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.contact-channel:hover {
    border-color: var(--accent-color);
}

.contact-channel span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Article reader surface ──────────────────────────────────────────────── */

.reader-shell {
    padding: 2.5rem;
}

.reader-shell h1 {
    font-size: 2.2rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.reader-prose {
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.reader-prose.ql-editor {
    background: transparent;
    padding: 0;
    border: none;
}

.reader-footer {
    margin-top: 3rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

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

    .hero-title {
        font-size: 2.2rem;
    }

    .featured-build-inner {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem;
    }

    .featured-build-image {
        display: none;
    }

    .note-item {
        flex-direction: column;
        gap: 0.4rem;
    }

    .projects-panel-grid {
        grid-template-columns: 1fr;
    }
}