/* ═══════════════════════════════════════════════════
   portfolio.mateobrl.fr — terminal / CLI authentic
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #0a0a0a;
    --bg-elev: #111111;
    --text: #e8e8e8;
    --text-strong: #ffffff;
    --muted: #6a6a6a;
    --dim: #4a4a4a;
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-strong: rgba(255, 255, 255, 0.18);

    --font: 'IBM Plex Mono', ui-monospace, 'JetBrains Mono', Menlo, Monaco, monospace;

    --col: 820px;
    --gutter: clamp(1.25rem, 4vw, 2rem);
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg-elev: #f2f2f2;
    --text: #1a1a1a;
    --text-strong: #000000;
    --muted: #7a7a7a;
    --dim: #b0b0b0;
    --hairline: rgba(0, 0, 0, 0.1);
    --hairline-strong: rgba(0, 0, 0, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--text-strong); color: var(--bg); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); }

/* ═══════════════════════════════════════════════════
   PROGRESS BAR (top, scroll-linked)
   ═══════════════════════════════════════════════════ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 1px;
    background: var(--text-strong);
    width: 0;
    z-index: 100;
    transition: width 0.08s linear;
}

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--hairline);
}

.header-inner {
    max-width: var(--col);
    margin: 0 auto;
    padding: 0.9rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-strong);
    font-size: 13px;
    letter-spacing: -0.01em;
}

.logo .prompt { color: var(--muted); font-weight: 400; }
.logo .accent { color: var(--muted); font-weight: 400; }
.logo:hover .prompt { color: var(--text-strong); }

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list {
    display: flex;
    gap: 0.1rem;
}

.nav-list a {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    font-size: 12.5px;
    color: var(--muted);
    transition: color 0.15s;
    border: 1px solid transparent;
}

.nav-list a:hover { color: var(--text-strong); }

.nav-list a.active {
    color: var(--text-strong);
    border-color: var(--hairline);
}

.nav-list a.external::after {
    content: ' ↗';
    color: var(--muted);
}

.theme-toggle {
    width: 28px;
    height: 28px;
    border: 1px solid var(--hairline);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    font-size: 11px;
}

.theme-toggle:hover { color: var(--text-strong); border-color: var(--hairline-strong); }

.theme-toggle .fa-moon { display: none; }
.theme-toggle .fa-sun { display: block; }
[data-theme="light"] .theme-toggle .fa-moon { display: block; }
[data-theme="light"] .theme-toggle .fa-sun { display: none; }

.menu-toggle {
    display: none;
    width: 28px;
    height: 28px;
    border: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 13px;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════
   MAIN / LAYOUT
   ═══════════════════════════════════════════════════ */
main {
    max-width: var(--col);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

section {
    padding: 3rem 0;
}

section:first-child { padding-top: 2.5rem; }

/* ═══════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════ */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-strong);
    font-weight: 500;
    font-size: 14px;
}

.section-head .hash { color: var(--muted); font-weight: 400; }
.section-head .meta {
    margin-left: auto;
    color: var(--dim);
    font-size: 11px;
    font-weight: 400;
}

.prompt-line {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 1.5rem;
}

.prompt-line .user { color: var(--text-strong); }
.prompt-line .cmd { color: var(--text); }
.prompt-line .arg { color: var(--muted); }

/* ═══════════════════════════════════════════════════
   RULE (between sections)
   ═══════════════════════════════════════════════════ */
.rule {
    border: none;
    height: 1px;
    background: var(--hairline);
    margin: 1.5rem 0;
    position: relative;
}

.rule::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 28px;
    height: 1px;
    background: var(--text-strong);
    transform: translateY(-50%);
}

/* ═══════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════ */
.hero {
    padding-top: 2rem;
    padding-bottom: 1rem;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 11.5px;
    margin-bottom: 1.5rem;
}

.hero-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-strong);
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-prompt {
    color: var(--muted);
    margin-bottom: 1.25rem;
    font-size: 13px;
}

.hero-prompt .user { color: var(--text-strong); }
.hero-prompt .cmd { color: var(--text); }

