/* Sound page — lab tokens + slides shell; Soft boxes; Tour + modules. */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

html:has(.slides),
html:has(.slides) body {
  height: 100%;
  overflow: hidden;
}

a { color: inherit; }

.col {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
  width: 100%;
}

.soft-box {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.btn-icon-ext {
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.7;
}

/* -- Home mark -- */
.home-mark {
  position: fixed;
  top: max(1.5rem, calc(env(safe-area-inset-top, 0px) + 1rem));
  left: max(1.5rem, calc(env(safe-area-inset-left, 0px) + 1rem));
  z-index: 15;
  display: block;
  line-height: 0;
  opacity: 0.72;
  transition: opacity 0.2s var(--ease);
}
.home-mark img {
  display: block;
  width: clamp(2.4rem, 7vw, 3.1rem);
  height: auto;
}
.home-mark:hover,
.home-mark:focus-visible {
  opacity: 1;
  outline: none;
}
.home-mark:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 4px;
}

/* -- Hero (slide 1) -- */
.hero {
  padding: clamp(2rem, 6vh, 3rem) clamp(1rem, 4vw, 2.5rem);
}

.hero-copy { width: 100%; }

.hero-brand {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero-brand img {
  display: block;
  width: clamp(5.5rem, 16vw, 7.5rem);
  height: auto;
}

.hero-subtitle {
  margin: 0.55rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 500;
  color: var(--sea);
  letter-spacing: -0.02em;
}

.hero-lede {
  margin: 1.15rem auto 0;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.55;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.65rem;
}

/* -- Stage (slide 2) -- */
.stage-slide {
  justify-content: safe center;
  align-items: center;
  padding-top: clamp(1.5rem, 4vh, 2.5rem);
  padding-bottom: clamp(4rem, 8vh, 5.5rem);
}

.stage-inner {
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.step-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.step-tab {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.4rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 85%, #fff);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.step-tab:hover {
  border-color: color-mix(in srgb, var(--sea) 35%, var(--line));
  color: var(--ink);
}
.step-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.step-tab__title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.step-tab__mod {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.92;
  width: 100%;
}
.step-tab__mod img {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.step-tab.is-active .step-tab__mod img {
  filter: brightness(0) invert(1);
}

.step-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step-lede {
  margin: 0.55rem auto 1.15rem;
  max-width: 30rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.path-box {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.path-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.path-item {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}
.path-item.is-active {
  color: var(--ink);
}
.path-item.is-done {
  color: var(--ok);
}

.role-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.role-tab {
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.42rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 85%, #fff);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.role-tab:hover {
  border-color: color-mix(in srgb, var(--sea) 35%, var(--line));
  color: var(--ink);
}
.role-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.view-panel {
  padding: 1rem 1.1rem 1.1rem;
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
}

.view-panel__heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-panel__stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: 16rem;
  margin: 0 auto;
}

.view-stat {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--paper-2) 45%, #fff);
  text-align: center;
}
.view-stat__k {
  color: var(--ink-soft);
  font-weight: 600;
}
.view-stat__v {
  font-weight: 700;
  color: var(--ink);
}

.view-panel__hint {
  margin: 0.25rem 0 0;
  max-width: 26rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* -- Modules (slide 3) -- */
.modules-slide {
  justify-content: safe center;
  padding: clamp(2rem, 6vh, 3rem) clamp(1rem, 4vw, 2.5rem);
}

.slide-icon {
  display: flex;
  justify-content: center;
  margin: 0 auto 0.85rem;
  width: 4.25rem;
  height: 4.25rem;
}
.slide-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.slide-icon--modules {
  color: var(--horizon, var(--sea));
}

.modules-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modules-lede {
  margin: 0.65rem auto 1.35rem;
  max-width: 30rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.module-card {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.1rem 1rem 1.15rem;
  cursor: pointer;
  color: inherit;
  transition: border-color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}
.module-card:hover,
.module-card:focus-visible {
  border-color: color-mix(in srgb, var(--sea) 40%, var(--line));
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.08);
}
.module-card.is-selected {
  border-color: var(--ink);
}
.module-card__mark {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}
.module-card__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.module-card__role {
  max-width: 22rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

@media (min-width: 640px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .module-card__role {
    font-size: 0.8rem;
  }
}

/* -- Module detail modal -- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal[hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 26, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;
}
.modal.open .modal-backdrop { opacity: 1; }

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 32rem;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(20, 22, 26, 0.28);
  padding: 2rem;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 220ms var(--ease), opacity 220ms var(--ease);
}
.modal.open .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}
.modal-close svg { width: 12px; height: 12px; }
.modal-close:hover,
.modal-close:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-right: 2rem;
  min-height: 2.5rem;
}
.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-width: 0;
}
.modal-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: left;
}
.modal-mark {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  flex-shrink: 0;
}
.modal-mark[hidden] { display: none !important; }

.modal-section {
  margin-top: 1.15rem;
  text-align: center;
}
.modal-section p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 1.75rem;
}

.modal-actions .btn.modal-action-disabled,
.modal-actions .btn.modal-action-disabled:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
  border: 1.5px solid color-mix(in srgb, var(--ink) 18%, var(--line));
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  box-shadow: none;
}

@media (max-width: 520px) {
  .step-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .step-tab__title { font-size: 0.78rem; }
  .step-tab__mod img {
    width: 24px;
    height: 24px;
  }
}
