:root {
  --bg: #f7efe5;
  --paper: rgba(255, 250, 244, 0.78);
  --card: rgba(255, 255, 255, 0.8);
  --ink: #1f1b1a;
  --muted: #655b56;
  --accent: #d94f3d;
  --accent-2: #f1b24a;
  --accent-3: #2b8a78;
  --line: rgba(31, 27, 26, 0.09);
  --shadow: 0 20px 60px rgba(92, 54, 30, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(241, 178, 74, 0.42), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(43, 138, 120, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf4eb 0%, #f3e1cf 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 90%);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.95), rgba(255, 236, 212, 0.8));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(217, 79, 61, 0.16);
  filter: blur(8px);
}

.topbar,
.hero-content,
.dashboard,
.story-board {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 8px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(217, 79, 61, 0.12);
}

.series-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.language-picker select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  min-width: 120px;
  outline: none;
  cursor: pointer;
}

.language-picker select:focus {
  outline: none;
}

.series-pill,
.filter-button,
.ghost-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
}

.series-pill {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(31, 27, 26, 0.5);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.series-pill:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.series-pill-active {
  background: var(--ink);
  color: white;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  padding: 20px 28px 36px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
strong {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", system-ui, serif;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 0.94;
}

.lead {
  max-width: 58ch;
  margin: 20px 0 0;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-button,
.ghost-button {
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  background: var(--ink);
  color: white;
  box-shadow: 0 16px 30px rgba(31, 27, 26, 0.18);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.primary-button:hover,
.ghost-button:hover,
.filter-button:hover,
.series-pill:hover {
  transform: translateY(-2px);
}

.live-strip {
  display: grid;
  gap: 14px;
  margin-top: 30px;
  padding: 18px 20px;
  border: 1px solid rgba(31, 27, 26, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(217, 79, 61, 0.12);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  animation: pulse 1.6s infinite;
}

.hero-stage {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.orbit {
  position: absolute;
  inset: 50%;
  border: 1px dashed rgba(31, 27, 26, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-one {
  width: 300px;
  height: 300px;
  animation: spin 18s linear infinite;
}

.orbit-two {
  width: 420px;
  height: 420px;
  animation: spinReverse 24s linear infinite;
}

.stage-card {
  position: absolute;
  display: grid;
  gap: 8px;
  width: min(100%, 250px);
  padding: 20px;
  border: 1px solid rgba(31, 27, 26, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.stage-card p,
.stage-card span {
  margin: 0;
  color: var(--muted);
}

.stage-card strong {
  font-size: 1.8rem;
}

.stage-card-main {
  top: 34px;
  right: 24px;
  animation: bob 6s ease-in-out infinite;
}

.stage-card-side {
  left: 8px;
  bottom: 84px;
  animation: bob 5.2s ease-in-out infinite 0.5s;
}

.stage-card-floating {
  right: 84px;
  bottom: 8px;
  animation: bob 6.4s ease-in-out infinite 1s;
}

main {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.dashboard,
.story-board {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-button {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.filter-button.active {
  background: var(--accent-3);
  color: white;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.character-card,
.story-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(55, 33, 20, 0.08);
}

.character-card {
  display: grid;
  gap: 18px;
  min-height: 290px;
  padding: 22px;
  transform: translateY(14px);
  opacity: 0;
  animation: fadeUp 500ms ease forwards;
}

.character-card::after,
.story-card::after {
  content: "";
  position: absolute;
  inset: auto -26px -26px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(217, 79, 61, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.character-role,
.activity-label,
.story-time {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.character-name,
.story-title {
  margin: 6px 0 0;
  font-size: 1.75rem;
  line-height: 1;
}

.status-badge,
.meta-chip {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.status-badge {
  background: rgba(43, 138, 120, 0.12);
  color: var(--accent-3);
}

.character-summary,
.story-copy,
.activity-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.location-chip {
  background: rgba(241, 178, 74, 0.18);
  color: #8d5c08;
}

.vibe-chip {
  background: rgba(31, 27, 26, 0.08);
}

.activity-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
}

.story-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.story-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.story-time {
  color: var(--accent);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.8);
    opacity: 0.35;
  }
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes spinReverse {
  from {
    transform: translate(-50%, -50%) rotate(360deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(0deg);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .hero-content,
  .character-grid,
  .story-list {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 520px;
  }

  .stage-card-main {
    top: 12px;
  }

  .stage-card-side {
    left: 10px;
    bottom: 110px;
  }

  .stage-card-floating {
    right: 22px;
    bottom: 14px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 10px;
  }

  .hero,
  .dashboard,
  .story-board {
    border-radius: 24px;
  }

  .topbar,
  .hero-content,
  .dashboard,
  .story-board {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .language-picker {
    width: 100%;
    justify-content: space-between;
  }

  .hero-stage {
    min-height: 470px;
  }

  .stage-card {
    width: 100%;
    max-width: 100%;
  }

  .stage-card-main,
  .stage-card-side,
  .stage-card-floating {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
  }

  .hero-stage {
    gap: 14px;
    align-content: center;
  }

  .orbit {
    display: none;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .toolbar-actions,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .filters,
html[dir="rtl"] .meta-row,
html[dir="rtl"] .card-top {
  direction: rtl;
}
