/* --- Color Variables --- */
:root {
  --cobalt-blue: #1F365D;
  --classic-blue: #24528f;
  --lichen-blue: #5486c2;
  --bee-yellow: #e4bb54;
  --porcelain-white: #f2f2f2;
  --white: #fff;
}

/* --- General Page Styles --- */
body {
  font-family: 'EB Garamond', serif;
  margin: 0;
  background: var(--porcelain-white);
  color: var(--classic-blue);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'DM Serif Display', serif;
}

/* --- Typography Utility Classes --- */
.text-title {
  font-family: 'DM Serif Display', serif;
}

.text-subtitle {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
}

.text-body {
  font-family: 'EB Garamond', serif;
}

.chapter-detail-content .text-body {
  font-size: 1.5rem;
  line-height: 1.6;
}

.text-accent {
  font-family: 'Montserrat', sans-serif;
}

/* --- Motion Tokens --- */
:root {
  --ease-emphasis: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-xxs: 120ms;
  --dur-xs: 180ms;
  --dur-sm: 240ms;
  --dur-md: 360ms;
  --dur-lg: 600ms;
}

/* --- Timeline --- */
.timeline-app {
  min-height: 100vh;
  background: var(--porcelain-white);
}

.timeline-root {
  position: relative;
}

.timeline-list {
  position: relative;
  margin: 0 auto;
  max-width: 960px;
  padding-bottom: 6rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.timeline-year {
  grid-column: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cobalt-blue);
}

.timeline-card {
  grid-column: 2;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.timeline-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-content {
  padding: 1.25rem 1.25rem 1.5rem;
}

.timeline-title {
  margin: 0 0 0.5rem 0;
  color: var(--classic-blue);
}

.timeline-preview {
  margin: 0 0 0.75rem 0;
  color: var(--classic-blue);
}

@media (max-width: 992px) {
  .timeline-item {
      grid-template-columns: 80px 1fr;
  }

  .timeline-card {
      grid-template-columns: 1fr;
  }
}

/* --- Prototype Page --- */
.prototype-app {
  min-height: 100vh;
}

/* Locomotive Scroll container sizing */
[data-scroll-container] {
  min-height: 100vh;
}

.proto-hero {
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
  /* Frosted glass */
  background: rgba(242, 242, 242, 0.82);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  backdrop-filter: saturate(150%) blur(10px);
}

.proto-hero::before {
  display: none;
}

.proto-hero__spacer {
  height: 72px;
}

.proto-hero__title {
  margin: 0;
  color: var(--cobalt-blue);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
}

.proto-hero__subtitle {
  margin: 0.25rem 0 0 0;
  color: var(--classic-blue);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-style: italic;
}

.proto-hero__divider {
  margin-top: 1.25rem;
  border-bottom: 3px solid var(--bee-yellow);
  position: relative;
  padding-bottom: 0.5rem;
}

.proto-hero__divider-text {
  display: inline-block;
  margin-bottom: -1.5px;
  text-transform: uppercase;
  color: var(--bee-yellow);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Level 1 hero tweaks */
.proto-hero--l1 {
  text-align: center;
}

.proto-hero--l1 .proto-hero__title {
  justify-self: center;
}

.proto-hero--l1 .proto-hero__subtitle {
  justify-self: center;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}


.proto-card {
  cursor: pointer;
  transition: transform var(--dur-sm) var(--ease-standard), box-shadow var(--dur-sm) var(--ease-standard);
}

.proto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.proto-toolbar .badge {
  font-weight: 600;
}

.proto-stage {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  position: relative;
  min-height: 85vh;
  /* almost full screen */
  padding-bottom: 88px;
  /* space for footer controls */
}

/* Level 2: stage without background or shadow */
.level-2 .proto-stage {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding-top: 72px;
  min-height: calc(100vh - 72px);
}


.proto-stage-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.proto-stage-content {
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

/* --- Prototype visuals --- */
.centuries-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 25vh;
  padding-bottom: 35vh;
}

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

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

.century-card {
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 1rem 1rem 1rem 1.25rem;
  box-shadow: none;
  cursor: pointer;
  transition: none;
}

.century-card__eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--classic-blue);
  margin-bottom: 0.25rem;
}

