:root {
  color-scheme: light;
  --ink: #17110c;
  --paper: #fff8e8;
  --paper-deep: #efe5cc;
  --sun: #f2a51a;
  --ember: #c34b2c;
  --leaf: #275c47;
  --leaf-dark: #183c35;
  --night: #171b2f;
  --muted: #73695b;
  --line: #dfd2b4;
  --shadow: 0 20px 45px rgba(45, 31, 20, .12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--night);
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 78px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(242, 165, 26, .13), transparent 23rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  display: flex;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: var(--leaf);
  border-radius: 50% 50% 42% 42%;
}

.header-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.narrow-shell {
  width: min(720px, calc(100% - 32px));
}

.home-hero {
  padding-top: clamp(42px, 8vw, 90px);
}

.portal-cta {
  display: inline-flex;
  margin-top: 24px;
  padding: 13px 18px;
  color: white;
  background: var(--ember);
  border-radius: 14px;
  text-decoration: none;
  font-weight: 900;
}

.eyebrow,
.card-label {
  color: var(--ember);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #ffd783;
}

h1,
h2,
h3 {
  font-family: Georgia, serif;
}

h1 {
  max-width: 820px;
  margin: 8px 0 14px;
  font-size: clamp(42px, 8vw, 78px);
  line-height: .98;
  letter-spacing: -.045em;
}

.narrow-shell h1 {
  font-size: clamp(38px, 7vw, 62px);
}

.lede {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
}

.action-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
  margin-top: 40px;
}

.feature-card {
  position: relative;
  display: flex;
  min-height: 360px;
  overflow: hidden;
  padding: 24px;
  color: white;
  align-items: flex-end;
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
}

.feature-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(16, 12, 9, .88), transparent 65%);
}

.legend-card {
  background:
    radial-gradient(circle at 72% 24%, #f4bc49 0 5%, transparent 6%),
    linear-gradient(145deg, #9f4e30, #203a35 72%);
}

.interview-card {
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 211, 116, .7) 0 6%, transparent 7%),
    linear-gradient(145deg, #446d5e, #7f4b34);
}

.feature-card .card-label {
  position: absolute;
  z-index: 2;
  top: 24px;
  color: #ffe0a1;
}

.feature-copy {
  position: relative;
  z-index: 2;
}

.feature-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 46px);
}

.feature-copy p {
  max-width: 520px;
  margin: 0 0 18px;
  color: #f4ecdc;
  line-height: 1.5;
}

.text-link {
  font-size: 13px;
  font-weight: 900;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0 40px;
}

.trust-strip article,
.review-notice {
  padding: 18px;
  background: var(--paper-deep);
  border-radius: 18px;
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip span,
.review-notice p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.progress {
  height: 7px;
  margin: 32px 0 18px;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--sun);
  transition: width .2s ease;
}

.prompt-panel,
.transcript-panel,
.draft-panel {
  margin-top: 18px;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 24px;
}

.prompt-panel {
  color: white;
  background: linear-gradient(145deg, var(--leaf), var(--leaf-dark));
  box-shadow: var(--shadow);
}

.prompt-panel .card-label {
  color: #cce0d4;
}

.prompt-panel h2 {
  margin: 12px 0 24px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.2;
}

.recorder-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.record-button {
  display: inline-flex;
  gap: 10px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--paper);
  align-items: center;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
}

.record-dot {
  width: 22px;
  height: 22px;
  background: var(--ember);
  border: 5px solid #f6c9b9;
  border-radius: 50%;
}

.record-button.recording .record-dot {
  animation: pulse 1.2s infinite;
}

.status-text {
  color: #d9e8df;
  font-size: 12px;
}

.text-button {
  margin-top: 16px;
  padding: 0;
  color: #d7ebdf;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.custom-question-panel {
  margin-top: 16px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 248, 232, .96);
  border-radius: 16px;
}

.compact-row {
  margin: 12px 0 0;
}

audio {
  width: 100%;
  margin-top: 20px;
}

.transcript-panel,
.draft-panel {
  background: white;
  border: 1px solid var(--line);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
}

textarea,
input,
select {
  width: 100%;
  padding: 13px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid #cfc0a0;
  border-radius: 13px;
}

.language-control {
  margin-top: 28px;
  padding: 16px;
  background: var(--paper-deep);
  border-radius: 17px;
}

.language-control select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--leaf) 50%) calc(100% - 18px) calc(50% - 2px) / 6px 6px no-repeat,
    linear-gradient(135deg, var(--leaf) 50%, transparent 50%) calc(100% - 12px) calc(50% - 2px) / 6px 6px no-repeat,
    #fffdf7;
}

