/* ==========================================================================
   Javlon — personal site
   Direction: ultramarine ink on cool paper, one saffron highlight.
   Bricolage Grotesque for interface + headings, Source Serif 4 for reading.
   The one bold moment is the home-page hero (the drifting "embedding field");
   everything else stays quiet and structural.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-weight: 200 800;
    font-stretch: 75% 100%;
    font-display: swap;
    src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/source-serif-4-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Serif 4';
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/source-serif-4-latin-italic.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
    --bg: #f2f3fa;
    --surface: #ffffff;
    --ink: #0d1033;
    --muted: #555a80;
    --line: #d8dbee;
    --accent: #2b3bff;
    --accent-hover: #1e2bd6;
    --on-accent: #ffffff;
    --highlight: #ffc933;
    --deep: #0d1033;

    --font-ui: 'Bricolage Grotesque', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-read: 'Source Serif 4', Georgia, 'Times New Roman', serif;

    --container-width: 1120px;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4.5rem;

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;

    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0a0c24;
    --surface: #12163a;
    --ink: #eceeff;
    --muted: #9aa0d0;
    --line: #262b5c;
    --accent: #8895ff;
    --accent-hover: #a5afff;
    --on-accent: #0a0c24;

    color-scheme: dark;
}

/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 1.0625rem;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-ui);
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: var(--highlight);
    color: #0d1033;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: min(100% - 2.5rem, var(--container-width));
    margin-inline: auto;
}

main {
    padding-bottom: var(--space-lg);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-sm);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* ---------- Header & navigation ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.navbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.site-logo {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 1.45rem;
    font-weight: 780;
    letter-spacing: -0.04em;
}

.site-logo-dot {
    width: 0.42em;
    height: 0.42em;
    border-radius: 50%;
    background: var(--highlight);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

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

.nav-links a {
    position: relative;
    padding: 0.3rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links a.active {
    color: var(--ink);
    font-weight: 650;
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    border-radius: 3px;
    background: var(--highlight);
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
    background: var(--surface);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-size: 1.4rem;
    cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-toggle-bars {
    position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle-bars::before {
    top: -6px;
}

.nav-toggle-bars::after {
    top: 6px;
}

.nav-toggle.is-open .nav-toggle-bars {
    background: transparent;
}

.nav-toggle.is-open .nav-toggle-bars::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bars::after {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1000px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-wrapper {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
        padding: var(--space-sm) 1.25rem var(--space-md);
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }

    .nav-wrapper.is-open {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-links a {
        padding: 0.8rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--line);
    }

    .nav-links a.active::after {
        left: auto;
        right: 0;
        bottom: auto;
        top: 50%;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        transform: translateY(-50%);
    }

    .theme-toggle-btn {
        align-self: flex-start;
    }
}

/* ---------- Buttons ---------- */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border: 1.5px solid transparent;
    border-radius: 14px;
    font-weight: 650;
    font-size: 1rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button-primary {
    background: var(--accent);
    color: var(--on-accent);
}

.button-primary:hover {
    background: var(--accent-hover);
}

.button-secondary {
    border-color: var(--ink);
    color: var(--ink);
}

.button-secondary:hover {
    background: var(--ink);
    color: var(--bg);
}

/* ---------- Page headers (shared by every inner page) ---------- */
.blog-header,
.education-header,
.experience-header,
.projects-header,
.certifications-header,
.contact-header {
    padding: var(--space-xl) 0 var(--space-lg);
}

.blog-header h1,
.education-header h1,
.experience-header h1,
.projects-header h1,
.certifications-header h1,
.contact-header h1,
.about-page h1 {
    margin: 0;
    max-width: 16ch;
    font-size: clamp(2.6rem, 7vw, 5rem);
    font-weight: 750;
    font-stretch: 92%;
    letter-spacing: -0.04em;
    line-height: 1;
}

.page-intro,
.contact-header p {
    max-width: 46ch;
    margin: var(--space-sm) 0 0;
    font-family: var(--font-read);
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--muted);
}

/* ---------- Hero (home) ---------- */
.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: min(82vh, 760px);
    padding: var(--space-xl) 0;
}