.hero-name {
    color: var(--text-strong);
    font-weight: 500;
    font-size: clamp(1.9rem, 5.5vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.hero-name strong {
    font-weight: 500;
    letter-spacing: 0.02em;
}

.cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--text-strong);
    vertical-align: text-bottom;
    margin-left: 0.15em;
    animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-role {
    color: var(--muted);
    margin-bottom: 1.8rem;
    font-size: 14px;
}

.hero-role span + span::before {
    content: ' / ';
    color: var(--dim);
    margin: 0 0.15rem;
}

.hero-desc {
    color: var(--text);
    max-width: 58ch;
    margin-bottom: 2rem;
    font-size: 14px;
}

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

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--hairline-strong);
    font-size: 13px;
    color: var(--text);
    transition: all 0.18s ease;
    cursor: pointer;
}

.btn .arrow { transition: transform 0.25s; display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-fill {
    background: var(--text-strong);
    color: var(--bg);
    border-color: var(--text-strong);
}

.btn-fill:hover {
    background: transparent;
    color: var(--text-strong);
}

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

/* ═══════════════════════════════════════════════════
   ABOUT — JSON / config style
   ═══════════════════════════════════════════════════ */
.json-block {
    background: var(--bg-elev);
    border: 1px solid var(--hairline);
    padding: 1.1rem 1.25rem;
    margin: 1rem 0 1.5rem;
    font-size: 13px;
    line-height: 1.85;
    color: var(--text);
}

.json-block .brace { color: var(--muted); }
.json-block .key { color: var(--muted); }
.json-block .key::before { content: '"'; }
.json-block .key::after { content: '"'; }
.json-block .colon { color: var(--dim); margin: 0 0.3rem; }
.json-block .val { color: var(--text-strong); }
.json-block .val::before { content: '"'; color: var(--dim); }
.json-block .val::after { content: '"'; color: var(--dim); }
.json-block .indent { padding-left: 1.5rem; }
.json-block .comma { color: var(--dim); }

.about-text p {
    color: var(--text);
    margin-bottom: 1rem;
    max-width: 64ch;
}

/* ═══════════════════════════════════════════════════
   SKILLS — terminal progress bars
   ═══════════════════════════════════════════════════ */
.skills-group {
    margin-top: 1.5rem;
}

.skills-group + .skills-group { margin-top: 2rem; }

.skills-group .group-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    color: var(--text-strong);
    font-size: 13px;
}

.skills-group .group-head .num {
    color: var(--muted);
    font-size: 12px;
}

.skill-row {
    display: grid;
    grid-template-columns: 30px 1fr 60px 38px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 13px;
}

.skill-row .branch {
    color: var(--dim);
    text-align: center;
}

.skill-row .name {
    color: var(--text);
}

.skill-row .bar {
    height: 3px;
    background: var(--hairline);
    position: relative;
    overflow: hidden;
}

.skill-row .fill {
    position: absolute;
    inset: 0 100% 0 0;
    background: var(--text-strong);
    transition: right 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skills-group.visible .fill { right: var(--rem); }

.skill-row .pct {
    color: var(--muted);
    text-align: right;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════
   TIMELINE (Experience)
   ═══════════════════════════════════════════════════ */
.timeline {
    position: relative;
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--hairline);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.75rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 6px;
    width: 11px;
    height: 11px;
    border: 1px solid var(--text-strong);
    background: var(--bg);
    box-sizing: border-box;
}

.timeline-item.work::before {
    background: var(--text-strong);
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 11.5px;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.timeline-meta .date { color: var(--text-strong); }
.timeline-meta .type {
    color: var(--muted);
    padding: 0 0.4rem;
    border: 1px solid var(--hairline);
}

.timeline-item.work .timeline-meta .type {
    color: var(--text-strong);
    border-color: var(--hairline-strong);
}

.timeline-title {
    color: var(--text-strong);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0.2rem;
}

.timeline-place {
    color: var(--muted);
    font-size: 12.5px;
    margin-bottom: 0.4rem;
}

.timeline-place::before { content: '→ '; color: var(--dim); }

.timeline-desc {
    color: var(--text);
    font-size: 13px;
    max-width: 60ch;
}

/* ═══════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════ */
.project-card {
    border: 1px solid var(--hairline);
    background: var(--bg-elev);
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
    transition: border-color 0.18s;
}

.project-card:hover {
    border-color: var(--hairline-strong);
}

.project-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.project-head .num { color: var(--muted); font-size: 12px; }
.project-head h3 {
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 500;
}

.project-head .version {
    margin-left: auto;
    color: var(--muted);
    font-size: 11.5px;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--hairline);
}

.project-card p {
    color: var(--text);
    font-size: 13px;
    margin-bottom: 1rem;
    max-width: 64ch;
}

.project-stack {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 1.1rem;
}

.project-stack .label { color: var(--dim); }
.project-stack .label::after { content: ': '; }

.project-stack .tag {
    display: inline-block;
    margin-right: 0.3rem;
}

.project-stack .tag::before { content: '['; color: var(--dim); }
.project-stack .tag::after { content: ']'; color: var(--dim); }

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 13px;
}