.language-control p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.field-help {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.button-row {
  display: flex;
  gap: 12px;
  margin: 18px 0 40px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button {
  padding: 13px 18px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  color: white;
  background: var(--ember);
}

.secondary-button {
  color: var(--leaf);
  background: #e2eadc;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.draft-panel {
  margin-bottom: 40px;
}

.draft-panel h2 {
  margin-bottom: 8px;
}

.draft-panel input {
  margin-bottom: 14px;
}

.save-story-button {
  margin-left: 8px;
}

.story-details {
  margin: 16px 0;
  border-top: 1px solid #d7c8aa;
  border-bottom: 1px solid #d7c8aa;
}

.story-details summary {
  padding: 14px 0;
  color: var(--leaf);
  cursor: pointer;
  font-weight: 900;
}

.story-details p {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.65;
}

.draft-output {
  margin-top: 16px;
  padding: 16px;
  background: var(--paper-deep);
  border-radius: 14px;
}

.draft-output:empty {
  display: none;
}

.generated-cover {
  position: relative;
  height: 250px;
  margin-bottom: 20px;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #c76a3d, #315f50 72%);
  border-radius: 20px;
}

.cover-sun {
  position: absolute;
  top: 28px;
  right: 38px;
  width: 58px;
  height: 58px;
  background: #ffd36f;
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(255, 211, 111, .13);
}

.cover-hill {
  position: absolute;
  bottom: -80px;
  width: 125%;
  height: 220px;
  border-radius: 50% 50% 0 0;
}

.cover-hill-back {
  left: -38%;
  background: #497968;
  transform: rotate(8deg);
}

.cover-hill-front {
  right: -42%;
  bottom: -105px;
  background: #183c35;
  transform: rotate(-7deg);
}

.cover-path {
  position: absolute;
  right: 32%;
  bottom: -25px;
  width: 55px;
  height: 180px;
  background: #e8b86d;
  border-radius: 50% 50% 0 0;
  transform: rotate(9deg);
}

.cover-copy {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 18px;
  left: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.cover-copy small,
.cover-copy strong {
  display: block;
}

.cover-copy strong {
  max-width: 470px;
  margin-top: 5px;
  font-family: Georgia, serif;
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1.08;
}

.legend-hero {
  min-height: 340px;
  padding: 86px 0 40px;
  color: white;
  background:
    linear-gradient(to top, rgba(23, 17, 12, .83), transparent 65%),
    radial-gradient(circle at 72% 25%, #efaf39 0 5%, transparent 6%),
    linear-gradient(145deg, #743a26, #243a36);
}

.legend-hero h1 {
  margin-bottom: 8px;
}

.legend-hero p:last-child {
  color: #f2e5cd;
}

.legend-body {
  padding: 32px 0 50px;
}

.legend-body > h2 {
  margin-top: 36px;
  font-size: 30px;
}

.legend-chapter {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

.legend-chapter h2,
.variant-section h2,
.reflection-section h2,
.source-section h2 {
  margin: 7px 0 14px;
  font-size: clamp(28px, 5vw, 38px);
}

.legend-chapter > p:not(.eyebrow) {
  color: #51483e;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
}

.citation-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.citation-row a {
  padding: 7px 10px;
  color: var(--leaf);
  background: #e2eadc;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.variant-section,
.reflection-section,
.source-section {
  padding: 42px 0 10px;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.variant-grid article {
  padding: 18px;
  background: var(--paper-deep);
  border-radius: 17px;
}

.variant-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.reflection-section ol {
  padding-left: 24px;
}

.reflection-section li {
  padding: 10px 0 10px 8px;
  color: #51483e;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.45;
}

.source-card {
  display: block;
  margin: 10px 0;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
}

.source-card span,
.source-card strong,
.source-card small {
  display: block;
}

.source-card span {
  color: var(--ember);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.source-card strong {
  margin: 5px 0;
}

.source-card small {
  color: var(--muted);
}

.detail-list article {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list article > span {
  display: grid;
  flex: 0 0 40px;
  height: 40px;
  place-items: center;
  color: white;
  background: var(--leaf);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.detail-list strong {
  font-family: Georgia, serif;
  font-size: 19px;
}

.detail-list p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.story-cover {
  position: relative;
  height: 330px;
  margin: 28px 0 24px;
  overflow: hidden;
  padding: 26px;
  color: white;
  background:
    linear-gradient(to top, rgba(28, 20, 13, .82), transparent 66%),
    radial-gradient(circle at 72% 25%, #ffc85a 0 6%, transparent 7%),
    linear-gradient(145deg, #426d5c, #9a5934);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.story-cover > div {
  position: absolute;
  right: 26px;
  bottom: 24px;
  left: 26px;
}

.story-cover h2 {
  max-width: 520px;
  margin: 6px 0;
  font-size: clamp(30px, 6vw, 45px);
}

blockquote {
  margin: 24px 0;
  padding-left: 18px;
  color: #594f42;
  border-left: 4px solid var(--sun);
  font-family: Georgia, serif;
  font-size: clamp(20px, 4vw, 28px);
  font-style: italic;
  line-height: 1.4;
}

.story-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.story-meta span {
  padding: 8px 11px;
  color: var(--leaf);
  background: #e2eadc;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.storage-summary {
  display: flex;
  gap: 5px;
  margin: 28px 0 18px;
  padding: 16px;
  background: var(--paper-deep);
  flex-direction: column;
  border-radius: 16px;
}

.storage-summary span {
  color: var(--muted);
  font-size: 11px;
}

.local-stories {
  display: grid;
  gap: 16px;
  padding-bottom: 40px;
}

.local-story-card {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 22px rgba(45, 31, 20, .07);
}

.local-story-card h2 {
  margin: 6px 0;
  font-size: 27px;
}

.local-story-card > p,
.local-story-card details p {
  color: var(--muted);
  line-height: 1.6;
}

.local-story-card details summary {
  padding: 12px 0;
  color: var(--leaf);
  cursor: pointer;
  font-weight: 900;
}

.saved-recordings > div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.saved-recordings small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.delete-story-button {
  margin-top: 12px;
  padding: 9px 0;
  color: var(--ember);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.empty-library {
  padding: 28px;
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  background: rgba(255, 248, 232, .95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  min-width: 90px;
  padding: 16px 12px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

.bottom-nav a.active {
  color: var(--ember);
}

.portal-page {
  min-height: 100vh;
  margin-top: -74px;
  padding: 130px 0 70px;
  color: var(--paper);
  background:
    radial-gradient(circle at 15% 8%, rgba(242, 165, 26, .16), transparent 24rem),
    radial-gradient(circle at 90% 35%, rgba(39, 92, 71, .62), transparent 30rem),
    var(--night);
}

.portal-intro h1 {
  max-width: 920px;
}

.portal-intro > p:last-child {
  max-width: 720px;
  color: #d9d3c6;
  font-size: 17px;
  line-height: 1.6;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .65fr);
  gap: 20px;
  margin-top: 34px;
}

.scene-card,
.portal-guide {
  overflow: hidden;
  background: rgba(255, 248, 232, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, .35);
}

.legend-scene {
  position: relative;
  height: min(62vh, 610px);
  min-height: 430px;
  overflow: hidden;
  background: #1b2b32;
}

.legend-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.scene-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffe1a3;
  background: #1b2b32;
  font-weight: 900;
}

.scene-badge,
.scene-instructions {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.scene-badge {
  top: 18px;
  left: 18px;
  display: flex;
  padding: 10px 13px;
  background: rgba(14, 20, 19, .67);
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.scene-badge span {
  color: #ffd783;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.scene-badge strong {
  margin-top: 3px;
  color: white;
  font-family: Georgia, serif;
}

.scene-instructions {
  right: 15px;
  bottom: 13px;
  padding: 7px 10px;
  color: #ece5d7;
  background: rgba(14, 20, 19, .58);
  border-radius: 999px;
  font-size: 9px;
}

.sun-control {
  padding: 16px 20px 6px;
  color: var(--ink);
}

.sun-control label {
  margin-bottom: 7px;
}

.sun-control input {
  width: 100%;
  accent-color: var(--sun);
}

.hotspot-row {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
}

.hotspot-row button {
  flex: none;
  padding: 9px 12px;
  color: var(--leaf);
  background: #e2eadc;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.hotspot-row button.active {
  color: white;
  background: var(--ember);
}

.hotspot-detail {
  padding: 8px 20px 22px;
  color: var(--ink);
}

.hotspot-detail h2 {
  margin: 5px 0 7px;
  font-size: 27px;
}

.hotspot-detail > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.portal-guide {
  position: relative;
  padding: 26px;
  color: var(--ink);
}

.portal-guide h2 {
  margin: 7px 0 9px;
  font-size: 30px;
}

.portal-guide > p:not(.eyebrow, .guide-disclaimer) {
  color: var(--muted);
  line-height: 1.55;
}

.guide-orb {
  display: grid;
  width: 82px;
  height: 82px;
  margin-bottom: 24px;
  place-items: center;
  background: radial-gradient(circle, #f7c45d, #c34b2c 58%, #183c35 60%);
  border-radius: 50%;
  box-shadow: 0 0 0 11px rgba(242, 165, 26, .12);
}

.guide-orb span {
  width: 25px;
  height: 25px;
  background: var(--paper);
  border-radius: 50%;
}

.guide-orb.speaking {
  animation: guide-pulse .55s infinite alternate ease-in-out;
}

.portal-guide textarea {
  background: #fffdf7;
}

.guide-controls {
  display: flex;
  gap: 9px;
  margin-top: 10px;
}

.guide-controls select {
  width: auto;
  min-width: 110px;
}

.guide-sources {
  display: flex;
  gap: 7px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.guide-sources a {
  padding: 7px 9px;
  color: var(--leaf);
  background: #e2eadc;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  text-decoration: none;
}

.guide-disclaimer {
  margin-top: 17px;
  padding: 11px;
  color: var(--muted);
  background: var(--paper-deep);
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.5;
}

.portal-reading-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--ember);
  text-decoration: none;
}

.portal-catalogue {
  padding-top: 65px;
}

.portal-catalogue h2 {
  margin: 5px 0 22px;
  font-size: clamp(32px, 5vw, 48px);
}

.portal-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 13px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.portal-card {
  position: relative;
  min-height: 245px;
  padding: 20px;
  color: #eee5d6;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
}

.portal-card.active {
  background: linear-gradient(150deg, rgba(195, 75, 44, .45), rgba(39, 92, 71, .5));
  border-color: rgba(255, 211, 131, .45);
}

.portal-card > span,
.portal-card small,
.portal-card strong {
  display: block;
}

.portal-card > span {
  margin-top: 32px;
  color: #ffd783;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.portal-card h3 {
  margin: 7px 0;
  color: white;
  font-size: 25px;
}

.portal-card p,
.portal-card small {
  color: #cfc8bb;
  font-size: 11px;
  line-height: 1.5;
}

.portal-card strong {
  position: absolute;
  bottom: 18px;
  color: #ffd783;
  font-size: 10px;
  text-transform: uppercase;
}

.portal-symbol {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  opacity: .8;
}

.portal-symbol.shadow {
  background: linear-gradient(110deg, #ffd783 49%, #172421 50%);
  border-radius: 50%;
}

.portal-symbol.web {
  border: 1px solid #ffd783;
  border-radius: 50%;
  box-shadow: inset 0 0 0 7px transparent, inset 0 0 0 8px #ffd783;
}

.portal-symbol.baobab {
  background: #ffd783;
  clip-path: polygon(43% 100%, 45% 50%, 12% 42%, 42% 38%, 25% 0, 50% 30%, 72% 2%, 59% 39%, 95% 31%, 59% 51%, 58% 100%);
}

.portal-symbol.river {
  border: solid #b9ddd6;
  border-width: 0 0 5px;
  border-radius: 50%;
  transform: rotate(-12deg);
}

.portal-symbol.moon {
  background: #ffd783;
  border-radius: 50%;
  box-shadow: -10px 0 0 0 var(--night);
}

@keyframes guide-pulse {
  to {
    transform: scale(1.08);
    box-shadow: 0 0 0 18px rgba(242, 165, 26, .08), 0 0 35px rgba(242, 165, 26, .35);
  }
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(195, 75, 44, .2);
  }
}

@media (max-width: 720px) {
  .header-note {
    display: none;
  }

  .action-grid,
  .trust-strip,
  .variant-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 310px;
  }

  .bottom-nav {
    justify-content: stretch;
  }

  .bottom-nav a {
    flex: 1;
    min-width: 0;
    padding-inline: 4px;
  }

  .portal-layout {
    grid-template-columns: 1fr;
  }

  .legend-scene {
    min-height: 420px;
    height: 58vh;
  }

  .portal-guide {
    padding: 21px;
  }

  .guide-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-controls select {
    width: 100%;
  }

  .portal-cards {
    grid-template-columns: repeat(5, 210px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-orb.speaking {
    animation: none;
  }
}

.immersive-body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  padding: 0;
  color: white;
  background: #010207;
}

.immersive-body .site-header,
.immersive-body .bottom-nav {
  display: none;
}

.immersive-body > main,
.cosmos-portal,
.cosmos-scene {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
}

.cosmos-portal {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(44, 92, 133, .18), transparent 30%),
    #010207;
}

.cosmos-scene {
  position: absolute;
  inset: 0;
}

.cosmos-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.cosmos-portal .scene-loading {
  color: rgba(255, 239, 205, .78);
  background:
    radial-gradient(circle at center, rgba(42, 77, 112, .2), transparent 28rem),
    #010207;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.enter-portal {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: clamp(84px, 13vw, 128px);
  aspect-ratio: 1;
  padding: 0;
  color: white;
  background:
    radial-gradient(circle, rgba(255, 194, 88, .34) 0 4%, transparent 5% 100%);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.portal-rings,
.portal-rings::before,
.portal-rings::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid rgba(255, 206, 120, .7);
  border-radius: 50%;
  box-shadow:
    0 0 24px rgba(255, 175, 55, .38),
    inset 0 0 24px rgba(255, 175, 55, .22);
  animation: portal-breathe 2.4s ease-in-out infinite;
}

.portal-rings::before {
  inset: 13%;
  border-color: rgba(193, 224, 255, .55);
  animation-delay: -.8s;
}

.portal-rings::after {
  inset: 29%;
  border-color: rgba(255, 224, 168, .88);
  animation-delay: -1.6s;
}

.enter-portal::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  content: "";
  background: #ffe2a4;
  border-radius: 50%;
  box-shadow: 0 0 23px 8px rgba(255, 176, 54, .68);
  transform: translate(-50%, -50%);
}

.enter-portal.entering {
  pointer-events: none;
  animation: portal-enter 1.2s ease-in forwards;
}

.location-marker {
  position: absolute;
  z-index: 6;
  top: 49%;
  left: 54%;
  width: 28px;
  height: 28px;
  pointer-events: none;
  border: 1px solid rgba(255, 202, 105, .85);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(255, 175, 55, .8);
  animation: marker-pulse 1s ease-in-out infinite;
}

.location-marker span {
  position: absolute;
  inset: 9px;
  background: #ffd078;
  border-radius: 50%;
}

.immersive-controls {
  position: absolute;
  z-index: 8;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  flex-direction: column;
}

.immersive-controls button,
.source-panel button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  color: #fff5df;
  background: rgba(6, 15, 17, .58);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .24);
  backdrop-filter: blur(16px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.immersive-controls #voiceQuestion {
  color: #21130a;
  background: rgba(255, 199, 97, .92);
  border-color: rgba(255, 232, 188, .9);
  box-shadow:
    0 0 0 7px rgba(255, 180, 55, .12),
    0 8px 30px rgba(0, 0, 0, .3);
}

.microphone-icon {
  position: relative;
  display: block;
  width: 12px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.microphone-icon::before {
  position: absolute;
  right: -6px;
  bottom: -6px;
  left: -6px;
  height: 10px;
  content: "";
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.microphone-icon::after {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 10px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
}

.immersive-controls #voiceQuestion.listening {
  color: white;
  background: #b93d2d;
  animation: microphone-listening .72s ease-in-out infinite alternate;
}

.immersive-controls #toggleAmbience.active {
  color: #18301f;
  background: rgba(153, 210, 137, .94);
  border-color: rgba(220, 255, 208, .9);
}

.voice-invitation {
  position: absolute;
  z-index: 8;
  right: 82px;
  bottom: max(27px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  padding: 11px 15px 11px 12px;
  color: #fff7e8;
  background: rgba(5, 14, 15, .72);
  align-items: center;
  border: 1px solid rgba(255, 218, 150, .32);
  border-radius: 999px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, .35),
    0 0 24px rgba(255, 181, 55, .12);
  backdrop-filter: blur(16px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  animation: invitation-arrive .55s ease-out both;
}

.voice-invitation.leaving {
  animation: invitation-leave .45s ease-in both;
}

.voice-waves {
  display: flex;
  width: 26px;
  height: 26px;
  gap: 3px;
  align-items: center;
  justify-content: center;
  background: #ffc761;
  border-radius: 50%;
}

.voice-waves i {
  display: block;
  width: 2px;
  height: 8px;
  background: #2a180b;
  border-radius: 999px;
  animation: voice-wave .72s ease-in-out infinite alternate;
}

.voice-waves i:nth-child(2) {
  height: 13px;
  animation-delay: -.24s;
}

.voice-waves i:nth-child(3) {
  animation-delay: -.48s;
}

.immersive-panel,
.caption-panel {
  position: absolute;
  z-index: 9;
  color: #fff7e8;
  background: rgba(4, 12, 13, .68);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 20px 65px rgba(0, 0, 0, .35);
  backdrop-filter: blur(18px);
}

.sun-panel {
  right: 78px;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 58px);
  width: min(250px, calc(100vw - 112px));
  padding: 14px 17px;
  border-radius: 999px;
}

.sun-panel input {
  width: 100%;
  accent-color: #ffc153;
}

.caption-panel {
  right: 80px;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  max-width: 720px;
  padding: 13px 17px;
  border-radius: 16px;
}

.caption-panel p {
  margin: 0;
  font-size: clamp(12px, 1.7vw, 15px);
  line-height: 1.55;
}

.legend-chat {
  position: absolute;
  z-index: 8;
  top: clamp(90px, 16vh, 150px);
  right: max(82px, env(safe-area-inset-right));
  display: flex;
  width: min(320px, calc(100vw - 190px));
  max-height: min(570px, 70vh);
  overflow: hidden;
  flex-direction: column;
  color: #fff7e8;
  pointer-events: none;
}

.legend-chat[hidden] {
  display: none;
}

.legend-chat header {
  display: flex;
  flex: 0 0 auto;
  padding: 12px 14px 10px;
  flex-direction: column;
  background: rgba(7, 18, 14, .78);
  border: 1px solid rgba(255, 233, 190, .18);
  border-radius: 17px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}

.legend-chat header span {
  color: #ffd791;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.legend-chat header small {
  margin-top: 3px;
  color: rgba(255, 247, 232, .64);
  font-size: 11px;
}

.chat-messages {
  display: flex;
  gap: 10px;
  min-height: 120px;
  padding: 10px 0;
  overflow-y: auto;
  flex: 1 1 auto;
  flex-direction: column;
  pointer-events: auto;
}

.chat-bubble {
  width: fit-content;
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-bubble.assistant {
  align-self: flex-start;
  color: #fff8ea;
  background: rgba(48, 72, 39, .92);
  border-bottom-left-radius: 5px;
}

.chat-bubble.user {
  align-self: flex-end;
  color: #2b1909;
  background: #f3c676;
  border-bottom-right-radius: 5px;
}

.chat-bubble.system {
  align-self: center;
  color: rgba(255, 247, 232, .72);
  background: rgba(0, 0, 0, .34);
  font-size: 10px;
  text-align: center;
}

.chat-meta {
  display: block;
  margin-top: 5px;
  color: rgba(255, 247, 232, .58);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.legend-chat .question-panel {
  position: static;
  flex: 0 0 auto;
  width: auto;
  padding: 12px;
  background: rgba(7, 18, 14, .78);
  border: 1px solid rgba(255, 233, 190, .18);
  border-radius: 17px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.legend-chat .question-panel textarea {
  min-height: 56px;
  max-height: 90px;
}

.source-panel {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: min(330px, calc(100vw - 36px));
  padding: 58px 20px 20px;
  border-radius: 20px;
}

.source-panel button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 22px;
}

.source-panel #guideSources {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.question-panel {
  right: 82px;
  bottom: max(27px, env(safe-area-inset-bottom));
  width: min(410px, calc(100vw - 112px));
  padding: 12px;
  border-radius: 17px;
}

.question-panel textarea {
  width: 100%;
  min-height: 78px;
  padding: 12px;
  color: white;
  resize: vertical;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 11px;
  outline: none;
}

.question-panel textarea:focus {
  border-color: rgba(255, 199, 97, .8);
}

.question-panel textarea::placeholder {
  color: rgba(255, 255, 255, .58);
}

.question-panel > div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.question-panel select,
.question-panel button {
  height: 38px;
  color: white;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
}

.question-panel select {
  flex: 1;
  padding: 0 10px;
}

.question-panel option {
  color: #17110c;
}

.question-panel button {
  width: 45px;
  color: #291809;
  background: #ffc761;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.source-panel a {
  padding: 10px 12px;
  color: #ffe1a3;
  border: 1px solid rgba(255, 225, 163, .16);
  border-radius: 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.source-panel > a {
  display: block;
  margin-top: 12px;
  color: white;
  background: rgba(255, 255, 255, .08);
  text-align: center;
}

.voice-status {
  position: absolute;
  z-index: 10;
  right: 34px;
  bottom: 41px;
  color: #511c08;
  pointer-events: none;
  animation: voice-listening .65s ease-in-out infinite alternate;
}

.portal-destinations {
  position: absolute;
  z-index: 7;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 32px));
  padding: 12px;
  color: white;
  background: rgba(3, 11, 18, .76);
  border: 1px solid rgba(180, 216, 235, .2);
  border-radius: 20px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .32);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.portal-destinations-label {
  color: rgba(222, 236, 244, .72);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
}

.portal-destination-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.portal-destinations button {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 9px 12px;
  color: white;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  cursor: pointer;
  text-align: left;
  transition:
    background .2s ease,
    border-color .2s ease,
    transform .2s ease;
}

.portal-destinations button:hover,
.portal-destinations button:focus-visible {
  background: rgba(255, 196, 92, .12);
  border-color: rgba(255, 196, 92, .48);
  transform: translateY(-2px);
}

.portal-destinations button.departing {
  pointer-events: none;
  border-color: rgba(255, 196, 92, .72);
  animation: destination-depart .65s ease-in forwards;
}

.portal-destinations button:disabled {
  opacity: .42;
}

.destination-dot {
  display: block;
  width: 5px;
  height: 5px;
  margin: auto;
  background: rgba(207, 224, 238, .8);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(176, 212, 240, .4);
}

.destination-dot.active {
  width: 8px;
  height: 8px;
  background: #ffc45c;
  box-shadow: 0 0 12px rgba(255, 178, 54, .9);
}

.destination-copy {
  display: grid;
  gap: 2px;
}

.destination-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1;
}

.destination-copy small {
  color: rgba(222, 236, 244, .68);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

@keyframes destination-depart {
  to {
    opacity: .45;
    transform: scale(.96);
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: -1px !important;
  white-space: nowrap !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

@keyframes portal-breathe {
  50% {
    opacity: .52;
    transform: scale(1.08);
  }
}

@keyframes portal-enter {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.4);
  }
}

@keyframes marker-pulse {
  50% {
    opacity: .38;
    transform: scale(1.55);
  }
}

@keyframes voice-listening {
  to {
    opacity: .35;
    transform: scale(.72);
  }
}

@keyframes microphone-listening {
  to {
    box-shadow:
      0 0 0 12px rgba(185, 61, 45, .2),
      0 8px 30px rgba(0, 0, 0, .3);
  }
}

@keyframes voice-wave {
  to {
    height: 16px;
  }
}

@keyframes invitation-arrive {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
}

@keyframes invitation-leave {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

@media (max-width: 720px) {
  .immersive-controls {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .immersive-controls button {
    width: 44px;
    height: 44px;
  }

  .portal-destinations {
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 24px));
    padding: 9px;
  }

  .portal-destinations-label {
    font-size: 8px;
  }

  .portal-destinations button {
    min-height: 46px;
    padding: 8px 9px;
  }

  .destination-copy strong {
    font-size: 13px;
  }

  .destination-copy small {
    font-size: 8px;
  }

  .caption-panel {
    right: 68px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
  }

  .legend-chat {
    top: 76px;
    right: 66px;
    bottom: auto;
    left: auto;
    width: min(220px, calc(100vw - 176px));
    max-height: 72vh;
  }

  .legend-chat header small {
    font-size: 9px;
  }

  .chat-bubble {
    max-width: 96%;
    padding: 9px 10px;
    font-size: 11px;
  }

  .legend-chat .question-panel {
    padding: 9px;
  }

  .sun-panel {
    right: 67px;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px);
  }

  .voice-status {
    right: 28px;
    bottom: 31px;
  }

  .voice-invitation {
    right: 66px;
    bottom: max(18px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 82px);
    font-size: 11px;
  }

  .question-panel {
    right: 66px;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: calc(100vw - 80px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-rings,
  .portal-rings::before,
  .portal-rings::after,
  .location-marker,
  .voice-status,
  .immersive-controls #voiceQuestion.listening,
  .voice-waves i,
  .voice-invitation,
  .voice-invitation.leaving {
    animation: none;
  }
}

.llorona-environment {
  position: fixed;
  z-index: 100;
  inset: 0;
  min-height: 100dvh;
  overflow: hidden;
  color: #eef7f6;
  background:
    radial-gradient(circle at 68% 20%, rgba(190, 224, 224, .16), transparent 24rem),
    #061014;
}

.llorona-scene {
  position: absolute;
  inset: 0;
}

.llorona-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.llorona-scene .scene-loading {
  color: rgba(228, 242, 240, .76);
  background:
    radial-gradient(circle at 68% 20%, rgba(181, 216, 217, .12), transparent 25rem),
    #061014;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.llorona-story-intro {
  position: absolute;
  z-index: 4;
  top: max(22px, env(safe-area-inset-top));
  left: max(22px, env(safe-area-inset-left));
  width: min(480px, calc(100vw - 44px));
  padding: 18px 20px;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(5, 17, 21, .8), rgba(5, 17, 21, .28));
  border-left: 2px solid rgba(183, 217, 216, .58);
  border-radius: 0 18px 18px 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .7);
}

.llorona-story-intro .eyebrow {
  margin: 0 0 7px;
  color: #a8ccca;
}

.llorona-story-intro h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  letter-spacing: -.035em;
}

.llorona-story-intro p:last-child {
  max-width: 430px;
  margin: 10px 0 0;
  color: rgba(231, 244, 242, .76);
  font-family: Georgia, serif;
  font-size: clamp(13px, 1.8vw, 17px);
  line-height: 1.55;
}

.llorona-environment-nav {
  position: absolute;
  z-index: 5;
  top: max(22px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.llorona-environment-nav a,
.llorona-ambience {
  min-height: 44px;
  padding: 11px 14px;
  color: #eef7f6;
  background: rgba(5, 16, 20, .7);
  border: 1px solid rgba(194, 226, 224, .22);
  border-radius: 999px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .24);
  backdrop-filter: blur(14px);
  text-decoration: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.llorona-controls {
  position: absolute;
  z-index: 5;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  align-items: center;
}

.llorona-ambience[aria-pressed="true"] {
  color: #102527;
  background: #b8d8d4;
  border-color: #e4f2ef;
}

.llorona-hint {
  margin: 0;
  padding: 10px 13px;
  color: rgba(231, 244, 242, .7);
  background: rgba(5, 16, 20, .58);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  font-size: 11px;
}

.llorona-model-status {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  max-width: min(420px, calc(100vw - 40px));
  margin: 0;
  padding: 10px 14px;
  color: rgba(238, 247, 246, .82);
  background: rgba(5, 16, 20, .72);
  border: 1px solid rgba(194, 226, 224, .2);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  font-size: 11px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.llorona-model-status[hidden] {
  display: none;
}

.llorona-chat {
  top: 92px;
  right: max(22px, env(safe-area-inset-right));
  width: min(350px, calc(100vw - 44px));
  max-height: calc(100dvh - 190px);
}

.llorona-chat header {
  background: rgba(5, 20, 23, .86);
  border-color: rgba(179, 218, 217, .22);
}

.llorona-chat header span {
  color: #b8d8d4;
}

.llorona-chat header em {
  margin-top: 7px;
  color: rgba(211, 231, 229, .7);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.llorona-chat .chat-bubble.assistant {
  background: rgba(22, 65, 66, .94);
}

.llorona-chat .chat-bubble.user {
  color: #07191b;
  background: #b8d8d4;
}

.llorona-chat .chat-bubble p {
  margin: 0;
}

.llorona-chat .question-panel {
  background: rgba(5, 20, 23, .86);
  border-color: rgba(179, 218, 217, .22);
}

.llorona-chat-status {
  display: block;
  min-height: 1.3em;
  margin-top: 8px;
  color: rgba(225, 241, 239, .62);
  font-size: 9px;
  line-height: 1.4;
}

.llorona-citations {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.llorona-citations a {
  padding: 4px 7px;
  color: #d8eeeb;
  border: 1px solid rgba(211, 237, 234, .26);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.llorona-credit {
  position: absolute;
  z-index: 5;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(22px, env(safe-area-inset-left));
  width: min(470px, calc(100vw - 470px));
  padding: 9px 12px;
  color: rgba(226, 241, 239, .72);
  background: rgba(5, 16, 20, .64);
  border: 1px solid rgba(194, 226, 224, .16);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  font-size: 9px;
  line-height: 1.45;
}

.llorona-credit p {
  margin: 0;
}

.llorona-credit div {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

.llorona-credit a {
  color: #b8d8d4;
  font-weight: 800;
}

@media (max-width: 720px) {
  .llorona-story-intro {
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    width: min(310px, calc(100vw - 28px));
    padding: 13px 15px;
  }

  .llorona-story-intro h1 {
    font-size: clamp(31px, 11vw, 46px);
  }

  .llorona-story-intro p:last-child {
    display: none;
  }

  .llorona-environment-nav {
    top: max(108px, calc(env(safe-area-inset-top) + 108px));
    right: auto;
    bottom: auto;
    left: max(12px, env(safe-area-inset-left));
    justify-content: flex-start;
  }

  .llorona-chat {
    top: max(166px, calc(env(safe-area-inset-top) + 166px));
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 260px);
  }

  .llorona-chat header {
    padding: 9px 12px;
  }

  .llorona-chat .chat-messages {
    min-height: 80px;
  }

  .llorona-chat .question-panel textarea {
    min-height: 44px;
  }

  .llorona-credit {
    bottom: max(66px, calc(env(safe-area-inset-bottom) + 66px));
    left: max(12px, env(safe-area-inset-left));
    width: min(61vw, 360px);
    padding: 7px 9px;
    font-size: 8px;
  }

  .llorona-credit div {
    gap: 7px;
  }

  .llorona-controls {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    justify-content: space-between;
  }

  .llorona-hint {
    max-width: 58vw;
    border-radius: 14px;
    line-height: 1.35;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .llorona-story-intro p:last-child {
    display: none;
  }

  .llorona-environment-nav {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    left: auto;
  }

  .llorona-chat {
    top: max(62px, calc(env(safe-area-inset-top) + 62px));
    right: max(10px, env(safe-area-inset-right));
    left: auto;
    width: min(340px, 48vw);
    max-height: calc(100dvh - 130px);
  }

  .llorona-credit {
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    width: min(42vw, 330px);
    padding: 5px 7px;
    font-size: 7px;
  }
}
