:root {
    --site-font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --root-font-size: 22px;
    --base-letter-spacing: 0px;
    /* Black & White Palette */
    --dark-teal: #000000;           /* Primary text / dark fills */
    --muted-green: #595959;         /* Secondary text (gray) */
    --teal-blue: #000000;           /* Links / accents */
    --warm-tan: #000000;            /* Accent (light-bg contexts only — dark-bg contexts hardcode white directly) */
    --cream-white: #ffffff;         /* Background */

    /* Color Usage */
    --primary-color: var(--teal-blue);
    --primary-dark: var(--dark-teal);
    --secondary-color: var(--muted-green);
    --accent-color: var(--warm-tan);
    --text-primary: var(--dark-teal);
    --text-secondary: var(--muted-green);
    --bg-primary: var(--cream-white);
    --bg-secondary: #ffffff;
    --bg-dark: var(--dark-teal);
    --border-color: #e5e5e5;
    --highlight-color: var(--warm-tan);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
}

/* Minecraft Font */
@font-face {
    font-family: 'Minecraft';
    src: url('https://fonts.cdnfonts.com/s/31739/Minecrafter.Alt.woff') format('woff'),
         url('https://fonts.cdnfonts.com/s/31739/Minecrafter.Reg.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

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

html {
    scroll-behavior: smooth;
    font-size: var(--root-font-size);
}

body {
    font-family: var(--site-font);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    font-size: 0.7rem;
    letter-spacing: var(--base-letter-spacing);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(0, 0, 0,0.12)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
    z-index: 0;
}

/* Adjust font sizes for better readability with pixel font */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--site-font);
    line-height: 1.4;
    font-weight: normal; /* Pixel fonts don't use bold weights */
    letter-spacing: var(--base-letter-spacing);
}

p, li, span, a, div, button, input, textarea {
    font-family: var(--site-font);
    letter-spacing: var(--base-letter-spacing);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 2px solid var(--border-color);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-teal);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--teal-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--teal-blue);
    transition: width 0.3s ease;
}

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

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

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.font-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--site-font);
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    transition: color 0.3s ease;
    letter-spacing: -1px;
}

.font-toggle:hover {
    color: var(--teal-blue);
}

.font-toggle::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--teal-blue);
    transition: width 0.3s ease;
}

.font-toggle:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: #000000;
    color: white;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 11;
}

.hero-content {
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: -2px; /* Much narrower spacing */
}

.highlight {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: -1.5px;
}

