/* Custom styles supplementing Tailwind */

/* Smooth scroll offset for fixed nav */
html {
    scroll-padding-top: 80px;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 3rem;
    }
}

/* Navigation */
.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav-fixed.scrolled {
    background: rgba(5, 10, 24, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(140, 232, 214, 0.1);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .nav {
        padding: 0 2rem;
    }
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    z-index: 101;
}

.nav-logo-mark {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mint);
    color: var(--midnight-deep);
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-weight: 700;
}

.nav-logo-text {
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-cta {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(140, 232, 214, 0.4);
    color: var(--mint-light);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.nav-cta:hover {
    background: var(--mint);
    color: var(--midnight-deep);
    border-color: var(--mint);
}

@media (min-width: 1024px) {
    .nav-cta {
        display: inline-flex;
    }
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
}

/* Mobile menu */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 24, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--midnight-deep);
    z-index: 100;
    padding: 6rem 2rem 2rem;
    overflow-y: auto;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.mobile-menu-link:hover {
    color: var(--mint-light);
    padding-left: 0.5rem;
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 1rem 0;
}

.mobile-menu-phone,
.mobile-menu-email {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--mint-light);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

.mobile-menu-email {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Hero */
.hero {
    min-height: 100vh;
    background: var(--midnight);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 140%;
    background: radial-gradient(ellipse at center, rgba(61, 191, 174, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--cream), transparent);
    pointer-events: none;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 7rem 1.5rem 4rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .hero-grid {
        padding: 8rem 2rem 5rem;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: center;
    }
}

@media (min-width: 1024px) {
    .hero-grid {
        padding: 8rem 3rem 5rem;
        gap: 4rem;
    }
}

.hero-content {
    max-width: 560px;
}

.hero-headline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    color: #fff;
    margin: 1.5rem 0 1.5rem;
    letter-spacing: -0.02em;
}

.hero-accent {
    color: var(--mint-light);
    font-style: italic;
}

.hero-sub {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    max-width: 480px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.hero-trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-trust-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-trust-dot {
    color: rgba(140, 232, 214, 0.4);
    font-size: 0.75rem;
}

.hero-image {
    position: relative;
    min-height: 500px;
}

@media (min-width: 768px) {
    .hero-image {
        min-height: 600px;
    }
}

.hero-img-main {
    width: 100%;
    height: 70vh;
    max-height: 650px;
}

@media (min-width: 768px) {
    .hero-img-main {
        height: 80vh;
        max-height: 750px;
        position: absolute;
        right: 0;
        top: 0;
        width: 55%;
    }
}

.hero-img-float {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 55%;
    border: 4px solid var(--midnight);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
    .hero-img-float {
        width: 45%;
        bottom: -2rem;
        left: -2rem;
    }
}

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

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 2;
    text-decoration: none;
}

.hero-scroll svg {
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* Section header */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .section-header {
        margin-bottom: 5rem;
    }
}

.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mint);
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.section-title--dark {
    color: var(--midnight);
}

.section-title--light {
    color: #fff;
}

/* Services */
.services {
    padding: 6rem 0;
    background: var(--cream);
}

@media (min-width: 768px) {
    .services {
        padding: 8rem 0;
    }
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.service-card {
    cursor: default;
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(10, 22, 40, 0.1);
    margin-bottom: 1.5rem;
    color: var(--mint);
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    background: var(--mint);
    border-color: var(--mint);
    color: var(--midnight-deep);
}

.service-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--midnight);
    margin-bottom: 0.75rem;
}

.service-desc {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgba(10, 22, 40, 0.65);
}

