/* ===========================================
   CLEAR DIRECTION SCHOOLS
   Global Stylesheet — Premium Edition
   =========================================== */

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

:root {
    /* Colors */
    --cds-navy: #1B2A4A;
    --cds-navy-deep: #0F1B32;
    --cds-navy-light: #243656;
    --cds-gold: #C8963E;
    --cds-gold-light: #D4A85A;
    --cds-stone: #E8E2D8;
    --cds-dark: #1A1A2E;
    --cds-text: #4A4A5A;
    --cds-text-light: #6B6B7B;
    --cds-bg: #F7F5F2;
    --cds-white: #FFFFFF;
    --cds-border: rgba(27, 42, 74, 0.08);

    /* Typography */
    --heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing — generous for luxury feel */
    --section-pad: clamp(100px, 14vw, 200px);
    --container-max: 1200px;
    --container-wide: 1400px;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--cds-navy) var(--cds-bg);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cds-bg); }
::-webkit-scrollbar-thumb { background: var(--cds-navy); border-radius: 0; }

body {
    font-family: var(--body);
    color: var(--cds-text);
    line-height: 1.75;
    background: var(--cds-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Film grain overlay — subtle warmth */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* --- Typography Scale --- */
h1, h2, h3, h4 { font-family: var(--heading); color: var(--cds-dark); line-height: 1.15; }

h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(2.2rem, 4.5vw, 3.5rem); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); font-weight: 600; letter-spacing: -0.005em; }
h4 { font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 3px; }

p { font-size: clamp(1rem, 1.1vw, 1.15rem); margin-bottom: 1.5rem; }
p:last-child { margin-bottom: 0; }

/* --- Utility --- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 clamp(1.5rem, 4vw, 3rem); }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 clamp(1.5rem, 4vw, 3rem); }

.overline {
    font-family: var(--body);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--cds-gold);
    margin-bottom: 1.5rem;
    display: block;
}

/* --- Buttons — refined --- */
.btn {
    font-family: var(--body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    padding: 1.1rem 2.8rem;
    border: 1.5px solid var(--cds-navy);
    color: var(--cds-navy);
    background: transparent;
    display: inline-block;
    transition: all 0.5s var(--ease-out-expo);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--cds-navy);
    transition: left 0.5s var(--ease-out-expo);
    z-index: -1;
}
.btn:hover { color: var(--cds-white); }
.btn:hover::before { left: 0; }

.btn-gold {
    border-color: var(--cds-gold);
    color: var(--cds-gold);
}
.btn-gold::before { background: var(--cds-gold); }
.btn-gold:hover { color: var(--cds-white); }

.btn-solid {
    background: var(--cds-navy);
    color: var(--cds-white);
    border-color: var(--cds-navy);
}
.btn-solid::before { background: var(--cds-navy-light); }
.btn-solid:hover { background: var(--cds-navy-light); border-color: var(--cds-navy-light); color: var(--cds-white); }

.btn-white {
    border-color: rgba(255,255,255,0.4);
    color: var(--cds-white);
}
.btn-white::before { background: var(--cds-white); }
.btn-white:hover { color: var(--cds-navy); }

/* --- Scroll Reveal — slow and deliberate --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.4s var(--ease-out-expo), transform 1.4s var(--ease-out-expo);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.2s; }
.reveal-delay-2 { transition-delay: 0.4s; }
.reveal-delay-3 { transition-delay: 0.6s; }

/* --- Gold Accent Line (decorative utility) --- */
.accent-line {
    width: 40px;
    height: 1px;
    background: var(--cds-gold);
    display: block;
}
.accent-line-center { margin: 0 auto; }

/* ===========================================
   NAVIGATION
   =========================================== */
#mainNav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 3rem;
    transition: all 0.6s var(--ease-out-expo);
    background: transparent;
}
#mainNav.scrolled {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.2rem 3rem;
    box-shadow: 0 1px 30px rgba(0,0,0,0.04);
}