.project-links a {
    color: var(--text);
    transition: color 0.15s;
}

.project-links a:hover { color: var(--text-strong); text-decoration: underline; text-underline-offset: 3px; }
.project-links a::before { content: '→ '; color: var(--muted); }
.project-links a .ext { color: var(--muted); font-size: 11px; }

/* ═══════════════════════════════════════════════════
   CONTACT — config file style
   ═══════════════════════════════════════════════════ */
.contact-fields {
    border: 1px solid var(--hairline);
    background: var(--bg-elev);
    margin-top: 1rem;
}

.contact-fields .row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--hairline);
    transition: background 0.18s;
}

.contact-fields .row:last-child { border-bottom: none; }
.contact-fields .row:hover { background: var(--bg); }

.contact-fields .key { color: var(--muted); font-size: 12.5px; }
.contact-fields .key::after { content: ':'; }

.contact-fields .val {
    color: var(--text-strong);
    font-size: 13.5px;
    word-break: break-all;
}

.contact-fields .val a:hover { text-decoration: underline; text-underline-offset: 3px; }
.contact-fields .ext { color: var(--muted); font-size: 12px; }

.contact-note {
    color: var(--dim);
    font-size: 12px;
    margin-top: 1rem;
}

.contact-note::before { content: '// '; }

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
footer {
    border-top: 1px solid var(--hairline);
    padding: 1.5rem var(--gutter);
    max-width: var(--col);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 11.5px;
    margin-top: 2rem;
}

footer .clock { color: var(--text); }

footer .clock::before {
    content: '●';
    color: var(--text-strong);
    margin-right: 0.4rem;
    animation: blink 1.6s ease-in-out infinite;
}

footer .right { display: flex; gap: 1rem; align-items: center; }
footer .top { cursor: pointer; transition: color 0.15s; }
footer .top:hover { color: var(--text-strong); }

/* ═══════════════════════════════════════════════════
   REVEAL
   ═══════════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

[data-stagger] > * {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-stagger].visible > * {
    opacity: 1;
    transform: translateY(0);
}

[data-stagger].visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].visible > *:nth-child(2) { transition-delay: 0.12s; }
[data-stagger].visible > *:nth-child(3) { transition-delay: 0.19s; }
[data-stagger].visible > *:nth-child(4) { transition-delay: 0.26s; }
[data-stagger].visible > *:nth-child(5) { transition-delay: 0.33s; }
[data-stagger].visible > *:nth-child(6) { transition-delay: 0.40s; }
[data-stagger].visible > *:nth-child(n+7) { transition-delay: 0.47s; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .menu-toggle { display: inline-flex; }

    .nav-list {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--hairline);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s, opacity 0.25s;
        z-index: 40;
    }

    .nav-list.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-list a {
        padding: 0.85rem var(--gutter);
        border: none;
        border-bottom: 1px solid var(--hairline);
        font-size: 13px;
    }

    .nav-list a.active { border-color: var(--hairline); background: var(--bg-elev); }

    .hero-actions { flex-direction: column; align-items: stretch; }
    .btn { justify-content: space-between; }

    .skill-row {
        grid-template-columns: 24px 1fr 50px 36px;
        font-size: 12px;
    }

    .contact-fields .row { grid-template-columns: 80px 1fr; }
    .contact-fields .ext { display: none; }
}

/* ═══════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .cursor { animation: none; }
}

@media print {
    header, footer, .menu-toggle, .scroll-progress { display: none; }
    body { background: white; color: black; }
    .reveal, [data-stagger] > * { opacity: 1 !important; transform: none !important; }
    .skills-group .fill { right: var(--rem) !important; }
}