.hero-description {
    font-size: 0.7rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 2;
    letter-spacing: -1px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: normal;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

.hero-image {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 6s ease-in-out infinite;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Project thumbnails scattered in the side margins of the home page —
   image-only, click jumps to that project's CAD-tab modal. Hidden below
   ~1550px viewport width, where there's no longer clear margin space
   outside the 1200px content column to float in without overlapping text. */
.side-float {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 5;
    animation: float 7s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.side-float img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.side-float:hover {
    /* drop the bob/rotate animation on hover so the scale transition below
       (an animation's transform otherwise always wins over a plain one) is
       actually visible */
    animation: none;
    transform: scale(1.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.side-float.pos-left { left: 40px; }
.side-float.pos-right { right: 40px; }

.side-float.sf-b, .side-float.sf-d { animation-delay: -3.5s; }

@media (max-width: 1550px) {
    .side-float { display: none; }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    display: block;
    width: 30px;
    height: 30px;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Section Styles */
section {
    padding: 5rem 0;
    position: relative;
    z-index: 1;
    background-color: var(--bg-primary);
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(0, 0, 0,0.12)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
    z-index: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: normal;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -2px;
    position: relative;
    z-index: 11;
}

/* About Section */
.about {
    background: var(--bg-primary);
    padding-top: 2rem; /* Add extra padding at top so content is visible */
    position: relative;
    z-index: 1; /* Ensure it's above hero */
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 11;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-belief {
    font-weight: 600;
    color: var(--text-primary) !important;
    border-left: 3px solid var(--teal-blue);
    padding-left: 1rem;
}

.about-info {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.info-item {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-item a:hover {
    color: var(--primary-dark);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    border: 2px solid var(--border-color);
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--teal-blue);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--teal-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Projects Section */
.projects {
    background: var(--bg-primary);
}

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

.project-card {
    background: white;
    border-radius: 16px;
    overflow: visible; /* Allow card to expand on hover */
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    z-index: 11;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    z-index: 12;
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--dark-teal), var(--teal-blue));
    position: relative;
    overflow: hidden; /* Keep overflow hidden to create magnifying effect */
    background-color: var(--dark-teal); /* Fallback if image doesn't load */
    cursor: zoom-in; /* Show magnifying glass cursor */
    transition: height 0.3s ease;
}

.project-card:hover .project-image {
    cursor: zoom-in;
    height: 400px; /* Expand vertically when hovering over the card */
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the space when not hovering - can crop top/bottom */
    display: block;
    transition: transform 0.1s ease-out, object-fit 0.3s ease;
    transform-origin: center center;
    will-change: transform; /* Optimize for animations */
}

.project-card:hover .project-img {
    object-fit: contain; /* Show full image when hovering/zooming */
}

/* Overlay removed - image expands on hover instead */

.project-link {
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Skills Section */
.skills {
    background: var(--bg-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.skill-category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-name {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.skill-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--teal-blue), var(--muted-green));
    border-radius: 4px;
    transition: width 1s ease;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--teal-blue);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.skill-tag:hover {
    background: var(--dark-teal);
    transform: scale(1.05);
}

/* Contact Section */
.contact {
    background: var(--bg-primary);
}

.contact-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-content {
    display: flex;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 11;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.contact-item a {
    color: var(--teal-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--dark-teal);
}

.contact-item p {
    color: var(--text-secondary);
    margin: 0;
}

/* Experience Section */
.experience {
    background: var(--bg-primary);
}

.experience-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.experience-item {
    background: white;
    border-left: 4px solid var(--teal-blue);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--border-color);
    position: relative;
    z-index: 11;
}

.experience-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
}

.experience-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: baseline;
}

.experience-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.experience-company {
    font-size: 1.1rem;
    color: var(--teal-blue);
    font-weight: 500;
}

.experience-date {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.experience-details {
    list-style: none;
    padding-left: 0;
}

.experience-details li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.experience-details li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--teal-blue);
    font-weight: bold;
}

.experience-video {
    margin-top: 1.5rem;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.youtube-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Speaking toast */
.speaking-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--teal-blue);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    z-index: 9999;
    max-width: 320px;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.speaking-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-text {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    line-height: 1.4;
    flex: 1;
}

.toast-text strong {
    color: var(--text-primary);
}

.toast-text span {
    color: var(--teal-blue);
}

.toast-link {
    font-size: 0.8rem;
    color: var(--teal-blue);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.toast-link:hover {
    text-decoration: underline;
}

.toast-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #555;
}

/* Tab panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.inhabit-placeholder {
    padding: 4rem 0 0;
}

.inhabit-pdf-wrapper {
    position: relative;
    width: 100%;
    margin-top: 1.5rem;
}

.inhabit-fullscreen-btn {
    display: block;
    margin: 0 auto 0.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--teal-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.inhabit-fullscreen-btn:hover {
    opacity: 0.85;
}

.inhabit-intro {
    max-width: 750px;
    margin: 1.5rem 0 2rem;
}

.inhabit-role {
    font-size: 1rem;
    font-weight: 700;
    color: var(--teal-blue);
    margin-bottom: 0.5rem;
}

.inhabit-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.inhabit-pitch-pdf {
    display: block;
    width: 100%;
    height: 88vh;
    border: none;
}

.youtube-facade {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
    padding-bottom: 56.25%;
    height: 0;
}

.youtube-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s ease;
}

.youtube-facade:hover .youtube-thumb {
    filter: brightness(0.75);
}

.youtube-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    border: none;
    border-radius: 50%;
    width: 68px;
    height: 68px;
    font-size: 1.6rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    transition: transform 0.2s ease, background 0.2s ease;
    pointer-events: none;
}

.youtube-facade:hover .youtube-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: red;
}

.youtube-facade iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    border-radius: 12px;
}

.project-card .video-views {
    padding-left: 0.75rem;
}

.video-views {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #888;
    text-align: left;
}

/* Education Section */
.education {
    background: var(--bg-secondary);
    position: relative;
}

.education::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid-white" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(0, 0, 0,0.06)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid-white)"/></svg>');
    pointer-events: none;
    z-index: 0;
}

.education-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.education-item {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 11;
}

.education-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.education-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: baseline;
}

.education-degree {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.education-school {
    font-size: 1.1rem;
    color: var(--teal-blue);
    font-weight: 500;
}

.education-date {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.education-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 1rem;
}

/* Awards Section */
.awards {
    background: var(--bg-primary);
    position: relative;
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
}

.award-card {
    background: white;
    padding: 1.1rem 0.9rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    z-index: 11;
}

.award-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.award-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.award-description {
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.72rem;
}

/* Languages Section */
.languages {
    background: var(--bg-secondary);
    position: relative;
}

.languages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid-white2" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(0, 0, 0,0.06)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid-white2)"/></svg>');
    pointer-events: none;
    z-index: 0;
}

.languages-list {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.language-item {
    background: white;
    position: relative;
    z-index: 1;
    padding: 1.5rem 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    transition: transform 0.3s ease;
}

.language-item:hover {
    transform: scale(1.05);
}

.language-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.language-level {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 0;
    position: relative;
    z-index: 11;
}

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

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

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

    .footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

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

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

    .experience-header,
    .education-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .experience-date,
    .education-date {
        margin-left: 0;
    }

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

    .languages-list {
        flex-direction: column;
    }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.sr {
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.sr.sr-up    { transform: translateY(45px); }
.sr.sr-left  { transform: translateX(-55px); }
.sr.sr-right { transform: translateX(55px); }
.sr.sr-scale { transform: scale(0.88); }

.sr.sr-visible {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
}

/* ============================================================
   SECTION TITLE SWEEP UNDERLINE
   ============================================================ */
.section-title::after {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--teal-blue), var(--warm-tan));
    border-radius: 2px;
    width: 0;
    margin: 0.5rem auto 0;
    transition: width 0.85s cubic-bezier(0.25, 1, 0.5, 1) 0.25s;
}
.section-title.sr-visible::after {
    width: 56px;
}

/* ============================================================
   SCROLL SIDEBAR
   ============================================================ */
#scroll-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-track {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    width: 2px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 2px;
    overflow: hidden;
}

#sidebar-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--teal-blue), var(--warm-tan));
    transition: height 0.12s linear;
    border-radius: 2px;
}

.sdot {
    position: relative;
    display: flex;
    align-items: center;
    padding: 11px 0;
    cursor: pointer;
}

.sdot-ring {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cream-white);
    border: 2px solid rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.sdot.active .sdot-ring {
    background: var(--teal-blue);
    border-color: var(--teal-blue);
    transform: scale(1.5);
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
}

.sdot-label {
    position: absolute;
    left: 18px;
    font-size: 0.48rem;
    color: var(--dark-teal);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.25s ease;
    pointer-events: none;
    background: var(--cream-white);
    padding: 2px 7px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    letter-spacing: 0;
}

.sdot:hover .sdot-label,
.sdot.active .sdot-label {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 900px) {
    #scroll-sidebar { display: none; }
}

/* ============================================================
   HERO PARTICLES
   ============================================================ */
.hero-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    animation: ptFloat 9s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ptFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.22; }
    33%       { transform: translateY(-28px) rotate(120deg); opacity: 0.48; }
    66%       { transform: translateY(18px) rotate(240deg); opacity: 0.12; }
}