.century-card__title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--cobalt-blue);
  line-height: 1.2;
}

.century-card__desc {
  margin-top: 0.25rem;
  color: var(--lichen-blue);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.3;
}

.century-card__meta {
  margin-top: 0.25rem;
  color: var(--classic-blue);
}

.century-card__years {
  display: block;
  font-size: clamp(1.125rem, 2.3vw, 1.5rem);
  line-height: 1.25;
}

.century-card__count {
  display: block;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.25;
}

.century-card.selected {
  outline: none;
  outline-offset: 0;
}

/* Level 0: two-column layout like level 1 */
.century-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
  min-height: 100vh;
}

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

/* Level 0: use compact row height */
.level-0 .century-row {
  min-height: 25vh;
}

.century-left {
  position: static;
  top: auto;
  height: auto;
}

.century-left-inner {
  transform: none;
  display: grid;
  gap: 0.25rem;
  justify-items: start;
}

.century-left-badge {
  font-weight: 700;
  color: var(--classic-blue);
  font-family: 'DM Serif Display', serif;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.05;
}

.century-left-badge .century-word {
  font-size: 0.8em;
  opacity: 0.9;
}

.century-left-badge .century-roman {
  font-size: 1.2em;
  letter-spacing: 0.02em;
}

.century-right {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  padding: 0.75rem;
  position: relative;
}

.century-right::before {
  content: "";
  position: absolute;
  left: -0.625rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--classic-blue);
  opacity: 0.25;
}

.century-card.selected .century-right {
  border-color: rgba(36, 82, 143, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  background: rgba(36, 82, 143, 0.02);
}

@media (max-width: 768px) {
  .century-right::before {
      content: none;
  }
}

/* (reverted) */

.years-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.year-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background var(--dur-xs) var(--ease-standard), transform var(--dur-xs) var(--ease-standard);
}

.year-chip:hover {
  transform: translateY(-1px);
}

.year-chip__year {
  font-weight: 700;
  color: var(--classic-blue);
}

.year-chip__count {
  color: var(--classic-blue);
}

/* Level 1: year sections with chapter previews */
.year-sections {
  display: grid;
  gap: 1rem;
  padding-top: 35vh;
  padding-bottom: 35vh;
}

.scroll-end-spacer {
  height: 100vh;
}

.year-section {
  padding: 0.75rem 1rem;
  transition: background var(--dur-sm) var(--ease-standard), border-color var(--dur-sm) var(--ease-standard), box-shadow var(--dur-sm) var(--ease-standard);
}

.year-section.selected {}

.year-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: start;
  min-height: 100vh;
}

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

.year-left {
  /* position: sticky; top: 45vh; height: 0; */
}

.year-left-inner {
  transform: translateY(-50%);
  display: grid;
  gap: 0.25rem;
  justify-items: start;
}

