/* ==========================================================================
   officialmhf.dev — portfolio styles
   ========================================================================== */

:root {
    --bg: #07050d;
    --bg-soft: #0d0917;
    --surface: #130d21;
    --surface-2: #1a1330;
    --border: #2a2040;
    --border-soft: rgba(192, 132, 252, 0.14);
    --text: #efeaf8;
    --muted: #a99fc4;
    --dim: #6f6590;

    --accent: #a855f7;
    --accent-strong: #9333ea;
    --accent-soft: #c084fc;
    --pink: #f0abfc;
    --indigo: #818cf8;
    --green: #4ade80;

    --gradient: linear-gradient(120deg, #f0abfc 0%, #c084fc 28%, #a855f7 55%, #818cf8 100%);
    --gradient-btn: linear-gradient(120deg, #c026d3 0%, #9333ea 45%, #6366f1 100%);

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 30px 80px -30px rgba(124, 58, 237, 0.45);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --header-h: 72px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

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

/* Subtle film grain over everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(168, 85, 247, 0.4); color: #fff; }

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

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(920px, 100% - 32px); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent-soft); }

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 200;
    padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff;
}
.skip-link:focus { top: 12px; }

.gradient-text {
    background: var(--gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.gradient-text.animated { animation: gradient-pan 8s linear infinite; }
.gradient-bg { background: var(--gradient); background-size: 200% 200%; animation: gradient-pan 10s ease infinite; }

@keyframes gradient-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Buttons ---------- */
.btn {
    --mx: 0px; --my: 0px;
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 26px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: 600 0.95rem/1 var(--font);
    cursor: pointer;
    transform: translate(var(--mx), var(--my));
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.3s, border-color 0.3s;
    isolation: isolate;
    white-space: nowrap;
}
.btn-sm { padding: 10px 18px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-primary {
    color: #fff;
    background: var(--gradient-btn);
    background-size: 180% 100%;
    box-shadow: 0 10px 30px -10px rgba(168, 85, 247, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 16px 40px -10px rgba(168, 85, 247, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, 0.03); border-color: var(--border); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--accent-soft); background: rgba(168, 85, 247, 0.08); }
.btn span[aria-hidden] { transition: transform 0.3s var(--ease); }
.btn:hover span[aria-hidden] { transform: translateX(3px); }

/* ---------- Header ---------- */
.scroll-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
    background: var(--gradient); transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
}

.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50;
    height: var(--header-h);
    transition: background-color 0.4s, border-color 0.4s, backdrop-filter 0.4s;
    border-bottom: 1px solid transparent;
}
.site-header.scrolled {
    background: rgba(7, 5, 13, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom-color: var(--border-soft);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { font-family: var(--mono); font-weight: 500; font-size: 1.05rem; display: inline-flex; align-items: center; }
.logo-bracket { color: var(--dim); transition: color 0.3s; }
.logo-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo:hover .logo-bracket { color: var(--accent-soft); }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav ul a {
    position: relative; display: block; padding: 8px 14px;
    font-size: 0.925rem; color: var(--muted); border-radius: 999px;
    transition: color 0.25s, background-color 0.25s;
}
.main-nav ul a:hover, .main-nav ul a.active { color: var(--text); }
.main-nav ul a.active { background: rgba(168, 85, 247, 0.12); }

.nav-toggle {
    display: none; position: relative; width: 44px; height: 44px;
    border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}
.nav-toggle span {
    position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--text);
    transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-open .nav-toggle span:first-child { top: 21px; transform: rotate(45deg); }
.nav-open .nav-toggle span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Language menu ---------- */
.header-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; }

.lang-menu { position: relative; }
.lang-button {
    position: relative; isolation: isolate;
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 12px 0 10px;
    border: 1px solid var(--border); border-radius: 999px;
    background: rgba(19, 13, 33, 0.6); backdrop-filter: blur(10px);
    color: var(--text); font: 600 0.8rem/1 var(--mono); letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s, transform 0.3s var(--ease), box-shadow 0.4s var(--ease);
}
/* Gradient ring that fades in on hover */
.lang-button::before {
    content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px;
    background: var(--gradient); background-size: 200% auto;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity 0.35s;
    animation: gradient-pan 4s linear infinite;
}
.lang-button:hover, .lang-menu.open .lang-button {
    border-color: transparent;
    background: rgba(168, 85, 247, 0.12);
    box-shadow: 0 8px 26px -10px rgba(168, 85, 247, 0.75);
    transform: translateY(-1px);
}
.lang-button:hover::before, .lang-menu.open .lang-button::before { opacity: 1; }
.lang-flag { width: 20px; height: 15px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); transition: transform 0.4s var(--ease); }
.lang-button:hover .lang-flag { transform: rotate(-8deg) scale(1.08); }
.lang-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.35s var(--ease), color 0.3s; }
.lang-button:hover .lang-chevron { color: var(--accent-soft); transform: translateY(1px); }
.lang-menu.open .lang-chevron { transform: rotate(180deg); color: var(--accent-soft); }

.lang-list {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 200px; padding: 6px;
    border-radius: 16px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(192, 132, 252, 0.08);
    opacity: 0; visibility: hidden;
    transform: translateY(-8px) scale(0.96); transform-origin: top right;
    transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), visibility 0.25s;
}
.lang-menu.open .lang-list,
html:not(.js) .lang-menu:focus-within .lang-list { opacity: 1; visibility: visible; transform: none; }
.lang-list li { opacity: 0; transform: translateY(-4px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.lang-menu.open .lang-list li { opacity: 1; transform: none; }
.lang-menu.open .lang-list li:nth-child(2) { transition-delay: 0.05s; }

.lang-option {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 11px;
    color: var(--muted); font-size: 0.9rem;
    transition: color 0.25s;
}
/* Highlight that sweeps in from the left */
.lang-option::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.22), rgba(129, 140, 248, 0.08));
    transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.lang-option { isolation: isolate; }
