* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #c9a84c;
    --ice: #7ab4cc;
    --text: #d6ccbb;
    --dim: rgba(214,204,187,0.5);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#scroller {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background: #080b12;
}

#scroller::-webkit-scrollbar {
    display: none;
}

#scroller {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.page {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 60px 40px;
}

.aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

#page-counter {
    position: fixed;
    top: 24px;
    right: 28px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: rgba(201,168,76,0.6);
    z-index: 1000;
}

#dot-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: var(--gold);
    box-shadow: 0 0 8px rgba(201,168,76,0.6);
}

.scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    animation: hintPulse 2.5s ease-in-out infinite;
    z-index: 10;
}

.scroll-hint span {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--gold);
}

.hint-arrow {
    width: 14px;
    height: 14px;
    border-right: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
    transform: rotate(45deg);
}

@keyframes hintPulse {
    0%,100%{opacity:.3;transform:translateX(-50%) translateY(0)} 50%{opacity:.6;transform:translateX(-50%) translateY(5px)}
}

.page:last-child .scroll-hint {
    display: none;
}

/* HERO */
#p0 {
  background: #080b12;
  text-align: center;
  background-image: url('images/NACHALO.jpg');
  background-size: cover;
  background-position: center;
}

#p0::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

#p0 .aurora {
    background: radial-gradient(ellipse 100% 60% at 50% 0%,rgba(20,70,50,.5) 0%,transparent 70%),radial-gradient(ellipse 80% 40% at 30% 0%,rgba(30,60,100,.35) 0%,transparent 60%),radial-gradient(ellipse 60% 30% at 70% 5%,rgba(80,20,80,.25) 0%,transparent 60%);
    animation: auroraShift 10s ease-in-out infinite alternate;
}

@keyframes auroraShift {
    0%{opacity:.7;filter:blur(30px)} 100%{opacity:1;filter:blur(50px)}
}

.hero-eyebrow {
    position:relative;
    z-index:1;
    font-family:'Bebas Neue',sans-serif;
    letter-spacing:.4em;
    font-size:.8rem;
    color:var(--gold);
    opacity:.8;
    margin-bottom:20px;
    animation:fadeUp 1s ease .3s both;
}

.hero-title {
    position:relative;
    z-index:1;
    font-family:'Playfair Display',serif;
    font-weight:900;
    font-size:clamp(3.5rem,12vw,8rem);
    line-height:.9;
    color:#fff;
    text-shadow:0 0 100px rgba(201,168,76,.25);
    animation:fadeUp 1s ease .5s both;
}

.hero-title em {
    display:block;
    color:var(--gold);
    font-style:normal;
}

.hero-sub {
    position:relative;
    left:125px;
    z-index:1;
    font-family:'Crimson Pro',serif;
    font-style:italic;
    font-size:clamp(1rem,2vw,1.3rem);
    color:var(--ice);
    opacity:.8;
    margin-top:24px;
    max-width:500px;
    line-height:1.65;
    animation:fadeUp 1s ease .7s both;
    /* margin-left: auto; */
    margin-right: auto;
}

/* FACTS */
#p1 {
    background: #09101a;
}

#p1 .aurora {
    background: radial-gradient(ellipse 120% 50% at 50% 100%,rgba(20,50,90,.4) 0%,transparent 70%);
}

.facts-title {
    font-family:'Bebas Neue',sans-serif;
    font-size:1.1rem;
    letter-spacing:.4em;
    color:var(--gold);
    opacity:.7;
    margin-bottom:50px;
    position:relative;
    z-index:1;
    text-align:center;
}

.facts-grid {
    position:relative;
    z-index:1;
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:2px;
    width:100%;
    max-width:900px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    border-radius:6px;
    overflow:hidden;
}

.fact {
    background:rgba(10,15,25,.9);
    padding:32px 20px;
    text-align:center;
}

.fact-num {
    display:block;
    font-family:'Bebas Neue',sans-serif;
    font-size:clamp(2.2rem,4vw,3rem);
    color:var(--gold);
    line-height:1;
}