/* ============================================================
   EXPERIENCE TIMELINE — CLEAN RESTORE
   ============================================================ */

/* Kill any leftover SVG/line experiments */
.exp-curve-svg,
.exp-line-track { display: none !important; }

.experience-timeline {
    padding-left: 0 !important;
}

/* Fix border shorthand overriding border-left in the original CSS */
.experience-item {
    border-left: 4px solid var(--teal-blue) !important;
    border-top: 2px solid var(--border-color) !important;
    border-right: 2px solid var(--border-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
    position: relative;
    z-index: 1;
}

/* Remove experimental pseudo-elements */
.experience-item::before,
.experience-item::after { display: none !important; }

/* ============================================================
   CAD SECTION
   ============================================================ */
.cad-hero {
    min-height: 44vh;
    background: #000000;
    color: white;
    display: flex;
    align-items: center;
    padding-top: 7rem;
    padding-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.cad-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="cg" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M60 0L0 0 0 60" fill="none" stroke="rgba(255,255,255,0.055)" stroke-width="1"/></pattern></defs><rect width="60" height="60" fill="url(%23cg)"/></svg>');
    opacity: 0.7;
}

.cad-hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.cad-hero-content h1 {
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: -2px;
    color: #ffffff;
    margin-bottom: 1.2rem;
    text-shadow: 0 0 30px rgba(255, 255, 255,0.4);
}

.cad-hero-content p {
    font-size: 0.65rem;
    opacity: 0.8;
    max-width: 560px;
    margin: 0 auto;
    line-height: 2.2;
    color: rgba(255,255,255,0.85);
}

.cad-gallery-section {
    padding: 4rem 0 6rem;
    background: var(--bg-primary);
}

.cad-gallery-title {
    text-align: center;
    margin-bottom: 2.5rem !important;
}

.cad-gallery {
    columns: 3;
    column-gap: 1.25rem;
}

@media (max-width: 900px) { .cad-gallery { columns: 2; column-gap: 0.75rem; } }
@media (max-width: 480px) { .cad-gallery { columns: 2; column-gap: 0.5rem; } }

.cad-photo-wrap {
    break-inside: avoid;
    margin-bottom: 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: var(--shadow-md);
    position: relative;
    display: block;
}

.cad-photo-wrap img {
    width: 100%;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25,1,0.5,1), filter 0.35s ease;
}

.cad-photo-wrap:hover img {
    transform: scale(1.07);
    filter: brightness(0.68);
}

