* { box-sizing: border-box; }

:root {
  --sand: #f6ead2;
  --sand-2: #efe0c2;
  --night: #1d1a12;
  --ink: #2b2417;
  --gold: #c9973f;
  --gold-2: #a87b2e;
  --blue: #1f6f8b;
  --red: #b4472e;
  --line: rgba(43, 36, 23, .16);
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Roboto Slab", Georgia, serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.65;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(29, 26, 18, .96);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--gold);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; flex-wrap: wrap; }
.logo { color: var(--sand); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: .04em; }
.logo-mark { color: var(--gold); margin-right: 6px; font-family: "Noto Sans Egyptian Hieroglyphs", serif; }
.logo-accent { color: var(--gold); font-weight: 400; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--sand-2); text-decoration: none; font-size: .92rem;
  padding: 8px 12px; border-radius: 8px; transition: .2s;
}
.nav a:hover, .nav a.active { background: rgba(201, 151, 63, .22); color: #fff; }
.nav-cta { border: 1px solid var(--gold); color: var(--gold) !important; }
.nav-toggle { display: none; background: none; border: 1px solid var(--gold); color: var(--gold); font-size: 1.2rem; border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #14202b 0%, #27455a 55%, #d9a750 100%);
  color: var(--sand);
  padding: 84px 0 240px;
}
.hero-sun {
  position: absolute; top: 60px; right: 8%;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffe9b0, #e8a63c 65%, rgba(232,166,60,0) 72%);
  filter: blur(1px);
  animation: pulse 5s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.06); } }
