/* ==========================================================================
   Rohit Jain portfolio
   Midnight-blue dark theme (default) + light theme, glass nav, timeline,
   scroll-reveal. No frameworks, no external assets beyond Google Fonts.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
    --bg: #0b1020;
    --bg-soft: #0e1528;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-solid: #121a30;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e7ebf5;
    --text-muted: #98a3bd;
    --accent: #6d9eff;
    --accent-2: #ff8a5c;
    --accent-soft: rgba(109, 158, 255, 0.13);
    --accent-2-soft: rgba(255, 138, 92, 0.14);
    --grad: linear-gradient(100deg, #6d9eff 0%, #9d7bff 55%, #ff8a5c 100%);
    --nav-bg: rgba(11, 16, 32, 0.72);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --glow-1: rgba(63, 105, 224, 0.20);
    --glow-2: rgba(224, 108, 63, 0.10);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f6f8fc;
    --bg-soft: #eef2f9;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --border: rgba(15, 26, 56, 0.10);
    --border-strong: rgba(15, 26, 56, 0.20);
    --text: #17203a;
    --text-muted: #5b6785;
    --accent: #2456c9;
    --accent-2: #c84623;
    --accent-soft: rgba(36, 86, 201, 0.09);
    --accent-2-soft: rgba(200, 70, 35, 0.10);
    --grad: linear-gradient(100deg, #2456c9 0%, #6a3fd8 55%, #c84623 100%);
    --nav-bg: rgba(246, 248, 252, 0.78);
    --shadow: 0 12px 28px rgba(23, 32, 58, 0.10);
    --glow-1: rgba(36, 86, 201, 0.12);
    --glow-2: rgba(200, 70, 35, 0.07);
    color-scheme: light;
}

/* ---------------- Reset & base ---------------- */

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

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

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }

strong { color: var(--text); font-weight: 600; }
em { color: var(--text-muted); }

h1, h2, h3, h4 { font-family: "Sora", "Inter", sans-serif; line-height: 1.2; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--text-muted); font-weight: 400; }

/* ---------------- Icons ---------------- */

.icon {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex: none; vertical-align: -3px;
}
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------------- Gradient text ---------------- */

.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---------------- Nav ---------------- */

.nav {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12); }

.nav-inner {
    max-width: 1080px; margin: 0 auto; padding: 0 24px;
    height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
    font-family: "Sora", sans-serif;
    font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
    color: var(--text);
}
.brand span { color: var(--accent); }

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

.nav-link {
    color: var(--text-muted);
    font-size: 0.92rem; font-weight: 500;
    padding: 7px 13px; border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text); cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); transform: rotate(15deg); }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }

.nav-burger {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 38px; height: 38px;
    background: none; border: 0; cursor: pointer;
}
.nav-burger span {
    display: block; height: 2px; width: 22px; margin: 0 auto;
    background: var(--text); border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Hero ---------------- */

.hero {
    position: relative;
    padding: 150px 0 56px;
    overflow: hidden;
}

.hero-glow {
    position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(600px 420px at 12% -8%, var(--glow-1), transparent 65%),
        radial-gradient(560px 400px at 88% 12%, var(--glow-2), transparent 65%),
        var(--bg);
}
.hero-glow::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black 25%, transparent 75%);
    opacity: 0.5;
}

.hero-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 48px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.83rem; font-weight: 500; letter-spacing: 0.02em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    padding: 5px 14px; border-radius: 999px;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 800; letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.role {
    font-size: clamp(1.15rem, 2.6vw, 1.6rem);
    font-weight: 700; letter-spacing: -0.01em;
    margin-bottom: 18px;
}

.tagline {
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1.02rem;
    margin-bottom: 30px;
}

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

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: var(--grad);
    color: #fff; border: 0;
    box-shadow: 0 6px 20px rgba(109, 158, 255, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(109, 158, 255, 0.38); }

.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); }

.hero-photo { flex: none; }

.photo-ring {
    position: relative;
    width: 280px; height: 280px;
    border-radius: 50%;
    padding: 5px;
    background: var(--grad);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}
.photo-ring img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg);
}

/* ---------------- Stats ---------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 60px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 2px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.stat-num {
    font-family: "Sora", sans-serif;
    font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em;
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ---------------- Sections ---------------- */

.section { padding: 64px 24px; }

.section-title {
    display: flex; align-items: baseline; gap: 14px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800; letter-spacing: -0.02em;
    margin-bottom: 34px;
}
.section-kicker {
    font-family: "Sora", sans-serif;
    font-size: 0.9rem; font-weight: 700;
    color: var(--accent-2);
}
.section-title::after {
    content: "";
    flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--border-strong), transparent);
    align-self: center;
}

/* ---------------- Cards ---------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px 28px;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 18px;
    padding: 26px 30px;
    display: grid; gap: 14px;
    color: var(--text-muted);
    font-size: 1.02rem;
}

/* ---------------- Timeline ---------------- */

.timeline {
    position: relative;
    display: grid; gap: 26px;
    padding-left: 30px;
}
.timeline::before {
    content: "";
    position: absolute; left: 7px; top: 10px; bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2) 90%, transparent);
    opacity: 0.45;
}

.tl-item { position: relative; }

