/* ================================================================
   DIWA — BUWAN NG WIKA WEBSITE
   EDITING GUIDE:
   1. Search for "EDIT HERE" to find the easiest parts to customize.
   2. Change the colors below to quickly update the entire theme.
   3. Main section styles are clearly labeled throughout this file.
   ================================================================ */

/* EDIT HERE: Pangunahing kulay ng website. */
:root {
  --navy: #172846;
  --navy-light: #253b61;
  --red: #bd3a2f;
  --gold: #e7a93a;
  --gold-light: #f6d788;
  --cream: #f7f0df;
  --paper: #fffaf0;
  --ink: #202634;
  --muted: #6f6c65;
  --line: rgba(32, 38, 52, 0.15);
  --white: #fffdf7;
  --shadow: 0 22px 65px rgba(38, 31, 20, 0.13);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p,
blockquote {
  margin-top: 0;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: 112px 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--white);
  color: var(--navy);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* -------------------- NAVIGATION -------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(247, 240, 223, 0.94);
  border-color: var(--line);
  box-shadow: 0 8px 25px rgba(37, 31, 22, 0.05);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 40, 70, 0.5);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  color: var(--navy);
  font-size: 1rem;
  letter-spacing: 0.23em;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  color: #39404c;
  font-size: 0.86rem;
  font-weight: 600;
}

.main-nav a:not(.nav-cta) {
  position: relative;
}

.main-nav a:not(.nav-cta)::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 1px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.main-nav a:not(.nav-cta):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  padding: 11px 18px;
  border: 1px solid var(--navy);
  border-radius: 100px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-cta:hover {
  background: var(--navy);
  color: var(--white);
}

.menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  width: 23px;
  height: 2px;
  display: block;
  margin: 5px auto;
  background: var(--navy);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* -------------------- SHARED TYPOGRAPHY -------------------- */
.eyebrow,
.kicker {
  color: var(--red);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  display: inline-block;
  background: currentColor;
}

.section-heading h2 {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.5vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.section-heading.light h2 {
  color: var(--white);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 54px;
  padding: 14px 24px;
  border: 0;
  border-radius: 2px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--red);
  color: var(--white);
}

.button-primary:hover {
  background: #a92e26;
}

.button-dark {
  background: var(--navy);
  color: var(--white);
}

/* -------------------- HERO -------------------- */
.hero {
  position: relative;
  min-height: 780px;
  display: flex;
  align-items: center;
  padding: 145px 0 75px;
  background:
    radial-gradient(circle at 75% 43%, rgba(231, 169, 58, 0.11), transparent 25%),
    var(--cream);
  isolation: isolate;
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 26px, var(--gold) 26px 52px, var(--navy) 52px 78px, transparent 78px 84px);
  content: "";
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: 70px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin: 20px 0 30px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(4rem, 7vw, 7.2rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: var(--red);
  font-weight: 600;
}

.hero-text {
  max-width: 610px;
  margin-bottom: 36px;
  color: #50535a;
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 32px;
}

.text-link {
  padding: 8px 0;
  border-bottom: 1px solid rgba(23, 40, 70, 0.35);
  color: var(--navy);
  font-size: 0.83rem;
  font-weight: 700;
}

.hero-art {
  position: relative;
  height: 480px;
  display: grid;
  place-items: center;
}

.sun-core,
.sun-orbit {
  position: absolute;
  border-radius: 50%;
}

.sun-core {
  width: 245px;
  height: 245px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 0 0 26px rgba(231, 169, 58, 0.13);
  z-index: 2;
}

.sun-core::before,
.sun-core::after {
  position: absolute;
  inset: -36px;
  border: 2px dashed rgba(189, 58, 47, 0.35);
  border-radius: inherit;
  content: "";
}

.sun-core::after {
  inset: -66px;
  border-color: rgba(23, 40, 70, 0.19);
  animation: slow-spin 35s linear infinite;
}

