@import url('design-tokens.css');

/* ================================
   2. RESET / NORMALIZE
   ================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: var(--leading-normal);
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-weight: var(--font-normal);
    line-height: inherit;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   3. BASE STYLES
   ================================ */
a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
    color: var(--color-accent);
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    font: inherit;
}

/* ================================
   4. TYPOGRAPHY
   ================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-medium);
    color: var(--color-accent);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    letter-spacing: var(--tracking-wide);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

.text-lead {
    font-size: var(--text-xl);
    font-weight: var(--font-light);
    color: var(--color-text-primary);
    margin-bottom: var(--space-6);
}

.text-emphasis {
    font-size: var(--text-2xl);
    font-family: var(--font-display);
    color: var(--color-gold);
    text-align: center;
    margin: var(--space-8) 0;
}

small {
    font-size: var(--text-sm);
}

[lang="he"] {
    font-family: var(--font-hebrew);
}

/* ================================
   5. LAYOUT & GRID
   ================================ */
.main {
    width: 100%;
    overflow-x: hidden;
}

.section {
    position: relative;
    padding: var(--section-padding-y) 0;
    width: 100%;
    min-height: 80vh;
    /* Basic min height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section__container {
    width: 100%;
    max-width: var(--content-width-medium);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
    position: relative;
    z-index: var(--z-default);
}

.section__container--centered {
    text-align: center;
    align-items: center;
}

.section__header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section__title {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-2);
}

.section__content {
    margin-bottom: var(--space-12);
}

.section__content p:last-child {
    margin-bottom: 0;
}

/* ================================
   6. COMPONENTS
   ================================ */

/* 6.1 Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: var(--z-header);
    transition: background-color var(--duration-normal) var(--ease-smooth),
        transform var(--duration-normal) var(--ease-smooth);
}

.header--scrolled {
    background-color: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 168, 83, 0.1);
}

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

.nav__logo {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--color-gold);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.nav__list {
    display: flex;
    gap: var(--space-8);
    list-style: none;
}

.nav__link {
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-secondary);
    position: relative;
    padding: var(--space-2) 0;
}

.nav__link:hover,
.nav__link--active {
    color: var(--color-white);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: var(--color-gold);
    transition: all var(--duration-fast) var(--ease-smooth);
    transform: translateX(-50%);
}

.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

/* Language Switcher */
.language-switcher {
    position: relative;
    margin-left: var(--space-6);
}

.language-switcher__button {
    background: transparent;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: var(--space-2) var(--space-4);
    border-radius: 4px;
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    letter-spacing: var(--tracking-widest);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.language-switcher__button:hover {
    background: var(--color-gold);
    color: var(--color-midnight);
}

.language-switcher__menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    padding: var(--space-2);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--duration-fast) var(--ease-smooth);
    z-index: var(--z-dropdown);
}

.language-switcher__menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher__option {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    border-radius: 2px;
}

.language-switcher__option:hover {
    background: rgba(212, 168, 83, 0.1);
    color: var(--color-gold);
}

.language-switcher__option.active {
    color: var(--color-gold);
    font-weight: var(--font-medium);
}

/* 6.2 Hero Section */
.section--hero {
    height: 100vh;
    min-height: 700px;
    padding: 0;
    overflow: hidden;
}

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    /* For parallax */
    background-image: linear-gradient(rgba(10, 14, 26, 0.4), var(--color-midnight)), url('../assets/images/hero/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: var(--z-background);
}

.hero__content {
    position: relative;
    z-index: var(--z-default);
    text-align: center;
    max-width: var(--content-width-narrow);
    padding: 0 var(--content-padding-x);
}