.hero-field {
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.hero-field.is-ready {
    opacity: 1;
}

.hero-field canvas {
    width: 100%;
    height: 100%;
    display: block;
}

@media (min-width: 900px) {
    .hero-field {
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 28%, #000 58%);
        mask-image: linear-gradient(90deg, transparent 0%, transparent 28%, #000 58%);
    }
}

@media (max-width: 899px) {
    .hero {
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
        padding-bottom: var(--space-lg);
    }

    .hero-field {
        position: relative;
        z-index: auto;
        order: 2;
        left: auto;
        width: 100%;
        height: 220px;
        margin: var(--space-lg) 0 0;
    }
}

.hero-content {
    max-width: 44rem;
}

.hero-title {
    margin: 0;
    font-size: clamp(3.6rem, 10.5vw, 8rem);
    font-weight: 780;
    font-stretch: 92%;
    letter-spacing: -0.04em;
    line-height: 0.94;
}

.hero-subtitle {
    margin: var(--space-md) 0 var(--space-xs);
    font-size: clamp(1.3rem, 2.6vw, 1.75rem);
    font-weight: 560;
    letter-spacing: -0.02em;
}

.hero-description {
    max-width: 34rem;
    margin: 0;
    font-family: var(--font-read);
    font-size: 1.22rem;
    line-height: 1.6;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: var(--space-lg);
}

@media (max-width: 600px) {
    .hero {
        min-height: auto;
        padding: var(--space-lg) 0 var(--space-xl);
    }
}

/* ---------- Section headers ---------- */
.latest-posts {
    padding: var(--space-lg) 0 var(--space-xl);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--ink);
}

.section-header h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
    font-weight: 720;
}

.section-header a {
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: var(--highlight);
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.section-header a:hover {
    text-decoration-color: var(--accent);
}

/* ---------- Blog ---------- */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--space-md);
}

.blog-filters a {
    padding: 0.35rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-weight: 560;
    font-size: 0.95rem;
    color: var(--muted);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.blog-filters a:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.blog-filters a.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl) var(--space-lg);
    margin-bottom: var(--space-xl);
}

.blog-card {
    display: flex;
    flex-direction: column;
}

.blog-card:not(:has(.blog-card-image)) {
    padding-left: var(--space-md);
    border-left: 4px solid var(--highlight);
}

.blog-card:not(:has(.blog-card-image)) .blog-card-body {
    padding-top: 0;
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.blog-card-body {
    padding-top: var(--space-sm);
}

.blog-card-category {
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--accent);
}

.blog-card-title {
    margin: 0.25rem 0 0.5rem;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    font-weight: 700;
    line-height: 1.1;
}

.blog-card-title a {
    background: linear-gradient(var(--highlight), var(--highlight)) 0 100% / 0 3px no-repeat;
    transition: background-size 0.25s ease;
}

.blog-card-title a:hover {
    background-size: 100% 3px;
}

.blog-card-excerpt {
    margin: 0 0 var(--space-sm);
    font-family: var(--font-read);
    font-size: 1.08rem;
    color: var(--muted);
}

.blog-card-date,
.blog-card-time {
    font-size: 0.9rem;
    color: var(--muted);
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* ---------- Blog detail & long-form prose ---------- */
.blog-detail {
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--space-xl) 0 var(--space-lg);
}

.blog-detail-header {
    margin-bottom: var(--space-lg);
}

.blog-detail-header h1 {
    margin: var(--space-xs) 0 var(--space-sm);
    font-size: clamp(2.3rem, 6vw, 3.8rem);
    font-weight: 750;
    font-stretch: 92%;
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.blog-detail-excerpt {
    margin: 0 0 var(--space-sm);
    font-family: var(--font-read);
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--muted);
}

.blog-detail-header time {
    font-size: 0.95rem;
    color: var(--muted);
}

.blog-detail-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.blog-detail-content,
.about-biography,
.experience-information,
.education-information,
.certification-information,
.project-description {
    font-family: var(--font-read);
    font-size: 1.15rem;
    line-height: 1.75;
}

.blog-detail-content {
    font-size: 1.2rem;
}

.blog-detail-content img,
.about-biography img,
.project-description img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.blog-detail-content h2,
.blog-detail-content h3,
.about-biography h2,
.about-biography h3,
.project-description h2,
.project-description h3 {
    margin-top: var(--space-lg);
    font-family: var(--font-ui);
    line-height: 1.15;
}

.blog-detail-content a,
.about-biography a,
.experience-information a,
.education-information a,
.certification-information a,
.project-description a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-detail-content blockquote {
    margin: var(--space-lg) 0;
    padding-left: var(--space-md);
    border-left: 5px solid var(--highlight);
    font-style: italic;
    color: var(--muted);
}

.blog-detail-content pre,
.project-description pre {
    overflow-x: auto;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.55;
}

.blog-detail-content code,
.project-description code {
    font-size: 0.92em;
}

.blog-detail-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 2px solid var(--ink);
}

.blog-detail-footer a {
    font-weight: 650;
    color: var(--accent);
}