.hero-kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; color: #ffd98a; margin: 0 0 14px; }
.hero h1 {
  font-family: Oswald, sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05; margin: 0 0 18px; text-transform: uppercase;
}
.gold { color: var(--gold); }
.hero-lead { max-width: 34rem; font-size: 1.05rem; color: #e9dfc9; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 13px 26px; border-radius: 999px; transition: .2s; cursor: pointer; font-size: 1rem;
  border: 2px solid transparent; font-family: inherit;
}
.btn-gold { background: var(--gold); color: #241a08; }
.btn-gold:hover { background: #e2b35c; transform: translateY(-2px); }
.btn-ghost { border-color: var(--sand); color: var(--sand); }
.btn-ghost:hover { background: rgba(246, 234, 210, .14); }
.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.stat { max-width: 190px; }
.stat-num { display: block; font-family: Oswald, sans-serif; font-size: 2.4rem; color: #ffd98a; line-height: 1; }
.stat-label { font-size: .82rem; color: #ded3bd; }
.hero-pyramids { position: absolute; left: 0; right: 0; bottom: -2px; }
.hero-pyramids svg { display: block; width: 100%; height: 190px; }

/* ---------- sections ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--sand-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title {
  font-family: Oswald, sans-serif; text-transform: uppercase; letter-spacing: .06em;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem); margin: 0 0 8px; color: var(--ink);
  border-left: 6px solid var(--gold); padding-left: 14px;
}
.section-sub { margin: 0 0 34px; color: #6b5f49; }

/* ---------- era tabs ---------- */
.era-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.era-tab {
  font-family: Oswald, sans-serif; font-size: .95rem; letter-spacing: .03em;
  padding: 10px 16px; border-radius: 999px; border: 2px solid var(--gold-2);
  background: transparent; color: var(--ink); cursor: pointer; transition: .2s;
}
.era-tab:hover { background: rgba(201, 151, 63, .18); }
.era-tab.active { background: var(--night); color: var(--gold); border-color: var(--night); }
.era-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; box-shadow: 0 10px 30px rgba(43, 36, 23, .08);
  animation: fade .35s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.era-panel h3 { font-family: Oswald, sans-serif; margin: 0 0 4px; font-size: 1.5rem; }
.era-years { color: var(--red); font-weight: 600; margin: 0 0 14px; font-size: .95rem; }
.era-panel ul { margin: 14px 0 0; padding-left: 20px; }
.era-panel li { margin-bottom: 7px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 108px; top: 6px; bottom: 6px;
  width: 3px; background: linear-gradient(var(--gold), var(--blue));
}
.timeline li { display: flex; gap: 26px; margin-bottom: 26px; position: relative; }
.timeline .t-year {
  width: 96px; text-align: right; font-family: Oswald, sans-serif;
  font-size: 1.02rem; color: var(--red); flex-shrink: 0; padding-top: 2px;
}
.timeline .t-body {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 18px; flex: 1; position: relative;
}
.timeline .t-body::before {
  content: ""; position: absolute; left: -33px; top: 16px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--sand-2);
}
.timeline .t-body strong { display: block; font-family: Oswald, sans-serif; font-size: 1.05rem; }

/* ---------- pharaoh cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; transition: .25s; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 14px 34px rgba(43, 36, 23, .14); }
.card::after {
  content: "𓋹"; position: absolute; right: 10px; top: 4px;
  font-size: 2.6rem; color: rgba(201, 151, 63, .18); font-family: "Noto Sans Egyptian Hieroglyphs", serif;
}
.card-era { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); }
.card h3 { font-family: Oswald, sans-serif; margin: 6px 0 2px; font-size: 1.3rem; }
.card-dates { color: var(--red); font-size: .88rem; margin: 0 0 10px; font-weight: 600; }
.card p { margin: 0; font-size: .94rem; color: #4c4433; }

/* ---------- pyramids ---------- */
.pyramid-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 34px; align-items: center; }
.fact {
  display: flex; gap: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; align-items: baseline;
}
.fact b { font-family: Oswald, sans-serif; color: var(--gold-2); font-size: 1.5rem; min-width: 90px; }
.pyramid-art svg { width: 100%; height: auto; filter: drop-shadow(0 12px 20px rgba(0,0,0,.2)); }

/* ---------- hieroglyphs ---------- */
.glyph-board { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.glyph {
  font-family: "Noto Sans Egyptian Hieroglyphs", serif;
  font-size: 2.6rem; line-height: 1; cursor: pointer;
  width: 76px; height: 76px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); border-radius: 12px; transition: .2s;
}
.glyph:hover { border-color: var(--gold); transform: translateY(-3px); }
.glyph.active { background: var(--night); border-color: var(--gold); color: var(--gold); }
.glyph-answer {
  background: var(--night); color: var(--sand); border-radius: var(--radius);
  padding: 20px 24px; min-height: 76px; display: flex; align-items: center; gap: 18px;
  font-size: 1.05rem; animation: fade .3s ease;
}
.glyph-answer .big { font-family: "Noto Sans Egyptian Hieroglyphs", serif; font-size: 3rem; color: var(--gold); }
.glyph-answer-placeholder { color: #9a8f78; }
.glyph-note {
  margin-top: 22px; background: #fff; border-left: 5px solid var(--blue);
  padding: 16px 20px; border-radius: 0 12px 12px 0; font-size: .95rem;
}

/* ---------- quiz ---------- */
.quiz {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; box-shadow: 0 10px 30px rgba(43, 36, 23, .08);
}
.quiz-progress { height: 8px; background: var(--sand-2); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.quiz-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .4s; }
.quiz-step { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--blue); margin: 0 0 6px; }
.quiz-q { font-family: Oswald, sans-serif; font-size: 1.35rem; margin: 0 0 18px; }
.quiz-answers { display: grid; gap: 10px; }
.quiz-answers button {
  text-align: left; font-family: inherit; font-size: 1rem;
  padding: 13px 18px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line); background: var(--sand); transition: .15s;
}
.quiz-answers button:hover:not(:disabled) { border-color: var(--gold); background: #fff; }
.quiz-answers button:disabled { cursor: default; opacity: .75; }
.quiz-answers button.correct { border-color: #2e7d4f; background: #e3f4ea; opacity: 1; }
.quiz-answers button.wrong { border-color: var(--red); background: #fbe7e2; opacity: 1; }
.quiz-feedback { min-height: 24px; margin: 14px 0 0; font-weight: 600; }
.quiz-feedback.ok { color: #2e7d4f; }
.quiz-feedback.no { color: var(--red); }
.quiz-next { margin-top: 16px; }
.quiz-result { text-align: center; padding: 40px 20px; animation: fade .4s ease; }
.quiz-score { font-family: Oswald, sans-serif; font-size: 3.4rem; color: var(--gold-2); }
.quiz-result p { font-size: 1.1rem; margin: 6px 0 24px; }

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--sand-2); padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-inner p { margin: 0; font-size: .88rem; }
.footer-inner a { color: var(--gold); text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .hero { padding-top: 56px; }
  .hero-sun { width: 120px; height: 120px; right: -20px; }
  .pyramid-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 12px; }
  .timeline li { flex-direction: column; gap: 8px; padding-left: 34px; }
  .timeline .t-year { width: auto; text-align: left; }
  .timeline .t-body::before { left: -29px; }
}
