:root {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    margin: 0;
    background: var(--chat-bg-dark);
    color: var(--chat-text-primary);
}

.portfolio-main {
    min-height: 100vh;
    background: radial-gradient(circle at top left, var(--chat-surface-2), var(--chat-bg-dark));
}

.section {
    padding: 4rem 1.25rem;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.75rem;
    margin: 0 0 1.5rem;
    color: var(--chat-text-light);
}

.section-intro {
    max-width: 720px;
    margin-bottom: 2.5rem;
    color: var(--chat-text-secondary);
}

/* Top navigation */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: linear-gradient(to bottom, rgba(1,12,23,0.98), rgba(1,12,23,0.9));
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--chat-accent-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--chat-text-light);
}

.brand-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--chat-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 0.25rem;
    transition: var(--chat-transition);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--chat-accent-blue);
    transition: var(--chat-transition);
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--chat-text-light);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    width: 100%;
}

.nav-link.active {
    color: var(--chat-text-light);
}

.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    background: var(--chat-text-light);
}

/* Hero */
.hero {
    padding: 4.5rem 1.25rem 3.5rem;
    background: radial-gradient(circle at top right, rgba(13,110,253,0.18), transparent 55%),
                radial-gradient(circle at bottom left, rgba(25,135,84,0.12), transparent 55%),
                var(--chat-bg-dark);
}

.hero-content {
    max-width: 1100px;
    margin: 0 auto;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--chat-accent-blue);
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(2.1rem, 4vw, 2.8rem);
    margin: 0 0 0.5rem;
    color: var(--chat-text-light);
}

.hero-subtitle {
    max-width: 680px;
    color: var(--chat-text-secondary);
    margin-bottom: 1.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.hero-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--chat-text-secondary);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chat-accent-blue);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--chat-transition);
}

.btn.primary {
    background: var(--chat-accent-blue);
    color: var(--chat-text-light);
    box-shadow: var(--chat-shadow-medium);
}

.btn.primary:hover,
.btn.primary:focus-visible {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: var(--chat-shadow-heavy);
}

.btn.secondary {
    background: transparent;
    color: var(--chat-text-light);
    border-color: rgba(255,255,255,0.3);
}

.btn.secondary:hover,
.btn.secondary:focus-visible {
    background: rgba(255,255,255,0.06);
}

/* About */
.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 2rem;
}

.about-summary p {
    margin-top: 0;
}

.about-highlights {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.about-highlights li::before {
    content: "\2022";
    color: var(--chat-accent-blue);
    margin-right: 0.4rem;
}

/* Experience timeline */
.timeline {
    position: relative;
    margin-top: 1.5rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--chat-accent-blue), transparent);
}

.timeline-item {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: 2px;
    top: 0.4rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--chat-accent-blue);
    background: var(--chat-bg-dark);
}

.timeline-card {
    background: var(--chat-surface-2);
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1.1rem;
    box-shadow: var(--chat-shadow-light);
    border: 1px solid rgba(255,255,255,0.04);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    margin-bottom: 0.5rem;
}

.role {
    margin: 0;
    font-size: 1.05rem;
    color: var(--chat-text-light);
}

.meta {
    font-size: 0.85rem;
    color: var(--chat-text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-summary {
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
    color: var(--chat-text-secondary);
}

.timeline-bullets {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--chat-text-secondary);
}

.timeline-bullets li {
    margin-bottom: 0.4rem;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--chat-surface-2);
    border-radius: 10px;
    padding: 1.2rem 1.25rem 1.1rem;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: var(--chat-shadow-light);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.project-title {
    margin: 0;
    font-size: 1.02rem;
    color: var(--chat-text-light);
}

.project-description {
    margin: 0;
    color: var(--chat-text-secondary);
    font-size: 0.92rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--chat-text-secondary);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.2rem;
}

.project-link {
    font-size: 0.85rem;
    color: var(--chat-accent-blue);
    text-decoration: none;
}

.project-link:hover,
.project-link:focus-visible {
    text-decoration: underline;
}

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

.skill-group {
    background: var(--chat-surface-2);
    border-radius: 10px;
    padding: 1.1rem 1.2rem 1rem;
    border: 1px solid rgba(255,255,255,0.04);
}

.skill-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--chat-text-light);
}

.skill-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--chat-text-secondary);
    font-size: 0.9rem;
}

.skill-list li {
    margin-bottom: 0.35rem;
}

/* Education */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.education-item {
    background: var(--chat-surface-2);
    border-radius: 10px;
    padding: 1.1rem 1.2rem 1rem;
    border: 1px solid rgba(255,255,255,0.04);
}

.education-title {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: var(--chat-text-light);
}

.education-meta {
    font-size: 0.85rem;
    color: var(--chat-text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.education-notes {
    margin: 0;
    color: var(--chat-text-secondary);
    font-size: 0.9rem;
}

/* Contact */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2rem;
}

.contact-form {
    background: var(--chat-surface-2);
    border-radius: 10px;
    padding: 1.2rem 1.3rem 1.1rem;
    border: 1px solid rgba(255,255,255,0.04);
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.9rem;
}

.form-row label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
textarea {
    background: #020814;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.16);
    padding: 0.45rem 0.6rem;
    color: var(--chat-text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: 1px solid var(--chat-accent-blue);
    border-color: var(--chat-accent-blue);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.field-error {
    min-height: 1rem;
    font-size: 0.78rem;
    color: var(--chat-accent-red);
    margin: 0.15rem 0 0;
}

.contact-status {
    margin-top: 0.25rem;
    font-size: 0.86rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.social-links {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.social-links a {
    color: var(--chat-accent-blue);
    text-decoration: none;
}

.social-links a:hover,
.social-links a:focus-visible {
    text-decoration: underline;
}

.availability {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.availability-label {
    font-size: 0.9rem;
}

/* Toggle switch (checkbox) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: var(--chat-transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--chat-text-light);
    transition: var(--chat-transition);
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: var(--chat-accent-green);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(18px);
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.25rem 1.25rem 1.5rem;
    background: #020814;
    color: var(--chat-text-secondary);
    font-size: 0.82rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        right: 1.25rem;
        top: 100%;
        flex-direction: column;
        align-items: flex-start;
        background: #020814;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.12);
        padding: 0.5rem 0.75rem;
        margin-top: 0.35rem;
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .about-layout,
    .contact-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .timeline::before {
        left: 8px;
    }

    .timeline-item {
        padding-left: 2.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
