/*
Theme Name: Uzina din Nori
Theme URI: https://uzinadinnori.ro
Author: Mihnea Dumitru
Author URI: https://uzinadinnori.ro
Description: Temă personalizată pentru Uzina din Nori — comunicare, OSINT & AI. Design editorial, proiecte-first, responsive, SEO & AI friendly. Dark mode, PWA-ready, WCAG 2.1 AA.
Version: 4.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: uzina-din-nori
Tags: one-page, portfolio, custom-menu, featured-images, accessibility-ready, dark-mode
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ═══════════════════════════════════════════════
   DESIGN SYSTEM — Tokens & Variables
   ═══════════════════════════════════════════════ */
:root {
    /* ── Palette: Light ────────────────────────── */
    --ink:       #111116;
    --ink-90:    #26262e;
    --ink-75:    #3d3d48;
    --ink-60:    #555562;
    --ink-50:    #6e6e7d;
    --ink-35:    #8e8e9e;
    --ink-25:    #a8a8b8;
    --ink-15:    #c8c8d4;
    --ink-10:    #d8d8e0;
    --ink-05:    #ededf2;
    --ink-02:    #f5f5f8;
    --surface:   #f7f7f9;
    --white:     #ffffff;

    /* ── Accent System ─────────────────────────── */
    --accent:       #a67c2e;
    --accent-hover: #c49a42;
    --accent-bg:    rgba(166, 124, 46, 0.07);
    --accent-ring:  rgba(166, 124, 46, 0.25);

    --blue:         #2e6a8a;
    --blue-hover:   #3a82a8;
    --blue-bg:      rgba(46, 106, 138, 0.06);

    --green:        #3a7a54;
    --green-bg:     rgba(58, 122, 84, 0.1);

    --red:          #b04040;
    --red-bg:       rgba(176, 64, 64, 0.08);

    /* ── Typography ────────────────────────────── */
    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'IBM Plex Mono', 'Menlo', 'Courier New', monospace;

    /* ── Type Scale (fluid) ────────────────────── */
    --text-xs:   0.6875rem;   /* 11px */
    --text-sm:   0.8125rem;   /* 13px */
    --text-base: 1rem;        /* 16px */
    --text-md:   1.0625rem;   /* 17px */
    --text-lg:   1.1875rem;   /* 19px */
    --text-xl:   clamp(1.25rem, 2.5vw, 1.5rem);
    --text-2xl:  clamp(1.5rem, 4vw, 2.125rem);
    --text-3xl:  clamp(1.75rem, 5.5vw, 3rem);
    --text-hero: clamp(2rem, 6vw, 3.5rem);

    /* ── Spacing ───────────────────────────────── */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* ── Layout ────────────────────────────────── */
    --max-w:     1140px;
    --max-w-sm:  720px;
    --gutter:    clamp(1rem, 3vw, 2rem);
    --radius:    12px;
    --radius-sm: 8px;
    --radius-xs: 4px;

    /* ── Navigation ────────────────────────────── */
    --nav-h: 56px;

    /* ── Safe areas (iOS) ──────────────────────── */
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);

    /* ── Shadows ────────────────────────────────── */
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 8px 28px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-xl:  0 16px 48px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.05);

    /* ── Transitions ───────────────────────────── */
    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:   cubic-bezier(0.55, 0, 1, 0.45);
    --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast:  0.15s;
    --dur-base:  0.25s;
    --dur-slow:  0.45s;
    --dur-enter: 0.55s;

    /* ── Dark glass surfaces ───────────────────── */
    --glass-bg:  rgba(247, 247, 249, 0.88);
    --glass-blur: 20px;

    /* ── Semantic tokens ───────────────────────── */
    --card-bg:      var(--white);
    --card-border:  var(--ink-10);
    --nav-bg:       var(--glass-bg);
    --footer-bg:    var(--ink);
    --footer-text:  rgba(255,255,255,0.2);
    --footer-link:  rgba(255,255,255,0.35);
    --badge-live-bg:    var(--green-bg);
    --badge-live-color: var(--green);
    --badge-beta-bg:    var(--accent-bg);
    --badge-beta-color: var(--accent);
    --badge-new-bg:     var(--blue-bg);
    --badge-new-color:  var(--blue);
}

