/* =========================================================
   Base + Tokens
   ========================================================= */
:root {
    --green: #4CAF50;
    --green-dark: #388e3c;
    --green-hover: #45a049;
    --dark: #333;
    --dark2: #222;
    --light: #f0f0f0;
    --white: #fff;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 12px 25px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 18px 28px rgba(0,0,0,0.08);
    --page-max: 1100px;
    --topbar-h: 60px;
    --gap-md: 1.5rem;
    --trans-fast: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
}

/* =========================================================
   Topbar / Header
   ========================================================= */
.topbar {
    background-color: var(--dark);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    z-index: 1000;
    width: 100%;
}

.logo,
.topbar {
    box-sizing: border-box;
}

.logo {
    background-color: var(--dark2);
    font-family: 'Arial Black', sans-serif;
    font-size: 1.5rem;
    width: 150px;
    height: var(--topbar-h);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    line-height: 1.2;
    position: relative;
}

.logo a {
    color: inherit;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    transition: color .3s ease;
}

.logo a:hover,
.main-nav a:hover,
.mobile-menu a:hover {
    color: var(--green);
}

/* ===== NEW: Mobile hamburger ===== */
.hamburger {
    display: none;                 /* will show in media query */
    background: none;
    border: none;
    cursor: pointer;
    width: 42px;
    height: var(--topbar-h);
    align-items: center;
    justify-content: center;
    color: inherit;
}

.hamburger__icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: fill 0.2s ease;
}

.hamburger:hover .hamburger__icon,
.hamburger.is-open .hamburger__icon {
    fill: var(--green);
}

/* ===== NEW: Mobile dropdown ===== */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    z-index: 1001;
    width: 160px;
    overflow: hidden;
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: block;
    padding: .6rem .9rem;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-menu a:hover {
    background: #f5f5f5;
    color: var(--green);
}

.mobile-menu.is-open {
    display: block;
}

/* Desktop nav */
.main-nav {
    display: flex;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    margin: 0 1rem;
}

.main-nav a {
    color: var(--white);
    font-weight: bold;
    text-decoration: none;
    padding: .5rem 1rem;
    transition: color .3s;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
    background-color: var(--green);
    color: var(--white);
    text-align: center;
    width: 100%;
    margin-top: var(--topbar-h);
    padding: 5rem 2rem 4rem 2rem;
}

.hero h1 {
    font-size: 3rem;
}

.hero p {
    font-size: 1.25rem;
    margin-top: 1rem;
}

/* hero refinements */
.hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .9rem;
    opacity: .9;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero .hero-lead {
    font-size: 1.35rem;
    max-width: 52rem;
    margin: 1.5rem auto;
    line-height: 1.6;
}

.hero .hero-points {
    display: inline-block;
    text-align: left;
    margin: 1rem auto 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 1rem 1.4rem;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.hero .hero-points p {
    margin: .25rem 0;
    font-size: 1.05rem;
}

.hero .hero-note {
    opacity: .85;
    margin-top: 1.25rem;
    font-size: .95rem;
}

/* =========================================================
   About
   ========================================================= */
.about-section {
    padding: 4rem 2rem;
    background-color: var(--light);
    text-align: center;
    font-size: 1.2em;
    margin: 0 auto;
    position: relative;
}

.about-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about-section p {
    font-size: 1.25rem;
    color: #555;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

/* --- Single-line intro + rotating title --- */
.about-intro,
.rotating-title-wrapper {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: 1.25rem;
}

.rotating-title-wrapper p {
    margin: 0;
}

.scene {
    display: inline-block;
    width: 275px;
    height: 30px;
    position: relative;
    margin: 0 2px 5px 5px;
}

.cube {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
    transition: transform 1s ease-in-out;
}

.cube-face {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: #555;
    background-color: var(--light);
    border: 1px solid #ddd;
}

.cube-face.front  { transform: rotateX(0deg)   translateZ(15px); }
.cube-face.top    { transform: rotateX(90deg)  translateZ(15px); }
.cube-face.back   { transform: rotateX(180deg) translateZ(15px); }
.cube-face.bottom { transform: rotateX(270deg) translateZ(15px); }

/* highlight box */
.about-highlight {
    max-width: 68.5rem;
    margin: 2rem auto 2.5rem;
    background: var(--white);
    padding: 1.25rem;
    border-radius: 8px;
    color: #444;
    text-align: center;
}

.about-highlight p {
    padding: 0 5px;
}

/* 3 blocks */
.about-grid {
    display: grid;
    gap: 1.5rem;
    max-width: var(--page-max);
    margin: 0 auto 2.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-block {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem 1.2rem;
    text-align: left;
    box-shadow: 0 12px 25px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
}

.about-block h3 {
    margin: 0 0 .6rem 0;
    font-size: 1.1rem;
    color: #333;
}

.about-block p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: #555;
}

.about-outro {
    max-width: 40rem;
    margin: 0 auto;
    font-weight: 500;
    color: #444;
}

/* =========================================================
   Projects
   ========================================================= */
.projects-section {
    padding: 4rem 2rem;
    background-color: var(--white);
    text-align: center;
}

.projects-section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Tabs */
.project-tabs {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.project-tab {
    background: #f1f1f1;
    border: none;
    padding: .55rem 1.3rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--trans-fast), transform var(--trans-fast);
}

.project-tab:hover {
    background: #e0e0e0;
}

.project-tab.active {
    background: var(--green);
    color: var(--white);
    transform: translateY(-2px);
}

/* Category containers */
.project-categories {
    position: relative;
}

.project-category {
    display: none;
    animation: fadeIn .25s ease-in;
}

.project-category.active {
    display: block;
}

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

/* Projects grid */
.projects-section .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    justify-self: center;
    max-width: var(--page-max);
    margin: 0 auto;
}

/* Project card */
.project-card {
    width: 100%;
    max-width: 360px;
    justify-self: start;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 230px;
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
    overflow: hidden;
}

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

.project-card:active {
    transform: translateY(-1px) scale(.998);
}

/* inline media */
.project-media {
    position: relative;
    width: 100%;
    height: 160px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-media-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

.project-media-img,
.project-media-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.project-media-video {
    display: none; 
}

.card-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: none;
    background: rgba(0,0,0,0.45);
    color: var(--white);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1rem;
    z-index: 2;
}

.card-nav.left  { left: .6rem; }
.card-nav.right { right: .6rem; }

.project-card-body {
    padding: .9rem 1.1rem 1.1rem;
    flex: 1;
}

.project-card h3 {
    font-size: 1.05rem;
    margin-bottom: .35rem;
    text-align: left;
}

.project-card p {
    text-align: left;
    color: #666;
    font-size: .9rem;
}

/* =========================================================
   Gallery (modal)
   ========================================================= */
.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 14, 0.85);
    z-index: 9000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.gallery-modal.open {
    display: flex;
}

