/* =====================================================
   Rohith Chekuri — Portfolio Styles
   Modern, polished design inspired by portfolioexample.pdf
   ===================================================== */

/* --- Design Tokens --- */
:root {
    /* Dark mode is the default palette */
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --accent: #38bdf8;
    --dark: #020617;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --bg-main: #0b1220;
    --bg-light: #0f1a2e;
    --bg-accent: #16233e;
    --bg-card: #131f35;
    --border: #263449;
    --header-bg: rgba(11, 18, 32, 0.85);
    --accent-border: #2c4870;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Light mode overrides — applied when <html data-theme="light"> */
[data-theme="light"] {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #0ea5e9;
    --dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-main: #ffffff;
    --bg-light: #f8fafc;
    --bg-accent: #eff6ff;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.85);
    --accent-border: #bfdbfe;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Layout --- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.bg-light { background-color: var(--bg-light); }

/* --- Section Headers --- */
.section-head { margin-bottom: 48px; text-align: center; }
.section-number { display: block; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 8px; }
.section-title { font-size: 2rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.02em; }

/* --- Typography --- */
h1, h2, h3, h4 { color: var(--text-main); }
a { text-decoration: none; color: inherit; transition: color var(--transition); }
ul { margin-left: 22px; color: var(--text-muted); }
ul li { margin-bottom: 6px; }
ul li::marker { color: var(--primary); }

/* =====================================================
   HEADER & NAVIGATION
   ===================================================== */
#header {
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}
#header.scrolled { box-shadow: var(--shadow-sm); }

.nav-container { display: flex; justify-content: space-between; align-items: center; max-width: 1080px; margin: 0 auto; padding: 18px 24px; }

.logo { font-size: 1.4rem; font-weight: 800; display: flex; align-items: baseline; gap: 2px; }
.logo-mark { color: var(--text-main); letter-spacing: -0.02em; }
.logo-dot { color: var(--primary); }

.nav-links { display: flex; list-style: none; gap: 28px; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--text-muted); position: relative; transition: color var(--transition); }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--primary); transition: width var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta { background: var(--primary); color: white !important; padding: 8px 16px; border-radius: var(--radius-sm); transition: background var(--transition); }
.nav-cta:hover { background: var(--primary-hover); }
.nav-cta::after { display: none; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text-main); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; font-size: 1rem; transition: all var(--transition); margin-left: 4px; }
.theme-toggle:hover { border-color: var(--primary); transform: translateY(-2px); }

/* =====================================================
   HERO / ABOUT
   ===================================================== */
.hero {
    padding: 100px 0 60px;
    background: linear-gradient(180deg, var(--bg-accent) 0%, var(--bg-main) 100%);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-inner { text-align: center; position: relative; z-index: 1; }

.hero-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-accent);
    border: 1px solid var(--accent-border);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title { font-size: 1.5rem; font-weight: 600; color: var(--text-main); margin-bottom: 16px; }
.hero-tagline { font-size: 1.1rem; color: var(--text-muted); max-width: 580px; margin: 0 auto 28px; line-height: 1.7; }

.hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 32px; font-size: 0.95rem; color: var(--text-muted); }
.hero-meta a { color: var(--text-muted); transition: color var(--transition); }
.hero-meta a:hover { color: var(--primary); }

.cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 12px 28px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem; transition: all var(--transition); cursor: pointer; border: none; }
.btn.primary { background: var(--primary); color: white; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25); }
.btn.primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3); }
.btn.secondary { background: var(--bg-card); color: var(--primary); border: 2px solid var(--border); }
.btn.secondary:hover { border-color: var(--primary); background: var(--bg-accent); transform: translateY(-2px); }

/* =====================================================
   STATS
   ===================================================== */
.stats { padding: 40px 0; border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.stat-card { text-align: center; padding: 20px; transition: transform var(--transition); }
.stat-card:hover { transform: translateY(-4px); }
.stat-icon { font-size: 2rem; margin-bottom: 12px; }
.stat-value { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* =====================================================
   SKILLS
   ===================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.skill-card { background: var(--bg-card); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--border); transition: all var(--transition); }
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.skill-card h3 { font-size: 1.15rem; color: var(--primary); margin-bottom: 12px; }
.skill-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }

/* =====================================================
   TIMELINE (Experience & Education)
   ===================================================== */