/* ── Dark Mode ─────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --ink:       #e8e8f0;
        --ink-90:    #d0d0dc;
        --ink-75:    #b0b0c0;
        --ink-60:    #9090a4;
        --ink-50:    #787890;
        --ink-35:    #5c5c74;
        --ink-25:    #44445a;
        --ink-15:    #323248;
        --ink-10:    #282840;
        --ink-05:    #1e1e34;
        --ink-02:    #181830;
        --surface:   #131322;
        --white:     #1a1a2e;

        --accent:       #d4a84a;
        --accent-hover: #e4bc62;
        --accent-bg:    rgba(212, 168, 74, 0.1);
        --accent-ring:  rgba(212, 168, 74, 0.3);

        --blue:         #5aa0c4;
        --blue-hover:   #72b4d6;
        --blue-bg:      rgba(90, 160, 196, 0.1);

        --green:        #5aaa78;
        --green-bg:     rgba(90, 170, 120, 0.12);

        --shadow-sm:  0 1px 3px rgba(0,0,0,0.2);
        --shadow-md:  0 4px 16px rgba(0,0,0,0.25);
        --shadow-lg:  0 8px 32px rgba(0,0,0,0.3);
        --shadow-xl:  0 16px 56px rgba(0,0,0,0.35);

        --card-bg:     #1e1e32;
        --card-border: rgba(255,255,255,0.06);
        --nav-bg:      rgba(19, 19, 34, 0.9);
        --glass-bg:    rgba(19, 19, 34, 0.9);
        --footer-bg:   #0e0e1c;
    }
}

/* Data attribute override for manual toggle */
[data-theme="dark"] {
    --ink:       #e8e8f0;
    --ink-90:    #d0d0dc;
    --ink-75:    #b0b0c0;
    --ink-60:    #9090a4;
    --ink-50:    #787890;
    --ink-35:    #5c5c74;
    --ink-25:    #44445a;
    --ink-15:    #323248;
    --ink-10:    #282840;
    --ink-05:    #1e1e34;
    --ink-02:    #181830;
    --surface:   #131322;
    --white:     #1a1a2e;

    --accent:       #d4a84a;
    --accent-hover: #e4bc62;
    --accent-bg:    rgba(212, 168, 74, 0.1);

    --blue:         #5aa0c4;
    --blue-hover:   #72b4d6;
    --blue-bg:      rgba(90, 160, 196, 0.1);

    --green:        #5aaa78;
    --green-bg:     rgba(90, 170, 120, 0.12);

    --shadow-sm:  0 1px 3px rgba(0,0,0,0.2);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.25);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.3);

    --card-bg:     #1e1e32;
    --card-border: rgba(255,255,255,0.06);
    --nav-bg:      rgba(19, 19, 34, 0.9);
    --glass-bg:    rgba(19, 19, 34, 0.9);
    --footer-bg:   #0e0e1c;
}

[data-theme="light"] {
    --ink:       #111116;
    --ink-90:    #26262e;
    --ink-75:    #3d3d48;
    --ink-50:    #6e6e7d;
    --ink-25:    #a8a8b8;
    --ink-10:    #d8d8e0;
    --ink-05:    #ededf2;
    --ink-02:    #f5f5f8;
    --surface:   #f7f7f9;
    --white:     #ffffff;

    --accent:       #a67c2e;
    --accent-hover: #c49a42;
    --accent-bg:    rgba(166, 124, 46, 0.07);

    --blue:         #2e6a8a;
    --blue-hover:   #3a82a8;
    --blue-bg:      rgba(46, 106, 138, 0.06);

    --green:        #3a7a54;
    --green-bg:     rgba(58, 122, 84, 0.1);

    --shadow-sm:  0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 8px 28px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);

    --card-bg:     var(--white);
    --card-border: #d8d8e0;
    --nav-bg:      rgba(247, 247, 249, 0.88);
    --glass-bg:    rgba(247, 247, 249, 0.88);
    --footer-bg:   #111116;
}

