/* =========================================================
   SOLITUDE REFLECTIONS — MASTER CSS
   Layout order:
   1) HERO PANEL
   2) AUDIO + EXPLORE PANEL
   3) ARTICLE PANEL
   ========================================================= */

:root {
  --bg: #0f0c0a;
  --bg-soft: #171210;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7efe8;
  --muted: #ccbfb3;
  --soft: #9e8d81;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --hero-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --content-width: 1240px;

  --accent: #ff7a2f;
  --accent-2: #ff9d57;
  --accent-soft: rgba(255, 122, 47, 0.16);
  --accent-glow: 0 0 0 1px rgba(255, 122, 47, 0.4), 0 0 22px rgba(255, 122, 47, 0.26);

  --spirituality: #8478ff;
  --human: #56b5d9;
  --religion: #ff7a2f;

  --glass: blur(18px);
  --topbar-height: 68px;

  --panel-padding: clamp(18px, 2vw, 26px);
  --article-width: 920px;
}

html[data-theme="light"] {
  --bg: #f7efe7;
  --bg-soft: #fef8f3;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-2: rgba(255, 255, 255, 0.72);
  --surface-3: rgba(255, 255, 255, 0.9);
  --line: rgba(30, 20, 15, 0.1);
  --text: #241914;
  --muted: #66574d;
  --soft: #8a776b;
  --shadow: 0 18px 36px rgba(35, 25, 21, 0.1);
  --hero-shadow: 0 20px 55px rgba(35, 25, 21, 0.18);
  --accent: #e16622;
  --accent-2: #ff8f47;
  --accent-soft: rgba(225, 102, 34, 0.12);
  --accent-glow: 0 0 0 1px rgba(225, 102, 34, 0.26), 0 0 18px rgba(225, 102, 34, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 122, 47, 0.12), transparent 25%),
    radial-gradient(circle at top right, rgba(255, 190, 120, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  overflow: hidden;
}

body.sr-native-scroll {
  overflow: auto;
}

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

img {
  display: block;
  max-width: 100%;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.sr-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(12, 10, 9, 0.42);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}

html[data-theme="light"] .sr-topbar {
  background: rgba(250, 244, 238, 0.64);
}

.sr-topbar-left,
.sr-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.sr-brand-icon-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  box-shadow: var(--accent-glow);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), transparent 45%),
    linear-gradient(180deg, rgba(255, 122, 47, 0.22), rgba(255, 122, 47, 0.08));
  border: 1px solid rgba(255, 122, 47, 0.26);
}

.sr-brand-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.sr-brand-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sr-brand-name {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.sr-brand-sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

/* =========================================================
   ICON BUTTONS
   ========================================================= */

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.icon-btn:hover,
.icon-btn:active {
  transform: translateY(-1px) scale(1.01);
  border-color: rgba(255, 122, 47, 0.3);
  box-shadow: var(--shadow), var(--accent-glow);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn-accent {
  border-color: rgba(255, 122, 47, 0.28);
  box-shadow: var(--shadow), var(--accent-glow);
}

.theme-toggle .icon-sun,
html[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

.theme-toggle .icon-moon,
html[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

/* =========================================================
   APP SHELL / PANELS
   ========================================================= */

.sr-app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.sr-panels {
  position: absolute;
  inset: 0;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.panel-screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  padding-top: var(--topbar-height);
}

.panel-inner {
  width: min(100%, var(--content-width));
  height: calc(100dvh - var(--topbar-height));
  margin: 0 auto;
  padding: 16px;
}

body[data-panel="0"] .sr-panels {
  transform: translateY(0);
}

body[data-panel="1"] .sr-panels {
  transform: translateY(-100dvh);
}

body[data-panel="2"] .sr-panels {
  transform: translateY(-200dvh);
}

/* =========================================================
   HERO PANEL
   ========================================================= */

.hero-panel .panel-inner {
  display: flex;
  align-items: stretch;
}

.hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--hero-shadow);
  background: #110d0b;
}

.hero-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-screen-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 122, 47, 0.14), transparent 20%),
    linear-gradient(180deg, rgba(8, 6, 5, 0.18) 0%, rgba(8, 6, 5, 0.34) 35%, rgba(8, 6, 5, 0.78) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: clamp(22px, 4vw, 42px);
}

