/* Base Variables (Normal Mode / HR Mode) */
:root {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e2e8f0;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --font-main: 'Inter', system-ui, sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius: 16px;
}

/* Nerd Mode Variables */
body.nerd-mode {
    --bg-color: #0d1117;
    --surface-color: #161b22;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #3fb950;
    --accent-hover: #2ea043;
    --border: #30363d;
    --shadow: 0 0 20px rgba(63, 185, 80, 0.05);
    --font-main: 'Fira Code', monospace;
    --radius: 6px;
}

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

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

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    line-height: 1.3;
    transition: color 0.4s ease;
}

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

a:hover {
    color: var(--accent-hover);
}

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

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 24px 40px;
}

.section {
    margin-bottom: 70px;
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    display: inline-block;
}

.nerd-mode .section-title::before {
    content: "> ";
    color: var(--accent);
}

/* Components */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.nerd-mode .card:hover {
    box-shadow: 0 0 25px rgba(63, 185, 80, 0.15);
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn:hover {
    background: var(--accent-hover);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.nerd-mode .btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    box-shadow: none;
}

.nerd-mode .btn:hover {
    background: var(--accent);
    color: #0d1117;
    box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
}

/* Navbar & Toggle */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: var(--transition);
}

.nerd-mode .navbar {
    background: rgba(22, 27, 34, 0.9);
}

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

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.nerd-mode .logo::after {
    content: "_";
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mode-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.mode-label.active {
    color: var(--accent);
}

.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--border);
}

.nerd-mode input:checked + .slider {
    background-color: #2ea043;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Hero */
.hero {
    text-align: center;
    margin-top: 20px;
}

.name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nerd-mode .name {
    background: none;
    -webkit-text-fill-color: var(--accent);
    text-shadow: 0 0 10px rgba(63, 185, 80, 0.3);
}

.title {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 500;
}

.contact-info {
    color: var(--text-muted);
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dot-separator {
    opacity: 0.5;
}

.links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.summary {
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Toggle Display Magic */
.nerd-only {
    display: none !important;
}

.nerd-mode .nerd-only {
    display: block !important;
    animation: fadeIn 0.5s ease-out;
}

.nerd-mode .skills-grid.nerd-only {
    display: grid !important;
}

.nerd-mode .normal-only {
    display: none !important;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.skill-category h4 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

/* Terminal Styling */
.terminal-window {
    padding: 0;
    overflow: hidden;
    background: #0d1117;
    border: 1px solid #30363d;
}

.terminal-header {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #30363d;
}

.terminal-header span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-header span:nth-child(1) { background: #ff5f56; }
.terminal-header span:nth-child(2) { background: #ffbd2e; }
.terminal-header span:nth-child(3) { background: #27c93f; }

.terminal-body {
    padding: 20px;
    font-size: 0.95rem;
    color: #c9d1d9;
    line-height: 1.6;
}

.prompt {
    color: #3fb950;
    margin-right: 8px;
    font-weight: 600;
}

/* Experience */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.timeline-item {
    position: relative;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.timeline-header h4 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.company {
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
}

.nerd-mode .company {
    color: var(--text-muted);
}

.date {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-color);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.date-small {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nerd-mode .date {
    border-radius: 4px;
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
}

ul {
    padding-left: 24px;
}

li {
    margin-bottom: 12px;
    color: var(--text-main);
}

li::marker {
    color: var(--accent);
}

/* Grid 2 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.heart {
    color: #ef4444;
}

.nerd-mode .heart {
    color: var(--accent);
}

.archive-links {
    margin-top: 12px;
    font-size: 0.85rem;
}

.archive-links a {
    color: var(--text-muted);
    text-decoration: underline;
    margin: 0 4px;
}

.archive-links a:hover {
    color: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }

/* Responsive */
@media (max-width: 600px) {
    .name { font-size: 2.5rem; }
    .title { font-size: 1.25rem; }
    .contact-info { 
        flex-direction: column; 
        gap: 8px; 
    }
    .dot-separator { display: none; }
    .card { padding: 20px; }
    .container { padding: 80px 16px 30px; }
}