.gallery-dialog {
    margin-top: 50px;
    background: #121212;
    width: min(100%, 1100px);
    height: min(90vh, 800px);
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.gallery-close {
    position: absolute;
    top: .45rem;
    right: .6rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
}

.gallery-header {
    padding: 1.1rem 1.3rem .2rem;
}

.gallery-title {
    margin: 0;
    color: var(--white);
}

.gallery-subtitle {
    margin: .25rem 0 0;
    color: #aaa;
    font-size: .85rem;
}

.gallery-main {
    position: relative;
    flex: 1;
    margin: .2rem 1.3rem;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-media,
.gallery-placeholder {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-placeholder {
    color: var(--white);
    opacity: .5;
    font-size: 1.1rem;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(18,18,18,0.7);
    border: 1px solid rgba(255,255,255,0.12);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.gallery-nav.left  { left: .8rem; }
.gallery-nav.right { right: .8rem; }

.gallery-footer {
    padding: .4rem 1.3rem 1rem;
    color: var(--white);
    font-size: .85rem;
    display: flex;
    gap: .75rem;
    align-items: center;
}

.gallery-progress {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    overflow: hidden;
}

.gallery-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--green);
    transition: width .25s ease;
}

.gallery-counter-text {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* disabled state */
.is-disabled {
    opacity: .25;
    /*pointer-events: none;*/
    cursor: default;
}

/* =========================================================
   Contact (kept for full functionality)
   ========================================================= */
.contact-section {
    padding: 4rem 2rem;
    text-align: center;
    background-color: var(--white);
}

.contact-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-section p {
    font-size: 1.25rem;
}

.contact-section a {
    color: var(--green);
    font-weight: bold;
}

/* Form */
form {
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-family: Arial, sans-serif;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

input,
textarea {
    padding: .75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    transition: border-color .3s;
    font-family: inherit;
    box-sizing: border-box;
}

textarea {
    height: 200px;
}

input::placeholder,
textarea::placeholder {
    color: #999;
}

input.error,
textarea.error {
    border-color: red;
}

#charCount {
    text-align: right;
    font-size: .9rem;
    color: #666;
    margin-top: .5rem;
}

/* Submit / buttons that share same green look */
#submitButton,
#backButton {
    background-color: var(--green);
    color: var(--white);
    padding: .75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: transform .1s ease-in-out, background-color .1s ease-in-out;
}

#submitButton:hover,
#backButton:hover {
    background-color: var(--green-hover);
    transform: scale(1.02);
}

#submitButton:active,
#backButton:active {
    background-color: var(--green-dark);
    transform: scale(.98);
}

/* Overlay / popup (contact confirm) */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, .5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup {
    background-color: var(--white);
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .2);
    text-align: center;
}

.popup p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

.noscroll {
    overflow: hidden;
}

/* =========================================================
   Footer
   ========================================================= */
footer {
    background-color: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 1rem 0;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   Media Queries
   ========================================================= */
@media (max-width: 1024px) {
    .projects-section .projects-grid {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    /* nav */
    .main-nav {
        display: none;
    }

    /* show the new hamburger */
    .hamburger {
        display: flex;
    }

    /* hero */
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero .hero-points {
        display: block;
        width: 100%;
        text-align: left;
    }

    /* about grid -> 1 col */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-highlight,
    .about-grid {
        text-align: left;
    }

    .scene {
        width: 200px;
    }

    .cube-face {
        font-size: 1rem;
    }

    .gallery-main {
        margin: .5rem .6rem;
    }

    .gallery-nav.left  { left: .3rem; }
    .gallery-nav.right { right: .3rem; }

    .project-media {
        height: 150px;
    }

    /* form */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* section headings smaller */
    .projects-section h2,
    .about-section h2,
    .contact-section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .projects-section .projects-grid {
        grid-template-columns: repeat(1, minmax(250px, 1fr));
    }
}
