/* ============================================
   GLOBAL STYLES & VARIABLES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

:root {
    --bg-primary: oklch(98% 0.003 90);
    --bg-secondary: oklch(95% 0.003 90);
    --text-primary: oklch(15% 0.005 90);
    --text-secondary: oklch(30% 0.005 90);
    --text-tertiary: oklch(45% 0.005 90);
    --accent: oklch(45% 0.14 250);
    --border: oklch(85% 0.005 90);
    --mono-font: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
    --sans-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

html.dark-mode {
    --bg-primary: oklch(18% 0.005 90);
    --bg-secondary: oklch(22% 0.005 90);
    --text-primary: oklch(95% 0.003 90);
    --text-secondary: oklch(80% 0.003 90);
    --text-tertiary: oklch(65% 0.005 90);
    --accent: oklch(65% 0.14 250);
    --border: oklch(30% 0.005 90);
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

body {
    font-family: var(--sans-font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 300ms ease, color 300ms ease;
    overflow-x: hidden;
}

/* ============================================
   MOBILE-FIRST: HEADER / NAVIGATION
   ============================================ */

header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px;
    background: var(--bg-primary) / 0.95;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    transition: background-color 300ms ease, border-color 300ms ease;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.navbar-logo {
    height: 24px;
    width: auto;
    display: block;
}

/* Mobile Menu Styles */
nav {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
    z-index: 19;
}

nav.active {
    max-height: 400px;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 14px 16px;
    font-family: var(--mono-font);
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    transition: color 300ms ease, background-color 300ms ease;
    display: block;
}

nav a:hover,
nav a:focus {
    color: var(--accent);
    background-color: var(--bg-secondary);
}

nav a:last-of-type {
    border-bottom: none;
}

/* Hamburger Menu Toggle Button */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 300ms ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.lang-toggle,
.theme-toggle {
    font-family: inherit;
    font-size: 13px;
    background: none;
    border: 1px solid var(--text-primary);
    border-radius: 16px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 300ms ease;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-toggle:hover,
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Hide theme and lang toggle from nav in mobile */
nav .theme-toggle,
nav .lang-toggle {
    display: none;
}

/* ============================================
   MOBILE-FIRST: HERO SECTION
   ============================================ */

.hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.hero-content h1 {
    margin: 0;
    font-weight: 300;
    line-height: 0.95;
    font-size: clamp(28px, 8vw, 64px);
    letter-spacing: -0.02em;
}

.section-label {
    font-family: var(--mono-font);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-bio {
    font-size: clamp(14px, 3.5vw, 18px);
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 12px 0 0;
}

/* Skills Grid - Mobile First */
.skills-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.hero-image-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    max-height: 240px;
}

/* ============================================
   MOBILE-FIRST: SKILL BADGES
   ============================================ */

.skill-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--mono-font);
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    transition: all 300ms ease;
    min-height: 36px;
}

.skill-badge:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 10%, transparent);
}

@media (hover: none) {
    .skill-badge {
        transform: none;
    }

    .skill-badge:active {
        border-color: var(--accent);
        box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 10%, transparent);
    }
}

/* ============================================
   MOBILE-FIRST: PROJECTS SECTION
   ============================================ */

.projects-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 12px;
    border-top: 1px solid var(--border);
    transition: border-color 300ms ease;
}

