/* Fuentes autoalojadas (OFL, Google Fonts): no se envía la IP del visitante a Google.
   latin-ext incluye la l·l catalana. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/Fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/Fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/HankenGrotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/HankenGrotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  color-scheme: light;
  --piedra: #e7e4dc;
  --papel: #f3f1ec;
  --tinta: #26302a;
  --suave: #5b6b5e;
  --musgo: #3f5a3c;
  --liquen: #b7c25a;
  --anillo: #d3d0c4;
  --salvia: #d6d9c9;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--piedra);
  color: var(--tinta);
  font:
    16px/1.5 'Hanken Grotesk',
    system-ui,
    sans-serif;
}
button,
select,
textarea,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
.app {
  max-width: 720px;
  min-height: 100dvh;
  margin: auto;
  padding-bottom: 7rem;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.35rem;
}
.space-name,
h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings:
    'SOFT' 100,
    'WONK' 1;
}
.space-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}
.language-label {
  color: var(--suave);
  font-size: 0.84rem;
}
.language-label::after {
  content: ' ▾';
}
.language-label select {
  appearance: none;
  min-height: 36px;
  border: 0;
  padding: 0.25rem 0;
  background: transparent;
  color: var(--suave);
  outline: 0;
}
.notice {
  margin: 0;
  padding: 0 1.25rem;
  color: #6b746c;
  font-size: 0.72rem;
}
.point-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 3.5rem;
  padding: 0.35rem 1.25rem;
  color: var(--suave);
  font-size: 0.8rem;
}
.point-nav.hidden,
.hidden {
  display: none;
}
.icon-button,
.read-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--musgo);
}
svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.guide-card,
.entry-view {
  padding: 0.2rem 1.25rem 1rem;
}
.guide-card h1 {
  margin: 0.8rem 1rem 0.15rem;
  text-align: center;
  font-size: clamp(2rem, 8vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.ring-stage {
  position: relative;
  width: 236px;
  height: 236px;
  max-width: 64vw;
  margin: 1rem auto 0.35rem;
}
.entry-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--musgo);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
}
.ring-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  border: 0;
  border-radius: 50%;
  background: var(--musgo);
  color: #eef0e2;
  box-shadow: 0 0 0 6px var(--piedra);
}
.play-button svg {
  position: static;
  width: 1.7rem;
  height: 1.7rem;
}
.point-count,
.duration {
  margin: 0;
  text-align: center;
  color: var(--suave);
  font-size: 0.8rem;
}
.music-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  color: var(--suave);
  font-size: 0.8rem;
}
.music-toggle input {
  accent-color: var(--musgo);
}
.audio-missing {
  color: var(--suave);
  text-align: center;
}
details {
  margin-top: 0.8rem;
  border-top: 1px solid var(--anillo);
}
summary {
  padding: 0.65rem 0;
  color: var(--musgo);
  cursor: pointer;
  font-weight: 500;
}
details p,
.intro {
  max-width: 65ch;
  color: var(--suave);
}
.entry-view h1 {
  margin: 0.9rem 0 0.3rem;
  font-size: 2rem;
}
.route-list {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.75rem;
}
.route-list a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.6rem;
  border-bottom: 1px solid var(--anillo);
  color: var(--tinta);
  text-decoration: none;
}
.route-mini {
  flex: 0 0 40px;
  height: 40px;
}
.route-mini circle {
  fill: none;
  stroke: var(--anillo);
  stroke-width: 2;
}
.route-mini text {
  fill: var(--musgo);
  stroke: none;
  font-size: 12px;
  text-anchor: middle;
  dominant-baseline: central;
}
.quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
}
.quick button {
  min-height: 2.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  background: var(--salvia);
  color: #2f4130;
}
.conversation {
  padding: 0.25rem 1.25rem 0;
}
.bubble {
  max-width: 88%;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 22px 22px 22px 6px;
  background: var(--papel);
  font-size: 0.92rem;
  line-height: 1.5;
}
.bubble.visitor {
  margin-left: auto;
  border-radius: 22px 22px 6px 22px;
  background: var(--musgo);
  color: #f3f1ec;
}
.bubble p {
  margin: 0.2rem 0 0;
}
.label {
  display: block;
  color: #7c8a6f;
  font-size: 0.68rem;
  font-weight: 500;
}
.visitor .label {
  color: #d6d9c9;
}
.read-button {
  min-height: 32px;
}
.citations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.citation {
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--anillo);
  border-radius: 999px;
  color: var(--musgo);
  font-size: 0.72rem;
}
.composer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  gap: 0.45rem;
  max-width: 720px;
  margin: auto;
  padding: 1.4rem 0.9rem 0.8rem;
  /* Degradado al fondo: el contenido que pasa por debajo se desvanece en vez de cortarse. */
  background: linear-gradient(to bottom, transparent, var(--piedra) 45%);
}
.input-wrap {
  position: relative;
  flex: 1;
}
textarea {
  width: 100%;
  min-height: 48px;
  resize: none;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 3.3rem 0.72rem 1.1rem;
  background: #f6f5f1;
  color: var(--tinta);
  box-shadow: 0 1px 0 #cfccc2;
}
.mic-button,
.send-button {
  flex: 0 0 48px;
  min-width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--musgo);
  color: #eef0e2;
}
.send-button,
.mic-button {
  display: grid;
  place-items: center;
}
.send-button svg,
.mic-button svg {
  width: 1.25rem;
  height: 1.25rem;
}
#counter {
  position: absolute;
  right: 1rem;
  bottom: 0.2rem;
  color: var(--suave);
  font-size: 0.65rem;
}
.status {
  min-height: 1.4rem;
  margin: 0;
  padding: 0 1.25rem 0.5rem;
  color: var(--musgo);
  font-size: 0.82rem;
}
.status:empty {
  display: none;
}
.recording {
  animation: mic-pulse 1.2s ease-in-out infinite;
}
.audio-credits {
  margin: 1rem 0 0;
  padding: 0 1.25rem 1rem;
  color: var(--suave);
  font-size: 0.7rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(63, 90, 60, 0.3);
  outline-offset: 2px;
}
@keyframes mic-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(183, 194, 90, 0.35);
  }
}
@media (min-width: 700px) {
  .topbar,
  .notice,
  .point-nav,
  .guide-card,
  .entry-view,
  .conversation,
  .quick,
  .status {
    padding-right: 0;
    padding-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