.blog-detail-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* CKEditor 5 content highlights */
.blog-detail-content .marker-yellow { background-color: hsl(48, 100%, 70%); color: #0d1033; }
.blog-detail-content .marker-green  { background-color: hsl(120, 100%, 85%); color: #0d1033; }
.blog-detail-content .marker-red    { background-color: hsl(0, 100%, 85%); color: #0d1033; }
.blog-detail-content .marker-blue   { background-color: hsl(210, 100%, 85%); color: #0d1033; }
.blog-detail-content .marker-pink   { background-color: #fc7999; color: #0d1033; }
.blog-detail-content .pen-red       { color: #e91313; background-color: transparent; }
.blog-detail-content .pen-green     { color: #118800; background-color: transparent; }

/* ---------- Expandable rows: Experience, Education, Certifications ---------- */
.banner-list,
.education-banner-list {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-xl);
    border-top: 2px solid var(--ink);
}

.site-banner,
.education-banner {
    border-bottom: 1px solid var(--line);
}

.site-banner-header,
.education-banner-header {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-md);
    padding: 1.25rem 0.5rem;
    margin-inline: -0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.site-banner-header:hover,
.education-banner-header:hover {
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.site-banner-photo,
.education-banner-photo,
.site-banner-photo-placeholder,
.education-banner-photo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex-shrink: 0;
}

.site-banner-photo,
.education-banner-photo {
    object-fit: cover;
    border: 1px solid var(--line);
}

.site-banner-photo-placeholder,
.education-banner-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 1.6rem;
}

.site-banner-title-row,
.education-banner-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
}

.site-banner-title,
.education-banner-title {
    margin: 0;
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.15;
}

.site-type-badge,
.education-type-badge {
    padding: 0.1rem 0.7rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 560;
    color: var(--muted);
}

.site-banner-meta,
.education-banner-meta {
    margin: 0.25rem 0 0;
    font-size: 0.97rem;
    color: var(--muted);
}

.site-banner-arrow,
.education-banner-arrow {
    padding: var(--space-xs);
    font-size: 0.7rem;
    color: var(--muted);
    transition: transform 0.25s ease;
}

.site-banner.expanded .site-banner-arrow,
.site-banner[data-expanded="true"] .site-banner-arrow,
.education-banner.expanded .education-banner-arrow,
.education-banner[data-expanded="true"] .education-banner-arrow {
    transform: rotate(180deg);
    color: var(--accent);
}

.site-banner.expanded .site-banner-title,
.site-banner[data-expanded="true"] .site-banner-title,
.education-banner.expanded .education-banner-title,
.education-banner[data-expanded="true"] .education-banner-title {
    color: var(--accent);
}

.site-banner-details,
.education-banner-details {
    padding: 0 0.5rem var(--space-md) calc(64px + var(--space-md));
}

.site-banner-details[hidden],
.education-banner-details[hidden] {
    display: none;
}

.experience-information,
.education-information,
.certification-information {
    max-width: 42rem;
    font-size: 1.1rem;
}

.experience-information > :first-child,
.education-information > :first-child,
.certification-information > :first-child,
.project-description > :first-child {
    margin-top: 0;
}

.gallery-title {
    margin: var(--space-md) 0 var(--space-xs);
    font-size: 1.1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.gallery-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

@media (max-width: 600px) {
    .site-banner-header,
    .education-banner-header {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: var(--space-sm);
    }

    .site-banner-photo,
    .education-banner-photo,
    .site-banner-photo-placeholder,
    .education-banner-photo-placeholder {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .site-banner-details,
    .education-banner-details {
        padding-left: 0.5rem;
    }
}

/* ---------- Skills ---------- */
.skills-section {
    margin-top: var(--space-xl);
}

.skills-header h2 {
    margin: 0 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--ink);
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
    font-weight: 720;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.skill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.skill-info h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 650;
}

.skill-category {
    font-size: 0.9rem;
    color: var(--muted);
}

.skill-level {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.92rem;
    font-weight: 560;
    color: var(--muted);
    white-space: nowrap;
}

.skill-meter {
    display: inline-flex;
    gap: 3px;
}

.skill-meter i {
    width: 14px;
    height: 6px;
    border-radius: 3px;
    background: var(--line);
}

.skill-level[data-level="BEGINNER"] .skill-meter i:nth-child(-n+1),
.skill-level[data-level="INTERMEDIATE"] .skill-meter i:nth-child(-n+2),
.skill-level[data-level="ADVANCED"] .skill-meter i {
    background: var(--accent);
}

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

/* ---------- Projects ---------- */
.projects-list {
    margin: 0 0 var(--space-xl);
    border-top: 2px solid var(--ink);
}

.project {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 21rem);
    gap: var(--space-md) var(--space-lg);
    align-items: start;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--line);
}

.project-meta {
    padding-top: 0.35rem;
}

.project-period {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 720;
    font-stretch: 94%;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.project-status::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--accent);
}

.project-status[data-status="IN_PROGRESS"]::before {
    background: var(--highlight);
    box-shadow: 0 0 0 2px var(--ink);
}

.project-status[data-status="ARCHIVED"]::before {
    background: transparent;
    border: 2px solid var(--muted);
}

.project-title {
    margin: 0 0 0.6rem;
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    font-weight: 740;
    font-stretch: 94%;
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.project-summary {
    max-width: 34rem;
    margin: 0;
    font-family: var(--font-read);
    font-size: 1.18rem;
    line-height: 1.55;
    color: var(--muted);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: var(--space-sm) 0 0;
    padding: 0;
    list-style: none;
}

.project-tech li {
    padding: 0.15rem 0.65rem;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 560;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
    margin-top: var(--space-sm);
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: var(--highlight);
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.project-links a:hover {
    text-decoration-color: var(--accent);
}

.project-art {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
}

.project-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Generated artwork shown when a project has no image */
.project-art--1 {
    background:
        radial-gradient(circle at center, var(--on-accent) 1.5px, transparent 1.8px) 0 0 / 18px 18px,
        var(--accent);
}

.project-art--2 {
    background:
        repeating-radial-gradient(circle at 30% 70%, var(--highlight) 0 2px, transparent 2px 24px),
        var(--deep);
}

.project-art--3 {
    background:
        repeating-linear-gradient(-45deg, var(--highlight) 0 3px, transparent 3px 18px),
        var(--accent);
}

.project-art--4 {
    background:
        radial-gradient(circle at 70% 36%, var(--highlight) 0 17%, transparent 17.5%),
        radial-gradient(circle at 34% 68%, var(--accent) 0 8%, transparent 8.5%),
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
        var(--surface);
}

.project-details {
    grid-column: 2 / -1;
}

.project-details > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-weight: 650;
    color: var(--accent);
    cursor: pointer;
    list-style: none;
}

.project-details > summary::-webkit-details-marker {
    display: none;
}

.project-details > summary::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.project-details[open] > summary::after {
    transform: translateY(2px) rotate(-135deg);
}

.project-details .when-open,
.project-details[open] .when-closed {
    display: none;
}

.project-details[open] .when-open {
    display: inline;
}

.project-description {
    max-width: 42rem;
    margin-top: var(--space-sm);
    font-size: 1.1rem;
}

@media (max-width: 900px) {
    .project {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
        padding: var(--space-md) 0 var(--space-lg);
    }

    .project-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.25rem 1rem;
        padding-top: 0;
    }

    .project-status {
        margin-top: 0;
    }

    .project-art {
        order: 2;
        max-width: 28rem;
    }

    .project-main {
        order: 3;
    }

    .project-details {
        order: 4;
        grid-column: auto;
    }
}

/* ---------- Empty state (shared) ---------- */
.empty-state {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 17rem);
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg) var(--space-xl);
    border: 2px dashed var(--line);
    border-radius: var(--radius-lg);
}

