
/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff;
    color: #111111;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

ul {
    list-style: none;
}

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

/* ---------- TOKENS ---------- */
:root {
    --white:          #ffffff;
    --near-black:     #111111;
    --text-primary:   #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted:     #9ca3af;
    --accent:         #2563eb;
    --accent-hover:   #1d4ed8;
    --bg-alt:         #f9fafb;
    --border:         #e5e7eb;
    --tag-bg:         #f3f4f6;
    --tag-text:       #374151;

    --body-text:      #374151;
    --body-text-2:    #4b5563;

    --nav-height: 64px;
    --container:  1100px;
    --radius:     8px;
}

/* ---------- DARK MODE TOKENS ---------- */
[data-theme="dark"] {
    --white:          #0f0f0f;
    --near-black:     #f0f0f0;
    --text-primary:   #e2e2e2;
    --text-secondary: #9ca3af;
    --text-muted:     #6b7280;
    --accent:         #3b82f6;
    --accent-hover:   #2563eb;
    --bg-alt:         #1a1a1a;
    --border:         #2e2e2e;
    --tag-bg:         #222222;
    --tag-text:       #d1d5db;

    --body-text:      #c9d1d9;
    --body-text-2:    #b0bac6;
}

[data-theme="dark"] body {
    background-color: #0f0f0f;
    color: #f0f0f0;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 15, 15, 0.95);
}

[data-theme="dark"] .research-card,
[data-theme="dark"] .project-card {
    background: #161616;
}

[data-theme="dark"] .skill-tags span,
[data-theme="dark"] .project-stack code {
    background: #1e1e1e;
}

[data-theme="dark"] .research-draft-card {
    background: #1a1a1a;
    border-color: #3e3e3e;
}

[data-theme="dark"] .footer {
    background: #0f0f0f;
}

[data-theme="dark"] .hero-photo img {
    border-color: #2e2e2e;
}

[data-theme="dark"] .locked-in-icon path,
[data-theme="dark"] .locked-in-icon line,
[data-theme="dark"] .locked-in-icon circle {
    stroke: #f0f0f0;
}

[data-theme="dark"] .research-draft-icon path,
[data-theme="dark"] .research-draft-icon circle {
    stroke: #9ca3af;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--near-black);
}

p {
    color: var(--text-primary);
}

/* ---------- CONTAINER ---------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
}

/* ---------- NAVBAR ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    transition: box-shadow 0.2s ease;
}

.navbar.scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1rem;
    font-weight: 600;
    color: var(--near-black);
    letter-spacing: -0.01em;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

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

.nav-brand[data-tooltip] {
    position: relative;
}

.nav-brand[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--near-black);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.02em;
}

.nav-brand[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* sliding active bar */
.nav-links::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: var(--bar-left, 0px);
    height: 2px;
    width: var(--bar-width, 0px);
    background: var(--near-black);
    border-radius: 2px;
    transition: left 0.3s ease, width 0.3s ease;
    pointer-events: none;
}

.nav-links li a {
    font-size: 0.875rem;
    font-weight: 450;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.15s ease;
    display: block;
}

.nav-links li a:hover {
    color: var(--near-black);
}

.nav-links li a.active {
    color: var(--near-black);
}

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

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--near-black);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.toggle-track {
    position: relative;
    width: 90px;
    height: 40px;
    border-radius: 40px;
    background: #74b9ff;
    overflow: hidden;
    display: block;
    transition: background-color 0.5s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

[data-theme="dark"] .toggle-track {
    background: #1b1b24;
}

/* Halos */
.toggle-halo {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    background: transparent;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.15), 
                0 0 0 20px rgba(255, 255, 255, 0.1),
                0 0 0 30px rgba(255, 255, 255, 0.05);
    z-index: 1;
}

[data-theme="dark"] .toggle-halo {
    left: 54px;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.04), 
                0 0 0 20px rgba(255, 255, 255, 0.04),
                0 0 0 30px rgba(255, 255, 255, 0.04);
}

/* Indicator (Sun / Moon) */
.toggle-indicator {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    background: #ffcc00; /* Sun */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease, box-shadow 0.5s ease;
    z-index: 5;
    overflow: hidden;
}

[data-theme="dark"] .toggle-indicator {
    left: 54px;
    background: #d4d8dd; /* Moon */
    box-shadow: inset -4px -2px 0 0 #a9b0b8, 0 2px 4px rgba(0,0,0,0.3);
}

/* Craters */
.crater {
    position: absolute;
    background: #99a2ad;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease, top 0.5s ease, left 0.5s ease;
}

[data-theme="dark"] .crater {
    opacity: 1;
}

