*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
}

/* ─── Views ──────────────────────────────────────────────── */

.view {
  position: fixed;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
}

.view.active {
  display: flex;
}

/* ─── Home ───────────────────────────────────────────────── */

#view-home {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: linear-gradient(to bottom, var(--color-sky-light), var(--color-honey-main));
  padding: 2rem;
}

.home-logo {
  width: min(220px, 40vw);
  height: auto;
  animation: float 3s ease-in-out infinite;
}

.home-title {
  font-family: var(--font-display);
  font-size: clamp(var(--font-size-xl), 5vw, var(--font-size-2xl));
  font-weight: 700;
  color: var(--color-earth-dark);
  text-align: center;
  text-shadow: 0 2px 4px rgba(68, 21, 4, 0.2);
}

.home-subtitle {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-earth-red);
  text-align: center;
  font-weight: 500;
}

.home-lang-buttons {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.home-secondary-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Spread ─────────────────────────────────────────────── */

#view-spread {
  flex-direction: column;
  background: #000;
}

.spread-swiper {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-container {
  position: absolute;
  inset: 0;
  z-index: var(--z-video);
  background: var(--color-earth-dark);
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(68, 21, 4, 0.4);
  z-index: 5;
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}

.video-loader.visible {
  opacity: 1;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(251, 184, 43, 0.3);
  border-top-color: var(--color-honey-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Spread nav buttons */
.spread-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-nav);
  background: rgba(68, 21, 4, 0.55);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-honey-light);
  cursor: pointer;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: background var(--t-fast), opacity var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
}

.spread-nav-btn:hover  { background: rgba(68, 21, 4, 0.8); }
.spread-nav-btn:active { background: rgba(68, 21, 4, 0.95); }
.spread-nav-btn.hidden { opacity: 0; pointer-events: none; }

.spread-nav-prev { left: 0.5rem; }
.spread-nav-next { right: 0.5rem; }

.spread-nav-label {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
}

/* Menu button top-right */
.spread-menu-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: var(--z-nav);
  background: rgba(68, 21, 4, 0.55);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-honey-light);
  cursor: pointer;
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
}

.spread-menu-btn:hover { background: rgba(68, 21, 4, 0.8); }

/* ─── Narrative bar ──────────────────────────────────────── */

.narrative-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bar-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bar-bg);
  backdrop-filter: blur(var(--bar-blur));
  -webkit-backdrop-filter: blur(var(--bar-blur));
  z-index: var(--z-bar);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* ─── Section view ───────────────────────────────────────── */

#view-section {
  flex-direction: column;
  background: var(--color-bg);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--color-honey-main);
  background: var(--color-cream);
  flex-shrink: 0;
}

.section-header-logo {
  height: 40px;
  width: auto;
}

.section-header-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-earth-dark);
  flex: 1;
}

.section-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

/* ─── Orientation overlay ────────────────────────────────── */

.overlay-orientation {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--overlay-bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
}

.overlay-orientation.visible {
  display: flex;
}

.overlay-orientation .rotate-icon {
  color: var(--color-honey-main);
  animation: rotate-continuous 2s linear infinite;
}

.overlay-orientation p {
  color: var(--color-honey-light);
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

/* ─── Modal spreads ──────────────────────────────────────── */

.modal-spreads {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-spreads.visible {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(68, 21, 4, 0.6);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 80vh;
  background: var(--color-cream);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slide-up var(--t-normal) ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--color-honey-main);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-earth-dark);
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-earth-red);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
  min-width: 44px;
  min-height: 44px;
}

.modal-close-btn:hover { background: rgba(144, 54, 16, 0.1); }

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Update banner ──────────────────────────────────────── */

.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-loader);
  background: var(--color-leaf-dark);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
}

.update-banner.visible {
  display: flex;
}
