/* Main Styles */

/* Header */
.apple-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.1s ease;
}

/* Scrolled State - Dark Theme (Default) */
/* Scrolled State - No change needed for solid header, but keeping selector if JS uses it */
.apple-nav.scrolled {
    background: rgba(0, 0, 0, 0.8);
}

.apple-nav nav {
    max-width: 996px;
    margin: 0 auto;
    padding: 0 22px;
    position: relative;
    z-index: 101;
    /* Ensure nav stays above menu */
    background: transparent;
}

.apple-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    height: 44px;
    width: 100%;
}

.apple-links a {
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    transition: opacity 0.3s;
    letter-spacing: -0.01em;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    height: 44px;
}

.apple-links a:hover {
    opacity: 1;
}

.apple-logo,
.nav-icon {
    opacity: 0.8;
    color: var(--color-text-main);
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.apple-logo svg,
.nav-icon svg {
    display: block;
    height: 44px;
    width: auto;
}

.theme-btn,
.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    /* Match nav height */
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar {
    display: none;
}

body {
    background-color: var(--color-bg-default);
    /* Fix undefined var */
    /* Background handled by pseudo-element for blur */
    color: var(--color-text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    /* Prevent horizontal scroll from Blur overflow if any */
}



/* Glass Panel Utility (Dark Mode Default) */
/* Industrial Panel Utility */
.glass-panel {
    background: var(--color-bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 40px;
    box-shadow: none;
    transition: border-color var(--transition-sharp);
}

.glass-panel:hover {
    border-color: var(--border-focus);
}

/* Glass Pill (Footer) */
/* Industrial Pill */
.glass-pill {
    background: var(--color-bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 15px 40px;
    width: fit-content;
    margin: 0 auto 40px auto;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 44px;
    position: relative;
    /* Background handled by body */
}

.hero-content {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
    background: transparent;
    padding: 60px 40px;
    border: none;
    box-shadow: none;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.07143;
    letter-spacing: -0.005em;
    margin-bottom: 22px;
    color: var(--color-text-main);
    text-transform: uppercase;
}

.hero p {
    color: inherit;
    font-family: var(--font-body);
    font-size: 21px;
    line-height: 1.38105;
    font-weight: 600;
    letter-spacing: .011em;
    max-width: 780px;
    margin: 0 auto;
}

/* Apple One Banner */
.one-banner {
    background-color: transparent;
    padding: 38px 0;
    width: 100%;
}

.banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 34px;
    max-width: 980px;
    margin: 0 auto;
    background: var(--color-bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 30px 40px;
    transition: border-color var(--transition-sharp);
}

.banner-content:hover {
    border-color: var(--color-primary);
}

.one-logo-group {
    display: flex;
    align-items: center;
    gap: 4px;
    color: inherit;
}

.logo-text {
    font-size: 42px;
    font-weight: 600;
    font-family: var(--font-heading);
    line-height: 1;
    letter-spacing: -0.01em;
}

.one-banner p {
    font-size: 19px;
    line-height: 1.4211;
    font-weight: 600;
    font-family: var(--font-body);
    color: inherit;
    text-align: left;
    letter-spacing: 0.012em;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
    padding: 7px 15px;
    border-radius: 980px;
    /* Small Pill */
    text-decoration: none;
    font-size: 14px;
    font-family: var(--font-body);
    font-weight: 400;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.btn-outline:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-primary);
    color: var(--color-text-main);
    text-decoration: none;
}

/* Discipline Sections - 2 Column Layout */
.section-discipline {
    padding: 100px 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discipline-grid {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.discipline-text {
    text-align: left;
    background: var(--color-bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 60px;
    width: 100%;
    transition: border-color var(--transition-sharp);
}

.discipline-text:hover {
    border-color: var(--color-primary);
}

.discipline-text h2 {
    font-size: 56px;
    margin-bottom: 24px;
    line-height: 1.1;
    color: var(--color-text-main);
    font-family: var(--font-heading);
}

.discipline-text p {
    font-size: 21px;
    color: var(--color-text-muted);
    margin-bottom: 40px;
    line-height: 1.4;
    font-family: var(--font-body);
}

.discipline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.discipline-list li {
    font-size: 19px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    font-family: var(--font-body);
}

.discipline-list li::before {
    content: "+";
    margin-right: 15px;
    font-size: 20px;
    color: var(--color-primary);
    font-weight: 700;
}

.discipline-image {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-card {
    background: var(--color-bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-sharp);
}

.glass-card:hover {
    border-color: var(--color-primary);
}

.alt-bg {
    background-color: transparent;
    /* Changed to transparent for background image */
}

@media (max-width: 768px) {
    .discipline-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .order-mobile-last {
        order: 2;
    }

    .discipline-text h2 {
        font-size: 40px;
    }
}

.center-text {
    text-align: center;
}

/* Animations */
/* Animations - Converted to Transitions for Reversibility */
.digital-typewriter {
    display: inline-block;
    white-space: nowrap;
    margin: 0 auto;
    border-right: 0.10em solid var(--color-primary);
    /* Blinking Cursor only, width handles by JS */
    width: auto;
    animation: blink-caret 0.75s step-end infinite;
    font-family: var(--font-heading);
    color: var(--color-text-main);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.07143;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--color-primary)
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Carousel Layout - Infinite Marquee */
.carousel-container {
    width: 100%;
    /* max-width is optional but good for containing the mask */
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    /* Remove side padding to let mask work fully to edges */

    /* Alpha Mask */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px;
    /* Moved from inline */
    position: relative;
    z-index: 2;
}

.carousel-header h2 {
    font-family: var(--font-heading);
    font-size: 48px;
    color: var(--color-text-main);
    margin: 0;
    /* Moved from inline */
}

/* Controls removed, but styles kept just in case */
.carousel-controls {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 30px;
    width: max-content;
    /* Force width to fit all items */
    padding: 30px 4px;
    /* Maintain vertical padding */

    /* Animation */
    animation: marquee 40s linear infinite;
    will-change: transform;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Move exactly half the content width. 
           (8 cards * 300px) + (7 gaps * 30px) = 2610px total width.
           We want to move 4 cards + 4 gaps = 1320px.
           50% of 2610 is 1305. So we need -15px more.
        */
        transform: translateX(calc(-50% - 15px));
    }
}

/* Tool Cards */
.tool-card {
    flex: 0 0 300px;
    height: auto;
    background: var(--color-bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.1s;
}

.tool-card:hover {
    border-color: var(--color-primary);
    transform: none;
    box-shadow: none;
}

/* Hide the image container if it's just space now */
.tool-card .card-image {
    display: none;
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-card h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--color-text-main);
    text-transform: uppercase;
    font-weight: 700;
}

.course-meta {
    font-family: var(--font-body);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.contact-btn {
    margin-top: 20px;
    display: inline-block;
}

/* Mobile Menu */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-bg-default);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
}

.mobile-menu.open {
    max-height: 300px;
    /* Increased for more items */
    border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu-links {
    list-style: none;
    padding: 20px 40px;
    margin: 0 auto;
    max-width: 980px;
}

.mobile-menu-links li {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.mobile-menu-links li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.mobile-menu-links a {
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 16px;
    font-family: var(--font-body);
    font-weight: 500;
    display: block;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.open .mobile-menu-links a {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}



/* Modal Styles */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 20px;
}

#modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    text-align: center;
}

#modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 32px;
    color: var(--color-text-main);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.modal-desc {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 30px;
}

.modal-action {
    display: inline-block;
    padding: 12px 32px;
    background: #fff;
    color: #000;
    text-decoration: none;
    border-radius: 980px;
    font-weight: 500;
    font-size: 17px;
    transition: transform 0.2s, background-color 0.2s;
}

.modal-action:hover {
    transform: scale(1.05);
    background: #f5f5f7;
    text-decoration: none;
    color: #000;
}

body.light-theme .modal-action {
    background: #1d1d1f;
    color: #fff;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 24px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #fff;
}

/* Light Theme Modal Overrides */
/* Removed legacy modal overrides */

/* Premium Border Animation */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.modal-content.premium-border {
    position: relative;
    /* Remove standard border to let animation shine, or keep it subtle */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
    /* Subtle red glow */
}

.modal-content.premium-border::after,
.modal-content.premium-border::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    z-index: -1;
    padding: 2px;
    /* Border width */
    border-radius: var(--radius-md);
    /* Matches modal radius + padding */
    background: conic-gradient(from var(--angle), transparent 70%, var(--color-primary));
    animation: 3s spin linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.modal-content.premium-border::before {
    filter: blur(10px);
    opacity: 0.5;
    /* Glow effect */
}

@keyframes spin {
    from {
        --angle: 0deg;
    }

    to {
        --angle: 360deg;
    }
}

/* Light Mode Header Override (Restored for Apple-style) */
body.light-theme .apple-nav {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .apple-nav.scrolled {
    background: rgba(255, 255, 255, 0.8);
}