.fact-label {
    font-family:'Crimson Pro',serif;
    font-size:.9rem;
    color:var(--dim);
    margin-top:8px;
    line-height:1.5;
}

/* EPOCH PAGES */
.epoch-page {
    align-items:flex-start;
    padding:0;
}

.epoch-split {
    position:relative;
    z-index:1;
    width:100%;
    height:100%;
    display:grid;
    grid-template-columns:320px 1fr;
}

.epoch-left {
    border-right:1px solid rgba(255,255,255,.06);
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    padding:50px 36px;
    position:relative;
    overflow:hidden;
}

.epoch-num {
    font-family:'Bebas Neue',sans-serif;
    font-size:clamp(5rem,14vw,10rem);
    line-height:1;
    color:rgba(255,255,255,.04);
    position:absolute;
    top:20px;
    left:20px;
    user-select:none;
}

.epoch-period {
    font-family:'Bebas Neue',sans-serif;
    letter-spacing:.3em;
    font-size:.75rem;
    margin-bottom:10px;
}

.epoch-name {
    font-family:'Playfair Display',serif;
    font-weight:700;
    font-size:clamp(1.4rem,2.5vw,2rem);
    color:#fff;
    line-height:1.2;
    margin-bottom:24px;
}

.epoch-desc {
    font-family:'Crimson Pro',serif;
    font-weight:300;
    font-size:.95rem;
    color:var(--dim);
    line-height:1.8;
}

.epoch-right {
    padding:40px 50px 40px 36px;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:8px;
    justify-content:center;
    position: relative;
  background-size: cover;
  background-position: center;
  transition: background-image 0.6s ease;
}

.epoch-right::-webkit-scrollbar {
    width:3px;
}

.epoch-right::-webkit-scrollbar-thumb {
    background:rgba(255,255,255,.1);
}

.epoch-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.65);
  z-index: 0;
  transition: opacity 0.4s ease;
}

.epoch-right .event {
  position: relative;
  z-index: 1;
}

.epoch-right-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 0;
}

.event {
    border:1px solid rgba(255,255,255,.06);
    border-radius:4px;
    background:rgba(10,15,25,.7);
    cursor:pointer;
    transition:border-color .2s,background .2s;
    overflow:hidden;
}

.event:hover {
    background:rgba(15,22,38,.9);
}

.event.open {
    border-color:var(--accent);
}

.event-head {
    display:flex;
    align-items:center;
    gap:16px;
    padding:13px 18px;
}

.event-year {
    font-family:'Bebas Neue',sans-serif;
    font-size:1rem;
    letter-spacing:.05em;
    min-width:55px;
    flex-shrink:0;
}

.event-title {
    font-family:'Crimson Pro',serif;
    font-size:1rem;
    font-weight:400;
    color:var(--text);
    flex:1;
    line-height:1.3;
}

.event-arrow {
    font-size:.6rem;
    color:rgba(255,255,255,.25);
    flex-shrink:0;
    transition:transform .25s;
}

.event.open .event-arrow {
    transform:rotate(180deg);
}

.event-body {
    max-height:0;
    overflow:hidden;
    transition:max-height .4s cubic-bezier(.4,0,.2,1);
}

.event.open .event-body {
    max-height:200px;
}

.event-text {
    padding:0 18px 16px 89px;
    font-family:'Crimson Pro',serif;
    font-size:.92rem;
    font-weight:300;
    line-height:1.75;
    color:rgba(214,204,187,.75);
}