/* ═══════════════════════════════════════════════
   RESET & BASE (Mobile-First)
   ═══════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--nav-h) + var(--space-lg));
    overscroll-behavior-x: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    line-height: 1.65;
    font-size: var(--text-base);
    overflow-x: hidden;
    padding-top: var(--safe-t);
    padding-bottom: var(--safe-b);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overscroll-behavior-y: none;
}

main { flex: 1; }

::selection {
    background: var(--accent);
    color: #fff;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
a:hover { color: var(--accent); }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

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

strong { font-weight: 600; }
em { font-style: italic; }

/* ── Accessibility ────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--ink);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    z-index: 200;
    font-size: var(--text-sm);
    font-weight: 600;
}
.skip-link:focus { top: var(--space-sm); color: var(--white); }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ═══════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════ */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0 var(--gutter);
    padding-left: max(var(--gutter), var(--safe-l));
    padding-right: max(var(--gutter), var(--safe-r));
    background: var(--nav-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--card-border);
    transition: background var(--dur-base), border-color var(--dur-base);
}

/* Scrolled state — denser nav */
.site-nav.scrolled {
    --nav-h: 48px;
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    transition: height var(--dur-base);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: var(--text-base);
    color: var(--ink);
    padding: var(--space-sm) 0;
    letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--ink); }

/* Nav right side: links + theme toggle */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ── Mobile nav overlay ───────────────────────── */
.nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0; bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    padding: var(--space-xl) var(--gutter);
    padding-bottom: max(var(--space-xl), var(--safe-b));
    gap: var(--space-xs);
    list-style: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 99;
}
.nav-links.open { display: flex; }
.nav-links li { list-style: none; }

.nav-links a {
    display: flex;
    align-items: center;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--ink-60);
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--ink-05);
    letter-spacing: 0.01em;
    min-height: 48px;
    transition: color var(--dur-fast);
}
.nav-links a:hover,
.nav-links a:active { color: var(--ink); }

/* ── Hamburger ────────────────────────────────── */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px; height: 44px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    color: var(--ink);
}
.nav-toggle span {
    display: block;
    width: 20px; height: 1.5px;
    background: currentColor;
    position: absolute;
    left: 12px;
    transition: all 0.3s var(--ease-out);
    border-radius: 1px;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle.active span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ── Theme Toggle ─────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: none;
    border: 1px solid var(--ink-10);
    border-radius: 50%;
    cursor: pointer;
    color: var(--ink-50);
    font-size: var(--text-sm);
    transition: all var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.theme-toggle svg {
    width: 16px; height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
    padding: calc(var(--nav-h) + var(--space-xl)) var(--gutter) var(--space-2xl);
    padding-left: max(var(--gutter), var(--safe-l));
    padding-right: max(var(--gutter), var(--safe-r));
    max-width: var(--max-w);
    margin: 0 auto;
    position: relative;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: var(--text-hero);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    max-width: 44rem;
}
.hero h1 em {
    font-style: italic;
    color: var(--blue);
}

.hero .lead {
    font-size: var(--text-md);
    color: var(--ink-50);
    line-height: 1.7;
    max-width: 38rem;
}
.hero .lead a { font-weight: 500; }

/* ═══════════════════════════════════════════════
   SECTIONS — Shared
   ═══════════════════════════════════════════════ */
.section {
    padding: var(--space-2xl) var(--gutter);
    padding-left: max(var(--gutter), var(--safe-l));
    padding-right: max(var(--gutter), var(--safe-r));
}

.section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
}
.section-title em {
    font-style: italic;
    color: var(--blue);
}

/* ═══════════════════════════════════════════════
   PROJECT CARDS
   ═══════════════════════════════════════════════ */

/* ── Featured Project (Context Politic) ─────── */
.project-featured {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    margin-bottom: var(--space-lg);
    transition: border-color var(--dur-base), box-shadow var(--dur-base);
}

.project-featured__visual {
    background: var(--ink);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}
.project-featured__visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(46,106,138,0.2), rgba(166,124,46,0.1));
    pointer-events: none;
}

.project-featured__stat {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--accent);
    position: relative;
    z-index: 1;
}
.project-featured__stat-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-top: var(--space-xs);
    position: relative;
    z-index: 1;
}

.project-featured__body {
    padding: var(--space-lg);
}

.project-featured__body h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

/* ── Project Grid ─────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

/* ── Project Card ─────────────────────────────── */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: border-color var(--dur-base), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
    display: flex;
    flex-direction: column;
    position: relative;
}
.project-card:active { transform: scale(0.985); }

