/* =========================
   THEME TOKENS
========================= */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #eef4fb;
    --text: #1e293b;
    --text-muted: #475569;
    --heading: #0f172a;
    --primary: #0369a1;          /* readable on light backgrounds */
    --accent: #38bdf8;
    --accent-soft: #e0f2fe;
    --accent-soft-text: #075985;
    --border: #e2e8f0;
    --shadow: 0 5px 20px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 14px 34px rgba(15, 23, 42, 0.14);
    --navy: #0f172a;
    --radius: 14px;
    --header-h: 68px;
}

:root[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #131c2e;
    --surface-alt: #101828;
    --text: #cbd5e1;
    --text-muted: #94a3b8;
    --heading: #f1f5f9;
    --primary: #7dd3fc;
    --accent-soft: #0c2a40;
    --accent-soft-text: #7dd3fc;
    --border: #1e293b;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.5);
}

/* =========================
   GENERAL STYLES
========================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

ul, ol { list-style: none; }

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2000;
    background: var(--accent);
    color: var(--navy);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus { top: 12px; }


/* =========================
   NAVIGATION BAR
========================= */

.site-header {
    background-color: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar {
    max-width: 1200px;
    margin: auto;
    height: var(--header-h);
    padding: 0 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.nav-links a {
    display: block;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.25s, background-color 0.25s;
}

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

.nav-links a.active {
    color: var(--accent);
    background-color: rgba(56, 189, 248, 0.12);
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.25s;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.18); }

.menu-btn { display: none; font-size: 22px; }


/* =========================
   HERO SECTION
========================= */

.hero {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    padding: 70px 30px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.22), transparent 45%),
        linear-gradient(135deg, #0f172a, #1e3a8a);
}

.hero-inner {
    max-width: 1100px;
    margin: auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1.3fr 0.8fr;
    align-items: center;
    gap: 50px;
}

