/* ═══════════════════════════════════════════════════════════
   Portfolio — Gabriel Henrique
   Handcrafted Design System
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg: #0c0c0e;
    --bg-alt: #111114;
    --surface: #18181b;
    --border: rgba(255, 255, 255, 0.06);
    --text: #f0ece5;
    --text-dim: #8a8a8d;
    --text-muted: #555558;
    --accent: #c4a1ff;
    --accent-dim: rgba(196, 161, 255, 0.12);
    --warm: #ffb088;
    --warm-dim: rgba(255, 176, 136, 0.10);
    --green: #5eeea0;

    --font: 'Sora', -apple-system, sans-serif;
    --mono: 'DM Mono', 'Fira Code', monospace;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius: 12px;
    --container: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* ──── GLOBAL SCROLLBAR ──── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(196, 161, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 161, 255, 0.3);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 161, 255, 0.15) transparent;
}

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

/* ──── GRAIN OVERLAY ──── */
.grain {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px;
}

/* ──── AMBIENT BLOBS ──── */
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
}

.blob-1 {
    width: 600px; height: 600px;
    background: var(--accent);
    top: -10%; right: -5%;
    animation: float1 20s ease-in-out infinite;
}

.blob-2 {
    width: 500px; height: 500px;
    background: var(--warm);
    bottom: 10%; left: -10%;
    animation: float2 25s ease-in-out infinite;
}

.blob-3 {
    width: 400px; height: 400px;
    background: #5e8eea;
    top: 50%; left: 40%;
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 30px) scale(1.05); }
    66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.08); }
    66% { transform: translate(-20px, 20px) scale(0.92); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-60px, 40px); }
}

/* ──── CONTAINER ──── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* ──── NAVIGATION ──── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0 2rem;
    height: 64px;
    transition: all 0.4s var(--ease);
}

.nav.scrolled {
    background: rgba(12, 12, 14, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav__inner {
    max-width: var(--container);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

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

.nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav__links a {
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-dim);
    border-radius: 8px;
    transition: all 0.2s var(--ease);
    font-weight: 400;
}

.nav__links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.nav__cta {
    color: var(--accent) !important;
    border: 1px solid rgba(196, 161, 255, 0.25) !important;
    margin-left: 0.5rem;
}

.nav__cta:hover {
    background: var(--accent-dim) !important;
    color: var(--accent) !important;
}

.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 110;
}

.nav__burger span {
    width: 22px; height: 1.5px;
    background: var(--text);
    transition: all 0.3s var(--ease);
}

.nav__burger.active span:first-child {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav__burger.active span:last-child {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ──── HERO ──── */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    padding: 120px 2rem 80px;
    max-width: var(--container);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero__tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--green);
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
}

.pulse-dot {
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(94, 238, 160, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(94, 238, 160, 0); }
}

.hero__title {
    font-size: clamp(3.5rem, 7vw, 6rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.hero__title--outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--text-dim);
    transition: all 0.5s var(--ease);
}

.hero:hover .hero__title--outline {
    -webkit-text-stroke-color: var(--accent);
    text-shadow: 0 0 60px rgba(196, 161, 255, 0.15);
}

.hero__role {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--mono);
    font-size: 0.95rem;
    color: var(--text-dim);
}

.hero__role-line {
    width: 40px; height: 1px;
    background: var(--text-muted);
}

.cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

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

/* ──── TERMINAL ──── */
.hero__terminal {
    background: rgba(17, 17, 20, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-family: var(--mono);
    font-size: 0.82rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.terminal__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}

.terminal__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}