.project-card h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 400;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.project-card__desc {
    font-size: var(--text-sm);
    color: var(--ink-50);
    line-height: 1.7;
    flex: 1;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--ink-05);
}
.project-card__tags span {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    background: var(--ink-02);
    border-radius: var(--radius-xs);
    color: var(--ink-50);
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-top: var(--space-sm);
    color: var(--blue);
    padding: var(--space-xs) 0;
    min-height: 44px;
}
.project-card__link::after {
    content: '→';
    transition: transform var(--dur-fast);
    display: inline-block;
}
.project-card__link:hover::after { transform: translateX(3px); }
.project-card__link:hover { color: var(--accent); }

/* ── Badges ───────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 0.75rem;
    font-weight: 500;
}
.badge--live {
    background: var(--badge-live-bg);
    color: var(--badge-live-color);
}
.badge--live::before {
    content: '';
    width: 5px; height: 5px;
    background: var(--badge-live-color);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.badge--beta {
    background: var(--badge-beta-bg);
    color: var(--badge-beta-color);
}
.badge--new {
    background: var(--badge-new-bg);
    color: var(--badge-new-color);
}

/* ── Other Projects (chips) ───────────────────── */
.other-projects {
    margin-top: var(--space-xl);
}
.other-projects__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink-75);
    margin-bottom: var(--space-sm);
}
.other-projects__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.chip {
    padding: var(--space-sm) 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--ink-60);
    transition: all var(--dur-fast);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
}
.chip:hover { border-color: var(--accent-hover); color: var(--ink); }
.chip:active { transform: scale(0.97); background: var(--accent-bg); }

/* ═══════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════ */
.about-section {
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.about-text p {
    font-size: 0.9375rem;
    color: var(--ink-50);
    margin-bottom: var(--space-md);
    line-height: 1.75;
}
.about-text strong {
    color: var(--ink);
    font-weight: 600;
}

/* ── Timeline ─────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: var(--space-lg);
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 1px;
    background: var(--ink-10);
}

.timeline__item {
    padding-bottom: var(--space-lg);
    position: relative;
    padding-left: var(--space-md);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-lg));
    top: 5px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 1px var(--accent);
}

.timeline__period {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
}
.timeline__role {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    color: var(--ink);
    margin: 2px 0;
}
.timeline__org {
    font-size: var(--text-sm);
    color: var(--ink-50);
}
.timeline__detail {
    font-size: 0.75rem;
    color: var(--ink-25);
    margin-top: 2px;
}

/* ── Education Grid ───────────────────────────── */
.education-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--ink-05);
}
.education-item {
    text-align: center;
    padding: 0.75rem var(--space-sm);
}
.education-item__flag {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}
.education-item__degree {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    color: var(--ink);
}
.education-item__school {
    font-size: 0.72rem;
    color: var(--ink-50);
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Publications ─────────────────────────────── */
.publications {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--ink-05);
}
.publications__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-75);
    margin-bottom: var(--space-sm);
}
.publications__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.publications__list span {
    font-size: var(--text-sm);
    color: var(--ink-25);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════════ */
.contact-section {
    background: var(--footer-bg);
    color: var(--surface);
}
.contact-section .section-label { color: var(--accent-hover); }
.contact-section .section-title { color: #e8e8f0; }
.contact-section .section-title em { color: var(--accent-hover); }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.contact-desc {
    font-size: 0.9375rem;
    color: var(--ink-25);
    margin-bottom: var(--space-lg);
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--space-md) 1.1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    transition: all var(--dur-fast);
    color: #e8e8f0;
    min-height: 56px;
    touch-action: manipulation;
}
.contact-row:hover,
.contact-row:active {
    background: rgba(255,255,255,0.07);
    border-color: var(--accent-ring);
    color: #e8e8f0;
}
.contact-row__icon {
    font-size: 1.125rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.contact-row__label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
}
.contact-row__value {
    font-size: var(--text-sm);
}

.social-row {
    display: flex;
    gap: var(--space-sm);
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.45);
    font-size: 1.1rem;
    transition: all var(--dur-fast);
    touch-action: manipulation;
}
.social-btn:hover,
.social-btn:active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 1.25rem var(--gutter);
    padding-left: max(1.25rem, var(--safe-l));
    padding-right: max(1.25rem, var(--safe-r));
    padding-bottom: max(1.25rem, var(--safe-b));
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
}
.footer-left {
    font-size: 0.7rem;
    color: var(--footer-text);
}
.footer-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
}
.footer-links a {
    font-size: 0.65rem;
    color: var(--footer-link);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: var(--space-xs) 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.footer-links a:hover { color: var(--accent-hover); }

.footer-art {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.1);
    text-align: center;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255,255,255,0.03);
    max-width: var(--max-w);
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

