/* ============================================
   TSN Website - Custom Styles
   Converted from React/Next.js to Static HTML/CSS
   ============================================ */

/* Root Variables */
:root {
    /* TSN Design Tokens */
    --void: #050505;
    --surface: #F7F6F3;
    --surface2: #EDEBE6;
    --electric: #0047E1;
    --lead: #5C5C5C;
    --rule: #D8D5CE;
    --rule-inv: rgba(255, 255, 255, 0.1);
    
    /* Font Variables */
    --font-display: 'Cormorant Garamond', serif;
    --font-label: 'Bebas Neue', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--void);
    color: var(--surface);
    overflow-x: hidden;
    line-height: 1.6;
}

body::selection {
    background-color: var(--electric);
    color: white;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
}

.hero-title {
    font-size: clamp(72px, 10vw, 156px);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -3px;
}

.section-h2 {
    font-size: clamp(44px, 5.5vw, 88px);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -2px;
    line-height: 1.1;
}

.section-h3 {
    font-size: clamp(22px, 2vw, 32px);
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
}

.label-caps {
    font-family: var(--font-label);
    font-size: 11px;
    letter-spacing: 6px;
    text-transform: uppercase;
}

.body-text {
    font-size: 15px;
    font-weight: 300;
    line-height: 1.85;
    color: var(--lead);
}

/* Utility Classes */
.content-max {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .content-max {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .content-max {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .content-max {
        padding-left: 3.5rem;
        padding-right: 3.5rem;
    }
}

@media (min-width: 1280px) {
    .content-max {
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

.section-py {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

@media (min-width: 640px) {
    .section-py {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

@media (min-width: 768px) {
    .section-py {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

@media (min-width: 1024px) {
    .section-py {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: var(--rule-inv);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--electric);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .custom-cursor {
        display: block;
    }
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 71, 225, 0.1);
}

/* Navigation Styles */
#navbar {
    backdrop-filter: blur(12px);
}

#navbar.scrolled {
    background-color: rgba(5, 5, 5, 0.95);
    border-bottom-color: var(--rule-inv);
}

/* Mobile Menu */
.mobile-menu-hidden {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.mobile-menu-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.hamburger-menu-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.hamburger-menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Hero Section */
#hero {
    position: relative;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-eyebrow,
.hero-logo,
.hero-subhead,
.hero-cta {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-eyebrow {
    animation-delay: 0.2s;
}

.hero-logo {
    animation-delay: 0.4s;
}

.hero-subhead {
    animation-delay: 0.6s;
}

.hero-cta {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Bar Animation */
.stats-bar {
    transform: translateY(100%);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

/* Scroll Indicator Animation */
.scroll-indicator {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Decorative Sphere Animation */
.decorative-sphere > div {
    animation: rotate360 24s linear infinite;
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pillar Items Hover */
.pillar-item {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.pillar-item:hover {
    transform: translateX(10px);
}

/* Program Cards */
.program-card {
    transition: all 0.3s ease;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Timeline Items */
.timeline-item {
    position: relative;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Testimonial Cards */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Team & Advisor Cards */
.team-card,
.advisor-card {
    transition: transform 0.3s ease;
}

.team-card:hover,
.advisor-card:hover {
    transform: scale(1.05);
}

/* Scroll to Top Button */
#scroll-to-top {
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(100px);
}

#scroll-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Smooth Transitions */
a,
button {
    transition: all 0.3s ease;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Loading Animation for Images */
img {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--electric);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .custom-cursor,
    #navbar,
    #scroll-to-top,
    .scroll-indicator {
        display: none;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Already dark by default */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --void: #000000;
        --surface: #FFFFFF;
        --electric: #0055FF;
    }
}

/* Additional Hover Effects */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--electric);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
    transform: translateX(0);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .section-h2 {
        font-size: clamp(32px, 8vw, 44px);
    }
    
    .content-max {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-max {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Desktop Enhancements */
@media (min-width: 1920px) {
    .content-max {
        max-width: 1600px;
    }
}

/* Performance Optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU Acceleration for Animations */
.hero-logo,
.magnetic-btn,
.program-card,
.decorative-sphere > div {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Prevent Layout Shift */
.hero-logo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

/* Loading State */
body.loading {
    overflow: hidden;
}

body.loading::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--void);
    z-index: 10000;
    animation: fadeOut 0.5s 0.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}
