/* ===== Reset & Variables ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #30465e;
    --navy-deep: #1e2e44;
    --navy-light: #5b7490;
    --blue: #004aad;
    --blue-hover: #003a8c;
    --blue-soft: rgba(0, 74, 173, 0.06);
    --blue-softer: rgba(0, 74, 173, 0.04);
    --blue-border: rgba(0, 74, 173, 0.18);
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-alt: #f1f3f6;
    --ink: #1a1a2e;
    --ink-muted: #5a6478;
    --border: #e3e5ea;
    --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.08);
    --shadow-lg: 0 12px 32px rgba(26, 26, 46, 0.12);
    --transition: 0.2s ease;
}

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

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Navigation ===== */
#navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--navy-deep);
    border-bottom: 1px solid rgba(109, 109, 109, 0.24);
    transition: var(--transition);
}

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

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 52px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
    font-size: 15px;
    font-weight: 500;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    transition: color 0.15s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: #6b9eff;
    transition: width var(--transition);
}

.nav-link:hover {
    color: white;
}

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

.nav-link.active {
    color: white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    padding: 80px 32px;
    overflow: hidden;
    background: var(--navy-deep);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Background video — locked, no interaction allowed */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    background: var(--navy-deep);
}

.hero-video::-webkit-media-controls,
.hero-video::-webkit-media-controls-panel,
.hero-video::-webkit-media-controls-play-button,
.hero-video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none !important;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 32, 0.5);
}

.hero-content {
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Hero name — big editorial display */
.hero-name {
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.92;
    color: white;
    margin-bottom: 36px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    animation: rise 0.7s 0.2s ease-out forwards;
}

/* Tagline (typing) */
.hero-tagline {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    min-height: 2.2rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: rise 0.6s 0.4s ease-out forwards;
}

.typing-text {
    color: white;
    font-weight: 600;
}

.cursor {
    color: white;
    animation: blink 1s infinite;
    font-weight: 400;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(1rem, 1.25vw, 1.1rem);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.65;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: rise 0.6s 0.5s ease-out forwards;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    opacity: 0;
    animation: rise 0.6s 0.6s ease-out forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--blue);
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Sections ===== */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 32px;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--navy-deep);
    margin-bottom: 16px;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-header.visible .section-title {
    opacity: 1;
    transform: translateY(0);
}

.section-line {
    width: 48px;
    height: 3px;
    background: var(--blue);
    border-radius: 2px;
    margin: 0 auto;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.8s 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-header.visible .section-line {
    transform: scaleX(1);
}

/* ===== Background Section ===== */
.background-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    max-width: none;
    padding-left: 32px;
    padding-right: 32px;
}

.background-section > .section-header,
.background-section > .background-grid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.background-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.bg-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    text-align: center;
    opacity: 0;
    transform: translateY(48px) scale(0.96);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    position: relative;
}

.bg-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bg-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 74, 173, 0.2);
}

.bg-card-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    background: var(--blue-soft);
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: var(--blue);
    overflow: hidden;
}

.bg-card-icon svg {
    width: 36px;
    height: 36px;
}

.bg-card-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.bg-card-icon--photo,
.bg-card-icon--contain {
    width: 320px;
    height: 240px;
    border-radius: 26px;
}

.bg-card-icon--photo img {
    object-fit: cover;
    object-position: 70% 30%;
}

.bg-card-icon--contain {
    background: var(--surface);
    padding: 10px;
}

.bg-card-icon--contain img {
    object-fit: contain;
}

.bg-card h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--navy-deep);
}

.bg-card p {
    color: var(--ink-muted);
    font-size: 15px;
    margin-bottom: 0;
}

.bg-card p strong {
    color: var(--navy-deep);
    font-weight: 600;
}

/* ===== Projects Section ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(56px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 74, 173, 0.2);
}

.project-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--surface-alt);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
}

.placeholder-text {
    color: var(--navy-light);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: 1.5px dashed var(--navy-light);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 46, 68, 0.75);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    background: var(--blue);
    border-radius: 10px;
    transition: var(--transition);
    transform: translateY(12px);
    box-shadow: none;
}

.project-card:hover .project-link {
    transform: translateY(0);
}

.project-link:hover {
    background: var(--blue-hover);
}

.project-content {
    padding: 28px;
}

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

/* Replaces pill — inline status with dot */
.project-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.project-status.active {
    color: #16a34a;
}

.project-status.active::before {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.project-status.complete {
    color: var(--navy-light);
}

.project-status.complete::before {
    background: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(91, 116, 144, 0.2);
}

.project-date {
    color: var(--ink-muted);
    font-size: 13px;
    font-weight: 500;
}

.project-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--navy-deep);
    letter-spacing: -0.01em;
}

.project-description {
    color: var(--ink-muted);
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-pill {
    padding: 5px 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--navy);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.tech-pill:hover {
    background: var(--blue-soft);
    border-color: var(--blue-border);
    color: var(--blue);
}

/* ===== Skills Section ===== */
.skills-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    max-width: none;
    padding-left: 32px;
    padding-right: 32px;
}

.skills-section > .section-header,
.skills-section > .skills-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.skill-category {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    opacity: 0;
    transform: translateY(48px) scale(0.96);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.skill-category.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.skill-category:hover {
    border-color: rgba(0, 74, 173, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.skill-category-title {
    font-size: 19px;
    margin-bottom: 24px;
    font-weight: 700;
    color: var(--navy-deep);
}

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

.skill-badge {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--navy-deep);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    cursor: default;
}

.skill-badge:hover {
    background: var(--blue-soft);
    border-color: var(--blue-border);
    color: var(--blue);
    transform: translateY(-1px);
}

.education-card {
    grid-column: 1 / -1;
}

.education-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.education-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.education-item:first-of-type {
    padding-top: 0;
}

.education-item h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--navy-deep);
}

.education-degree {
    color: var(--navy-deep);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.education-date,
.education-location {
    color: var(--ink-muted);
    font-size: 13px;
}

/* ===== Footer ===== */
.footer {
    background: var(--navy-deep);
    color: rgba(255, 255, 255, 0.85);
    padding: 80px 32px 32px;
    position: relative;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-title {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
    letter-spacing: -0.01em;
}

.footer-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-bottom: 48px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto 48px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.footer-link svg {
    width: 20px;
    height: 20px;
    color: #6b9eff;
    flex-shrink: 0;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .hero {
        padding: 64px 24px 72px;
        min-height: 80vh;
    }

    .nav-links {
        position: fixed;
        top: 55px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: center;
        background: var(--navy-deep);
        width: 100%;
        padding: 32px;
        gap: 24px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.1s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-toggle {
        display: flex;
    }

    .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);
    }

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

    .section {
        padding: 64px 24px;
    }

    .background-section,
    .skills-section {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 640px) {

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .bg-card,
    .project-content,
    .skill-category {
        padding: 24px 20px;
    }
}

/* ===== Reduce motion preference ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
