@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
    --bg:         #0f0f0f;
    --bg-2:       #141414;
    --bg-card:    #1a1a1a;
    --bg-card-2:  #1f1f1f;
    --border:     #2e2e2e;
    --border-soft:#252525;
    --text:       #ece8e1;
    --text-muted: #8c8680;
    --text-dim:   #5a5650;
    --accent:     #c9a84c;
    --accent-dim: rgba(201,168,76,0.1);
    --accent-mid: rgba(201,168,76,0.25);
    --glass:      rgba(255,255,255,0.04);
    --glass-border:rgba(255,255,255,0.08);
    --white:      #f5f1ea;
    --font-sans:  'DM Sans', sans-serif;
    --font-serif: 'DM Serif Display', serif;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-img: 8px;
}

*, *::before, *::after {
    padding: 0; margin: 0; box-sizing: border-box;
    text-decoration: none; list-style: none; scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(201,168,76,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(100,100,180,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 70%);
    background-attachment: fixed;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* HEADER */
header {
    position: fixed; top: 1.2rem; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 3rem;
    background: rgba(15,15,15,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 2rem;
    border-radius: 3rem;
    z-index: 1000;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
header.scrolled {
    background: rgba(15,15,15,0.92);
    border-color: rgba(201,168,76,0.3);
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.logo { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-size: 1rem; font-weight: 600; }
.logo-mark { background: var(--accent); color: #0f0f0f; font-weight: 700; font-size: 0.78rem; padding: 0.28rem 0.55rem; border-radius: var(--radius-sm); letter-spacing: 1px; }
.logo-name { color: var(--text); }
.nav-links { display: flex; gap: 2rem; }
li a { position: relative; color: var(--text-muted); font-size: 0.88rem; font-weight: 400; transition: color 0.2s ease; }
li a::after { content: ''; position: absolute; bottom: -3px; left: 0; width: 0; height: 1.5px; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; }
li a:hover { color: var(--text); }
li a:hover::after { width: 100%; }
.visit-btn { padding: 0.48rem 1.2rem; border: 1px solid rgba(201,168,76,0.4); border-radius: 3rem; background: rgba(201,168,76,0.08); color: var(--accent); font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
.visit-btn:hover { background: var(--accent); color: #0f0f0f; border-color: var(--accent); }
#menu-icon { font-size: 1.4rem; display: none; cursor: pointer; color: var(--text); }

/* SECTIONS */
section { min-height: 100vh; padding: 8rem 10%; width: 100%; position: relative; }

/* ABOUT */
.about { display: flex; align-items: center; justify-content: center; background: var(--bg); overflow: hidden; }
.about::before { content: 'RS'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-serif); font-size: 30vw; color: rgba(255,255,255,0.018); pointer-events: none; user-select: none; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.about-container { display: flex; align-items: center; justify-content: center; gap: 7rem; position: relative; z-index: 1; }
.about img { width: 18vw; max-width: 260px; min-width: 160px; border-radius: var(--radius-img); filter: grayscale(15%); animation: fadeSlideUp 0.8s ease forwards; border: 1px solid var(--border); box-shadow: 0 8px 40px rgba(0,0,0,0.4); transition: filter 0.3s ease; }
.about img:hover { filter: grayscale(0%); }
.info-box { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; animation: fadeSlideUp 0.8s ease 0.15s forwards; opacity: 0; max-width: 520px; }
.info-box h3 { font-size: 0.88rem; font-weight: 400; color: var(--text-muted); letter-spacing: 2.5px; text-transform: uppercase; }
.info-box h1 { font-family: var(--font-serif); font-size: 3.8rem; font-weight: 400; line-height: 1.08; color: var(--white); letter-spacing: -0.02em; }
.info-box span#typed-text { font-size: 1.05rem; color: var(--accent); font-weight: 400; min-height: 1.6rem; display: block; }
.about-bio { font-size: 0.9rem; color: var(--text-muted); line-height: 1.75; border-left: 2px solid rgba(201,168,76,0.3); padding-left: 1rem; }
.btn-group { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.btn { padding: 0.55rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); font-family: var(--font-sans); font-size: 0.83rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.socials { display: flex; gap: 1.3rem; }
.socials i { font-size: 1.4rem; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; }
.socials i:hover { color: var(--accent); transform: translateY(-2px); }

/* SECTION TITLES */
.section-title { font-family: var(--font-serif); font-size: 2.8rem; font-weight: 400; margin-bottom: 3rem; color: var(--white); letter-spacing: -0.02em; display: inline-block; }
.section-title::after { content: ''; display: block; width: 2rem; height: 2px; background: var(--accent); border-radius: 2px; margin-top: 0.5rem; }

/* SKILLS SECTION */
.skills { background: var(--bg); padding-top: 5rem; padding-bottom: 5rem; min-height: auto; background-image: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 60%); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 0.9rem; }
.skill-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    padding: 1.2rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    cursor: default;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.skill-card:hover {
    background: rgba(201,168,76,0.1);
    border-color: rgba(201,168,76,0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(201,168,76,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
}
.skill-card i {
    font-size: 1.6rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.skill-card:hover i { color: var(--accent); }
.skill-card span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-align: center;
}

/* EXPERIENCE */
.experience { background: var(--bg-2); }
.experience-info { display: flex; align-items: flex-start; justify-content: center; gap: 4rem; }
.experience img { width: 22vw; max-width: 280px; min-width: 180px; border-radius: var(--radius-img); filter: grayscale(25%); border: 1px solid var(--border); flex-shrink: 0; box-shadow: 0 8px 32px rgba(0,0,0,0.35); transition: filter 0.3s ease; }
.experience img:hover { filter: grayscale(0%); }
.grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; flex: 1; }
.grid-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1.6rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(24px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.grid-card.visible { opacity: 1; transform: translateY(0); }
.grid-card:hover { background: rgba(255,255,255,0.06); box-shadow: 0 4px 24px rgba(0,0,0,0.2); border-color: rgba(201,168,76,0.3); border-left-color: var(--accent); }
.grid-card i { font-size: 1.2rem; color: var(--accent); margin-bottom: 0.2rem; }
.grid-card > span { font-size: 0.72rem; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; }
.grid-card h3 { font-size: 1rem; font-weight: 600; color: var(--white); }
.grid-card p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.7; }
.exp-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.6rem; }
.exp-header h3 { font-size: 0.98rem; font-weight: 600; color: var(--white); margin-bottom: 0.2rem; line-height: 1.3; }
.company { font-size: 0.8rem; color: var(--accent); font-weight: 400; }
.exp-date { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; padding-top: 0.15rem; flex-shrink: 0; }
.exp-points { display: flex; flex-direction: column; gap: 0.45rem; }
.exp-points li { font-size: 0.84rem; color: var(--text-muted); line-height: 1.65; padding-left: 1.1rem; position: relative; }
.exp-points li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-size: 0.75rem; opacity: 0.7; }

/* PROJECTS */
.projects { background: var(--bg); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.project-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    opacity: 0;
    transform: translateY(24px);
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(201,168,76,0.35);
    transform: translateY(-5px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(201,168,76,0.1);
}
.project-card img { width: 100%; height: 175px; object-fit: cover; object-position: top; display: block; filter: grayscale(20%); transition: filter 0.3s ease; border-bottom: 1px solid var(--glass-border); }
.project-card:hover img { filter: grayscale(0%); }
.project-card-body { padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.9rem; flex: 1; }
.project-card h3 { font-size: 1rem; font-weight: 600; color: var(--white); }
.project-card p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.project-card .btn-group { margin-top: auto; padding-top: 0.5rem; border-top: 1px solid var(--glass-border); }
.project-card .btn { font-size: 0.78rem; padding: 0.4rem 0.9rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { padding: 0.18rem 0.65rem; font-size: 0.7rem; font-weight: 500; border: 1px solid var(--border); border-radius: 3rem; color: var(--text-muted); background: transparent; }

/* CONTACT */
.contact { display: flex; flex-direction: column; align-items: flex-start; background: var(--bg-2); }
.contact .section-title { font-size: 2.8rem; }
.contact-subtitle { color: var(--text-muted); margin-bottom: 2.5rem; font-size: 0.92rem; max-width: 460px; line-height: 1.75; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 500px; }
.form-group { position: relative; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem 1.2rem; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-sans); font-size: 0.9rem; outline: none; transition: border-color 0.2s ease, background 0.2s ease; backdrop-filter: blur(8px); }
.form-group input:-webkit-autofill, .form-group input:-webkit-autofill:hover, .form-group input:-webkit-autofill:focus, .form-group input:-webkit-autofill:active { -webkit-text-fill-color: var(--text) !important; -webkit-box-shadow: 0 0 0px 1000px #1a1a1a inset !important; transition: background-color 5000s ease-in-out 0s; caret-color: var(--text); }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); background: rgba(255,255,255,0.06); }
.form-group textarea { resize: vertical; min-height: 140px; }
.form-group label { position: absolute; left: 1.2rem; top: 1rem; font-size: 0.88rem; color: var(--text-muted); pointer-events: none; transition: all 0.2s ease; background: transparent; padding: 0 0.3rem; border-radius: 2px; }
.form-group input:focus ~ label, .form-group input:not(:placeholder-shown) ~ label, .form-group textarea:focus ~ label, .form-group textarea:not(:placeholder-shown) ~ label { top: -0.55rem; font-size: 0.7rem; color: var(--accent); letter-spacing: 0.5px; background: var(--bg-2); }
.submit-btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.85rem 2rem; background: var(--accent); color: #0f0f0f; border: none; border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; width: fit-content; }
.submit-btn:hover { background: #d4b060; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.25); }
.form-success { display: none; color: var(--accent); font-size: 0.88rem; padding: 1rem 1.2rem; border: 1px solid rgba(201,168,76,0.3); border-radius: var(--radius-sm); background: var(--accent-dim); }

/* FOOTER */
footer { background: #080808; border-top: 1px solid var(--border-soft); color: var(--text-muted); padding: 2.5rem 10%; display: flex; flex-direction: column; gap: 1.2rem; align-items: center; }
footer ul { display: flex; gap: 2rem; }
footer ul li a { color: var(--text-dim); font-size: 0.82rem; transition: color 0.2s ease; }
footer ul li a:hover { color: var(--accent); }
.footer-socials { display: flex; gap: 1.5rem; }
.footer-socials a { color: var(--text-dim); font-size: 1.2rem; transition: all 0.2s ease; }
.footer-socials a:hover { color: var(--accent); transform: translateY(-2px); }
.copyright { font-size: 0.76rem; color: #333; }

/* BACK TO TOP */
.back-to-top { position: fixed; bottom: 2rem; right: 2rem; width: 2.4rem; height: 2.4rem; background: var(--accent); color: #0f0f0f; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 999; box-shadow: 0 4px 16px rgba(201,168,76,0.2); }
.back-to-top.visible { opacity: 1; pointer-events: all; }
.back-to-top:hover { background: #d4b060; transform: translateY(-3px); }

/* CODE PEEK */
.peek-btn { position: absolute; top: 2rem; right: 2rem; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(201,168,76,0.3); border-radius: var(--radius-sm); padding: 0.35rem 0.85rem; font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500; cursor: pointer; z-index: 10; transition: all 0.2s ease; }
.peek-btn:hover { background: var(--accent-mid); border-color: var(--accent); }
.peek-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 1001; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; backdrop-filter: blur(4px); }
.peek-overlay.active { opacity: 1; pointer-events: all; }
.peek-panel { position: fixed; top: 0; right: 0; width: 500px; max-width: 100vw; height: 100vh; background: rgba(12,12,12,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-left: 1px solid var(--glass-border); z-index: 1002; padding: 2rem; display: flex; flex-direction: column; gap: 1.4rem; transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; box-shadow: -8px 0 40px rgba(0,0,0,0.5); }
.peek-panel.active { transform: translateX(0); }
.peek-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid var(--glass-border); }
.peek-title { color: var(--white); font-size: 1rem; font-weight: 600; }
.peek-close { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 1rem; cursor: pointer; transition: all 0.2s ease; padding: 0.3rem 0.5rem; line-height: 1; }
.peek-close:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.peek-description { color: var(--text-muted); font-size: 0.87rem; line-height: 1.75; border-left: 2px solid var(--accent); padding: 0.8rem 1rem; background: var(--accent-dim); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.peek-code { background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 1.5rem; overflow-x: auto; flex: 1; }
.peek-code code { color: #c9c0a8; font-family: 'Courier New', monospace; font-size: 0.8rem; line-height: 1.8; white-space: pre; }

/* MEDIA QUERIES */
@media(max-width: 1280px) {
    header { gap: 2rem; padding: 0.7rem 1.5rem; }
    .about-container { gap: 4rem; }
    .experience-info { flex-direction: column; align-items: center; }
    .experience img { width: 55vw; }
}
@media(max-width: 768px) {
    section { padding: 6rem 6%; }
    header { gap: 1rem; padding: 0.7rem 1rem; }
    header .visit-btn { display: none; }
    .about-container { flex-direction: column; gap: 2.5rem; }
    .about img { width: 55vw; }
    .info-box { align-items: center; text-align: center; }
    .info-box h1 { font-size: 2.8rem; }
    .about-bio { text-align: left; }
    .grid { grid-template-columns: 1fr; }
    .section-title { font-size: 2.2rem; }
    .exp-header { flex-direction: column; gap: 0.3rem; }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}
@media(max-width: 600px) {
    header #menu-icon { display: block; }
    .nav-links { position: absolute; top: calc(100% + 0.5rem); left: 0; width: 100%; padding: 1rem; display: none; flex-direction: column; text-align: center; background: rgba(10,10,10,0.95); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 0 0 var(--radius-md) var(--radius-md); z-index: 999; }
    .nav-links.active { display: flex; }
    .nav-links li { padding: 0.7rem 0; border-bottom: 1px solid var(--border-soft); }
    .nav-links li:last-child { border-bottom: none; }
    .about img { width: 72vw; }
    .info-box h1 { font-size: 2.3rem; }
    footer ul { flex-wrap: wrap; justify-content: center; gap: 1rem; }
}