/* About */
.about {
    background: var(--midnight);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: radial-gradient(ellipse at left, rgba(61, 191, 174, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.about-image-col {
    position: relative;
}

.about-img-main {
    width: 100%;
    height: 500px;
}

.about-img-accent {
    position: absolute;
    bottom: -2rem;
    right: -1rem;
    width: 60%;
    border: 4px solid var(--midnight);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .about-img-main {
        height: 600px;
    }
    .about-img-accent {
        width: 55%;
        bottom: -3rem;
        right: -2rem;
    }
}

.about-img-main img,
.about-img-accent img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-content-col {
    position: relative;
    z-index: 1;
}

.about-text {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1.5rem;
}

.about-text--light {
    color: rgba(255, 255, 255, 0.55);
}

.about-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.about-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.about-stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--mint);
    line-height: 1;
}

.about-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* Academy */
.academy {
    background: var(--cream);
    padding: 6rem 0;
}

@media (min-width: 768px) {
    .academy {
        padding: 8rem 0;
    }
}

.academy-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 900px) {
    .academy-layout {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.academy-text {
    max-width: 520px;
}

.academy-desc {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: rgba(10, 22, 40, 0.7);
    margin-bottom: 2rem;
}

.academy-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.academy-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(10, 22, 40, 0.8);
}

.academy-features svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--mint);
}

.academy-images {
    position: relative;
}

.academy-img-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.academy-img-grid .img-editorial {
    width: 100%;
    height: 300px;
}

.academy-img-grid .img-editorial:last-child {
    height: 220px;
}

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

/* Gallery */
.gallery {
    background: var(--warm-white);
    padding: 6rem 0;
}

@media (min-width: 768px) {
    .gallery {
        padding: 8rem 0;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 280px);
    }
    .gallery-item--tall {
        grid-row: span 2;
    }
}

.gallery-item {
    overflow: hidden;
}

.gallery-item .img-editorial {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

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

/* Testimonial */
.testimonial {
    background: var(--midnight);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.testimonial::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(61, 191, 174, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.testimonial-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.testimonial-quote {
    color: var(--mint);
    margin-bottom: 2rem;
}

.testimonial blockquote {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.testimonial-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.testimonial-location {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mint-light);
}

/* Contact */
.contact {
    background: var(--cream);
    padding: 6rem 0;
}

@media (min-width: 768px) {
    .contact {
        padding: 8rem 0;
    }
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.contact-info {
    max-width: 480px;
}

.contact-desc {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(10, 22, 40, 0.65);
    margin-bottom: 2.5rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.contact-detail:hover .contact-detail-value {
    color: var(--mint);
}

.contact-detail svg {
    flex-shrink: 0;
    margin-top: 0.25rem;
    color: var(--mint);
}

.contact-detail-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(10, 22, 40, 0.4);
    margin-bottom: 0.25rem;
}

.contact-detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--midnight);
    line-height: 1.5;
    transition: color 0.3s ease;
}

/* Contact form */
.contact-form-col {
    background: #fff;
    padding: 2.5rem;
    border: 1px solid rgba(10, 22, 40, 0.08);
}

.contact-form-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--midnight);
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(10, 22, 40, 0.5);
    margin-bottom: 0.5rem;
}

.form-select {
    width: 100%;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid rgba(10, 22, 40, 0.2);
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: var(--midnight);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230A1628' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    border-bottom-color: var(--mint);
}

.form-textarea {
    width: 100%;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid rgba(10, 22, 40, 0.2);
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: var(--midnight);
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

.form-textarea:focus {
    border-bottom-color: var(--mint);
}

.form-success {
    text-align: center;
    padding: 3rem 1rem;
}

.form-success-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--midnight);
    margin: 1rem 0 0.5rem;
}

.form-success-text {
    font-size: 0.9375rem;
    color: rgba(10, 22, 40, 0.65);
    line-height: 1.6;
}

/* Map */
.map-section {
    background: var(--midnight);
}

.map-section iframe {
    filter: grayscale(0.5) contrast(1.1);
    opacity: 0.85;
    transition: opacity 0.4s ease;
}

.map-section:hover iframe {
    opacity: 1;
}