.hero-copy {
  max-width: min(760px, 88%);
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff0e8;
  background: rgba(255, 122, 47, 0.16);
  border: 1px solid rgba(255, 122, 47, 0.26);
  box-shadow: var(--accent-glow);
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 4.9vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: #fff7f2;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.hero-subtitle-marquee {
  position: relative;
  width: 100%;
  max-width: 760px;
  overflow: hidden;
  margin-bottom: 16px;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.hero-subtitle-track {
  display: inline-flex;
  min-width: max-content;
  animation: marqueeX 22s linear infinite;
}

.hero-subtitle {
  padding-right: 32px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: #f2ddd2;
  white-space: nowrap;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  color: #e8d3c7;
  font-size: 0.95rem;
}

.hero-meta strong {
  color: #fff4ed;
}

.hero-edge-hint {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.74);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =========================================================
   PANEL 2: AUDIO + EXPLORE
   ========================================================= */

.media-panel .panel-inner {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.96fr) minmax(320px, 1.04fr);
  gap: 16px;
  min-height: 0;
  height: 100%;
}

.media-card,
.explore-card-shell {
  position: relative;
  min-height: 0;
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.media-card-inner,
.explore-card-inner {
  height: 100%;
  padding: clamp(18px, 2vw, 24px);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(1.28rem, 2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.media-header-row,
.explore-header-row {
  margin-bottom: 16px;
}

.audio-top {
  display: grid;
  gap: 16px;
}

.now-playing-card {
  border-radius: 24px;
  padding: 16px;
  border: 1px solid rgba(255, 122, 47, 0.24);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 122, 47, 0.14), transparent 35%),
    rgba(255,255,255,0.04);
  box-shadow: var(--accent-glow);
}

.now-playing-label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.now-playing-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#nowPlayingTitle {
  display: block;
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

.player-visual {
  display: inline-flex;
  align-items: end;
  gap: 4px;
  height: 26px;
  flex: 0 0 auto;
}

.player-visual span {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.45;
  animation: playerPulse 1s ease-in-out infinite;
}

.player-visual span:nth-child(2) { animation-delay: 0.12s; }
.player-visual span:nth-child(3) { animation-delay: 0.24s; }
.player-visual span:nth-child(4) { animation-delay: 0.36s; }

body:not(.is-playing) .player-visual span {
  animation-play-state: paused;
  opacity: 0.2;
}

.track-grid {
  display: grid;
  gap: 10px;
}

.track-item {
  width: 100%;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.track-item:hover,
.track-item.active-track {
  transform: translateY(-1px);
  border-color: rgba(255, 122, 47, 0.28);
  background: rgba(255,255,255,0.08);
  box-shadow: var(--accent-glow);
}

.track-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
}

.track-item.active-track .track-status-dot {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 122, 47, 0.48);
}

.track-copy {
  min-width: 0;
}

.track-label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
}

.track-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-play-icon {
  opacity: 0.78;
}

.main-audio {
  width: 100%;
  margin-top: 14px;
  border-radius: 16px;
  box-shadow: var(--accent-glow);
}

/* =========================================================
   EXPLORE
   ========================================================= */

.explore-card-shell {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 122, 47, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
}