/* EPOCH THEMES */
#p2{--accent:#c9a84c} #p2 .aurora{background:radial-gradient(ellipse 100% 80% at 0% 50%,rgba(100,70,10,.2) 0%,transparent 60%)} #p2 .epoch-period{color:#c9a84c} #p2 .event-year{color:#c9a84c}
#p3{--accent:#7ab4cc} #p3 .aurora{background:radial-gradient(ellipse 100% 80% at 0% 50%,rgba(10,60,100,.2) 0%,transparent 60%)} #p3 .epoch-period{color:#7ab4cc} #p3 .event-year{color:#7ab4cc}
#p4{--accent:#d05555} #p4 .aurora{background:radial-gradient(ellipse 100% 80% at 0% 50%,rgba(100,15,15,.2) 0%,transparent 60%)} #p4 .epoch-period{color:#d05555} #p4 .event-year{color:#d05555}
#p5{--accent:#4db87a} #p5 .aurora{background:radial-gradient(ellipse 100% 80% at 0% 50%,rgba(10,90,40,.2) 0%,transparent 60%)} #p5 .epoch-period{color:#4db87a} #p5 .event-year{color:#4db87a}
/* OUTRO */
#p6 {
    background:#070a10;
    text-align:center;
}
#p6 .aurora {
    background:radial-gradient(ellipse 120% 70% at 50% 100%,rgba(30,20,60,.5) 0%,transparent 70%);
}

.outro-label {
    font-family:'Bebas Neue',sans-serif;
    letter-spacing:.4em;
    font-size:.75rem;
    color:var(--gold);
    opacity:.6;
    margin-bottom:20px;
    position:relative;
    z-index:1;
}

.outro-title {
    font-family:'Playfair Display',serif;
    font-weight:900;
    font-size:clamp(1.8rem,5vw,3.5rem);
    color:#fff;
    line-height:1.2;
    max-width:700px;
    position:relative;
    z-index:1;
    margin-bottom:30px;
}

.outro-body {
    font-family:'Crimson Pro',serif;
    font-style:italic;
    font-size:clamp(.95rem,1.5vw,1.15rem);
    color:var(--dim);
    max-width:560px;
    line-height:1.8;
    position:relative;
    z-index:1;
    margin-bottom:50px;
}

.outro-footer {
    font-family:'Bebas Neue',sans-serif;
    letter-spacing:.2em;
    font-size:1rem;
    color:rgba(255,255,255,.2);
    position:relative;
    z-index:1;
}

.outro-footer strong {
    color:var(--gold);
    opacity:.6;
}

@keyframes fadeUp {
    from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)}
}

.page-content {
    opacity:0;
    transition:opacity .6s ease,transform .6s ease;
    transform:translateY(20px);
}

.page.visible .page-content {
    opacity:1;
    transform:translateY(0);
}