.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green { background: #28c840; }

.terminal__tab {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.terminal__body {
    padding: 20px;
    line-height: 1.9;
    color: var(--text-dim);
}

.t-prompt { color: var(--accent); margin-right: 6px; }
.t-output { color: var(--text-dim); padding-left: 1.2rem; }
.t-highlight { color: var(--warm); padding-left: 1.2rem; }

/* ──── MARQUEE ──── */
.marquee-section {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    padding: 1.2rem 0;
}

.marquee__track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee__content {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 0 1.25rem;
    white-space: nowrap;
}

.marquee__item {
    font-size: 0.88rem;
    color: var(--text-dim);
    font-weight: 400;
}

.marquee__item strong {
    color: var(--text);
    font-weight: 600;
    margin-right: 4px;
}

.marquee__sep {
    color: var(--text-muted);
    font-size: 0.5rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ──── SECTIONS ──── */
.section {
    padding: 8rem 0;
    position: relative;
    z-index: 2;
}

.section--alt {
    background: var(--bg-alt);
}

.section__header {
    display: flex;
    align-items: baseline;
    gap: 1.2rem;
    margin-bottom: 4rem;
}

.section__number {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    opacity: 0.7;
}

.section__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* ──── WORK CARDS ──── */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.work-card {
    padding: 2.5rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.4s var(--ease);
    position: relative;
}

.work-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}

.work-card:hover::before { opacity: 1; }

.work-card:hover {
    border-color: rgba(196, 161, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.work-card__num {
    font-family: var(--mono);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-muted);
    opacity: 0.25;
    position: absolute;
    top: 1.5rem; right: 1.5rem;
}

.work-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.work-card p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.work-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.work-card__tags span {
    padding: 0.2rem 0.65rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 6px;
}

/* ──── STACK ──── */
.stack-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stack-item {
    display: grid;
    grid-template-columns: 260px 1fr 50px;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.stack-item:first-child {
    border-top: 1px solid var(--border);
}

.stack-item:hover {
    padding-left: 0.5rem;
}

.stack-item:hover .stack-item__name {
    color: var(--text);
}

.stack-item__name {
    font-size: 0.92rem;
    color: var(--text-dim);
    font-weight: 400;
    transition: color 0.3s;
}

.stack-item--featured .stack-item__name {
    font-weight: 600;
    color: var(--text);
}

.stack-item__bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 6px;
    overflow: hidden;
}

.stack-item__fill {
    height: 100%;
    background: linear-gradient(90deg, #b48cff, #ffb088);
    border-radius: 6px;
    width: 0;
    transition: width 1.2s var(--ease);
    box-shadow: 0 0 12px rgba(180, 140, 255, 0.35), 0 0 4px rgba(255, 176, 136, 0.2);
}

.stack-item--featured .stack-item__fill {
    height: 100%;
}

.stack-item--featured .stack-item__bar {
    height: 8px;
}

.stack-item__pct {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
}

/* ──── PROJECTS ──── */
.project-list {
    display: flex;
    flex-direction: column;
}

.project {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 2rem;
    align-items: start;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.project:first-child {
    border-top: 1px solid var(--border);
}

.project:hover {
    padding-left: 1rem;
}

.project:hover .project__name {
    color: var(--accent);
}

.project__index {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-top: 0.2rem;
}

.project__name {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

.project__desc {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 1rem;
    max-width: 600px;
}

.project__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project__tags span {
    padding: 0.2rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--warm);
    background: var(--warm-dim);
    border-radius: 6px;
}

.project__links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.2rem;
}

.project__link {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: color 0.2s;
    white-space: nowrap;
}

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

/* ──── TIMELINE ──── */
.timeline {
    display: flex;
    flex-direction: column;
}

.timeline__item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}

.timeline__item:first-child {
    border-top: 1px solid var(--border);
}

.timeline__date {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem;
}

.timeline__year {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
}

.timeline__period {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.timeline__badge-now {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--green);
    background: rgba(94, 238, 160, 0.08);
    border: 1px solid rgba(94, 238, 160, 0.15);
    border-radius: 6px;
    margin-left: 0.5rem;
}

.timeline__content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.timeline__company {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.timeline__content > p:last-child {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.65;
}

/* ──── CONTACT ──── */
.contact-block {
    max-width: 900px;
}

.contact__header {
    margin-bottom: 3rem;
}

.contact__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.contact__dot { color: var(--accent); }

.contact__sub {
    font-size: 1rem;
    color: var(--text-dim);
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: start;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form__field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form__field input,
.form__field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    outline: none;
}

.form__field input:focus,
.form__field textarea:focus {
    border-color: var(--accent);
}

.form__field input::placeholder,
.form__field textarea::placeholder {
    color: var(--text-muted);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.9rem 2rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    width: 100%;
}

.btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 161, 255, 0.2);
}

.btn__arrow {
    transition: transform 0.3s var(--ease);
}

.btn:hover .btn__arrow {
    transform: translateX(4px);
}

.contact__links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contact__links-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.contact__link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    transition: all 0.2s var(--ease);
}

.contact__link-item:hover {
    color: var(--text);
    padding-left: 0.5rem;
}

.contact__link-item span {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.contact__link-item:hover span {
    transform: translate(2px, -2px);
    color: var(--accent);
}

/* ──── FOOTER ──── */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer__copy {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer__made {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ──── CUSTOM CURSOR ──── */
.custom-cursor {
    position: fixed;
    top: 0; left: 0;
    z-index: 10000;
    pointer-events: none;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
}

.cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s;
}

.custom-cursor.hovering .cursor-ring {
    width: 56px; height: 56px;
    border-color: var(--accent);
}

.custom-cursor.hovering .cursor-dot {
    width: 4px; height: 4px;
    background: var(--accent);
}

@media (pointer: coarse) {
    .custom-cursor { display: none; }
}

/* ──── SCROLL PROGRESS ──── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--warm));
    z-index: 10001;
    width: 0;
    transition: none;
}

/* ──── HERO GREETING ──── */
.hero__greeting {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ──── SECTION SUBTITLE ──── */
.section__subtitle {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* ──── CERTIFICATIONS ──── */
.certs-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    cursor: grab;
}

.certs-scroll:active {
    cursor: grabbing;
}

.certs-scroll::-webkit-scrollbar {
    height: 4px;
}

.certs-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.certs-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.certs-track {
    display: flex;
    gap: 1.2rem;
    width: max-content;
    padding-bottom: 0.5rem;
}

.cert-card {
    flex-shrink: 0;
    width: 280px;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.cert-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--warm));
    opacity: 0;
    transition: opacity 0.3s;
}

.cert-card:hover::after { opacity: 1; }

.cert-card:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 161, 255, 0.15);
}