.timeline { position: relative; padding-left: 8px; }
.timeline-item { position: relative; padding-left: 40px; margin-bottom: 40px; transition: transform var(--transition); }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: -40px; width: 2px; background: var(--border); }
.timeline-item:last-child::before { bottom: 0; }
.timeline-dot { position: absolute; left: -7px; top: 4px; width: 16px; height: 16px; background: var(--primary); border: 3px solid var(--bg-main); border-radius: 50%; box-shadow: 0 0 0 2px var(--primary); transition: transform var(--transition); }
.timeline-item:hover .timeline-dot { transform: scale(1.25); }
.timeline-content { background: var(--bg-card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition); }
.timeline-content:hover { box-shadow: var(--shadow-md); }
.timeline-content h3 { font-size: 1.2rem; margin-bottom: 4px; }
.timeline-content h4 { font-size: 1rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.date { display: inline-block; font-size: 0.85rem; color: var(--primary); background: var(--bg-accent); padding: 4px 10px; border-radius: 6px; font-weight: 600; margin-bottom: 12px; }

/* =====================================================
   PROJECTS
   ===================================================== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; }
.project-card { background: var(--bg-card); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--border); transition: all var(--transition); display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.project-card h3 { font-size: 1.25rem; margin-bottom: 12px; }
.project-summary { color: var(--text-muted); margin-bottom: 16px; font-size: 0.95rem; }
.project-card ul { margin-bottom: 20px; }

.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tech-stack span { background: var(--bg-accent); color: var(--primary); padding: 5px 12px; font-size: 0.82rem; font-weight: 500; border-radius: 100px; border: 1px solid var(--accent-border); }

/* =====================================================
   EDUCATION
   ===================================================== */
.education-list { display: grid; gap: 20px; max-width: 700px; margin: 0 auto; }
.education-block { background: var(--bg-card); padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); border-left: 4px solid var(--primary); box-shadow: var(--shadow-sm); transition: all var(--transition); }
.education-block:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.education-block h3 { font-size: 1.15rem; margin-bottom: 6px; }
.edu-meta { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 8px; }
.edu-coursework { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* =====================================================
   CONTACT
   ===================================================== */
.contact-intro { text-align: center; color: var(--text-muted); font-size: 1.05rem; margin-bottom: 36px; }
.contact-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.contact-link-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: all var(--transition); text-align: center; }
.contact-link-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.contact-icon { font-size: 1.5rem; margin-bottom: 8px; }
.contact-link-card span { font-weight: 600; color: var(--text-main); }
.contact-link-card small { color: var(--text-muted); }

.form-message { padding: 14px 20px; text-align: center; border-radius: var(--radius-sm); margin-bottom: 24px; font-weight: 500; }
.form-message.success { background: #d1fae5; color: #065f46; }
.form-message.error { background: #fee2e2; color: #991b1b; }

.contact-form { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 16px; }
.form-row input { flex: 1; }
.contact-form input, .contact-form textarea { padding: 14px 16px; font-size: 1rem; font-family: var(--font-main); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-main); transition: border var(--transition), box-shadow var(--transition); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.contact-form button { align-self: center; }

/* =====================================================
   FOOTER
   ===================================================== */
footer { text-align: center; padding: 40px 0; background: var(--dark); color: var(--text-light); }
.footer-text { font-size: 0.9rem; }

/* =====================================================
   BACK TO TOP
   ===================================================== */
#backToTop { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all var(--transition); z-index: 100; box-shadow: var(--shadow-md); }
#backToTop.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* =====================================================
   ANIMATIONS
   ===================================================== */
[data-animate] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-animate].in-view { opacity: 1; transform: translateY(0); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero-title { font-size: 1.2rem; }
    .hero-meta { flex-direction: column; gap: 8px; }
    .nav-toggle { display: flex; }
    .nav-links { position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 24px; gap: 12px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); transform: translateY(-100%); opacity: 0; visibility: hidden; transition: all var(--transition); }
    .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-cta { text-align: center; }
    .section { padding: 64px 0; }
    .section-title { font-size: 1.6rem; }
    .form-row { flex-direction: column; }
    .contact-links { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .container { padding: 0 16px; }
    .timeline-item { padding-left: 32px; }
}

@media print {
    #header, #backToTop, .nav-toggle, .cta-buttons { display: none; }
    .section { padding: 20px 0; }
}