.welcome {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #bae6fd;
    font-size: 14px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 22px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero h1 {
    font-size: clamp(36px, 5.5vw, 58px);
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero h1 span { color: var(--accent); }

.hero-role {
    font-size: clamp(20px, 2.6vw, 28px);
    color: #e0f2fe;
    margin-bottom: 20px;
}

.hero-text {
    font-size: 18px;
    color: #dbeafe;
    max-width: 560px;
}

.hero-buttons {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.hero-meta {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    font-size: 14px;
    color: #bfdbfe;
}

.hero-photo {
    justify-self: center;
    width: min(100%, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.hero-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #0f172a;
}


/* =========================
   BUTTONS
========================= */

.btn {
    display: inline-block;
    padding: 12px 26px;
    background-color: var(--accent);
    color: var(--navy);
    text-decoration: none;
    border: 2px solid var(--accent);
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s, background-color 0.25s, color 0.25s;
}

.btn:hover {
    transform: translateY(-3px);
    background-color: #7dd3fc;
    border-color: #7dd3fc;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background-color: transparent;
    color: #fff;
}

.secondary-btn:hover {
    color: var(--navy);
}

.dark-outline {
    color: var(--primary);
    border-color: var(--primary);
}

.dark-outline:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}


/* =========================
   GENERAL SECTIONS
========================= */

.section {
    max-width: 1100px;
    margin: auto;
    padding: 90px 30px;
}

.section-title {
    text-align: center;
    font-size: 35px;
    margin-bottom: 50px;
    color: var(--heading);
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--accent);
    margin: 12px auto 0;
}

/* Scroll reveal: only hidden when JS is running */
.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.visible {
    opacity: 1;
    transform: none;
}


/* =========================
   SHARED CARD STYLES
========================= */

.skill-card,
.project-card,
.timeline-item,
.about-text,
.about-facts {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.skill-card:hover,
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 28px;
    line-height: 1;
}


/* =========================
   ABOUT SECTION
========================= */

.about-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 28px;
    align-items: stretch;
    max-width: 950px;
    margin: 0 auto;
}

.about-text { padding: 34px; }
.about-text p { margin-bottom: 16px; }
.about-text p:last-child { margin-bottom: 0; }

.about-facts {
    padding: 14px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-facts div {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.about-facts div:last-child { border-bottom: none; }

.about-facts dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.about-facts dd {
    font-weight: 600;
    color: var(--heading);
}


/* =========================
   SKILLS
========================= */

.skills-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.skill-card {
    padding: 28px;
    text-align: center;
}

.skill-card h3 {
    color: var(--heading);
    margin: 12px 0 14px;
    font-size: 18px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.chips li {
    padding: 4px 12px;
    font-size: 14px;
    border-radius: 999px;
    background-color: var(--accent-soft);
    color: var(--accent-soft-text);
    font-weight: 500;
}


/* =========================
   PROJECTS
========================= */

.projects-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.project-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.project-type {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.project-card h3 {
    color: var(--heading);
    margin-bottom: 12px;
    font-size: 21px;
}

.project-card p {
    margin-bottom: 20px;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags li {
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 999px;
    background-color: var(--accent-soft);
    color: var(--accent-soft-text);
}

.projects-more {
    text-align: center;
    margin-top: 40px;
}


/* =========================
   EXPERIENCE TIMELINE
========================= */

.timeline {
    max-width: 800px;
    margin: auto;
    position: relative;
    padding-left: 34px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(var(--accent), transparent);
}

.timeline-item {
    position: relative;
    padding: 28px 30px;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -34px;
    top: 34px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--accent);
    border: 4px solid var(--bg);
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-date {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-soft-text);
    background: var(--accent-soft);
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.timeline-item h3 {
    color: var(--heading);
    font-size: 19px;
}

.timeline-item h4 {
    margin: 4px 0 10px;
    color: var(--primary);
    font-weight: 600;
}


/* =========================
   CONTACT
========================= */

.contact-intro {
    text-align: center;
    margin: -20px auto 35px;
    color: var(--text-muted);
}

#contact-form {
    max-width: 700px;
    margin: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--heading);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group textarea {
    border-color: #334155;
}

.form-group textarea { resize: vertical; }

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

.form-group.invalid input,
.form-group.invalid textarea { border-color: #ef4444; }

.field-error {
    display: block;
    min-height: 0;
    margin-top: 5px;
    font-size: 14px;
    color: #dc2626;
}

:root[data-theme="dark"] .field-error { color: #f87171; }

#contact-form .btn { width: 100%; }

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.form-status {
    margin-top: 16px;
    text-align: center;
    font-weight: 600;
}

.form-status:empty { margin: 0; }
.form-status.success { color: #16a34a; }
.form-status.error { color: #dc2626; }

.contact-links {
    margin-top: 35px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.contact-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: transform 0.25s, border-color 0.25s;
}

.contact-links a:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}


/* =========================
   FOOTER
========================= */

footer {
    background-color: var(--navy);
    color: #cbd5e1;
    text-align: center;
    padding: 26px;
    font-size: 14px;
}


/* =========================
   BACK TO TOP BUTTON
========================= */

#back-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 900;

    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--navy);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);

    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}


/* =========================
   TABLET
========================= */

@media (max-width: 900px) {

    .skills-container { grid-template-columns: repeat(2, 1fr); }

    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-photo {
        order: -1;
        width: 230px;
    }

    .hero-text { margin: 0 auto; }
    .hero-buttons,
    .hero-meta { justify-content: center; }

    .about-content { grid-template-columns: 1fr; }
}


/* =========================
   SMARTPHONE
========================= */

@media (max-width: 650px) {

    .navbar { padding: 0 20px; }

    .menu-btn { display: inline-flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        background-color: var(--navy);
        flex-direction: column;
        text-align: center;
        padding: 14px 20px 20px;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

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

    .hero { padding: 50px 20px; }

    .hero-text { font-size: 16px; }

    .hero-buttons .btn { width: 100%; text-align: center; }

    .section { padding: 70px 20px; }
    .section-title { font-size: 30px; }

    .skills-container,
    .projects-container { grid-template-columns: 1fr; }

    .about-text,
    .project-card,
    .timeline-item,
    #contact-form { padding: 24px; }

    .timeline { padding-left: 28px; }
    .timeline-item::before { left: -28px; }

    #back-to-top { right: 15px; bottom: 18px; width: 44px; height: 44px; }
}


/* =========================
   REDUCED MOTION
========================= */

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

    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }

    .js .reveal { opacity: 1; transform: none; }
}