.year-left-badge {
  font-weight: 700;
  color: var(--classic-blue);
  font-family: 'Montserrat', sans-serif;
  background: rgba(36, 82, 143, 0.08);
  border: 1px solid rgba(36, 82, 143, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
}

.year-left-count {
  color: var(--classic-blue);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
}

.year-columns {
  display: grid;
  gap: 0.75rem;
}

.year-right {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  padding: 0.25rem;
}


/* TMP */
.year-section.selected .year-right {
  /* border-color: rgba(36, 82, 143, 0.18); */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  background: rgba(36, 82, 143, 0.02);
}

.year-col {
  display: grid;
  gap: 0.5rem;
}

.year-col-head {
  margin-bottom: 0.25rem;
}

.year-col-items {
  display: grid;
  gap: 0.5rem;
}

/* Level 1 override: make year-left non-sticky and remove translate */
.level-1 .year-left {
  position: static;
  top: auto;
  height: auto;
}

.level-1 .year-left-inner {
  transform: none;
}

.level-1 .year-row {
  min-height: 100vh;
}

/* Level 1: year pill visual reset */
.level-1 .year-left-badge {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 3rem;
}

/* Level 1: New card design with header and body - matching reference design exactly */
.level-1 .chapter-snippet {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  margin-top: 1rem;
  min-height: auto;
  max-width: 580px;
  width: 100%;
  border: 2px solid rgba(31, 54, 93, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Level 1: Header section with dark blue background - matching reference proportions */
.level-1 .chapter-snippet__header {
  background: var(--cobalt-blue);
  padding: 3rem 2.5rem 2.5rem 2.5rem;
  color: var(--white);
  position: relative;
  border-radius: 24px 24px 0 0;
  border-bottom: none;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Level 1: Tabs container - positioned at top to match reference */
.level-1 .chapter-snippet__tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  position: absolute;
  top: -1rem;
  left: 2.5rem;
  z-index: 3;
}

/* Level 1: Individual tabs - base styling for layered design */
.level-1 .chapter-snippet__tab {
  background: var(--porcelain-white);
  color: var(--cobalt-blue);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'DM Serif Display', serif;
  border: 2px solid rgba(31, 54, 93, 0.15);
  position: relative;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* First tab - on top, fully rounded corners */
.level-1 .chapter-snippet__tab:first-child {
  border-radius: 14px;
  z-index: 3;
  position: relative;
}

/* Second tab - behind first tab with offset to the right */
.level-1 .chapter-snippet__tab:last-child {
  border-radius: 14px;
  z-index: 1;
  position: relative;
  margin-left: -30px;
  transform: translateX(50px) translateY(4px);
}

/* Single tab - fully rounded when there's only one tab */
.level-1 .chapter-snippet__tab:only-child {
  border-radius: 14px;
  border: 2px solid rgba(31, 54, 93, 0.15);
}

/* Level 1: Title in header - matching reference size and layout */
.level-1 .chapter-snippet__title {
  color: var(--white);
  font-size: 2.5rem;
  line-height: 1;
  margin: 0;
  font-family: 'DM Serif Display', serif;
  text-align: left;
  font-weight: 700;
  margin-top: 1rem;
  max-width: calc(100% - 1rem);
  letter-spacing: -0.02em;
}

/* Level 1: Body section matching reference layout */
.level-1 .chapter-snippet__body {
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  background: var(--white);
  min-height: 140px;
}

/* Level 1: Content text section */
.level-1 .chapter-snippet__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Level 1: Preview text - matching reference styling */
.level-1 .chapter-snippet__preview {
  margin: 0;
  color: var(--cobalt-blue);
  font-size: 1.4rem;
  line-height: 1.3;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
}

/* Level 1: Thumbnail matching reference design exactly */
.level-1 .chapter-snippet__thumb {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--porcelain-white);
  border: 4px solid #E8B4D1;
  margin-left: auto;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.level-1 .chapter-snippet__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



/* Level 1: year right without background */
.level-1 .year-right {
  background: transparent;
}

.level-1 .year-section.selected .year-right {
  background: transparent;
}

.level-1 .year-right {
  box-shadow: none;
}

.level-1 .year-section.selected .year-right {
  box-shadow: none;
}

.chapter-snippet {
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 10px;
  transition: background var(--dur-xs) var(--ease-standard), box-shadow var(--dur-xs) var(--ease-standard), border-color var(--dur-xs) var(--ease-standard), opacity var(--dur-xs) var(--ease-standard);
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.chapter-snippet:hover {
  background: rgba(0, 0, 0, 0.03);
}

.chapter-snippet.is-selected {
  border-color: rgba(36, 82, 143, 0.35);
  background: var(--white);
}

.chapter-snippet.is-selected:hover {
  background: var(--white);
}

/* Level 1: hover styles for new card design */
.level-1 .chapter-snippet:hover {
  transform: translateY(-2px);
  transition: transform var(--dur-xs) var(--ease-standard);
}

.level-1 .chapter-snippet.is-selected {
  border: 2px solid var(--classic-blue);
}

.level-1 .chapter-snippet.is-selected:hover {
  transform: translateY(-2px);
}

.chapter-snippet__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.chapter-snippet {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: start;
}

.chapter-snippet__thumb {
  width: 56px;
  height: 56px;
  position: relative;
  overflow: hidden;
}

.chapter-snippet__thumb::before {
  content: none;
}

.chapter-snippet__thumb::after {
  content: none;
}

.chapter-snippet__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  position: relative;
  z-index: 1;
}

.chapter-snippet__content {
  min-width: 0;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
}

.pill--cat {
  background: rgba(36, 82, 143, 0.08);
  color: var(--classic-blue);
  border: 1px solid rgba(36, 82, 143, 0.25);
}

.chapter-snippet__title {
  margin: 0;
  color: var(--cobalt-blue);
}


.chapter-snippet__date {
  font-weight: 700;
  color: var(--classic-blue);
  font-size: 1.3rem;
}

.chapter-snippet__preview {
  margin: 0.25rem 0 0 0;
  color: var(--classic-blue);
}

.proto-crumbs {
  position: absolute;
  left: 1.25rem;
  top: 1rem;
  color: var(--classic-blue);
}

.proto-crumbs .crumb+.crumb {
  margin-left: 0.25rem;
}

.proto-arrows {
  position: absolute;
  left: 1rem;
  bottom: 3.75rem;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.proto-arrow {
  position: static;
  transform: none;
  border: none;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  /* background: var(--white); */
  /* box-shadow: 0 10px 20px rgba(0,0,0,0.08); */
  color: var(--classic-blue);
  font-size: 56px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* Ensure arrows sit above stage content on level 2 */
.level-2 .proto-arrow {
  z-index: 10;
}

.proto-arrow--left {
  left: 1rem;
}

.proto-arrow--right {
  left: calc(1rem + 108px);
}

.stage-grid {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 3rem;
  height: calc(100vh - 72px - 88px - 2.5rem);
  align-items: stretch;
}

/* Prevent min-content overflow of grid children */
.stage-grid>* {
  min-width: 0;
  min-height: 0;
}

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

.stage-media {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stage-media img,
.stage-media video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.stage-media__chips {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--cobalt-blue);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chip--year {
  font-weight: 700;
}

.chip--cat {
  opacity: 0.9;
}

.stage-title {
  color: var(--cobalt-blue);
  margin: 0 0 0.5rem 0;
}

.stage-lead {
  color: var(--classic-blue);
  font-size: 1.125rem;
}

.stage-body {
  color: var(--cobalt-blue);
  font-size: 1.25rem;
  padding: 14px 22px
}

.stage-index {
  color: var(--classic-blue);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  margin: 0;
  z-index: 2;
}

.stage-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.scroll-area {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-right: 6px;
}

/* Title pill + tags */
.stage-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
  margin-bottom: 8px;
}

.meta-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid rgba(36, 82, 143, 0.25);
  border-radius: 28px 28px 0 0;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(36, 82, 143, 0.12);
  justify-self: start;
  width: max-content;
  margin-left: 20px;
}

.meta-pill {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cobalt-blue);
}

.meta-divider {
  width: 1px;
  height: 18px;
  background: rgba(36, 82, 143, 0.25);
  display: inline-block;
}

.stage-title-pill {
  background: var(--classic-blue);
  color: var(--white);
  border-radius: 0 28px 28px 0;
  padding: 14px 22px;
  line-height: 1.1;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.5rem, 3.6vw, 2.625rem);
  box-shadow: 0 6px 20px rgba(36, 82, 143, 0.25);
  margin-left: -20px;
  padding-left: 40px;
}

/* Level 2: tweak inner pill paddings */
.level-2 .meta-pill-group .meta-pill:first-of-type {
  padding-left: 0.5rem;
}

.level-2 .meta-pill-group .meta-pill:last-of-type {
  padding-right: 0.5rem;
}

.proto-dots {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.proto-dots .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lichen-blue);
  border: none;
}

.proto-dots .dot.active {
  background: var(--classic-blue);
}

/* Stage bottom-left category pills */
.stage-cats {
  position: absolute;
  left: 1rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.stage-cat-pill {
  background: rgba(36, 82, 143, 0.08);
  color: var(--classic-blue);
  border: 1px solid rgba(36, 82, 143, 0.25);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
}

.stage-cat-pill.active {
  background: var(--classic-blue);
  color: var(--white);
  border-color: var(--classic-blue);
}

/* --- Wheel (floating navigator) --- */
.efmp-wheel {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(140px, 18vw, 240px);
  height: clamp(140px, 18vw, 240px);
  pointer-events: none;
  z-index: 1000;
  transition: transform var(--dur-sm) var(--ease-emphasis);
}

/* 30% fuera de la pantalla en ambos lados */
.efmp-wheel--right {
  right: 0;
  left: auto;
  transform: translate(30%, -50%);
}

.efmp-wheel--left {
  left: 0;
  right: auto;
  transform: translate(-30%, -50%);
}

/* Reduced mode for level 1: subtle scale step between 0 and 2 */
.efmp-wheel--right.efmp-wheel--reduced {
  transform: translate(30%, -50%) scale(0.96);
}

.efmp-wheel--left.efmp-wheel--reduced {
  transform: translate(-30%, -50%) scale(0.96);
}

.efmp-wheel__disk {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scale(var(--efmp-wheel-disk-scale, 0.86));
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bee-yellow);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  border: 2px dashed rgba(228, 187, 84, 0.8);
}

.efmp-wheel__notch {
  position: absolute;
  top: 50%;
  width: clamp(28px, 2.4vw, 40px);
  height: 1px;
  background: var(--classic-blue);
  transform: translateY(-50%);
  opacity: 0.8;
}

.efmp-wheel__notch--left {
  left: calc(-1 * clamp(14px, 1.2vw, 24px));
}

.efmp-wheel__notch--right {
  right: calc(-1 * clamp(14px, 1.2vw, 24px));
  display: none;
}

.efmp-wheel--left .efmp-wheel__notch--left {
  display: none;
}

.efmp-wheel--left .efmp-wheel__notch--right {
  display: block;
}

.efmp-wheel__label {
  position: absolute;
  right: calc(100% + 18px);
  top: 45%;
  transform: translateY(-50%);
  color: var(--classic-blue);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.2rem, 2.8vw, 2.25rem);
  text-align: right;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
}

.efmp-wheel__sublabel {
  position: absolute;
  right: calc(100% + 18px);
  top: 60%;
  transform: translateY(-50%);
  color: rgba(36, 82, 143, 0.75);
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  text-align: right;
  white-space: nowrap;
  pointer-events: auto;
}

.efmp-wheel--left .efmp-wheel__label {
  left: calc(100% + 18px);
  right: auto;
  text-align: left;
}

/* Compact mode: smaller main label */
.efmp-wheel--compact .efmp-wheel__label {
  font-size: clamp(0.9rem, 2vw, 1.5rem);
}

.efmp-wheel--left .efmp-wheel__sublabel {
  left: calc(100% + 18px);
  right: auto;
  text-align: left;
}

/* Ticks and radial progress */
.efmp-wheel__ticks {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  /* Base color from disk, darkened via filter */
  background: repeating-conic-gradient(var(--bee-yellow) 0 2deg, transparent 2deg 12deg);
  filter: brightness(0.85);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent calc(50% - 6px), #000 calc(50% - 6px));
  mask: radial-gradient(circle at 50% 50%, transparent calc(50% - 6px), #000 calc(50% - 6px));
}

.efmp-wheel__progress {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(var(--classic-blue) 0deg calc(var(--p, 0) * 1deg), transparent 0 360deg);
  opacity: 0.35;
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent calc(50% - 6px), #000 calc(50% - 6px));
  mask: radial-gradient(circle at 50% 50%, transparent calc(50% - 6px), #000 calc(50% - 6px));
}

/* Radial list (independent from rotating disk) */
.efmp-wheel__markers {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.efmp-wheel__marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--classic-blue);
  /* opacity: 0.5; */
  transform-origin: 0 0;
  transition: width var(--dur-xs) var(--ease-standard), height var(--dur-xs) var(--ease-standard);
}

/* Level 2 compact: grow marker on hover (2x) */
.efmp-wheel--compact .efmp-wheel__marker:hover {
  width: 12px;
  height: 12px;
}

.efmp-wheel__labels {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  transition: opacity 300ms var(--ease-emphasis);
}

.efmp-wheel__label-item {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 50%;
  color: var(--classic-blue);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.1rem, 2.8vw, 1.75rem);
  white-space: nowrap;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: 1.5rem;
}

.efmp-wheel__label-item.is-active {
  opacity: 1;
  font-weight: 700;
}

/* Compact mode for level 2: hide radial labels and slightly shrink wheel */
.efmp-wheel--compact {
  transform: translateY(-50%) scale(0.92);
  transition: transform var(--dur-sm) var(--ease-emphasis);
}

.efmp-wheel--right.efmp-wheel--compact {
  transform: translate(30%, -50%) scale(0.92);
}

.efmp-wheel--left.efmp-wheel--compact {
  transform: translate(-30%, -50%) scale(0.92);
}

.efmp-wheel--compact .efmp-wheel__labels {
  opacity: 1;
}

.efmp-wheel--compact .efmp-wheel__label-item {
  font-size: clamp(0.55rem, 1.1vw, 0.75rem);
  opacity: 0; /* ocultas por defecto */
}

/* Fade labels layer during level transitions to avoid flicker */
/* Transition now handled by JS; keep rule minimal or remove if not needed */
.efmp-wheel--transitioning .efmp-wheel__labels { opacity: 0; }

.efmp-wheel__back {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% - 24px), -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid rgba(36, 82, 143, 0.25);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  color: var(--classic-blue);
  display: grid;
  place-items: center;
  font-size: 20px;
  pointer-events: auto;
  opacity: 0;
  transition: transform var(--dur-sm) var(--ease-emphasis), opacity var(--dur-sm) var(--ease-emphasis);
  cursor: pointer;
}