.empty-state--compact {
    grid-template-columns: 1fr;
    padding: var(--space-md) var(--space-lg);
}

.empty-state-title {
    margin: 0 0 var(--space-xs);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 740;
    letter-spacing: -0.035em;
}

.empty-state-text {
    max-width: 32rem;
    margin: 0;
    font-family: var(--font-read);
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--muted);
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: var(--space-md);
}

.empty-state-art {
    width: 100%;
    height: auto;
    color: var(--muted);
}

.empty-state-art .axis {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
}

.empty-state-art .grid {
    stroke: var(--line);
    stroke-width: 1.5;
    stroke-dasharray: 2 7;
    stroke-linecap: round;
}

.empty-state-art .ghost {
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-dasharray: 3 5;
    opacity: 0.7;
}

.empty-state-art .next {
    fill: var(--highlight);
    stroke: var(--ink);
    stroke-width: 2;
}

@media (max-width: 760px) {
    .empty-state {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }

    .empty-state-art {
        order: -1;
        max-width: 11rem;
    }
}

/* ---------- About ---------- */
.about-page {
    max-width: 46rem;
    margin: 0 auto;
    padding: var(--space-xl) 0;
}

.about-photo {
    width: 190px;
    height: 190px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.about-age {
    margin: var(--space-sm) 0 var(--space-lg);
    color: var(--muted);
    font-size: 1.05rem;
}

.about-biography {
    font-size: 1.2rem;
}

/* ---------- Contact ---------- */
.contact-page {
    max-width: 46rem;
    margin: 0 auto;
}

.contact-list {
    margin-bottom: var(--space-xl);
    border-top: 2px solid var(--ink);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 1.1rem 0.5rem;
    margin-inline: -0.5rem;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.contact-item:hover {
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.contact-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 1.4rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.contact-item:hover .contact-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.contact-content h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 680;
}

.contact-content p {
    margin: 0.1rem 0 0;
    color: var(--muted);
    word-break: break-word;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: var(--space-lg);
    padding: var(--space-md) 0 var(--space-lg);
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
    color: var(--muted);
}

.site-footer p {
    margin: 0;
}

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