.crater--1 { width: 8px; height: 8px; top: 6px; left: 8px; box-shadow: inset 1px 1px 0 rgba(0,0,0,0.1); }
.crater--2 { width: 12px; height: 12px; top: 14px; left: 16px; box-shadow: inset 1px 1px 0 rgba(0,0,0,0.1); }
.crater--3 { width: 6px; height: 6px; top: 20px; left: 6px; box-shadow: inset 1px 1px 0 rgba(0,0,0,0.1); }

/* Clouds */
.toggle-clouds {
    position: absolute;
    inset: 0;
    z-index: 3;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0);
}

[data-theme="dark"] .toggle-clouds {
    opacity: 0;
    transform: translateY(15px);
}

.cloud {
    position: absolute;
    background: #fff;
    border-radius: 20px;
}

.cloud--1 {
    width: 32px;
    height: 12px;
    bottom: 2px;
    right: 4px;
}
.cloud--1::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: -8px;
    left: 6px;
}
.cloud--1::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    top: -4px;
    left: 18px;
}

.cloud--2 {
    width: 40px;
    height: 14px;
    bottom: -4px;
    right: -10px;
    opacity: 0.7;
}
.cloud--2::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: -10px;
    left: 8px;
}

/* Stars */
.toggle-stars {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(-15px);
}

[data-theme="dark"] .toggle-stars {
    opacity: 1;
    transform: translateY(0);
}

.star {
    position: absolute;
    background: transparent;
    border-radius: 50%;
}

/* Small 4-pointed stars */
.star::before,
.star::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.star::before { width: 100%; height: 2px; }
.star::after { width: 2px; height: 100%; }

.star--1 { width: 8px; height: 8px; top: 10px; left: 16px; }
.star--2 { width: 4px; height: 4px; top: 6px; left: 32px; }
.star--3 { width: 5px; height: 5px; top: 24px; left: 12px; }
.star--4 { width: 6px; height: 6px; top: 28px; left: 30px; }
.star--5 { width: 4px; height: 4px; top: 20px; left: 42px; }

/* ---------- HERO ---------- */
.hero {
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 96px;
    background: var(--white);
}

.hero-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 80px;
    align-items: center;
}

.hero-name {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--near-black);
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}

.hero-bio {
    font-size: 1.0625rem;
    color: var(--body-text);
    line-height: 1.75;
    margin-bottom: 18px;
    max-width: 580px;
}

.hero-bio:last-of-type {
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    background: var(--near-black);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #333333;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--near-black);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
    border-color: #9ca3af;
    background: var(--bg-alt);
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 450;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.social-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Hero photo */
.hero-photo {
    flex-shrink: 0;
}

.hero-photo img {
    width: 420px;
    height: 480px;
    border-radius: 12px;
    object-fit: cover;
    object-position: center top;
    border: 1px solid var(--border);
    display: block;
}

/* Hero footer quote */
.hero-footer-quote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 0 4px;
}

.hero-arc-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.85;
}

.hero-arc-text {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
    letter-spacing: 0.02em;
}

/* ---------- SECTION SHARED ---------- */
.section {
    padding: 96px 0;
    border-top: 1px solid var(--border);
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* ---------- ABOUT ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.about-col p {
    color: var(--body-text);
    line-height: 1.75;
    margin-bottom: 16px;
}

.about-col p:last-child {
    margin-bottom: 0;
}

.about-col .section-title {
    margin-bottom: 24px;
}

.edu-item {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

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

.edu-degree {
    font-size: 1rem;
    font-weight: 600;
    color: var(--near-black);
    margin-bottom: 2px;
}

.edu-spec {
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: 500;
}

.edu-school {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.edu-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* ---------- RESEARCH ---------- */
.research-row {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.research-draft-card {
    flex-shrink: 0;
    width: 180px;
    background: var(--bg-alt);
    border: 2px dashed #9ca3af;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px 16px;
}

.research-draft-icon {
    width: 64px;
    height: 52px;
    opacity: 0.55;
}

.research-draft-text {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
    letter-spacing: 0.02em;
    text-align: center;
}

.research-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    flex: 1;
}

.research-badge {
    display: inline-block;
    background: var(--near-black);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
}

.research-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--near-black);
    line-height: 1.4;
    margin-bottom: 10px;
}

.research-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
}

.research-desc {
    font-size: 0.9375rem;
    color: var(--body-text);
    line-height: 1.75;
    margin-bottom: 12px;
}

.research-desc:last-of-type {
    margin-bottom: 24px;
}

.research-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.research-link:hover {
    border-bottom-color: var(--accent);
}