.efmp-wheel__back.is-visible {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* Compact: grow back button by 20% with same transition */
.efmp-wheel--compact .efmp-wheel__back {
  transform: translate(calc(-50% - 24px), -50%) scale(1.5);
}

.efmp-wheel--compact .efmp-wheel__back.is-visible {
  transform: translate(-50%, -50%) scale(1.5);
}

@media (max-width: 992px) {
  .efmp-wheel {
      width: clamp(110px, 26vw, 160px);
      height: clamp(110px, 26vw, 160px);
  }
}

/* Debug: centerline to verify alignment with notch */
.efmp-debug-line {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: red;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.75;
}

/* Settings gear */
.efmp-settings {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1200;
  font-family: 'Montserrat', sans-serif;
}

.efmp-settings__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(36, 82, 143, 0.25);
  background: var(--white);
  color: var(--classic-blue);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.efmp-settings__panel {
  display: none;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid rgba(36, 82, 143, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 220px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.efmp-settings.is-open .efmp-settings__panel {
  display: block;
}

.efmp-settings__title {
  font-weight: 700;
  color: var(--cobalt-blue);
  margin-bottom: 6px;
}

.efmp-settings__group {
  display: grid;
  gap: 6px;
}

.efmp-settings__label {
  color: var(--classic-blue);
  font-size: 0.9rem;
}

.efmp-settings__options {
  display: grid;
  gap: 6px;
}

.efmp-settings__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--classic-blue);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}