.nav-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-wordmark {
    font-family: var(--body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--cds-white);
    text-decoration: none;
    transition: color 0.6s var(--ease-out-expo);
}
#mainNav.scrolled .nav-wordmark { color: var(--cds-navy); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-link {
    font-family: var(--body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.4s ease;
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--cds-gold);
    transition: width 0.5s var(--ease-out-expo);
}
.nav-link:hover { color: var(--cds-white); }
.nav-link:hover::after { width: 100%; }
#mainNav.scrolled .nav-link { color: var(--cds-text-light); }
#mainNav.scrolled .nav-link:hover { color: var(--cds-navy); }

.nav-cta {
    font-family: var(--body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 0.75rem 2rem;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--cds-white);
    transition: all 0.5s var(--ease-out-expo);
}
.nav-cta:hover { background: var(--cds-white); color: var(--cds-navy); border-color: var(--cds-white); }
#mainNav.scrolled .nav-cta {
    border-color: var(--cds-navy);
    color: var(--cds-navy);
}
#mainNav.scrolled .nav-cta:hover {
    background: var(--cds-navy);
    color: var(--cds-white);
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}
.nav-hamburger span {
    width: 26px;
    height: 1px;
    background: var(--cds-white);
    transition: all 0.4s var(--ease-out-expo);
}
#mainNav.scrolled .nav-hamburger span { background: var(--cds-navy); }
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 4px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -4px); }

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 340px;
    height: 100vh;
    background: var(--cds-navy-deep);
    z-index: 999;
    padding: 7rem 3rem 3rem;
    transition: right 0.6s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.mobile-menu.active { right: 0; }
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-menu a {
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: block;
    transition: all 0.4s ease;
}
.mobile-menu a:hover { color: var(--cds-gold); padding-left: 0.5rem; }

/* ===========================================
   FOOTER
   =========================================== */
footer {
    background: var(--cds-navy-deep);
    color: rgba(255,255,255,0.5);
    padding: clamp(4rem, 6vw, 6rem) 0;
}
.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
}
.footer-brand .nav-wordmark {
    font-size: 0.75rem;
    letter-spacing: 4px;
    margin-bottom: 1.2rem;
    display: block;
    color: rgba(255,255,255,0.8);
}
.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.35);
}
.footer-contact p {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 0.3rem;
    color: rgba(255,255,255,0.35);
}
.footer-contact a {
    color: rgba(255,255,255,0.5);
    transition: color 0.4s;
}
.footer-contact a:hover { color: var(--cds-gold); }
.footer-legal {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: clamp(2.5rem, 4vw, 4rem) clamp(1.5rem, 4vw, 3rem) 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: clamp(3rem, 4vw, 4rem);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.2);
}

/* ===========================================
   FORM MODAL
   =========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 27, 50, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--ease-out-expo);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--cds-white);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.5s var(--ease-out-expo);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
    padding: 2.5rem 2.5rem 1.2rem;
    border-bottom: 1px solid var(--cds-border);
}
.modal-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}
.modal-header p {
    font-size: 0.95rem;
    color: var(--cds-text-light);
}
.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.8rem;
    font-size: 1.5rem;
    color: var(--cds-text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}
.modal-close:hover { color: var(--cds-dark); }
.modal-body { padding: 2rem 2.5rem 2.5rem; }
.modal-body iframe { width: 100%; border: none; min-height: 450px; }

/* Page load animation is now handled by hero inline styles (shutter effect) */

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 968px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .footer-inner { flex-direction: column; gap: 2rem; }
}

@media (max-width: 768px) {
    #mainNav { padding: 1.2rem 1.5rem; }
    #mainNav.scrolled { padding: 0.8rem 1.5rem; }
    .modal { width: 95%; }
    .modal-header { padding: 1.5rem 1.5rem 1rem; }
    .modal-body { padding: 1rem 1.5rem 1.5rem; }
}