/* ---------- PROJECTS ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.project-top {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

.project-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--near-black);
}

.project-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-name a:hover {
    color: #2563eb;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--body-text-2);
    line-height: 1.7;
    flex: 1;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.project-stack code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ---------- SKILLS ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 80px;
}

.skill-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

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

.skill-tags span {
    font-size: 0.8125rem;
    background: var(--white);
    color: var(--tag-text);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 450;
    transition: border-color 0.15s ease;
}

.skill-tags span:hover {
    border-color: #9ca3af;
}

/* ---------- ACHIEVEMENTS ---------- */
.achievements-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 64px;
}

.achievement {
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

.achievement:first-child {
    border-top: 1px solid var(--border);
}

.achievement-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    padding-top: 4px;
    white-space: nowrap;
}

.achievement-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--near-black);
    margin-bottom: 8px;
}

.achievement-desc {
    font-size: 0.9rem;
    color: var(--body-text-2);
    line-height: 1.7;
}

/* Certifications */
.certs-block {
    padding-top: 48px;
}

.certs-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.certs-list {
    display: flex;
    flex-direction: column;
}

.cert {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.cert:last-child {
    border-bottom: none;
}

.cert-issuer {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--near-black);
    min-width: 140px;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.cert-name {
    font-size: 0.9rem;
    color: var(--body-text);
    flex: 1;
}

.cert-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.certs-more-wrap {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.projects-more-wrap {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.projects-more-wrap .btn-more-certs {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.projects-more-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0.85;
    flex-shrink: 0;
    transition: filter 0.2s ease;
}

/* dark mode: invert dark icon → white */
[data-theme="dark"] .projects-more-icon {
    filter: invert(1);
}

/* light hover: button goes dark, invert icon → white */
.btn-more-certs:hover .projects-more-icon {
    filter: invert(1);
}

/* dark hover: button goes light, revert icon → dark */
[data-theme="dark"] .btn-more-certs:hover .projects-more-icon {
    filter: invert(0);
}

/* ---------- LOCKED IN ---------- */
.locked-in-wrap {
    margin-top: 0;
    margin-bottom: 0;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.locked-in-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: 0.75;
}

.locked-in-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.btn-more-certs {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.25rem;
    border: 1.5px solid var(--near-black);
    border-radius: 999px;
    background: var(--white);
    color: var(--near-black);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-more-certs:hover {
    background: var(--near-black);
    color: var(--white);
}

.btn-cert-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0.85;
    flex-shrink: 0;
    transition: filter 0.2s ease;
}

/* dark mode: invert dark icon → white */
[data-theme="dark"] .btn-cert-icon {
    filter: invert(1);
}

/* light hover: button goes dark, invert icon → white */
.btn-more-certs:hover .btn-cert-icon {
    filter: invert(1);
}

/* dark hover: button goes light, revert icon → dark */
[data-theme="dark"] .btn-more-certs:hover .btn-cert-icon {
    filter: invert(0);
}

/* ---------- CONTACT ---------- */
.contact-wrap {
    max-width: 640px;
}

.contact-intro {
    font-size: 1.0625rem;
    color: var(--body-text);
    margin-bottom: 48px;
    line-height: 1.7;
}

.contact-items {
    display: flex;
    flex-direction: column;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.15s ease;
    color: var(--near-black);
}

.contact-item:first-child {
    border-top: 1px solid var(--border);
}

.contact-item:hover .contact-value {
    color: var(--accent);
}

.contact-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
}

.contact-icon--li img,
.contact-icon--mail img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.contact-icon--gh img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.contact-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.contact-value {
    font-size: 0.9375rem;
    color: var(--near-black);
    transition: color 0.15s ease;
}

/* ---------- FOOTER ---------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    background: var(--white);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--near-black);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-photo {
        order: -1;
    }

    .hero-photo img {
        width: 200px;
        height: 220px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 56px;
    }

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

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

    .achievement {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .container,
    .hero-inner,
    .nav-inner {
        padding: 0 20px;
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        padding-top: calc(var(--nav-height) + 48px);
        padding-bottom: 64px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 20px 20px;
        gap: 4px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

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

    .nav-links li a {
        display: block;
        padding: 10px 12px;
    }

    .hamburger {
        display: flex;
    }

    .research-card {
        padding: 28px 24px;
    }

    .project-card {
        padding: 24px 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-links {
        gap: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .cert {
        flex-wrap: wrap;
    }

    .cert-date {
        width: 100%;
        margin-top: 2px;
    }
}

/* ---------- ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (max-width: 640px) {
    .research-row {
        flex-direction: column;
    }

    .research-draft-card {
        width: 100%;
        flex-direction: row;
        padding: 20px 24px;
        gap: 16px;
    }
}
