:root {
    --background: #050506;
    --surface: #101012;
    --text: #f5f7ff;
    --muted: #a5abc0;
    --accent: #ff1744;
    --red-deep: #8f001c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--background); font-family: "DM Sans", sans-serif; line-height: 1.6; }
a { color: inherit; }
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 3px; background: rgba(255, 255, 255, 0.08); }
.scroll-progress span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--accent)); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 12px var(--accent); }

#loader { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow: hidden; background: var(--background); transition: opacity 0.9s ease, visibility 0.9s ease; }
#loader::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 20%, rgba(255, 23, 68, 0.08) 50%, transparent 80%); transform: translateX(-100%); animation: loaderSweep 2.2s ease-in-out infinite; }
.loader-content { position: relative; z-index: 1; width: min(420px, 78vw); text-align: center; animation: loaderRise 1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.loader-kicker { margin: 0 0 1.5rem; color: var(--muted); font: 0.7rem/1.2 Arial, sans-serif; letter-spacing: 0.35em; animation: loaderFade 0.8s 0.2s both; }
.loader-text, .logo, h1 span, h2 span, h3 span { color: var(--accent); }
.loader-text { font-size: clamp(4rem, 14vw, 7rem); font-weight: bold; letter-spacing: 0.12em; line-height: 1; text-shadow: 0 0 25px rgba(255, 23, 68, 0.4); animation: loaderTextIn 1.1s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.loader-text span { color: #ff526d; }
.loader-status { display: flex; align-items: center; justify-content: center; gap: 0.55rem; margin: 1.8rem 0 0.8rem; color: var(--muted); font: 0.72rem Arial, sans-serif; letter-spacing: 0.08em; animation: loaderFade 0.8s 0.55s both; }
.loader-status span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: loaderPulse 1s ease-in-out infinite; }
.loader-progress { height: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.12); animation: loaderFade 0.8s 0.7s both; }
.loader-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--accent)); box-shadow: 0 0 12px var(--accent); animation: loaderProgress 1.65s 0.35s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.loader-orbit { position: absolute; width: 28rem; height: 28rem; border: 1px solid rgba(255, 23, 68, 0.14); border-radius: 50%; animation: loaderOrbit 14s linear infinite; }
.orbit-one { transform: rotate(25deg) scaleY(0.32); }
@keyframes loaderSweep { to { transform: translateX(100%); } }
@keyframes loaderRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loaderTextIn { from { opacity: 0; letter-spacing: 0.45em; transform: scale(0.86); } to { opacity: 1; letter-spacing: 0.12em; transform: scale(1); } }
@keyframes loaderFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes loaderPulse { 50% { opacity: 0.35; transform: scale(0.65); } }
@keyframes loaderProgress { to { width: 100%; } }
@keyframes loaderOrbit { to { rotate: 360deg; } }
.loader-done { opacity: 0; visibility: hidden; pointer-events: none; }
header { position: fixed; inset: 0 auto 0 0; z-index: 5; width: 230px; padding: 2rem 1.25rem; background: rgba(5, 5, 6, 0.94); border-right: 1px solid rgba(255, 23, 68, 0.25); box-shadow: 12px 0 35px rgba(0, 0, 0, 0.28); }
nav { display: flex; height: 100%; flex-direction: column; align-items: stretch; gap: 3rem; }
.logo { padding: 0 0.75rem; font-size: 1.5rem; font-weight: bold; }
.nav-links { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.nav-links a { position: relative; display: block; padding: 0.85rem 0.75rem; color: var(--muted); text-decoration: none; transition: color 0.2s ease, background 0.2s ease, padding 0.2s ease; }
.nav-links a::before { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform: scaleY(0); transition: transform 0.2s ease; }
.nav-links a:hover, .nav-links a.active { padding-left: 1.1rem; color: var(--accent); background: rgba(255, 23, 68, 0.08); text-shadow: 0 0 10px var(--accent); }
.nav-links a:hover::before, .nav-links a.active::before { transform: scaleY(1); }

section { max-width: 1100px; min-height: 70vh; margin: auto; padding: 4.5rem 7%; margin-left: 230px; scroll-margin-top: 1rem; }
#about { padding-top: 3.5rem; }
.hero { min-height: 90vh; display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(2rem, 6vw, 5rem); text-align: left; }
.hero-photo-wrap { position: relative; width: min(330px, 32vw); aspect-ratio: 0.82; justify-self: center; padding: 0.55rem; background: #0c0d16; border: 3px solid #ff1744; box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 12px #ff1744, 0 0 34px rgba(255, 23, 68, 0.55); transform: rotate(-3deg); transition: transform 0.4s ease; }
.hero-photo-wrap:hover { transform: rotate(0) translateY(-8px); }
.hero-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(0.9) contrast(1.04); }
.hero-content { will-change: transform; }
.scroll-indicator { animation: scrollBounce 1.8s ease-in-out infinite; transition: opacity 0.3s ease; }
@keyframes scrollBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.hero h1 { margin: 0; font-family: "Bebas Neue", sans-serif; font-size: clamp(4.5rem, 12vw, 9rem); font-weight: 400; letter-spacing: 0.04em; line-height: 0.9; }
.hero-name { position: relative; display: inline-block; color: var(--accent); text-shadow: 0 0 5px #ff1744, 0 0 16px rgba(255, 23, 68, 0.85), 0 0 42px rgba(255, 23, 68, 0.5); animation: nameGlow 2.4s ease-in-out infinite; }
.hero-name::after { content: ""; position: absolute; right: 0; bottom: -0.08em; left: 0.08em; height: 3px; background: var(--accent); box-shadow: 0 0 8px var(--accent), 0 0 20px var(--accent); transform: scaleX(0.7); transform-origin: center; animation: nameUnderline 2.4s ease-in-out infinite; }
@keyframes nameGlow { 0%, 100% { filter: brightness(0.95); } 50% { filter: brightness(1.3); text-shadow: 0 0 7px #ff1744, 0 0 22px rgba(255, 23, 68, 0.95), 0 0 55px rgba(255, 23, 68, 0.6); } }
@keyframes nameUnderline { 0%, 100% { opacity: 0.65; transform: scaleX(0.7); } 50% { opacity: 1; transform: scaleX(1); } }
.hero h2 { color: var(--muted); font-size: 1.2rem; letter-spacing: 0.12em; }
.small-text, .section-title p { color: var(--accent); letter-spacing: 0.15em; }
.hero-description { color: var(--muted); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-top: 1.4rem; color: var(--muted); font: 0.78rem Arial, sans-serif; }
.hero-meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-meta i { width: 7px; height: 7px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 10px #39d98a; }
.relationship-name { display: inline-block; color: var(--accent); font-weight: 700; text-shadow: 0 0 6px rgba(255, 23, 68, 0.75), 0 0 16px rgba(255, 23, 68, 0.35); animation: relationshipGlow 2.4s ease-in-out infinite; }
@keyframes relationshipGlow { 0%, 100% { filter: brightness(0.95); } 50% { filter: brightness(1.25); } }
.main-button, .contact-button { display: inline-block; margin-top: 1.5rem; padding: 0.75rem 1.2rem; border: 1px solid var(--accent); color: var(--text); text-decoration: none; }
.main-button:hover, .contact-button:hover { background: var(--accent); }
.section-title { margin-bottom: 2rem; }
.section-title h2 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); }
.about-content, .skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.about-content { grid-template-columns: 1fr; }
.about-text { max-width: 760px; }
.skills-grid { grid-template-columns: repeat(4, 1fr); }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.info-card, .skill-card, .project-card, .contact-box { padding: 1.5rem; background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.1); }
.info-card, .skill-card, .project-card, .contact-box, .section-title { opacity: 0; transform: translateY(40px) scale(0.98); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.section-title { transform: translateY(28px); }
.is-visible { opacity: 1; transform: translateY(0); }
.info-card:nth-child(2), .skill-card:nth-child(2) { transition-delay: 0.1s; }
.info-card:nth-child(3), .skill-card:nth-child(3) { transition-delay: 0.2s; }
.info-card:nth-child(4), .skill-card:nth-child(4) { transition-delay: 0.3s; }
.skill-level { margin-top: 1.25rem; color: var(--muted); font: 0.72rem Arial, sans-serif; }
.skill-level > span { display: block; margin-bottom: 0.35rem; text-align: right; }
.skill-level > div { height: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
.skill-level i { display: block; width: var(--skill-width); height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--accent)); border-radius: inherit; box-shadow: 0 0 10px var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 1s 0.35s ease; }
.is-visible .skill-level i { transform: scaleX(1); }
.project-card { display: flex; gap: 1.5rem; }
.project-number { color: var(--accent); font-size: 2rem; }
.project-details { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin: 1rem 0 0.3rem; color: var(--muted); font-size: 0.85rem; }
.project-details strong { display: block; color: var(--text); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.project-tag { display: inline-block; margin: 0.5rem 0.4rem 0 0; color: var(--accent); font-size: 0.8rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
footer { padding: 2rem 7%; color: var(--muted); text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.cursor-glow, .particle-container { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.cursor-glow { inset: auto; width: 250px; height: 250px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 23, 68, 0.22), rgba(143, 0, 28, 0.12), transparent 70%); transform: translate(-50%, -50%); filter: blur(20px); }
.particle { position: absolute; display: block; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor, 0 0 22px color-mix(in srgb, currentColor 55%, transparent); animation: particleFloat linear infinite; animation-delay: var(--particle-delay); will-change: transform, opacity; }
.particle::after { content: ""; position: absolute; inset: 35%; border-radius: inherit; background: #fff; opacity: 0.7; }
.particle-diamond { border-radius: 1px; rotate: 45deg; box-shadow: 0 0 9px currentColor, 0 0 26px color-mix(in srgb, currentColor 60%, transparent); }

@media (max-width: 700px) {
    header { position: sticky; inset: auto; width: auto; padding: 1rem 5%; border-right: 0; border-bottom: 1px solid rgba(255, 23, 68, 0.25); }
    nav { height: auto; flex-direction: row; align-items: center; gap: 1rem; }
    nav, .nav-links { flex-direction: column; gap: 0.5rem; }
    nav { flex-direction: column; }
    .nav-links { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .nav-links a { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
    .nav-links a:hover, .nav-links a.active { padding-left: 0.5rem; background: transparent; }
    .nav-links a::before { display: none; }
    section { margin-left: 0; padding: 4.5rem 5%; scroll-margin-top: 1rem; }
    #about { padding-top: 3.5rem; }
    .about-content, .skills-grid, .info-grid { grid-template-columns: 1fr; }
    .hero-meta { flex-direction: column; align-items: center; }
    .hero { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
    .hero-photo-wrap { width: min(270px, 72vw); grid-row: 1; }
    .hero-content { grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
    #loader { transition-duration: 0.01ms; }
    .hero-content { transform: none !important; }
    .hero-name, .hero-name::after { animation: none; }
    .relationship-name { animation: none; }
}