/* FOOTER LINKS */
.footer-links {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-links a {
    display: inline-block;
    width: 48px;
    height: 48px;
    margin: 0 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    transform: scale(1.1);
}

.footer-links img {
    filter: invert(1) brightness(1.2);
    opacity: 0.7;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

html[data-theme="dark"] .footer-links img { filter: invert(1) brightness(1.2); opacity: 0.7; }
html[data-theme="light"] .footer-links img { filter: invert(1) brightness(0.6); opacity: 0.6; }
html[data-theme="dark"] .footer-links a:hover img { filter: invert(1) brightness(1.5); opacity: 1; }
html[data-theme="light"] .footer-links a:hover img { filter: invert(1) brightness(0.4); opacity: 1; }

@media(max-width:700px){
    .epoch-split{grid-template-columns:1fr;}
    .epoch-left{border-right:none;border-bottom:1px solid rgba(255,255,255,.06);padding:24px;justify-content:flex-start;}
    .epoch-right{padding:20px;}
    .facts-grid{grid-template-columns:1fr 1fr;}
    .event-text{padding-left:20px;}
    .hero-sub {
        left: 0 !important;
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}
  .hamburger-quiz {
    position: fixed;
    top: 70px;
    right: 28px;
    z-index: 20000;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(201,168,76,0.6);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s ease;
  }
  .hamburger-quiz span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold, #c9a84c);
    border-radius: 2px;
  }
  .hamburger-quiz:hover { background: rgba(201,168,76,0.2); }

  .side-menu-quiz {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: rgba(8,12,20,0.96);
    backdrop-filter: blur(16px);
    z-index: 21000;
    transition: right 0.3s;
    border-left: 1px solid rgba(255,255,255,0.08);
    padding: 90px 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .side-menu-quiz.open { right: 0; }
  .overlay-quiz {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(3px);
    z-index: 20500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s;
  }
  .overlay-quiz.visible { opacity: 1; visibility: visible; }
  .menu-item-quiz {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    padding: 14px 20px;
    color: #d6ccbb;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .menu-item-quiz:hover, .menu-item-quiz.active {
    color: #c9a84c;
    padding-left: 28px;
    border-bottom-color: #c9a84c;
  }

  #quizContainer {
    display: none;
    width: 100%;
    height: 100vh;          
    background: #080b12;
    padding: 100px 24px 60px;
    font-family: 'Crimson Pro', serif;
    overflow-y: auto;       /* скролл внутри контейнера */
    position: relative;     /* убрали fixed */
    top: auto;
    left: auto;
    z-index: auto;
  }
  .quiz-card {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(10,15,25,0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 36px;
    padding: 2rem;
  }
  .quiz-header h2 { font-family: 'Playfair Display', serif; font-size: 2rem; color: #c9a84c; text-align:center; margin-bottom:0.5rem; }
  .quiz-header p { color: rgba(214,204,187,0.6); text-align:center; margin-bottom:1.5rem; }
  .progress { text-align:center; font-family:'Bebas Neue',sans-serif; letter-spacing:2px; color:#c9a84c; margin-bottom:1rem; }
  .quiz-question { background:rgba(0,0,0,0.3); border-radius:24px; padding:1.5rem; margin-bottom:1rem; border-left:4px solid #c9a84c; }
  .question-title { font-size:1.3rem; font-weight:600; margin-bottom:1.5rem; color:#fff; }
  .quiz-options { display:flex; flex-direction:column; gap:12px; margin-bottom:20px; }
  .quiz-option { display:flex; align-items:center; gap:12px; cursor:pointer; padding:8px 12px; border-radius:40px; background:rgba(255,255,255,0.03); }
  .quiz-option:hover { background:rgba(201,168,76,0.15); }
  .quiz-option input { accent-color:#c9a84c; width:18px; height:18px; cursor:pointer; }
  .quiz-option span { font-size:1rem; color:#cbd5e1; cursor:pointer; flex:1; }
  .feedback-step { margin:10px 0; padding:10px 15px; border-radius:20px; font-size:0.9rem; }
  .feedback-step.correct { color:#8bc34a; border-left:3px solid #8bc34a; background:rgba(139,195,74,0.1); }
  .feedback-step.wrong { color:#ef9a9a; border-left:3px solid #ef9a9a; background:rgba(239,154,154,0.1); }
  .quiz-nav { display:flex; justify-content:space-between; gap:20px; margin-top:20px; }
  .quiz-btn { background:rgba(30,40,55,0.8); border:1px solid rgba(201,168,76,0.5); padding:12px 24px; border-radius:60px; font-family:'Bebas Neue',sans-serif; font-size:1rem; letter-spacing:1px; color:#d6ccbb; cursor:pointer; transition:0.2s; flex:1; text-align:center; }
  .quiz-btn-primary { background:#c9a84c; color:#080b12; border:none; font-weight:bold; }
  .quiz-btn-primary:hover { background:#b38f3a; transform:scale(0.97); }
  .quiz-btn:hover { background:rgba(50,65,85,0.9); border-color:#c9a84c; }
  .quiz-result-final { margin-top:30px; text-align:center; padding:20px; background:rgba(0,0,0,0.5); border-radius:28px; font-size:1.2rem; font-weight:bold; color:#c9a84c; }
  details { margin-top: 1rem; }
  details summary { cursor: pointer; color: #c9a84c; margin-bottom: 0.5rem; }
  details ul { max-height: 300px; overflow-y: auto; } 
  @media (max-width:700px){ .quiz-card { padding:1.2rem; } .question-title { font-size:1.1rem; } 
}
