:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --ink: #2e2e2e;
  --muted: #5e5e5e;
  --accent: #ff7302;
  --accent-2: #ffa902;
  --accent-soft: #fff1e4;
  --line: #dddddd;
  --radius: 20px;
  --shadow: 0 14px 42px rgba(35, 35, 35, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #fff3e6 0%, transparent 32%),
    radial-gradient(circle at 90% 15%, #f0f0f0 0%, transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 60%);
  line-height: 1.6;
  display: grid;
  place-items: center;
  padding: 1rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Times New Roman", serif;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

.app-shell {
  width: min(460px, 100%);
  height: min(920px, 96vh);
  background: #fbfbfb;
  border: 1px solid #cecece;
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(35, 35, 35, 0.2);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header {
  z-index: 12;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.brand-logo {
  width: 80px;
  height: auto;
}

.brand-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.brand h1 {
  font-size: 1.02rem;
}

.lang-switch {
  display: flex;
  gap: 0.35rem;
}

.lang-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.app-content {
  padding: 0.6rem;
  overflow: auto;
  display: grid;
  gap: 0.72rem;
  scroll-behavior: smooth;
}

.section-card {
  scroll-margin-top: 0.6rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  border-radius: var(--radius);
  border: 1px solid #d7d7d7;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 115, 2, 0.88), rgba(94, 94, 94, 0.88)),
    url("assets/graphics/parallel-lines.svg") center / cover no-repeat;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 95%;
  margin: 0.8rem;
  padding: 1rem;
  color: #fff;
  background: rgba(25, 25, 25, 0.33);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-content h2 {
  font-size: 1.6rem;
  margin: 0.3rem 0 0.5rem;
}

.section {
  padding: 0.92rem;
  display: grid;
  gap: 0.8rem;
}

.section-head {
  display: grid;
  gap: 0.35rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
}

.section h3 {
  font-size: 1.4rem;
}

.two-col,
.parallel-grid {
  display: grid;
  gap: 0.8rem;
}

.fact-cards {
  display: grid;
  gap: 0.55rem;
}

.fact-card {
  padding: 0.76rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7fbfe 100%);
}

.fact-card strong {
  display: block;
  font-size: 1.18rem;
  color: #e26000;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.58rem;
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.timeline li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 0.35rem;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.sundial-box {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  background: linear-gradient(180deg, #fff9f1, #f5f5f5);
  border-radius: 18px;
  border: 1px solid var(--line);
}

.sundial {
  width: min(380px, 92%);
}

.shadow-line {
  position: absolute;
  width: 100px;
  height: 4px;
  background: rgba(20, 36, 51, 0.42);
  transform-origin: left center;
  border-radius: 999px;
  top: 51%;
  left: 50%;
  translate: 0 -50%;
}

.sim-controls {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.56rem 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent), #e26000);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  color: #5e5e5e;
  border-color: #a8a8a8;
}

.art {
  width: 100%;
  max-width: 440px;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.next-desc {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.app-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.6rem calc(0.35rem + env(safe-area-inset-bottom));
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.tab {
  text-decoration: none;
  color: #6b6b6b;
  font-size: 0.78rem;
  text-align: center;
  font-weight: 700;
  padding: 0.44rem 0.32rem;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  background: #f9f9f9;
}

.tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #ffc89a;
}

.footer-note {
  text-align: center;
  padding-top: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
}

/* ── Panorama ──────────────────────────────────────────────── */
.panorama-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.panorama-wrap {
  position: relative;
  height: 500px;
  overflow: hidden;
  border-radius: 12px;
  cursor: grab;
  touch-action: none;
  background: #000;
}

.panorama-wrap:active {
  cursor: grabbing;
}

.panorama-inner {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.panorama-img {
  height: 500px;
  width: auto;
  max-width: none;
  display: block;
  user-select: none;
  pointer-events: none;
}

.hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transform: translate(-50%, -100%);
  cursor: pointer;
  pointer-events: all;
  background: none;
  border: none;
  padding: 0;
  animation: hotspot-bounce 2.4s ease-in-out infinite;
}

.pin-label {
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: "Manrope", sans-serif;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  line-height: 1.5;
}

.pin-arrow {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--accent);
}

@keyframes hotspot-bounce {
  0%, 100% { transform: translate(-50%, -100%) translateY(0);   }
  50%       { transform: translate(-50%, -100%) translateY(-5px); }
}

.hotspot-popup {
  position: absolute;
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 1rem 0.7rem 0.85rem;
  min-width: 170px;
  max-width: 220px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  z-index: 10;
  pointer-events: all;
}

.hotspot-popup.hidden {
  display: none;
}

.popup-close {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 0;
}

.popup-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  padding-right: 1rem;
  font-family: "Fraunces", serif;
}

.popup-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

@media (max-width: 560px) {
  body {
    padding: 0;
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}