.hero__hebrew {
    font-size: var(--text-4xl);
    color: var(--color-gold);
    /* Fallback */
    margin-bottom: var(--space-4);
    background: linear-gradient(90deg,
            var(--color-gold) 0%,
            var(--color-amber) 25%,
            var(--color-honey) 50%,
            var(--color-amber) 75%,
            var(--color-gold) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 8s linear infinite;
}

.hero__title {
    font-size: var(--text-7xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
    background: var(--gradient-text-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: var(--shadow-text-glow);
}

.hero__subtitle {
    font-family: var(--font-accent);
    font-size: var(--text-xl);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.hero__scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    animation: scroll-bounce 2s ease-in-out infinite;
    animation-delay: 2s;
    transition: color var(--duration-normal) var(--ease-smooth);
}

.hero__scroll-indicator:hover {
    color: var(--color-gold);
    animation-play-state: paused;
}

.hero__scroll-indicator:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 8px;
    border-radius: 4px;
}

.hero__scroll-text {
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
}


/* 6.3 Starfield Canvas */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

/* 6.4 Scripture Quotes */
.scripture-quote {
    font-family: var(--font-body);
    font-style: italic;
    font-size: var(--text-2xl);
    color: var(--color-honey);
    text-align: center;
    max-width: 40rem;
    margin: var(--space-12) auto;
    padding: var(--space-8);
    position: relative;
    line-height: var(--leading-loose);
    transition: transform var(--duration-slow) var(--ease-elegant);
}

.scripture-quote:hover {
    transform: scale(1.02);
}

.scripture-quote::before,
.scripture-quote::after {
    content: '"';
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    color: var(--color-gold);
    opacity: 0.3;
    position: absolute;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.scripture-quote:hover::before,
.scripture-quote:hover::after {
    color: var(--color-amber);
    text-shadow: 0 0 20px rgba(212, 168, 83, 0.5);
    opacity: 1;
}

.scripture-quote::before {
    top: 0;
    left: -1rem;
}

.scripture-quote::after {
    bottom: 0;
    right: -1rem;
}

.scripture-quote__reference {
    display: block;
    margin-top: var(--space-4);
    font-style: normal;
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    color: var(--color-gray-warm);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
}

/* 6.5 Images */
.section__figure {
    margin: var(--space-12) 0;
    text-align: center;
}

.image-frame {
    position: relative;
    border: 1px solid var(--color-gold);
    padding: var(--space-2);
    background: rgba(212, 168, 83, 0.05);
    display: inline-block;
    max-width: 100%;
    transition: box-shadow var(--duration-normal) var(--ease-smooth);
}

.image-frame:hover {
    box-shadow: var(--glow-gold);
}

.image-frame::before {
    content: '';
    position: absolute;
    inset: var(--space-2);
    border: 1px solid rgba(212, 168, 83, 0.3);
    pointer-events: none;
    z-index: 1;
}

.image-placeholder {
    width: 100%;
    height: 100%;
}

.section__figcaption {
    margin-top: var(--space-4);
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* 6.6 Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: var(--space-16) auto;
    padding: var(--space-8) 0;
}

.timeline__line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--color-gold);
    transform: translateX(-50%);
    opacity: 0.3;
}

.timeline__item {
    position: relative;
    margin-bottom: var(--space-12);
    width: 50%;
    padding-right: var(--space-8);
    text-align: right;
    clear: both;
}

.timeline__item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: var(--space-8);
    text-align: left;
}

.timeline__marker {
    position: absolute;
    top: 0;
    right: -5px;
    /* Half of width (10px) but offset? No, right: -5px relative to 50% width box puts it at center */
    width: 10px;
    height: 10px;
    background: var(--color-gold);
    border-radius: 50%;
    box-shadow: var(--glow-gold);
    z-index: 2;
}

.timeline__item:nth-child(even) .timeline__marker {
    right: auto;
    left: -5px;
}

.timeline__date {
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    color: var(--color-gold);
    margin-bottom: var(--space-2);
    display: block;
}

.timeline__title {
    font-size: var(--text-xl);
    color: var(--color-white);
    margin-bottom: var(--space-2);
}

.timeline__text {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
}

/* 6.7 Dividers */
.divider-ornate {
    height: 30px;
    width: 100%;
    max-width: 300px;
    margin: var(--space-16) auto;
    background-image: url('../assets/images/decorative/divider-ornate.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: relative;
    border: none;
    /* Remove any border if present */
}

.divider-ornate::before {
    display: none;
}

/* 6.8 Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 50px;
    height: 50px;
    background: rgba(212, 168, 83, 0.9);
    border: 1px solid var(--color-gold);
    border-radius: 50%;
    color: var(--color-midnight);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--duration-normal) var(--ease-elegant);
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

.scroll-to-top:hover {
    background: var(--color-gold);
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.scroll-to-top:active {
    transform: translateY(0);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top__text {
    font-family: var(--font-hebrew);
    font-size: 28px;
    font-weight: var(--font-bold);
    line-height: 1;
    color: var(--color-midnight);
}

.scroll-to-top:hover .scroll-to-top__text {
    color: var(--color-midnight);
}


/* ================================
   7. SECTION-SPECIFIC STYLES
   ================================ */

/* Section 1: Hero (handled in components) */

/* Section 2: Encounter */
.section--encounter {
    background: linear-gradient(180deg, var(--color-midnight) 0%, var(--color-twilight) 100%);
}

.section--encounter .text-lead {
    border-left: 2px solid var(--color-gold);
    padding-left: var(--space-6);
}

/* Section 3: History */
.section--history {
    background-color: #0d121f;
    /* Slightly lighter midnight */
    background-image: linear-gradient(rgba(13, 18, 31, 0.85), rgba(13, 18, 31, 0.95)), url('../assets/images/sections/landscape-gilead.jpg');
    background-size: cover;
    background-position: center;
}

/* Section 4: Gateway */
.section--gateway {
    background: radial-gradient(circle at center, #1a1f3c 0%, #0a0e1a 100%);
    overflow: hidden;
}

.section--gateway::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 50%, rgba(107, 91, 122, 0.15), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.section--gateway .content-block {
    margin-bottom: var(--space-16);
    padding: var(--space-8);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    max-width: 50rem;
    margin-left: auto;
    margin-right: auto;
    transition: transform var(--duration-slow) var(--ease-elegant),
        background var(--duration-slow) var(--ease-elegant);
}

.section--gateway .content-block:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-5px);
}