.sun-core span {
  font-family: var(--serif);
  font-size: 3.7rem;
  line-height: 1;
}

.sun-core small {
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.sun-orbit {
  border: 1px solid rgba(23, 40, 70, 0.16);
}

.orbit-one {
  width: 370px;
  height: 370px;
}

.orbit-two {
  width: 455px;
  height: 455px;
}

.orbit-two::before,
.orbit-two::after {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.orbit-two::before {
  top: 56px;
  right: 52px;
}

.orbit-two::after {
  bottom: 39px;
  left: 78px;
  background: var(--navy);
}

.art-note {
  position: absolute;
  right: -8px;
  bottom: 29px;
  margin: 0;
  padding-left: 15px;
  border-left: 2px solid var(--red);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.45;
}

.art-note strong {
  color: var(--navy);
}

.hero-pattern {
  position: absolute;
  z-index: -1;
  opacity: 0.22;
}

.pattern-left {
  top: 150px;
  left: -45px;
  width: 96px;
  height: 260px;
  background: repeating-linear-gradient(135deg, transparent 0 13px, var(--red) 13px 20px, transparent 20px 34px, var(--navy) 34px 41px);
}

.pattern-right {
  right: -35px;
  bottom: 85px;
  width: 82px;
  height: 220px;
  background: repeating-linear-gradient(45deg, transparent 0 12px, var(--gold) 12px 20px, transparent 20px 32px, var(--navy) 32px 39px);
}

.hero-footnote {
  position: absolute;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-footnote span {
  color: var(--red);
  font-weight: 700;
}

.hero-footnote div {
  width: 42px;
  height: 1px;
  background: rgba(32, 38, 52, 0.3);
}

.hero-footnote p {
  margin: 0;
}

/* -------------------- INTRODUCTION -------------------- */
.intro {
  background: var(--paper);
}

.intro-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 110px;
}

.intro-body {
  padding-top: 34px;
  color: var(--muted);
}

.intro-body .lead {
  margin-bottom: 24px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.45;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 75px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact {
  min-height: 140px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 26px 42px;
  border-right: 1px solid var(--line);
}

.fact:last-child {
  border-right: 0;
}

.fact strong {
  color: var(--navy);
  font-family: var(--serif);
  font-size: 2.05rem;
}

.fact span {
  color: var(--muted);
  font-size: 0.78rem;
}

/* -------------------- WORD OF THE DAY -------------------- */
.word-section {
  position: relative;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}

.word-section::before {
  position: absolute;
  top: -260px;
  right: -170px;
  width: 640px;
  height: 640px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.025), 0 0 0 160px rgba(255, 255, 255, 0.018);
  content: "";
}

.word-section .kicker {
  color: var(--gold-light);
}

.word-card {
  position: relative;
  display: grid;
  grid-template-columns: 100px 1.15fr 0.85fr;
  gap: 45px;
  margin-top: 60px;
  padding: 55px 60px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.035);
}

.word-number {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 50%;
  color: var(--gold-light);
  font-family: var(--serif);
}

.word-meta {
  display: flex;
  gap: 9px;
}

.word-meta span {
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.word-main h3 {
  margin: 14px 0 0;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: clamp(3.6rem, 7vw, 6.7rem);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.05em;
}

.pronunciation {
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.83rem;
  letter-spacing: 0.09em;
}

.definition {
  max-width: 500px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.word-example {
  align-self: center;
  padding-left: 36px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.word-example > span {
  color: var(--gold-light);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.word-example blockquote {
  margin: 13px 0 23px;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--serif);
  font-size: 1.18rem;
  font-style: italic;
}

.shuffle-button {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid rgba(246, 215, 136, 0.5);
  background: transparent;
  color: var(--gold-light);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.shuffle-button span {
  display: inline-block;
  margin-left: 10px;
  transition: transform 0.35s ease;
}

.shuffle-button:hover span {
  transform: rotate(180deg);
}

/* -------------------- STORIES -------------------- */
.stories {
  background: var(--cream);
}

.stories-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 58px;
}

.stories-header > p {
  max-width: 390px;
  margin-bottom: 4px;
  color: var(--muted);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.story-card {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  min-height: 350px;
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(35, 29, 20, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.story-featured {
  grid-column: 1 / -1;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 430px;
}

.story-visual {
  position: relative;
  min-height: 270px;
  overflow: hidden;
}

.visual-hapag {
  display: grid;
  place-items: center;
  background: var(--gold);
}

.visual-hapag::before,
.visual-hapag::after {
  position: absolute;
  width: 100%;
  height: 32px;
  background: repeating-linear-gradient(90deg, var(--navy) 0 18px, transparent 18px 34px, var(--red) 34px 51px, transparent 51px 67px);
  content: "";
  opacity: 0.75;
}

.visual-hapag::before { top: 0; }
.visual-hapag::after { bottom: 0; }

.visual-hapag p {
  position: absolute;
  right: 25px;
  bottom: 47px;
  color: rgba(23, 40, 70, 0.48);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.visual-sun {
  position: absolute;
  top: 58px;
  left: 68px;
  width: 88px;
  height: 88px;
  border: 2px solid var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(189, 58, 47, 0.1);
}

.visual-bowl {
  position: relative;
  width: 210px;
  height: 105px;
  margin-top: 75px;
  border-radius: 0 0 110px 110px;
  background: var(--navy);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.17), 0 23px 0 -12px rgba(189, 58, 47, 0.9);
}

.visual-bowl::before {
  position: absolute;
  top: -15px;
  left: 21px;
  width: 168px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-light);
  content: "";
}

.visual-bowl::after {
  position: absolute;
  top: -65px;
  left: 81px;
  width: 42px;
  height: 70px;
  border: 2px solid rgba(255, 253, 247, 0.55);
  border-width: 0 2px;
  border-radius: 50%;
  content: "";
  transform: rotate(8deg);
}

.story-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 48px;
}

.story-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
  color: var(--red);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-meta time {
  color: #99938a;
}

.story-content h3 {
  margin-bottom: 16px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.story-content > p {
  color: var(--muted);
  font-size: 0.92rem;
}

.story-link {
  margin-top: 8px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid rgba(23, 40, 70, 0.25);
  background: transparent;
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.story-link span {
  display: inline-block;
  margin-left: 10px;
  transition: transform 0.2s ease;
}

.story-link:hover span {
  transform: translateX(5px);
}

.visual-liham {
  display: grid;
  place-items: center;
  background: #b94538;
}

.envelope {
  position: relative;
  z-index: 2;
  width: 175px;
  height: 115px;
  display: grid;
  place-items: center;
  padding-top: 25px;
  background: #f7e8c9;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 0.79rem;
  font-style: italic;
  transform: rotate(-5deg);
  box-shadow: 0 17px 28px rgba(60, 14, 9, 0.18);
}

.envelope::before {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 58%, 100% 0);
  background: #ebd3aa;
  content: "";
}

.leaf {
  position: absolute;
  width: 45px;
  height: 100px;
  border: 3px solid rgba(247, 232, 201, 0.45);
  border-width: 0 0 0 3px;
  border-radius: 50%;
}

.leaf-one { top: 40px; right: 38px; transform: rotate(26deg); }
.leaf-two { bottom: 24px; left: 38px; transform: rotate(-145deg); }

.visual-dagat {
  background: #335d79;
}

.moon {
  position: absolute;
  top: 42px;
  right: 36px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 0 12px rgba(246, 215, 136, 0.08);
}

.boat {
  position: absolute;
  bottom: 105px;
  left: 50%;
  z-index: 2;
  width: 115px;
  height: 32px;
  border-radius: 0 0 70px 70px;
  background: var(--red);
  transform: translateX(-50%);
}

.boat::before {
  position: absolute;
  bottom: 25px;
  left: 50px;
  width: 3px;
  height: 85px;
  background: #172846;
  content: "";
}

.boat::after {
  position: absolute;
  bottom: 49px;
  left: 53px;
  width: 55px;
  height: 60px;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  background: var(--gold-light);
  content: "";
}

.wave {
  position: absolute;
  right: -10%;
  left: -10%;
  height: 68px;
  border-radius: 50%;
  border-top: 5px solid rgba(255, 255, 255, 0.45);
}

.wave-one { bottom: 45px; transform: rotate(3deg); }
.wave-two { bottom: 15px; transform: rotate(-2deg); opacity: 0.55; }

/* -------------------- KNOWLEDGE -------------------- */
.knowledge {
  background: var(--paper);
}

.knowledge-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 120px;
}

.knowledge-copy > p:not(.kicker) {
  max-width: 480px;
  margin: 30px 0;
  color: var(--muted);
}

.concept-list {
  border-top: 1px solid var(--line);
}

.concept-list article {
  display: grid;
  grid-template-columns: 55px 1fr;
  gap: 20px;
  padding: 31px 0;
  border-bottom: 1px solid var(--line);
}

.concept-list article > span {
  padding-top: 5px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 0.85rem;
}

.concept-list h3 {
  margin-bottom: 6px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.7rem;
}

.concept-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* -------------------- QUIZ -------------------- */
.quiz-section {
  background:
    linear-gradient(rgba(231, 169, 58, 0.94), rgba(231, 169, 58, 0.94)),
    repeating-linear-gradient(45deg, var(--navy) 0 10px, transparent 10px 30px);
}

.quiz-shell {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 80px;
  align-items: center;
}

.quiz-intro h2 {
  margin-bottom: 20px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.quiz-intro > p:not(.kicker) {
  color: rgba(23, 40, 70, 0.78);
}

.quiz-progress {
  height: 4px;
  margin-top: 32px;
  background: rgba(23, 40, 70, 0.2);
}

.quiz-progress span {
  width: 33.333%;
  height: 100%;
  display: block;
  background: var(--red);
  transition: width 0.35s ease;
}

.quiz-intro small {
  display: block;
  margin-top: 9px;
  color: var(--navy);
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quiz-card {
  min-height: 390px;
  padding: 50px;
  background: var(--paper);
  box-shadow: 18px 18px 0 rgba(23, 40, 70, 0.13);
}

.quiz-question {
  margin-bottom: 28px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(231, 169, 58, 0.08);
}

.quiz-option.correct {
  border-color: #3f8059;
  background: rgba(63, 128, 89, 0.12);
}

.quiz-option.wrong {
  border-color: var(--red);
  background: rgba(189, 58, 47, 0.1);
}

.quiz-feedback {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.quiz-next {
  min-height: 46px;
  margin-top: 10px;
  padding: 10px 20px;
}

.quiz-result {
  display: grid;
  place-items: center;
  min-height: 285px;
  text-align: center;
}

.quiz-result strong {
  display: block;
  color: var(--red);
  font-family: var(--serif);
  font-size: 4rem;
}

.quiz-result h3 {
  margin: 4px 0 10px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 2rem;
}

/* -------------------- FOOTER -------------------- */
.site-footer {
  padding: 80px 0 25px;
  background: #111e35;
  color: rgba(255, 255, 255, 0.68);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  padding-bottom: 65px;
}

.footer-brand .brand-mark {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--gold-light);
}

.footer-brand strong { color: var(--white); }
.footer-brand small { color: rgba(255, 255, 255, 0.5); }

.footer-top > div:first-child > p {
  max-width: 310px;
  margin-top: 20px;
  font-size: 0.84rem;
}

.footer-quote {
  position: relative;
  padding-left: 55px;
}

.footer-quote > span {
  position: absolute;
  top: -22px;
  left: 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 5rem;
  line-height: 1;
}

.footer-quote blockquote {
  margin-bottom: 13px;
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-style: italic;
  line-height: 1.45;
}

.footer-quote cite {
  color: var(--gold-light);
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
}

.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--gold-light); }

/* -------------------- STORY POP-UP -------------------- */
.story-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: 85vh;
  padding: 58px;
  border: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.story-dialog::backdrop {
  background: rgba(12, 24, 43, 0.78);
  backdrop-filter: blur(5px);
}

.story-dialog h2 {
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  line-height: 1.08;
}

.story-dialog #dialog-body {
  color: var(--muted);
}

.story-dialog #dialog-body p:first-child::first-letter {
  float: left;
  margin: 4px 9px 0 0;
  color: var(--red);
  font-family: var(--serif);
  font-size: 4.1rem;
  line-height: 0.76;
}

.dialog-close {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--navy);
  font-size: 1.5rem;
  cursor: pointer;
}

/* -------------------- SCROLL ANIMATIONS -------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slow-spin {
  to { transform: rotate(360deg); }
}

/* -------------------- RESPONSIVE DESIGN -------------------- */
@media (max-width: 980px) {
  .section { padding: 88px 0; }

  .main-nav { gap: 18px; }
  .main-nav a { font-size: 0.76rem; }

  .hero-grid { grid-template-columns: 1fr 0.8fr; gap: 10px; }
  .hero-art { transform: scale(0.8); }

  .intro-grid,
  .knowledge-grid { gap: 60px; }

  .word-card {
    grid-template-columns: 70px 1fr;
  }

  .word-example {
    grid-column: 2;
    margin-top: 6px;
    padding: 23px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 0;
  }

  .story-card:not(.story-featured) {
    grid-template-columns: 1fr;
  }

  .quiz-shell { gap: 45px; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 32px, 1180px); }
  .section { padding: 76px 0; }

  .nav-wrap { min-height: 74px; }
  .menu-toggle { display: block; z-index: 2; }

  .main-nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
    background: var(--cream);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  }

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

  .main-nav a { font-family: var(--serif); font-size: 1.5rem; }

  .menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero {
    min-height: auto;
    padding: 125px 0 105px;
  }

  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(3.65rem, 16vw, 5.5rem); }
  .hero-art { height: 390px; margin-top: 30px; transform: scale(0.88); }
  .hero-footnote { display: none; }
  .pattern-left { display: none; }

  .intro-grid,
  .knowledge-grid,
  .quiz-shell,
  .footer-top { grid-template-columns: 1fr; gap: 45px; }

  .intro-body { padding-top: 0; }

  .fact-strip { grid-template-columns: 1fr; }
  .fact { min-height: 110px; border-right: 0; border-bottom: 1px solid var(--line); }
  .fact:last-child { border-bottom: 0; }

  .word-card {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 35px 28px;
  }

  .word-example { grid-column: 1; }

  .stories-header { align-items: start; flex-direction: column; }
  .story-grid { grid-template-columns: 1fr; }
  .story-featured,
  .story-card { grid-column: auto; grid-template-columns: 1fr; }
  .story-content { padding: 35px 28px; }

  .quiz-card { min-height: 360px; padding: 34px 26px; }
  .footer-top { gap: 60px; }
}

@media (max-width: 480px) {
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 16px; }
  .hero-art { margin: -10px -35px 0; transform: scale(0.74); }
  .sun-core { width: 220px; height: 220px; }
  .art-note { right: 15px; }

  .story-visual { min-height: 250px; }
  .story-meta { align-items: flex-start; flex-direction: column; gap: 4px; }

  .footer-quote { padding-left: 0; }
  .footer-quote > span { position: static; display: block; height: 45px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 12px; }
  .story-dialog { padding: 50px 25px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}