.explore-category-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.explore-cat-btn {
  position: relative;
  min-height: 52px;
  border-radius: 20px;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  overflow: hidden;
  padding: 0 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.explore-cat-btn span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-cat-btn:hover,
.explore-cat-btn.active {
  transform: translateY(-1px);
}

.explore-cat-btn.spirituality {
  background: linear-gradient(180deg, rgba(132,120,255,0.24), rgba(132,120,255,0.12));
  border-color: rgba(132,120,255,0.26);
}

.explore-cat-btn.human,
.explore-cat-btn.human-nature {
  background: linear-gradient(180deg, rgba(86,181,217,0.24), rgba(86,181,217,0.12));
  border-color: rgba(86,181,217,0.26);
}

.explore-cat-btn.religion {
  background: linear-gradient(180deg, rgba(255,122,47,0.24), rgba(255,122,47,0.12));
  border-color: rgba(255,122,47,0.26);
}

.explore-list-panel {
  height: calc(100% - 150px);
  min-height: 220px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  overflow: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.explore-list-grid {
  display: grid;
  gap: 10px;
}

.explore-card-link {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.explore-card-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 122, 47, 0.24);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
}

.explore-card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explore-topic-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.explore-topic-dot.spirituality { background: var(--spirituality); }
.explore-topic-dot.human,
.explore-topic-dot.human-nature { background: var(--human); }
.explore-topic-dot.religion { background: var(--religion); }

.explore-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

.explore-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* =========================================================
   ARTICLE PANEL
   ========================================================= */

.article-panel .panel-inner {
  height: calc(100dvh - var(--topbar-height));
}

.article-shell {
  height: 100%;
  border-radius: 32px 32px 0 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.article-top {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.article-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.article-top-left {
  min-width: 0;
}

.article-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.article-subline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-scroll {
  overflow: auto;
  padding: clamp(22px, 3vw, 36px);
}

.article-content {
  width: min(100%, var(--article-width));
  margin: 0 auto;
}

.article-content h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 2.4vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.article-content p {
  margin: 0 0 1.1em;
  font-size: 1.04rem;
  color: var(--text);
}

.article-content .lead {
  font-size: 1.08rem;
}

.article-content .dropcap::first-letter {
  float: left;
  font-size: 3.15rem;
  line-height: 0.88;
  padding-right: 8px;
  font-weight: 800;
  color: var(--accent);
}

.article-content .aside {
  color: var(--muted);
  font-size: 0.96rem;
}

.article-content blockquote {
  margin: 24px 0;
  padding: 18px 18px 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 18px;
  background: var(--accent-soft);
  box-shadow: var(--accent-glow);
  font-style: italic;
}

.article-content .rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 18px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-content .rule::before,
.article-content .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.comments-card {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.04);
  padding: 18px;
}

.comments-note {
  margin: 0;
  color: var(--muted);
}

.sr-footer {
  margin-top: 26px;
  padding: 12px 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.sr-footer p {
  margin: 0;
}

.sr-footer a {
  color: inherit;
}

/* =========================================================
   HELPERS
   ========================================================= */

.marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  min-width: max-content;
  animation: marqueeX 18s linear infinite;
}

.hidden {
  display: none !important;
}

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes playerPulse {
  0%, 100% { height: 8px; opacity: 0.35; }
  50% { height: 24px; opacity: 1; }
}

@keyframes marqueeX {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .media-grid {
    grid-template-columns: 1fr;
  }

  .explore-list-panel {
    height: auto;
    min-height: 220px;
    max-height: 320px;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 64px;
  }

  .sr-topbar {
    padding: 10px 12px;
  }

  .sr-brand-name {
    font-size: 0.92rem;
  }

  .sr-brand-sub {
    display: none;
  }

  .panel-inner {
    padding: 12px;
  }

  .hero-stage {
    border-radius: 26px;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3.2rem);
  }

  .hero-subtitle {
    font-size: 0.98rem;
  }

  .hero-edge-hint {
    right: 16px;
    bottom: 14px;
    font-size: 0.72rem;
  }

  .explore-category-row {
    gap: 8px;
  }

  .explore-cat-btn {
    min-height: 46px;
    border-radius: 16px;
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .article-shell {
    border-radius: 24px 24px 0 0;
  }
}

@media (max-width: 640px) {
  body {
    overflow: auto;
  }

  body.sr-mobile-flow {
    overflow: auto;
  }

  .sr-app,
  .sr-panels {
    position: relative;
    inset: auto;
    height: auto;
    overflow: visible;
    transform: none !important;
  }

  .panel-screen {
    height: auto;
    min-height: 100dvh;
  }

  .panel-inner {
    height: auto;
  }

  .hero-panel .panel-inner,
  .media-panel .panel-inner {
    display: block;
  }

  .hero-stage {
    height: calc(100dvh - var(--topbar-height) - 20px);
  }

  .media-grid {
    height: auto;
  }

  .article-panel .panel-inner {
    height: auto;
  }

  .article-shell {
    height: auto;
  }

  .article-scroll {
    overflow: visible;
  }
}