:root {
    --accent: #F35C19;
    --accent-dim: rgba(243, 92, 25, 0.12);
    --bg: #0e0e0c;
    --bg-alt: #141412;
    --surface: #1a1a17;
    --border: #2e2e2a;
    --border-soft: #232320;
    --text: #e8e6e1;
    --text-muted: #8a8880;
    --text-dim: #5c5a54;
    --header-bg: rgba(14, 14, 12, 0.92);
    --font: 'IBM Plex Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --wrap: 1040px;
    --gap: 24px;
    --radius: 4px;
}

[data-theme="light"] {
    --accent: #d94e10;
    --accent-dim: rgba(217, 78, 16, 0.1);
    --bg: #f6f5f2;
    --bg-alt: #eeede8;
    --surface: #ffffff;
    --border: #d4d2cb;
    --border-soft: #e4e2db;
    --text: #1a1a18;
    --text-muted: #5c5a54;
    --text-dim: #8a8880;
    --header-bg: rgba(246, 245, 242, 0.94);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.site-header.scrolled {
    background: var(--header-bg);
    border-bottom-color: var(--border-soft);
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 16px;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.2;
}

.brand-mark {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.header-end {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-nav {
    display: flex;
    gap: 4px;
}

.site-nav a {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}

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

.site-nav a.is-active {
    color: var(--text);
    background: var(--accent-dim);
}

.header-utils {
    display: flex;
    gap: 4px;
}

.util-btn {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 5px 8px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

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

.lang-toggle .lang-sep { opacity: 0.35; margin: 0 2px; }
.lang-toggle[data-lang="es"] .lang-label { color: var(--accent); }
.lang-toggle[data-lang="es"] .lang-alt { opacity: 0.4; }
.lang-toggle[data-lang="en"] .lang-alt { color: var(--accent); }
.lang-toggle[data-lang="en"] .lang-label { opacity: 0.4; }

.theme-toggle[data-theme="dark"] .theme-icon-sun { display: inline; }
.theme-toggle[data-theme="dark"] .theme-icon-moon { display: none; }
.theme-toggle[data-theme="light"] .theme-icon-sun { display: none; }
.theme-toggle[data-theme="light"] .theme-icon-moon { display: inline; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.open span:first-child { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:last-child { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover { background: #ff6b2e; }

.btn-ghost {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}

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

/* ── Hero ── */
.hero {
    padding: 96px 0 64px;
    border-bottom: 1px solid var(--border-soft);
    overflow: visible;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 14px;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-name {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-alias {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    padding: 4px 10px;
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
    background: var(--accent-dim);
}

.hero-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 52ch;
    margin-bottom: 24px;
    line-height: 1.7;
}

.hero-lead strong { color: var(--text); font-weight: 600; }

.terminal {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 24px;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-alt);
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.terminal-dot:first-child { background: #c45c4a; }
.terminal-dot:nth-child(2) { background: #c4a84a; }
.terminal-dot:nth-child(3) { background: #6a9e5a; }

.terminal-title {
    margin-left: 8px;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-dim);
}

.terminal-body {
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.75;
    overflow-x: auto;
    color: var(--text-muted);
}

.terminal-body code { white-space: pre-wrap; }

.t-prompt { color: var(--accent); }
.t-out { color: var(--text-muted); }
.t-accent { color: var(--text); }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Avatar + chips */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 340px;
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
    overflow: visible;
}

.avatar-ring {
    width: min(268px, 58vw);
    height: min(268px, 58vw);
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(150deg, var(--accent) 0%, var(--border) 55%, transparent 100%);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 22%;
    display: block;
    background: var(--surface);
}

.hero-chips {
    position: absolute;
    inset: -8px;
    z-index: 3;
    pointer-events: none;
}

.chip {
    position: absolute;
    z-index: 3;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 6px 11px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    animation: chip-float 5s ease-in-out infinite;
}

.chip--accent {
    color: var(--accent);
    border-color: rgba(243, 92, 25, 0.45);
    background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.chip:nth-child(1) { top: 4%; left: 50%; transform: translateX(-50%); animation-name: chip-float-center; }
.chip:nth-child(2) { top: 32%; right: 0; animation-delay: 0.7s; }
.chip:nth-child(3) { bottom: 14%; right: 6%; animation-delay: 1.4s; }
.chip:nth-child(4) { bottom: 14%; left: 6%; animation-delay: 2.1s; }
.chip:nth-child(5) { top: 32%; left: 0; animation-delay: 2.8s; }

@keyframes chip-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes chip-float-center {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* ── Blocks ── */
.block {
    padding: 72px 0;
}

.block--alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.block-head {
    margin-bottom: 32px;
    max-width: 640px;
}

.block-title {
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.block-lead {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.prose {
    max-width: 640px;
    margin-bottom: 28px;
}

.prose p {
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.prose strong { color: var(--text); font-weight: 600; }

.note-card {
    max-width: 640px;
    padding: 16px 18px;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    border-top: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.note-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.note-card p:last-child {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.disclaimer {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.55;
    padding: 10px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
}

/* ── Experience ── */
.exp-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-soft);
}

.exp-row {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-soft);
}

.exp-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exp-brand .exp-org {
    line-height: 1.25;
}

.exp-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
    opacity: 0.72;
    filter: grayscale(0.15);
    transition: opacity 0.22s, filter 0.22s, transform 0.22s;
    padding: 4px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
}

.exp-row:hover .exp-logo {
    opacity: 1;
    filter: none;
    transform: scale(1.04);
}

.exp-logo--tr { border-radius: 50%; padding: 2px; }

.exp-logo--gms {
    filter: grayscale(0.1) brightness(1.35) contrast(1.05);
    opacity: 0.65;
}

[data-theme="light"] .exp-logo--gms {
    filter: grayscale(0.05) brightness(0.9);
    opacity: 0.78;
}

.exp-logo--9z {
    border-radius: 6px;
    background: #0a0a0a;
    padding: 3px;
}

[data-theme="light"] .exp-logo--9z {
    background: #1a1a1a;
}

.exp-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-dim);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    opacity: 0.55;
    margin-bottom: 2px;
}

.exp-row:hover .exp-logo-fallback {
    opacity: 0.9;
    color: var(--accent);
    border-color: var(--accent-dim);
}

.exp-meta time {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.exp-org {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
}

.exp-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.exp-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exp-body li {
    font-size: 0.88rem;
    color: var(--text-muted);
    padding-left: 14px;
    position: relative;
    line-height: 1.55;
}

.exp-body li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

/* ── Projects ── */
.group-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

.group-label:first-of-type { margin-top: 0; }

.work-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

.work-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    padding: 18px 20px;
    background: var(--bg);
    align-items: start;
}

.work-item--featured {
    grid-template-columns: 180px 1fr;
    padding: 22px 20px;
}

.work-item--compact {
    grid-template-columns: 1fr;
}

.work-thumb {
    display: block;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    aspect-ratio: 16 / 10;
    text-decoration: none;
}

.work-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--surface);
}

.work-thumb--game img {
    object-fit: contain;
    padding: 8px;
    background: #e8ecf0;
}

[data-theme="light"] .work-thumb--game img { background: #dde2e8; }

.work-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.work-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.work-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.work-stack {
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.01em;
}

.work-tag {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    padding: 2px 8px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.work-link {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
    text-decoration: none;
}

.work-link:hover { text-decoration: underline; }

/* ── Contact ── */
.contact-wrap { max-width: 560px; }

.contact-panel {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.contact-primary {
    display: block;
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}

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

.contact-channels {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-channels a {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
}

.contact-channels a:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer {
    padding: 28px 0 40px;
    border-top: 1px solid var(--border-soft);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }

    .hero-lead { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .terminal { text-align: left; }

    .hero-visual {
        order: -1;
        min-height: 280px;
    }

    .hero-chips { display: none; }

    .exp-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .work-item,
    .work-item--featured {
        grid-template-columns: 1fr;
    }

    .work-thumb { max-width: 280px; }
}

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

    .header-end {
        position: absolute;
        top: 56px;
        right: 20px;
        left: 20px;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        display: none;
    }

    .header-end.open { display: flex; }

    .site-nav {
        flex-direction: column;
        gap: 2px;
    }

    .site-nav a { padding: 10px 12px; }

    .header-utils {
        justify-content: center;
        padding-top: 8px;
        border-top: 1px solid var(--border-soft);
    }

    .block { padding: 56px 0; }

    .hero { padding: 80px 0 48px; }
}