.tl-dot {
    position: absolute; left: -30px; top: 30px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-item:first-child .tl-dot {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 4px var(--accent-2-soft);
}

.card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.card-head h4 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }

.company {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 3px;
    font-weight: 600; font-size: 0.95rem;
    color: var(--accent);
}
.company:hover { text-decoration: underline; }

.card-meta {
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    flex: none;
}

.badge {
    display: inline-block;
    font-size: 0.78rem; font-weight: 600;
    padding: 4px 12px; border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.badge-current {
    background: var(--accent-2-soft);
    color: var(--accent-2);
}

.loc {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.8rem; color: var(--text-muted);
}

/* ---------------- Chips ---------------- */

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 14px; }
.chips span {
    font-size: 0.76rem; font-weight: 500;
    padding: 4px 11px; border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.chips span:hover { color: var(--accent); border-color: var(--accent); }
.chips-lg span { font-size: 0.84rem; padding: 6px 14px; }

/* ---------------- Bullets ---------------- */

.bullets { list-style: none; display: grid; gap: 9px; color: var(--text-muted); }
.bullets li {
    position: relative;
    padding-left: 20px;
    font-size: 0.95rem;
}
.bullets li::before {
    content: "";
    position: absolute; left: 2px; top: 0.62em;
    width: 7px; height: 7px; border-radius: 2px;
    background: var(--grad);
    transform: rotate(45deg);
}
.bullets a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Subprojects ---------------- */

.subproject {
    margin-top: 18px;
    padding: 16px 18px 14px;
    border-radius: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}
.subproject h5 {
    font-family: "Sora", sans-serif;
    font-size: 0.98rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    color: var(--text);
}
.subproject h5::before {
    content: "↳";
    color: var(--accent-2);
    font-weight: 400;
}

/* ---------------- Skills ---------------- */

.skills-grid { display: grid; gap: 16px; }

.skill-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    display: grid; grid-template-columns: 210px 1fr;
    gap: 8px 24px; align-items: start;
    transition: border-color 0.2s ease;
}
.skill-group:hover { border-color: var(--border-strong); }
.skill-group h4 {
    font-size: 0.85rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--accent);
    padding-top: 7px;
}
.skill-group .chips { margin: 0; }

/* ---------------- Projects ---------------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
}

.project-card { display: flex; flex-direction: column; }
.project-card h4 {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    font-size: 1.04rem; font-weight: 700;
    margin-bottom: 12px;
}
.project-card h4 a { color: var(--text-muted); transition: color 0.2s ease; }
.project-card h4 a:hover { color: var(--accent); }
.project-card p { color: var(--text-muted); font-size: 0.93rem; flex: 1; }
.project-card .chips { margin-bottom: 0; margin-top: 14px; }

/* ---------------- Education ---------------- */

.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}
.edu-icon { color: var(--accent-2); margin-bottom: 14px; }
.edu-card h4 { font-size: 1.1rem; margin-bottom: 6px; }
.edu-degree { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 14px; }
.edu-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.88rem; }

/* ---------------- Awards ---------------- */

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

.card-subtitle {
    font-size: 1.05rem; font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.list-plain { list-style: none; display: grid; gap: 12px; color: var(--text-muted); font-size: 0.94rem; }
.list-plain a { color: var(--text-muted); }
.list-plain a .icon-xs { margin-left: 6px; }
.list-plain a:hover, .list-plain a:hover strong { color: var(--accent); }

.list-award li { display: flex; gap: 10px; }
.list-award .icon { color: var(--accent-2); margin-top: 3px; }

/* ---------------- Footer ---------------- */

.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    margin-top: 40px;
}
.footer-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding-top: 26px; padding-bottom: 26px;
    color: var(--text-muted); font-size: 0.88rem;
}
.footer-links { display: flex; gap: 8px; }
.footer-links a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.footer-links a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ---------------- Scroll reveal ---------------- */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .btn:hover, .stat:hover, .card:hover, .theme-toggle:hover, .footer-links a:hover { transform: none; }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
    .hero { padding-top: 120px; }
    .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 32px; }
    .photo-ring { width: 190px; height: 190px; }
    .stats { grid-template-columns: repeat(2, 1fr); margin-top: 44px; }
    .skill-group { grid-template-columns: 1fr; gap: 10px; }
    .skill-group h4 { padding-top: 0; }
}

@media (max-width: 760px) {
    .nav-links {
        position: fixed; top: 64px; left: 0; right: 0;
        flex-direction: column;
        background: var(--nav-bg);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        padding: 12px 24px 20px;
        gap: 4px;
        transform: translateY(-12px);
        opacity: 0; visibility: hidden;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
    }
    .nav-links.open { transform: none; opacity: 1; visibility: visible; }
    .nav-link { padding: 11px 13px; font-size: 1rem; }
    .nav-burger { display: flex; }

    .section { padding: 48px 24px; }
    .card { padding: 20px; }
    .card-meta { flex-direction: row; align-items: center; }
    .card-head { flex-direction: column; gap: 10px; }
    .timeline { padding-left: 24px; }
    .tl-dot { left: -24px; width: 13px; height: 13px; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { padding: 14px 16px; }
    .stat-num { font-size: 1.4rem; }
    .hero-cta .btn { flex: 1 1 45%; justify-content: center; }
}