.lang-option:hover, .lang-option:focus-visible { color: var(--text); outline: none; }
.lang-option:hover::before, .lang-option:focus-visible::before { transform: scaleX(1); }
.lang-option:hover .lang-flag { transform: scale(1.12); }
.lang-option.active { color: var(--text); }
.lang-name { flex: 1; }
.lang-tag { font-size: 0.7rem; color: var(--dim); padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; transition: color 0.25s, border-color 0.25s; }
.lang-option:hover .lang-tag { color: var(--accent-soft); border-color: rgba(192, 132, 252, 0.4); }
.lang-check { width: 16px; height: 16px; color: var(--accent-soft); opacity: 0; transform: scale(0.5); transition: opacity 0.25s, transform 0.3s var(--ease); }
.lang-option.active .lang-check { opacity: 1; transform: none; }
.lang-menu.switching .lang-button { opacity: 0.6; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed; left: 50%; bottom: 20px; z-index: 90;
    width: min(760px, calc(100% - 32px));
    display: flex; align-items: center; gap: 18px;
    padding: 18px 20px; border-radius: 20px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(192, 132, 252, 0.1);
    transform: translate(-50%, 140%); opacity: 0;
    transition: transform 0.6s var(--ease), opacity 0.4s;
}
.cookie-banner.show { transform: translate(-50%, 0); opacity: 1; }
.cookie-banner[hidden] { display: none; }
.cookie-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(168, 85, 247, 0.15); font-size: 1.4rem; }
.cookie-banner.show .cookie-icon { animation: cookie-wiggle 1.2s var(--ease) 0.5s; }
@keyframes cookie-wiggle { 20% { transform: rotate(-14deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(3deg); } }
.cookie-copy { flex: 1; min-width: 0; }
.cookie-copy h2 { font-size: 0.95rem; margin-bottom: 2px; }
.cookie-copy p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.cookie-actions { display: flex; gap: 8px; flex: none; }

.footer-text-btn {
    background: none; border: 0; padding: 0 6px; margin-right: 4px; cursor: pointer;
    color: var(--dim); font: inherit; font-size: 0.85rem; align-self: center;
    background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%;
    transition: color 0.25s, background-size 0.35s var(--ease);
}
.footer-text-btn:hover { color: var(--text); background-size: 100% 1px; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex; align-items: center;
    padding: calc(var(--header-h) + 48px) 0 96px;
    overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.aurora {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
    will-change: transform;
}
.aurora-1 { width: 620px; height: 620px; top: -220px; right: -120px; background: radial-gradient(circle, #a855f7 0%, transparent 65%); animation: float-a 18s ease-in-out infinite; }
.aurora-2 { width: 520px; height: 520px; bottom: -200px; left: -160px; background: radial-gradient(circle, #6366f1 0%, transparent 65%); animation: float-b 22s ease-in-out infinite; opacity: 0.4; }
.aurora-3 { width: 380px; height: 380px; top: 30%; left: 45%; background: radial-gradient(circle, #e879f9 0%, transparent 65%); animation: float-c 26s ease-in-out infinite; opacity: 0.22; }
@keyframes float-a { 50% { transform: translate(-80px, 90px) scale(1.1); } }
@keyframes float-b { 50% { transform: translate(120px, -60px) scale(1.15); } }
@keyframes float-c { 33% { transform: translate(-120px, 60px); } 66% { transform: translate(80px, -80px) scale(0.9); } }

.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(192, 132, 252, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(192, 132, 252, 0.07) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }

.badge {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 16px; margin-bottom: 28px;
    border: 1px solid var(--border); border-radius: 999px;
    background: rgba(19, 13, 33, 0.6); backdrop-filter: blur(8px);
    font-size: 0.85rem; color: var(--muted);
}
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pulse-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
    animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero-greeting { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--muted); margin-bottom: 8px; }
.hero-title {
    font-size: clamp(2.8rem, 7.5vw, 5.6rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    margin-bottom: 20px;
}
.js .hero-title:not(.is-split) { opacity: 0; }
.hero-title .word { display: inline-block; overflow: hidden; padding-bottom: 0.08em; vertical-align: top; }
.hero-title .word > span {
    display: inline-block;
    transform: translateY(110%) rotate(4deg);
    transition: transform 1.1s var(--ease);
    transition-delay: calc(var(--i) * 90ms + 150ms);
}
.hero-title.is-split.in .word > span { transform: none; }

.hero-role { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: clamp(1.05rem, 1.8vw, 1.3rem); font-weight: 500; margin-bottom: 22px; }
.hero-role .sep { color: var(--accent); }
.hero-intro { max-width: 36rem; color: var(--muted); font-size: 1.075rem; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 32px; }
.availability { font-size: 0.85rem; color: var(--muted); }

.hero-visual { position: relative; perspective: 1200px; }
.glass {
    background: linear-gradient(160deg, rgba(40, 28, 68, 0.55), rgba(19, 13, 33, 0.55));
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.code-card {
    --rx: 0deg; --ry: 0deg;
    position: relative;
    border-radius: 20px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    transition: transform 0.6s var(--ease);
    overflow: hidden;
}
.code-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(140deg, rgba(240, 171, 252, 0.6), transparent 35%, transparent 65%, rgba(129, 140, 248, 0.5));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.code-card-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.code-card-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a2d55; }
.code-card-bar span:nth-child(1) { background: #f472b6; }
.code-card-bar span:nth-child(2) { background: #c084fc; }
.code-card-bar span:nth-child(3) { background: #818cf8; }
.code-card-bar em { margin-left: auto; font-style: normal; font-size: 0.75rem; color: var(--dim); }
.code-card pre { margin: 0; padding: 22px 22px 26px; font-size: 0.82rem; line-height: 1.85; color: #d9d0ee; overflow-x: auto; }
.code-card .c { color: var(--dim); }
.code-card .k { color: #f0abfc; }
.code-card .v { color: #93c5fd; }
.code-card .t { color: #c084fc; }
.code-card .f { color: #a5b4fc; }
.code-card .s { color: #86efac; }
.caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 4px; vertical-align: -3px; background: var(--accent-soft); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.float-chip {
    position: absolute; display: grid; place-items: center;
    width: 58px; height: 58px; border-radius: 16px;
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.8);
    animation: bob 6s ease-in-out infinite;
}
.chip-1 { top: -26px; right: 12%; }
.chip-2 { bottom: 18%; left: -28px; animation-delay: -2s; }
.chip-3 { bottom: -24px; right: 22%; animation-delay: -4s; }
.float-chip .skill-logo { width: 30px; height: 30px; }
@keyframes bob { 50% { transform: translateY(-14px) rotate(4deg); } }

.scroll-cue {
    position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
    width: 26px; height: 42px; border: 1.5px solid var(--border); border-radius: 999px;
}
.scroll-cue span {
    position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px;
    background: var(--accent-soft); animation: scroll-cue 2s var(--ease) infinite;
}
@keyframes scroll-cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee {
    position: relative; overflow: hidden;
    border-block: 1px solid var(--border-soft);
    background: rgba(13, 9, 23, 0.6);
    padding: 18px 0;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.marquee-item .skill-logo, .marquee-item .skill-fallback { width: 22px; height: 22px; font-size: 0.6rem; border-radius: 6px; }
.marquee-item .skill-logo:not(.invert) { filter: saturate(0.9); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(80px, 12vw, 140px) 0; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(19, 13, 33, 0.55) 15%, rgba(19, 13, 33, 0.55) 85%, transparent); }

.section-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(48px, 7vw, 72px); }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.035em; }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 1.05rem; }
.section-bar {
    display: block; width: 64px; height: 4px; margin: 22px auto 0; border-radius: 4px;
    background: var(--gradient); background-size: 200% auto; animation: gradient-pan 6s linear infinite;
    transform: scaleX(0); transition: transform 1s var(--ease) 0.3s;
}
.section-head.in .section-bar { transform: scaleX(1); }

.card {
    position: relative;
    background: linear-gradient(170deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.4s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

/* Cursor-following glow */
.spotlight { --sx: 50%; --sy: 50%; overflow: hidden; }
.spotlight::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--sx) var(--sy), rgba(192, 132, 252, 0.14), transparent 45%);
    opacity: 0; transition: opacity 0.4s;
}
.spotlight:hover::after { opacity: 1; }
.spotlight:hover { border-color: rgba(192, 132, 252, 0.45); }

.prose p + p { margin-top: 1.1em; }
.prose p { color: var(--muted); font-size: 1.05rem; }
.prose p:first-child { color: var(--text); font-size: 1.15rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
.stats { display: grid; gap: 16px; }
.stat { padding: 28px 30px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.stat strong { font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat span { color: var(--muted); text-align: right; }
.stat:hover { transform: translateY(-4px); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-card { padding: 28px; }
.skill-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.skill-card h3 { font-size: 1.25rem; }
.skill-card .count { font-size: 0.8rem; color: var(--dim); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; position: relative; z-index: 1; }
.skill-tile {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 18px 8px 14px; border-radius: 14px; text-align: center;
    background: rgba(7, 5, 13, 0.55); border: 1px solid var(--border);
    transition: transform 0.4s var(--ease), border-color 0.3s, background-color 0.3s, box-shadow 0.4s var(--ease);
}
.skill-tile-icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
.skill-tile-icon::before {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.35), transparent 70%);
    opacity: 0; transform: scale(0.6); transition: opacity 0.4s, transform 0.4s var(--ease);
}
.skill-tile-name { font-size: 0.85rem; color: var(--muted); line-height: 1.3; transition: color 0.3s; }
.skill-tile:hover { transform: translateY(-5px); border-color: rgba(192, 132, 252, 0.5); background: rgba(168, 85, 247, 0.08); box-shadow: 0 14px 30px -18px rgba(168, 85, 247, 0.8); }
.skill-tile:hover .skill-tile-icon::before { opacity: 1; transform: scale(1); }
.skill-tile:hover .skill-logo { transform: scale(1.12) rotate(-4deg); }
.skill-tile:hover .skill-tile-name { color: var(--text); }

.skill-logo { position: relative; width: 36px; height: 36px; object-fit: contain; transition: transform 0.4s var(--ease); }
.skill-logo.invert { filter: invert(1) brightness(2); }
.skill-fallback {
    position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--gradient); color: #fff; font: 700 0.8rem/1 var(--mono); letter-spacing: -0.02em;
}

/* ---------- Projects ---------- */
.projects { display: grid; gap: 32px; }
.project { display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; }
.project:hover { border-color: rgba(192, 132, 252, 0.4); box-shadow: var(--shadow); }
.project.reverse .project-media { order: 2; }
.project-media { position: relative; display: block; min-height: 320px; overflow: hidden; background: var(--bg-soft); }
.project-media > img:first-child, .project-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.6s; }
.project-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(7, 5, 13, 0.75)); }
.project:hover .project-media > img:first-child { transform: scale(1.06); }
.project-logo {
    position: absolute; left: 22px; bottom: 22px; z-index: 1;
    width: 64px; height: 64px; object-fit: contain; border-radius: 16px;
    padding: 8px; background: rgba(7, 5, 13, 0.6); backdrop-filter: blur(10px);
    border: 1px solid var(--border-soft);
}
.project-body { padding: clamp(28px, 4vw, 44px); display: flex; flex-direction: column; gap: 18px; }
.project-index { font-size: 0.8rem; color: var(--accent-soft); letter-spacing: 0.02em; }
.project h3 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.project h3 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size 0.5s var(--ease); }
.project h3 a:hover { background-size: 100% 2px; }
.project-summary { color: var(--muted); }

.project-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 0; }
.project-meta div { padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(7, 5, 13, 0.55); border: 1px solid var(--border); }
.project-meta dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.project-meta dd { margin: 2px 0 0; font-family: var(--mono); font-size: 0.95rem; font-variant-caps: all-small-caps; letter-spacing: 0.06em; color: var(--accent-soft); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; color: #e3d5fb; background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(168, 85, 247, 0.25); }

.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: auto; padding-top: 6px; }
.link-arrow { font-weight: 600; color: var(--accent-soft); display: inline-flex; gap: 6px; }
.link-arrow span { transition: transform 0.3s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }
.link-muted { color: var(--muted); font-size: 0.925rem; transition: color 0.25s; }
.link-muted:hover { color: var(--text); }

/* ---------- Education ---------- */
.degree { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px 28px; margin-bottom: 48px; }
.degree-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; background: rgba(168, 85, 247, 0.15); border: 1px solid var(--border-soft); }
.degree h3 { font-size: 1.3rem; }
.degree p { color: var(--muted); font-size: 0.95rem; }
.degree-progress { margin-left: auto; min-width: 180px; flex: 0 1 240px; }
.degree-progress span { font-size: 0.8rem; color: var(--accent-soft); display: block; text-align: right; margin-bottom: 6px; }
.degree-progress .bar { height: 8px; border-radius: 8px; background: rgba(7, 5, 13, 0.7); border: 1px solid var(--border); overflow: hidden; }
.degree-progress .bar i { display: block; height: 100%; width: 0; background: var(--gradient); border-radius: inherit; transition: width 1.6s var(--ease) 0.3s; }
.degree.in .degree-progress .bar i { width: var(--w); }

.timeline { position: relative; display: grid; gap: 28px; padding-left: 44px; }
.timeline-line { position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline-line i { position: absolute; inset: 0; background: var(--gradient); transform-origin: top; transform: scaleY(var(--tl, 0)); border-radius: inherit; }
.timeline-item { position: relative; }
.timeline-dot {
    position: absolute; left: -44px; top: 26px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--border);
    display: grid; place-items: center;
}
.timeline-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status-completed .timeline-dot { border-color: var(--accent); background: var(--accent); }
.status-completed .timeline-dot::after { content: "✓"; width: auto; height: auto; background: none; color: #fff; font-size: 0.7rem; font-weight: 700; }
.status-current .timeline-dot { border-color: var(--accent-soft); box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.15); }
.status-current .timeline-dot::after { background: var(--accent-soft); animation: ping-soft 2s ease-in-out infinite; }
@keyframes ping-soft { 50% { transform: scale(1.5); opacity: 0.6; } }
.status-upcoming .timeline-card { border-style: dashed; background: rgba(19, 13, 33, 0.5); }

.timeline-card { padding: 24px 28px; }
.timeline-card:hover { transform: translateX(6px); }
.timeline-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.timeline-top h3 { font-size: 1.2rem; }
.period { font-size: 0.8rem; color: var(--accent-soft); padding: 3px 10px; border-radius: 999px; background: rgba(168, 85, 247, 0.12); }
.timeline-sub { margin-top: 4px; color: var(--accent-soft); font-size: 0.95rem; }
.timeline-text { margin-top: 12px; color: var(--muted); }
.status-pill { display: inline-block; margin-top: 16px; font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.status-current .status-pill { color: var(--green); }
.status-completed .status-pill { color: var(--accent-soft); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 28px; }
.contact-links { display: grid; gap: 14px; }
.contact-link { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.contact-link:hover { transform: translateX(6px); }
.contact-link .icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: rgba(168, 85, 247, 0.14); color: var(--accent-soft); font-size: 1.3rem; }
.contact-link small { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.contact-link span:last-child { word-break: break-word; }

.contact-form { padding: clamp(24px, 4vw, 36px); display: grid; gap: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { position: relative; }
.field input, .field textarea {
    width: 100%; padding: 22px 16px 10px;
    font: inherit; color: var(--text);
    background: rgba(7, 5, 13, 0.6); border: 1px solid var(--border); border-radius: var(--radius-sm);
    outline: none; resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.field textarea { min-height: 150px; }
.field label {
    position: absolute; left: 16px; top: 16px; color: var(--dim); pointer-events: none;
    transform-origin: 0 0; transition: transform 0.3s var(--ease), color 0.3s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-9px) scale(0.78); color: var(--accent-soft); }
.form-status { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.925rem; border: 1px solid; }
.form-status.success { color: #bbf7d0; background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); }
.form-status.error { color: #fecaca; background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.3); }
.btn.loading { opacity: 0.7; pointer-events: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); padding: 32px 0; color: var(--dim); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; gap: 10px; }
.footer-links a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); color: var(--muted); font-size: 1.1rem; transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease); }
.footer-links a:hover { color: var(--text); border-color: var(--accent-soft); transform: translateY(-3px); }

/* ---------- Project case page ---------- */
.case-hero { position: relative; overflow: hidden; padding: calc(var(--header-h) + 64px) 0 56px; }
.breadcrumbs { font-size: 0.8rem; color: var(--dim); margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent-soft); }
.case-title { display: flex; align-items: center; gap: 22px; margin-bottom: 32px; }
.case-title h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 700; letter-spacing: -0.045em; }
.case-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 18px; padding: 8px; background: var(--surface); border: 1px solid var(--border); }
.case-image { margin: 0 0 56px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.case-image img { width: 100%; }
.case-body { display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start; }
.case-aside { padding: 24px; position: sticky; top: calc(var(--header-h) + 24px); }
.case-aside h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 12px; font-weight: 500; }
.case-aside .tags + h2 { margin-top: 24px; }
.case-links { display: grid; gap: 10px; }
.case-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 72px 0 96px; padding-top: 32px; border-top: 1px solid var(--border-soft); }
.case-next { padding: 18px 24px; text-align: right; }
.case-next small { display: block; color: var(--dim); font-size: 0.75rem; }
.case-next strong { font-size: 1.2rem; }

.not-found { position: relative; min-height: 80svh; display: grid; place-items: center; text-align: center; padding: calc(var(--header-h) + 40px) 0 60px; overflow: hidden; }
.not-found h1 { font-size: clamp(2.8rem, 8vw, 5rem); margin: 10px 0 16px; }
.not-found p.muted { margin-bottom: 32px; }

/* ---------- Reveal animations ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(32px);
    filter: blur(6px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
    transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal].in { opacity: 1; transform: none; filter: none; }
/* Cards keep their own hover transforms once revealed */
.js .card[data-reveal].in { transition: opacity 0.9s var(--ease), transform 0.5s var(--ease), filter 0.9s var(--ease), border-color 0.4s, box-shadow 0.5s var(--ease); transition-delay: 0s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-inner { grid-template-columns: 1fr; gap: 72px; }
    .hero-visual { max-width: 560px; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stat { flex-direction: column; align-items: flex-start; }
    .stat span { text-align: left; }
    .case-body { grid-template-columns: 1fr; }
    .case-aside { position: static; }
}

@media (max-width: 860px) {
    :root { --header-h: 64px; }
    .nav-toggle { display: block; z-index: 2; }
    .main-nav {
        position: fixed; inset: 0; z-index: 1;
        flex-direction: column; justify-content: center; gap: 36px;
        background: rgba(7, 5, 13, 0.96); backdrop-filter: blur(20px);
        opacity: 0; visibility: hidden;
        transition: opacity 0.4s var(--ease), visibility 0.4s;
    }
    .main-nav ul { flex-direction: column; align-items: center; gap: 8px; }
    .main-nav ul a { font-size: 1.6rem; font-weight: 600; color: var(--text); opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
    .nav-open .main-nav { opacity: 1; visibility: visible; }
    .nav-open .main-nav ul a { opacity: 1; transform: none; }
    .nav-open .main-nav li:nth-child(2) a { transition-delay: 0.05s; }
    .nav-open .main-nav li:nth-child(3) a { transition-delay: 0.1s; }
    .nav-open .main-nav li:nth-child(4) a { transition-delay: 0.15s; }
    .nav-open .main-nav li:nth-child(5) a { transition-delay: 0.2s; }
    .nav-open { overflow: hidden; }
    .project, .project.reverse { grid-template-columns: 1fr; }
    .project.reverse .project-media { order: 0; }
    .project-media { min-height: 220px; aspect-ratio: 16 / 9; }
    .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .stat { flex-direction: row; align-items: baseline; }
    .stat span { text-align: right; }
    .hero { padding-bottom: 110px; }
    .hero-role { flex-direction: column; align-items: flex-start; gap: 2px; }
    .hero-role .sep { display: none; }
    .hero-actions .btn { flex: 1 1 auto; }
    .float-chip { width: 46px; height: 46px; border-radius: 13px; }
    .float-chip .skill-logo { width: 24px; height: 24px; }
    .skill-list { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
    .chip-2 { left: -8px; }
    .code-card pre { font-size: 0.72rem; padding: 18px; }
    .cookie-banner { flex-wrap: wrap; bottom: 12px; padding: 16px; gap: 12px 14px; }
    .cookie-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { flex: 1; }
    .lang-button { height: 44px; }
    .degree-progress { margin-left: 0; flex-basis: 100%; }
    .timeline { padding-left: 34px; }
    .timeline-dot { left: -34px; width: 20px; height: 20px; }
    .timeline-line { left: 9px; }
    .timeline-card, .skill-card { padding: 20px; }
    .case-title { flex-direction: column; align-items: flex-start; gap: 16px; }
    .case-nav { flex-direction: column-reverse; align-items: stretch; }
    .case-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
    html { scroll-behavior: auto; }
    .js [data-reveal] { opacity: 1; transform: none; filter: none; }
    .hero-title .word > span { transform: none; }
}