.cad-photo-cap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1rem 0.85rem;
    background: linear-gradient(0deg, rgba(0, 0, 0,0.88) 0%, transparent 100%);
    color: rgba(255,255,255,0.92);
    font-size: 0.55rem;
    letter-spacing: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 0 0 14px 14px;
}

.cad-photo-wrap:hover .cad-photo-cap {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

#lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.91);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    object-fit: contain;
}

#lightbox.open img {
    transform: scale(1);
}

.lb-close {
    position: absolute;
    top: 1.2rem;
    right: 1.4rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-family: sans-serif;
}

.lb-close:hover {
    background: rgba(255,255,255,0.25);
}

/* ============================================================
   ENHANCED AWARD CARDS — stagger hint via :nth-child
   ============================================================ */
.award-card:nth-child(1) { transition-delay: 0.00s; }
.award-card:nth-child(2) { transition-delay: 0.07s; }
.award-card:nth-child(3) { transition-delay: 0.14s; }
.award-card:nth-child(4) { transition-delay: 0.21s; }
.award-card:nth-child(5) { transition-delay: 0.28s; }

/* ============================================================
   ENHANCED PROJECT CARD default opacity (remove original
   inline-style override so our SR system takes over)
   ============================================================ */
.project-card {
    transition: all 0.3s ease, opacity 0.65s ease, transform 0.65s ease;
}

/* ============================================================
   PHOTO DETAIL MODAL
   ============================================================ */
#photo-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#photo-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.pm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pm-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 55% 45%;
    /* minmax(0, 1fr): without an explicit track size, an "auto" grid row
       sizes itself to its tallest child's natural content height — so a
       long description (or a tall image) grows the row past max-height,
       and neither column's own overflow/scroll ever kicks in because each
       one is laid out at its full natural height regardless of the card's
       clipped outer box. Capping the row is what makes max-height actually
       bound the columns instead of just visually clipping them. */
    grid-template-rows: minmax(0, 1fr);
    max-width: 980px;
    width: 100%;
    max-height: 88vh;
    background: var(--cream-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
    transform: scale(0.93) translateY(16px);
    transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1);
}

#photo-modal.open .pm-card {
    transform: scale(1) translateY(0);
}

.pm-img-wrap {
    background: #000000;
    min-height: 380px;
    max-height: 88vh; /* match .pm-card's cap so a tall/portrait image can't
                         push the whole modal past the viewport with no way
                         to scroll to the rest — it gets cropped by
                         object-fit:cover instead */
    overflow: hidden;
    position: relative;
}

.pm-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pm-canvas-hint {
    position: absolute;
    bottom: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    background: rgba(0, 0, 0,0.55);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    pointer-events: none;
}

/* Multi-image gallery strip inside the photo modal */
.pm-gallery {
    position: absolute;
    bottom: 0.85rem;
    right: 0.85rem;
    gap: 0.5rem;
}

.pm-img-wrap img.pm-gallery-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.35);
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pm-gallery-thumb:hover {
    opacity: 1;
}

.pm-gallery-thumb.active {
    opacity: 1;
    border-color: var(--teal-blue, #000000);
}

/* Live 3D tiles in the CAD gallery */
.cad-3d-tile canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.pm-info {
    padding: 2.4rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--cream-white);
    min-height: 0;
}

.pm-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-family: inherit;
}

.pm-close:hover {
    background: rgba(0, 0, 0, 0.72);
}

#pm-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark-teal);
    line-height: 1.45;
    margin: 0;
    font-family: var(--site-font);
}

#pm-desc {
    font-size: 0.67rem;
    color: var(--text-secondary);
    line-height: 1.85;
    margin: 0;
    flex: 1;
    font-family: var(--site-font);
}

.pm-tools {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pm-tools-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--teal-blue);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.55rem;
    font-family: var(--site-font);
}

#pm-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pm-tool-tag {
    padding: 0.2rem 0.6rem;
    background: var(--dark-teal);
    color: #fff;
    border-radius: 6px;
    font-size: 0.56rem;
    font-family: var(--site-font);
    white-space: nowrap;
}

@media (max-width: 700px) {
    .pm-card {
        grid-template-columns: 1fr;
        grid-template-rows: 42vw auto;
        max-height: 92vh;
    }
    .pm-img-wrap { min-height: unset; }
    .pm-info { padding: 1.4rem 1.2rem; }
    #pm-title { font-size: 0.85rem; }
    #pm-desc { font-size: 0.63rem; }
}

/* Video gallery tile play overlay */
.cad-video-wrap { position: relative; }
.cad-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: rgba(255,255,255,0.9);
    pointer-events: none;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    transition: transform 0.2s ease;
}
.cad-video-wrap:hover .cad-video-play {
    transform: scale(1.15);
}

/* Autoplaying video tile in CAD gallery */
.cad-tile-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