/* ═══════════════════════════════════════════════
   SCROLL ANIMATIONS
   ═══════════════════════════════════════════════ */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.delay-1 { transition-delay: 0.06s; }
.delay-2 { transition-delay: 0.12s; }
.delay-3 { transition-delay: 0.18s; }
.delay-4 { transition-delay: 0.24s; }
.delay-5 { transition-delay: 0.30s; }

@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
    .badge--live::before { animation: none; }
}

/* ═══════════════════════════════════════════════
   PAGE TEMPLATES — Unified (no more inline styles)
   ═══════════════════════════════════════════════ */

/* ── Standard Page ────────────────────────────── */
.page-wrap {
    padding: calc(var(--nav-h) + var(--space-3xl)) var(--gutter) var(--space-3xl);
    max-width: var(--max-w);
    margin: 0 auto;
}

.page-label {
    /* reuse section-label pattern */
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.page-heading {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    margin-bottom: var(--space-lg);
    line-height: 1.2;
}

.page-body {
    max-width: var(--max-w-sm);
    font-size: 0.95rem;
    color: var(--ink-50);
    line-height: 1.8;
}
.page-body p { margin-bottom: var(--space-md); }
.page-body a { text-decoration: underline; text-underline-offset: 2px; }
.page-body h2, .page-body h3 { color: var(--ink); margin: var(--space-xl) 0 var(--space-md); font-family: var(--font-display); }
.page-body h2 { font-size: var(--text-xl); }
.page-body h3 { font-size: var(--text-lg); }
.page-body ul, .page-body ol { padding-left: var(--space-lg); margin-bottom: var(--space-md); }
.page-body li { margin-bottom: var(--space-sm); }
.page-body img { border-radius: var(--radius-sm); margin: var(--space-lg) 0; }
.page-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-lg);
    margin: var(--space-lg) 0;
    font-style: italic;
    color: var(--ink-60);
}

/* ── 404 ──────────────────────────────────────── */
.error-404 {
    padding: calc(var(--nav-h) + var(--space-4xl)) var(--gutter) var(--space-4xl);
    max-width: var(--max-w);
    margin: 0 auto;
    text-align: center;
}
.error-404__code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}
.error-404__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    margin-bottom: var(--space-md);
}
.error-404__text {
    color: var(--ink-50);
    margin-bottom: var(--space-xl);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.error-404__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: var(--text-md);
    color: var(--blue);
    padding: var(--space-sm);
    min-height: 44px;
}
.error-404__link:hover { color: var(--accent); }
.error-404__link::before { content: '←'; }

/* ── Tool / Full-width Template ───────────────── */
.tool-hero {
    background: var(--footer-bg);
    padding: calc(var(--nav-h) + var(--space-2xl)) var(--gutter) var(--space-2xl);
    padding-left: max(var(--gutter), var(--safe-l));
    padding-right: max(var(--gutter), var(--safe-r));
    text-align: center;
    position: relative;
    overflow: hidden;
}
.tool-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(46,106,138,0.15), rgba(166,124,46,0.08));
    pointer-events: none;
}
.tool-hero__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.tool-hero__title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    font-weight: 400;
    color: #e8e8f0;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}
.tool-hero__desc {
    font-size: var(--text-base);
    color: var(--ink-25);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}
.tool-body {
    padding: var(--space-xl) var(--gutter) var(--space-2xl);
    padding-left: max(var(--gutter), var(--safe-l));
    padding-right: max(var(--gutter), var(--safe-r));
    background: var(--surface);
}
.tool-body__inner {
    max-width: 1080px;
    margin: 0 auto;
}