.content-block__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--color-honey);
    margin-bottom: var(--space-4);
    text-align: center;
}

/* Section 5: Reflections */
.section--reflections {
    background-image: linear-gradient(rgba(10, 14, 26, 0.6), rgba(0, 0, 0, 0.7)), url('../assets/images/sections/reflections-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 60vh;
}

.meditation {
    text-align: center;
    font-size: var(--text-lg);
    color: var(--color-sand);
}

.meditation__line {
    margin-bottom: var(--space-2);
    transition: color var(--duration-slow) var(--ease-smooth);
}

.meditation__line--emphasis {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--color-gold);
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}

.blessing {
    text-align: center;
    margin-top: var(--space-12);
}

.blessing__hebrew {
    font-family: var(--font-hebrew);
    font-size: var(--text-4xl);
    color: var(--color-gold);
    margin-bottom: var(--space-2);
    text-shadow: var(--shadow-text-glow);
}

.blessing__transliteration {
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.blessing__translation {
    font-style: italic;
    color: var(--color-white);
}

/* Footer Style */
.footer {
    padding: var(--space-12) 0;
    background-color: #000000;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__title {
    font-family: var(--font-display);
    letter-spacing: var(--tracking-widest);
    color: var(--color-gold);
    margin-bottom: var(--space-2);
}

.footer__hebrew {
    font-size: var(--text-2xl);
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
}

.footer__attribution {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.footer__links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer__links a {
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-secondary);
}

.footer__links a:hover {
    color: var(--color-gold);
}


/* ================================
   8. ANIMATIONS & KEYFRAMES
   ================================ */
@keyframes text-shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes scroll-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(10px) translateX(-50%);
    }

    60% {
        transform: translateY(5px) translateX(-50%);
    }
}

/* Apple-Style Scroll Animations */
[data-animate] {
    will-change: transform, opacity;
    backface-visibility: hidden;
    /* Initial state set by JavaScript for bidirectional animation */
}

/* Hero enhancements for fade effect */
.hero__content {
    will-change: transform, opacity;
}

.hero__background {
    will-change: transform, opacity;
}

/* Parallax elements */
[data-parallax] {
    will-change: transform;
}


/* ================================
   9. MEDIA QUERIES
   ================================ */
@media (max-width: 768px) {
    .hero__title {
        font-size: var(--text-5xl);
    }

    .timeline::before {
        left: 20px;
    }

    .timeline__line {
        left: 20px;
    }

    .timeline__item {
        width: 100%;
        padding-left: var(--space-12);
        padding-right: 0;
        text-align: left;
    }

    .timeline__item:nth-child(even) {
        margin-left: 0;
        padding-left: var(--space-12);
    }

    .timeline__marker {
        left: 15px;
        right: auto;
    }

    .timeline__item:nth-child(even) .timeline__marker {
        left: 15px;
        right: auto;
    }

    /* Mobile Navigation */
    .nav__mobile-toggle {
        display: block !important;
        /* Override hidden attribute if present via CSS */
        background: transparent;
        border: none;
        color: var(--color-gold);
        z-index: var(--z-overlay);
        padding: var(--space-2);
    }

    .nav__mobile-icon {
        display: block;
        width: 24px;
        height: 2px;
        background: currentColor;
        position: relative;
        transition: background var(--duration-fast);
    }

    .nav__mobile-icon::before,
    .nav__mobile-icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 100%;
        background: currentColor;
        transition: transform var(--duration-normal);
    }

    .nav__mobile-icon::before {
        top: -8px;
    }

    .nav__mobile-icon::after {
        bottom: -8px;
    }

    /* Active State for Icon */
    .nav-open .nav__mobile-icon {
        background: transparent;
    }

    .nav-open .nav__mobile-icon::before {
        transform: rotate(45deg);
        top: 0;
    }

    .nav-open .nav__mobile-icon::after {
        transform: rotate(-45deg);
        bottom: 0;
    }

    .nav__list {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(10, 14, 26, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        padding: var(--space-8);
        transform: translateX(100%);
        transition: transform var(--duration-normal) var(--ease-elegant);
        border-left: 1px solid var(--color-gold);
        z-index: var(--z-dropdown);
    }

    .nav-open .nav__list {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }
}

/* ================================
   10. UTILITIES
   ================================ */

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-gold);
    color: var(--color-midnight);
    padding: var(--space-4) var(--space-6);
    text-decoration: none;
    font-weight: var(--font-bold);
    z-index: var(--z-overlay);
    transition: top var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
    top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================
   REDUCED MOTION
   ================================ */
@media (prefers-reduced-motion: reduce) {

    [data-animate],
    [data-parallax],
    .hero__content,
    .hero__background {
        will-change: auto;
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
    }

    .hero__scroll-indicator {
        animation: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

```