.cert-card__badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--warm);
    background: var(--warm-dim);
    border-radius: 4px;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.cert-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.cert-card__issuer {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.cert-card__date {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ──── NAV KBD ──── */
.nav__kbd {
    cursor: pointer;
}

.nav__kbd kbd {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.nav__kbd:hover kbd {
    color: var(--accent);
    border-color: rgba(196, 161, 255, 0.2);
}

/* ──── COMMAND PALETTE ──── */
.cmd-palette {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
}

.cmd-palette.active {
    display: flex;
}

.cmd-palette__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.cmd-palette__modal {
    position: relative;
    width: 520px;
    max-width: 90vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    animation: cmdSlide 0.2s var(--ease);
}

@keyframes cmdSlide {
    from { transform: translateY(-12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.cmd-palette__search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cmd-palette__icon {
    color: var(--text-muted);
    font-size: 1rem;
}

.cmd-palette__search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
}

.cmd-palette__search input::placeholder {
    color: var(--text-muted);
}

.cmd-palette__search kbd {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.cmd-palette__results {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.88rem;
    transition: all 0.15s;
}

.cmd-item:hover,
.cmd-item.active {
    background: rgba(196, 161, 255, 0.08);
    color: var(--text);
}

.cmd-item__icon {
    width: 24px;
    text-align: center;
    font-size: 0.9rem;
}

.cmd-item kbd {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s;
}

.cmd-item:hover kbd,
.cmd-item.active kbd {
    opacity: 1;
}

.cmd-item.hidden {
    display: none;
}

.cmd-palette__footer {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 1.25rem;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ──── BACK TO TOP ──── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px; height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s var(--ease);
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ──── MATRIX RAIN EASTER EGG ──── */
.matrix-rain {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.matrix-rain.active {
    opacity: 0.15;
}

/* ──── REVEAL ANIMATIONS ──── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* Stagger */
.work-grid .work-card:nth-child(2) { transition-delay: 0.08s; }
.work-grid .work-card:nth-child(3) { transition-delay: 0.16s; }

/* ──── SQL PLAYGROUND ──── */
.sql-playground {
    margin-top: -1rem;
}

.sql-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Schema sidebar */
.sql-schema {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    position: sticky;
    top: 80px;
}

.sql-schema__title {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sql-schema__table {
    margin-bottom: 0.5rem;
}

.sql-schema__tname {
    color: var(--warm);
    cursor: pointer;
    padding: 0.3rem 0;
    transition: color 0.2s;
    user-select: none;
}

.sql-schema__tname:hover {
    color: var(--text);
}

.sql-schema__table.open .sql-schema__tname {
    color: var(--text);
}



.sql-schema__cols {
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    padding-left: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.sql-schema__table.open .sql-schema__cols {
    display: flex;
}

.sql-schema__cols span {
    color: var(--text-dim);
    font-size: 0.7rem;
}

.sql-schema__cols em {
    color: var(--accent);
    font-style: normal;
    margin-left: 0.3rem;
    font-size: 0.62rem;
    opacity: 0.7;
}

/* SQL Terminal */
.sql-terminal {
    background: rgba(17, 17, 20, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.sql-terminal__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}

.sql-terminal__label {
    margin-left: auto;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.sql-terminal__body {
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: 500px;
}

.sql-output {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sql-output::-webkit-scrollbar { width: 4px; }
.sql-output::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sql-welcome p {
    color: var(--text-muted);
}

/* Query echo */
.sql-query-echo {
    color: var(--accent);
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Error */
.sql-error {
    color: #ff6b6b;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 107, 107, 0.06);
    border-left: 2px solid #ff6b6b;
    border-radius: 0 4px 4px 0;
}

/* Result info */
.sql-info {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Result table */
.sql-table-wrapper {
    overflow-x: auto;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.sql-result-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 0.74rem;
    white-space: nowrap;
}

.sql-result-table th {
    background: rgba(196, 161, 255, 0.08);
    color: var(--accent);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.sql-result-table td {
    padding: 0.45rem 0.75rem;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.sql-result-table tr:hover td {
    background: rgba(255,255,255,0.02);
    color: var(--text);
}

.sql-result-table tr:last-child td {
    border-bottom: none;
}

/* Input row */
.sql-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.01);
}

.sql-prompt {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.sql-input-row input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.82rem;
    outline: none;
    padding: 0.3rem 0;
}

.sql-input-row input::placeholder {
    color: var(--text-muted);
}

.sql-run {
    background: none;
    border: 1px solid var(--border);
    color: var(--green);
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sql-run:hover {
    background: rgba(94, 238, 160, 0.1);
    border-color: var(--green);
}

/* Examples */
.sql-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.01);
}

.sql-example {
    padding: 0.25rem 0.65rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.sql-example:hover {
    color: var(--accent);
    border-color: rgba(196, 161, 255, 0.2);
    background: var(--accent-dim);
}

/* SHOW TABLES special output */
.sql-tables-list {
    margin-bottom: 1rem;
}

.sql-tables-list p {
    color: var(--text-dim);
    padding: 0.2rem 0;
}

.sql-tables-list p span {
    color: var(--warm);
}

/* ──── RESPONSIVE ──── */
@media (max-width: 860px) {
    .nav__burger { display: flex; }
    .nav__kbd { display: none; }

    .nav__links {
        position: fixed;
        top: 0; right: -100%;
        width: 260px; height: 100vh;
        background: rgba(12, 12, 14, 0.98);
        backdrop-filter: blur(30px);
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
        gap: 0.5rem;
        transition: right 0.4s var(--ease);
        border-left: 1px solid var(--border);
    }

    .nav__links.active { right: 0; }

    .nav__links a {
        font-size: 1rem;
        padding: 0.6rem 0;
    }

    .nav__cta {
        margin-left: 0 !important;
        margin-top: 1rem;
        text-align: center;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 3rem;
        min-height: auto;
        padding: 120px 2rem 60px;
    }

    .hero__title {
        font-size: clamp(2.8rem, 10vw, 4rem);
    }

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

    .stack-item {
        grid-template-columns: 140px 1fr 40px;
        gap: 0.75rem;
    }

    .project {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .project__index { display: none; }

    .project__links {
        flex-direction: row;
        gap: 1rem;
    }

    .timeline__item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .contact__grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

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

    .footer__inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

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

    .sql-schema {
        position: static;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 2.5rem;
    }

    .stack-item {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .stack-item__pct {
        text-align: left;
    }

    .marquee__item {
        font-size: 0.8rem;
    }
}