/* ── Blog / Index ─────────────────────────────── */
.blog-list__item {
    margin-bottom: var(--space-2xl);
}
.blog-list__date {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-xs);
}
.blog-list__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}
.blog-list__title a { color: var(--ink); }
.blog-list__title a:hover { color: var(--blue); }
.blog-list__excerpt {
    font-size: 0.9rem;
    color: var(--ink-50);
    line-height: 1.7;
}
.blog-list__pagination {
    margin-top: var(--space-xl);
    display: flex;
    gap: var(--space-md);
}
.blog-list__pagination a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--blue);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* ── Search Template ──────────────────────────── */
.search-header {
    margin-bottom: var(--space-xl);
}
.search-header__query {
    color: var(--blue);
    font-style: italic;
}

/* ═══════════════════════════════════════════════
   WP OVERRIDES
   ═══════════════════════════════════════════════ */
body.admin-bar .site-nav { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar .site-nav { top: 46px; }
    body.admin-bar .nav-links { top: calc(var(--nav-h) + 46px); }
}

.alignleft   { float: left;  margin-right: var(--space-lg); }
.alignright  { float: right; margin-left: var(--space-lg); }
.aligncenter { display: block; margin: 0 auto; }

/* WP Block Editor defaults */
.wp-block-image { margin: var(--space-lg) 0; }
.wp-block-image img { border-radius: var(--radius-sm); }
.has-text-align-center { text-align: center; }
.has-text-align-right  { text-align: right; }

/* ═══════════════════════════════════════════════
   RESPONSIVE: TABLET (600px+)
   ═══════════════════════════════════════════════ */