.projects-header {
    margin-bottom: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.project-card {
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 300ms ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

@media (hover: none) {
    .project-card:active {
        border-color: var(--accent);
        box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 10%, transparent);
    }
}

.project-title {
    font-size: clamp(15px, 3vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
}

.project-desc {
    font-size: clamp(13px, 2.5vw, 15px);
    line-height: 1.6;
    color: var(--text-secondary);
    flex-grow: 1;
}

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

.tag {
    font-family: var(--mono-font);
    font-size: clamp(10px, 2vw, 12px);
    color: var(--text-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 12px;
    background: transparent;
    transition: all 300ms ease;
    cursor: pointer;
}

.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.project-link {
    font-family: var(--mono-font);
    font-size: clamp(11px, 2vw, 13px);
    color: var(--accent);
    text-decoration: none;
    transition: all 300ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 0;
    min-height: 44px;
}

.project-link:hover {
    color: var(--text-primary);
}

/* ============================================
   MOBILE-FIRST: CURRICULUM SECTION
   ============================================ */

.curriculum-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 12px;
    border-top: 1px solid var(--border);
    transition: border-color 300ms ease;
}

.curriculum-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
}

.curriculum-divider {
    display: none;
    background: var(--border);
    width: 1px;
    height: 100%;
    min-height: 600px;
    transition: background-color 300ms ease;
}

.curriculum-column {
    display: flex;
    flex-direction: column;
}

.curriculum-column h3 {
    font-size: clamp(15px, 3vw, 18px);
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.certifications-title {
    margin-top: 20px;
    margin-bottom: 16px;
    font-size: clamp(15px, 3vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
}

.curriculum-item {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    transition: border-color 300ms ease;
}

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

.curriculum-position {
    font-size: clamp(13px, 2.5vw, 15px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.curriculum-company {
    font-family: var(--mono-font);
    font-size: clamp(10px, 2vw, 12px);
    color: var(--text-tertiary);
    margin-bottom: 3px;
}

.curriculum-period {
    font-family: var(--mono-font);
    font-size: clamp(10px, 2vw, 12px);
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.curriculum-description {
    font-size: clamp(12px, 2.2vw, 14px);
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-line;
}

/* ============================================
   MOBILE-FIRST: FOOTER
   ============================================ */

footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: var(--mono-font);
    font-size: clamp(10px, 2vw, 12px);
    color: var(--text-tertiary);
    transition: border-color 300ms ease, color 300ms ease;
}

footer a {
    color: inherit;
    text-decoration: none;
    transition: color 300ms ease;
    padding: 6px 0;
    display: inline-block;
    min-height: 44px;
}

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

/* ============================================
   TABLET BREAKPOINT: 640px+
   ============================================ */

@media (min-width: 640px) {
    header {
        padding: 14px 20px;
    }

    .navbar-logo {
        height: 28px;
    }

    .menu-toggle {
        display: none;
    }

    nav {
        position: static;
        max-height: none;
        border: none;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        background: none;
        border-bottom: none;
        padding: 0;
    }

    nav a {
        border: none;
        padding: 6px 8px;
        font-size: clamp(11px, 2vw, 13px);
        color: var(--text-primary);
        min-height: auto;
    }

    nav a:hover,
    nav a:focus {
        color: var(--accent);
        background: none;
    }

    nav .theme-toggle,
    nav .lang-toggle {
        display: flex;
    }

    .hero {
        padding: 40px 20px 32px;
        gap: 28px;
    }

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

    .hero-image {
        max-height: 280px;
    }

    .projects-section {
        padding: 40px 20px;
    }

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

    .project-card {
        padding: 16px;
    }

    .curriculum-section {
        padding: 40px 20px;
    }

    .curriculum-item {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    footer {
        padding: 18px 20px;
    }
}

/* ============================================
   TABLET BREAKPOINT: 768px+
   ============================================ */

@media (min-width: 768px) {
    header {
        padding: 16px 28px;
        gap: 24px;
    }

    .hero {
        padding: 56px 28px 44px;
        gap: 32px;
        grid-template-columns: 1.2fr 0.8fr;
    }

    .section-label {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .hero-bio {
        font-size: 15px;
        margin-top: 16px;
    }

    .skills-grid {
        gap: 12px;
        margin-top: 24px;
    }

    .hero-image {
        max-height: 320px;
    }

    .projects-section {
        padding: 56px 28px;
    }

    .projects-grid {
        gap: 16px;
    }

    .project-card {
        padding: 18px;
    }

    .curriculum-section {
        padding: 56px 28px;
    }

    .curriculum-container {
        grid-template-columns: 1fr 1px 1fr;
        gap: 32px;
    }

    .curriculum-divider {
        display: block;
    }

    .curriculum-item {
        padding-bottom: 18px;
        margin-bottom: 18px;
    }

    footer {
        padding: 20px 28px;
    }
}

/* ============================================
   DESKTOP BREAKPOINT: 1024px+
   ============================================ */

@media (min-width: 1024px) {
    header {
        gap: 32px;
        padding: 18px 40px;
    }

    .navbar-logo {
        height: 32px;
    }

    nav {
        gap: 20px;
    }

    nav a {
        padding: 0;
        font-size: 13px;
    }

    .hero {
        grid-template-columns: 1.3fr 0.8fr;
        gap: 48px;
        align-items: end;
        padding: 80px 40px 56px;
    }

    .hero-content h1 {
        font-size: clamp(36px, 5vw, 64px);
    }

    .section-label {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .hero-bio {
        font-size: 17px;
        max-width: 560px;
        margin-top: 24px;
    }

    .skills-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
        margin-top: 32px;
    }

    .skill-badge {
        padding: 12px 16px;
        font-size: 13px;
    }

    .skill-badge:hover {
        transform: translateY(-2px);
    }

    .hero-image {
        max-height: 400px;
    }

    .projects-section {
        padding: 64px 40px;
    }

    .projects-header {
        margin-bottom: 40px;
    }

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

    .project-card {
        padding: 24px;
    }

    .project-card:hover {
        transform: translateY(-4px);
    }

    .project-title {
        font-size: 17px;
    }

    .project-desc {
        font-size: 15px;
    }

    .curriculum-section {
        padding: 64px 40px;
    }

    .curriculum-container {
        gap: 40px;
    }

    .curriculum-divider {
        min-height: 600px;
    }

    .curriculum-column h3 {
        font-size: 17px;
        margin-bottom: 24px;
    }

    .certifications-title {
        margin-top: 28px;
        margin-bottom: 24px;
        font-size: 17px;
    }

    .curriculum-item {
        padding-bottom: 24px;
        margin-bottom: 24px;
    }

    .curriculum-position {
        font-size: 15px;
    }

    .curriculum-company {
        font-size: 12px;
    }

    .curriculum-period {
        font-size: 12px;
    }

    .curriculum-description {
        font-size: 14px;
    }

    footer {
        flex-direction: row;
        justify-content: space-between;
        padding: 24px 40px;
        font-size: 12px;
    }
}

/* ============================================
   ULTRA WIDE DESKTOP: 1440px+
   ============================================ */

@media (min-width: 1440px) {
    header {
        padding: 20px 64px;
    }

    .hero {
        padding: 96px 64px 72px;
        gap: 56px;
    }

    .projects-section {
        padding: 72px 64px;
    }

    .curriculum-section {
        padding: 72px 64px;
    }

    footer {
        padding: 28px 64px;
    }
}

/* ============================================
   ACCESSIBILITY & MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-color-scheme: dark) {
    html:not(.dark-mode) {
        color-scheme: light;
    }
}