/* Footer */
.footer {
    background: var(--midnight-deep);
    padding: 5rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 2rem;
    }
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.625rem;
    text-decoration: none;
    margin-bottom: 1.25rem;
}

.footer-logo-mark {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mint);
    color: var(--midnight-deep);
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.footer-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.footer-tagline {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.5);
}

.footer-nav-title,
.footer-contact h4 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 1.25rem;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-nav-link {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav-link:hover {
    color: var(--mint-light);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-contact-link {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact-link:hover {
    color: var(--mint-light);
}

.footer-address {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem 0;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}
</style>
<sm-file path="script.js">
(function () {
    'use strict';

    // ── Navigation scroll effect ──
    const nav = document.getElementById('nav');
    let lastScroll = 0;

    function handleNavScroll() {
        const currentScroll = window.pageYOffset;
        if (currentScroll > 60) {
            nav.classList.add('scrolled');
        } else {
            nav.classList.remove('scrolled');
        }
        lastScroll = currentScroll;
    }

    window.addEventListener('scroll', handleNavScroll, { passive: true });
    handleNavScroll();

    // ── Mobile menu ──
    const navToggle = document.getElementById('navToggle');
    const mobileMenu = document.getElementById('mobileMenu');
    const mobileOverlay = document.getElementById('mobileOverlay');
    const mobileLinks = mobileMenu.querySelectorAll('a');

    function openMenu() {
        mobileMenu.classList.add('open');
        mobileOverlay.classList.add('open');
        navToggle.classList.add('active');
        document.body.style.overflow = 'hidden';
    }

    function closeMenu() {
        mobileMenu.classList.remove('open');
        mobileOverlay.classList.remove('open');
        navToggle.classList.remove('active');
        document.body.style.overflow = '';
    }

    navToggle.addEventListener('click', function () {
        if (mobileMenu.classList.contains('open')) {
            closeMenu();
        } else {
            openMenu();
        }
    });

    mobileOverlay.addEventListener('click', closeMenu);

    mobileLinks.forEach(function (link) {
        link.addEventListener('click', closeMenu);
    });

    // ── Scroll reveal (below fold only) ──
    const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

    if (!prefersReducedMotion) {
        const reveals = document.querySelectorAll('.reveal');

        function checkReveal() {
            const windowHeight = window.innerHeight;
            reveals.forEach(function (el) {
                const elementTop = el.getBoundingClientRect().top;
                const revealPoint = 120;
                if (elementTop < windowHeight - revealPoint) {
                    el.classList.add('revealed');
                }
            });
        }

        window.addEventListener('scroll', checkReveal, { passive: true });
        // Initial check for elements already in view
        checkReveal();
    } else {
        // If reduced motion preferred, show all reveals immediately
        document.querySelectorAll('.reveal').forEach(function (el) {
            el.classList.add('revealed');
        });
    }

    // ── Contact form ──
    const contactForm = document.getElementById('contactForm');
    const formSuccess = document.getElementById('formSuccess');

    if (contactForm) {
        contactForm.addEventListener('submit', function (e) {
            e.preventDefault();

            // Simple validation
            const name = document.getElementById('name').value.trim();
            const email = document.getElementById('email').value.trim();

            if (!name || !email) {
                return;
            }

            // Hide form, show success
            contactForm.style.display = 'none';
            formSuccess.style.display = 'block';
        });
    }

    // ── Smooth scroll for anchor links ──
    document.querySelectorAll('a[href^="#"]').forEach(function (anchor) {
        anchor.addEventListener('click', function (e) {
            const targetId = this.getAttribute('href');
            if (targetId === '#') return;

            const target = document.querySelector(targetId);
            if (target) {
                e.preventDefault();
                const navHeight = nav ? nav.offsetHeight : 0;
                const targetPosition = target.getBoundingClientRect().top + window.pageYOffset - navHeight - 20;

                window.scrollTo({
                    top: targetPosition,
                    behavior: 'smooth'
                });
            }
        });
    });
})();