@media (min-width: 600px) {
    .hero {
        padding-top: calc(var(--nav-h) + var(--space-2xl));
        padding-bottom: var(--space-2xl);
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    .project-featured {
        grid-template-columns: 1fr 1.6fr;
    }
    .project-featured__visual { min-height: auto; padding: var(--space-2xl); }
    .project-featured__stat { font-size: 3.2rem; }
    .project-featured__body { padding: var(--space-xl); }
    .project-featured__body h3 { font-size: 1.35rem; }

    .contact-grid { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }

    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .tool-hero { padding-top: calc(var(--nav-h) + var(--space-3xl)); padding-bottom: var(--space-2xl); }
    .tool-body { padding: var(--space-2xl) var(--gutter) var(--space-3xl); }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: DESKTOP (900px+)
   ═══════════════════════════════════════════════ */
@media (min-width: 900px) {
    .nav-toggle { display: none; }

    .nav-links {
        display: flex;
        position: static;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        flex-direction: row;
        padding: 0;
        gap: 1.75rem;
        overflow: visible;
        bottom: auto;
        z-index: auto;
    }
    .nav-links a {
        font-size: var(--text-sm);
        font-weight: 500;
        color: var(--ink-50);
        letter-spacing: 0.02em;
        padding: var(--space-sm) 0;
        border-bottom: none;
        min-height: auto;
    }
    .nav-links a:hover { color: var(--ink); }
    .nav-links a.nav-active { color: var(--ink); }

    .hero {
        padding-top: calc(var(--nav-h) + var(--space-4xl));
        padding-bottom: var(--space-3xl);
    }

    .section { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }
    .section-title { margin-bottom: var(--space-xl); }

    .project-grid { grid-template-columns: repeat(3, 1fr); }

    .about-grid {
        grid-template-columns: 1.1fr 1fr;
        gap: var(--space-3xl);
    }

    .education-grid { grid-template-columns: repeat(4, 1fr); }

    .contact-grid { gap: var(--space-3xl); }
    .contact-desc { max-width: 380px; }

    /* Hover effects — desktop only */
    .project-featured:hover { border-color: var(--accent-hover); box-shadow: var(--shadow-md); }
    .project-card:hover {
        border-color: var(--accent-hover);
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    .tool-hero { padding-top: calc(var(--nav-h) + var(--space-3xl)); padding-bottom: var(--space-3xl); }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: LARGE DESKTOP (1200px+)
   ═══════════════════════════════════════════════ */
@media (min-width: 1200px) {
    :root { --max-w: 1200px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: SMALL PHONES (<380px)
   ═══════════════════════════════════════════════ */
@media (max-width: 380px) {
    .project-card { padding: 1.1rem; }
    .project-card h3 { font-size: var(--text-base); }
    .project-card__desc { font-size: 0.8125rem; }
    .about-text p { font-size: var(--text-sm); }
    .contact-row { padding: 0.75rem 0.9rem; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: LANDSCAPE PHONE
   ═══════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { padding-top: calc(var(--nav-h) + var(--space-md)); padding-bottom: var(--space-md); }
    .hero h1 { font-size: 1.5rem; }
    .section { padding: var(--space-lg) var(--gutter); }
    .nav-links { max-height: 70vh; }
}

/* ═══════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════ */
@media print {
    .site-nav, .nav-toggle, .social-row, .skip-link, .theme-toggle { display: none; }
    .fade-in { opacity: 1; transform: none; }
    .hero { padding-top: 2rem; }
    body { font-size: 11pt; background: white; color: #111; }
    a { color: #111; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
    .project-card, .project-featured { break-inside: avoid; border-color: #ccc; }
}

/* ═══════════════════════════════════════════════
   v4.0 — PROJECT FILTER BAR
   ═══════════════════════════════════════════════ */
.project-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.project-filter__btn {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.04em;
    padding: 0.5rem 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--ink-50);
    cursor: pointer;
    transition: all var(--dur-fast);
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.project-filter__btn:hover { border-color: var(--accent-hover); color: var(--ink); }
.project-filter__btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
[data-theme="dark"] .project-filter__btn.is-active { color: var(--ink); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .project-filter__btn.is-active { color: var(--ink); }
}

/* Filtered-out cards */
.project-card.is-hidden,
.project-featured.is-hidden { display: none; }

/* "În dezvoltare" badge */
.badge--dev {
    background: var(--blue-bg);
    color: var(--blue);
}

/* ═══════════════════════════════════════════════
   v4.0 — CONTACT FORM
   ═══════════════════════════════════════════════ */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.contact-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}
.contact-form__row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.contact-form__label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
.contact-form__input {
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: #e8e8f0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    transition: border-color var(--dur-fast), background var(--dur-fast);
    -webkit-appearance: none;
    appearance: none;
}
.contact-form__input::placeholder { color: rgba(255,255,255,0.25); }
.contact-form__input:focus {
    outline: none;
    border-color: var(--accent-hover);
    background: rgba(255,255,255,0.07);
}
.contact-form__textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.contact-form__submit {
    align-self: flex-start;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--ink);
    background: var(--accent-hover);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.6rem;
    cursor: pointer;
    min-height: 48px;
    transition: background var(--dur-fast), transform var(--dur-fast);
    touch-action: manipulation;
}
.contact-form__submit:hover { background: var(--accent); }
.contact-form__submit:active { transform: scale(0.98); }
.contact-form__notice {
    font-size: var(--text-sm);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    border: 1px solid transparent;
}
.contact-form__notice--ok {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green);
}
.contact-form__notice--err {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red);
}

/* ═══════════════════════════════════════════════
   v4.1 — LANGUAGE SWITCHER
   ═══════════════════════════════════════════════ */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
}
.lang-switch__btn {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0.32rem 0.5rem;
    border-radius: 14px;
    color: var(--ink-50);
    text-decoration: none;
    transition: color var(--dur-fast), background var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
}
.lang-switch__btn:hover { color: var(--ink); }
.lang-switch__btn.is-active {
    background: var(--accent);
    color: #fff;
}
[data-theme="dark"] .lang-switch__btn.is-active { color: var(--ink); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lang-switch__btn.is-active { color: var(--ink); }
}
@media (max-width: 480px) {
    .lang-switch__btn { padding: 0.3rem 0.4rem; font-size: 0.58rem; }
}

/* ═══════════════════════════════════════════════
   v4.1 — STATEMENT PAGES + FOOTER SUSTAIN LINE
   ═══════════════════════════════════════════════ */
.statement-body {
    max-width: 68ch;
    font-size: var(--text-md);
    line-height: 1.75;
    color: var(--ink-75);
}
.statement-body p { margin: 0 0 var(--space-md); }
.statement-body strong { color: var(--ink); font-weight: 600; }
.statement-body code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.1em 0.4em;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
}
.statement-updated {
    margin-top: var(--space-lg);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-50);
}
.footer-sustain {
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.35);
    text-align: center;
}
