@font-face {
  font-family: "Continua Ritwal";
  src: url("assets/fonts/ContinuaOnlineTrial-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Antarctican Ritwal";
  src: url("assets/fonts/AntarcticanMono-Book.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Antarctican Ritwal";
  src: url("assets/fonts/AntarcticanMono-Medium.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 600;
}

:root {
  color-scheme: light;
  --sol-suave: #ddc9a3;
  --eco-mar: #8b6f4b;
  --bosco: #993921;
  --bosco-deep: #742817;
  --sole-mio: #656636;
  --ink: #332923;
  --ink-muted: #635249;
  --light: #f4e8ce;
  --rule: rgba(116, 40, 23, 0.38);
  --display: "Continua Ritwal", "Gill Sans", "Avenir Next", sans-serif;
  --mono: "Antarctican Ritwal", "Courier New", monospace;
  --ease-ritual: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --header-height: calc(60px + var(--safe-top));
  --station-height: 68px;
  --action-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  background: #211b17;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: #211b17;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sole-mio);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.misiva {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  background-color: var(--sol-suave);
  background-image: linear-gradient(rgba(221, 201, 163, 0.91), rgba(221, 201, 163, 0.91)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 720px 720px;
}

.brand-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  padding: calc(8px + var(--safe-top)) max(18px, calc(var(--safe-right) + 10px)) 8px
    max(18px, calc(var(--safe-left) + 10px));
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(221, 201, 163, 0.97);
  background: color-mix(in srgb, var(--sol-suave) 94%, transparent);
  border-bottom: 1px solid var(--rule);
}

.official-wordmark {
  width: 116px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--bosco);
}

.official-wordmark__image {
  width: 100%;
  aspect-ratio: 272 / 99;
  display: block;
  background: currentColor;
  -webkit-mask: url("assets/brand/ritwal-logo-mask.png") center / contain no-repeat;
  mask: url("assets/brand/ritwal-logo-mask.png") center / contain no-repeat;
}

.reset-button {
  position: absolute;
  right: max(10px, calc(var(--safe-right) + 8px));
  min-width: 44px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--bosco-deep);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

[data-view="welcome"] .brand-header {
  position: absolute;
  inset: 0 0 auto;
  background: transparent;
  border-bottom-color: rgba(244, 232, 206, 0.3);
}

[data-view="welcome"] .official-wordmark {
  color: var(--light);
}

.welcome {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 568px;
  padding: calc(var(--header-height) + 18px) max(24px, calc(var(--safe-right) + 18px))
    calc(var(--safe-bottom) + 14px) max(24px, calc(var(--safe-left) + 18px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  place-items: center;
  gap: 10px;
  overflow: hidden;
  background-color: var(--bosco);
  background-image: linear-gradient(rgba(153, 57, 33, 0.9), rgba(153, 57, 33, 0.9)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 680px 680px;
  color: var(--light);
}

.welcome__frame {
  position: absolute;
  inset: calc(var(--header-height) + 8px) max(10px, calc(var(--safe-right) + 6px)) 10px
    max(10px, calc(var(--safe-left) + 6px));
  pointer-events: none;
  border: 2px dotted rgba(244, 232, 206, 0.82);
}

.welcome__copy {
  position: relative;
  z-index: 2;
  width: min(100%, 350px);
  text-align: center;
}

.welcome__quote {
  max-width: 34ch;
  margin: 0 auto 16px;
  color: var(--light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.48;
  text-transform: uppercase;
  text-wrap: balance;
}

.welcome h1,
.question-header h1,
.closing h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  text-wrap: balance;
}

.welcome h1 {
  color: var(--light);
  font-size: clamp(2.15rem, 10.4vw, 2.85rem);
  letter-spacing: 0;
  line-height: 0.98;
  text-transform: uppercase;
}

.ritual-seal {
  --seal-size: clamp(178px, 53vw, 220px);
  position: relative;
  z-index: 2;
  width: var(--seal-size);
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--light);
  cursor: pointer;
}

.ritual-seal__disc {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: block;
}

.ritual-seal__disc::before {
  position: absolute;
  inset: 10%;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  background-color: rgba(221, 201, 163, 0.1);
  background-image: linear-gradient(rgba(221, 201, 163, 0.08), rgba(221, 201, 163, 0.08)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 420px 420px;
  box-shadow: 0 20px 36px rgba(44, 15, 8, 0.22), inset 0 0 0 8px rgba(244, 232, 206, 0.06);
  opacity: 0.72;
  transform: rotate(-2deg);
  transition: inset 220ms var(--ease-ritual), opacity 220ms ease, transform 220ms var(--ease-ritual);
}

.ritual-seal__isotype {
  position: absolute;
  top: 31%;
  left: 37%;
  z-index: 2;
  width: 26%;
  height: 34%;
  background: url("assets/brand/ritwal-isotipo-bosco.png") center / contain no-repeat;
  pointer-events: none;
}

.ritual-seal__art {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: currentColor;
  -webkit-mask: url("assets/brand/ritwal-radial-mask.png") center / contain no-repeat;
  mask: url("assets/brand/ritwal-radial-mask.png") center / contain no-repeat;
}

.ritual-seal__action,
.ritual-seal__time {
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.ritual-seal__action {
  margin-top: 9px;
  padding: 5px 7px 4px;
  border-bottom: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ritual-seal__time {
  margin-top: 3px;
  padding: 0 4px;
  color: var(--light);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.element-orbit {
  position: relative;
  z-index: 2;
  width: min(100%, 184px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--light);
}

.brand-symbol {
  display: inline-block;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  background: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.brand-symbol--air {
  -webkit-mask-image: url("assets/brand/elemento-1.png");
  mask-image: url("assets/brand/elemento-1.png");
}

.brand-symbol--earth {
  -webkit-mask-image: url("assets/brand/elemento-2.png");
  mask-image: url("assets/brand/elemento-2.png");
}

.brand-symbol--fire {
  -webkit-mask-image: url("assets/brand/elemento-3.png");
  mask-image: url("assets/brand/elemento-3.png");
}

.brand-symbol--water {
  -webkit-mask-image: url("assets/brand/elemento-4.png");
  mask-image: url("assets/brand/elemento-4.png");
}

.brand-symbol--ritwal {
  -webkit-mask-image: url("assets/brand/ritwal-isotipo-mask.png");
  mask-image: url("assets/brand/ritwal-isotipo-mask.png");
}

.brand-symbol--category-food {
  -webkit-mask-image: url("assets/brand/categoria-comida.png");
  mask-image: url("assets/brand/categoria-comida.png");
}

.brand-symbol--category-service {
  -webkit-mask-image: url("assets/brand/categoria-servicio.png");
  mask-image: url("assets/brand/categoria-servicio.png");
}

.brand-symbol--category-tribe {
  -webkit-mask-image: url("assets/brand/categoria-tribu.png");
  mask-image: url("assets/brand/categoria-tribu.png");
}

.is-opening .ritual-seal__art {
  animation: seal-awakens 720ms var(--ease-ritual) both;
}

.is-opening .welcome__copy,
.is-opening .element-orbit,
.is-opening .ritual-seal__disc::before,
.is-opening .ritual-seal__action,
.is-opening .ritual-seal__time {
  animation: fade-away 420ms ease both;
}

@keyframes seal-awakens {
  0% {
    filter: blur(0);
    transform: rotate(0deg) scale(1);
  }
  55% {
    filter: blur(0);
    transform: rotate(24deg) scale(1.16);
  }
  100% {
    filter: blur(7px);
    opacity: 0;
    transform: rotate(62deg) scale(2.5);
  }
}

@keyframes fade-away {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.journey {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

.station-map {
  position: sticky;
  top: var(--header-height);
  z-index: 15;
  height: var(--station-height);
  overflow: hidden;
  background: rgba(221, 201, 163, 0.97);
  background: color-mix(in srgb, var(--sol-suave) 96%, transparent);
  border-bottom: 1px solid var(--rule);
}

.station-map::-webkit-scrollbar {
  display: none;
}

.station-map ol {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 max(5px, var(--safe-right)) 0 max(5px, var(--safe-left));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
}

.station-map li {
  position: relative;
  min-width: 0;
  padding: 7px 1px 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease;
}

.station-map__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.station-map li::after {
  position: absolute;
  right: -1px;
  bottom: 12px;
  width: 3px;
  height: 3px;
  content: "";
  border-radius: 50%;
  background: var(--eco-mar);
  opacity: 0.36;
}

.station-map li:last-child::after {
  display: none;
}

.station-map li[aria-current="step"] {
  background: transparent;
  color: var(--bosco-deep);
}

.station-map li[aria-current="step"]::before {
  position: absolute;
  right: 15%;
  bottom: 0;
  left: 15%;
  height: 2px;
  content: "";
  background: var(--bosco);
}

.station-map li.is-complete {
  color: var(--ink-muted);
}

.station-map li:not([aria-current="step"]) .brand-symbol {
  background: var(--eco-mar);
}

.station-map li.is-complete .brand-symbol {
  background: var(--sole-mio);
}

.station-map__symbol {
  width: 23px;
  height: 23px;
}

.question-area {
  width: min(100%, 560px);
  min-height: calc(100vh - var(--header-height) - var(--station-height));
  min-height: calc(100dvh - var(--header-height) - var(--station-height));
  margin: 0 auto;
  padding: clamp(18px, 3.2vh, 28px) max(20px, calc(var(--safe-right) + 16px))
    calc(var(--action-height) + var(--safe-bottom) + 18px)
    max(20px, calc(var(--safe-left) + 16px));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.question-header h1 {
  max-width: 18ch;
  color: var(--bosco-deep);
  font-size: clamp(2rem, 9.2vw, 2.65rem);
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.question-header h1:focus,
.closing h1:focus {
  outline: none;
}

.question-meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--bosco-deep);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-header > p {
  max-width: 48ch;
  margin: 9px 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.48;
  text-wrap: pretty;
}

#response-form {
  flex: 1 0 auto;
  margin: 0;
  padding-top: clamp(24px, 5vh, 44px);
  display: flex;
  flex-direction: column;
}

[data-question-type="rating"] #question-control {
  margin: 0;
  padding: 0;
}

.rating-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-fieldset legend {
  width: 100%;
  margin-bottom: 15px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.rating-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.rating-option {
  position: relative;
  min-width: 0;
  min-height: 60px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.rating-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rating-option__mark {
  width: clamp(48px, 13.2vw, 54px);
  aspect-ratio: 1;
  border: 1.5px solid var(--bosco);
  border-radius: 50%;
  background: transparent;
  transition: transform 180ms var(--ease-ritual), background 180ms ease, box-shadow 180ms ease;
}

.rating-option__number {
  position: absolute;
  z-index: 2;
  color: var(--bosco-deep);
  font-size: 1rem;
  font-weight: 600;
  transition: color 180ms ease;
}

.rating-option input:checked ~ .rating-option__number {
  color: var(--light);
}

.rating-option input:checked ~ .rating-option__mark {
  background: var(--bosco);
  box-shadow: 0 9px 18px rgba(116, 40, 23, 0.22), inset 0 0 0 5px var(--bosco),
    inset 0 0 0 6px var(--light);
  transform: translateY(-4px);
}

.rating-option input:focus-visible ~ .rating-option__mark {
  outline: 3px solid var(--sole-mio);
  outline-offset: 4px;
}

.rating-endpoints {
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field-group,
.contact-intro {
  width: 100%;
}

.field-group label,
.contact-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--bosco-deep);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.line-input,
.story-input,
.contact-field input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--bosco);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
}

.line-input,
.contact-field input {
  min-height: 56px;
  padding: 10px 2px;
}

.story-input {
  min-height: 180px;
  padding: 15px;
  resize: vertical;
  border: 1px dotted var(--bosco);
  line-height: 1.6;
}

.line-input::placeholder,
.story-input::placeholder,
.contact-field input::placeholder {
  color: var(--ink-muted);
}

.line-input:focus,
.story-input:focus,
.contact-field input:focus {
  border-color: var(--sole-mio);
}

.field-note,
.character-count,
.contact-intro {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.character-count {
  text-align: right;
}

.contact-intro {
  max-width: 48ch;
  margin: 0 0 28px;
  line-height: 1.6;
}

.contact-grid {
  display: grid;
  gap: 24px;
}

.contact-consent {
  grid-column: 1 / -1;
  margin-top: 30px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

.contact-consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--bosco);
}

.review-sheet {
  border-top: 1px solid var(--bosco);
}

.review-group {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--rule);
}

.review-group__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.review-group__header h2 {
  margin: 0;
  color: var(--bosco-deep);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.review-group__value {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.55;
}

.review-group > p {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.review-edit {
  min-width: 48px;
  min-height: 44px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: var(--bosco-deep);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-transform: uppercase;
}

.form-message {
  margin: 22px 0 0;
  padding: 14px 15px;
  border: 1px solid var(--bosco);
  background: rgba(153, 57, 33, 0.08);
  color: var(--bosco-deep);
  font-size: 0.78rem;
  line-height: 1.5;
}

.form-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  min-height: calc(var(--action-height) + var(--safe-bottom));
  padding: 8px max(12px, calc(var(--safe-right) + 8px)) var(--safe-bottom)
    max(12px, calc(var(--safe-left) + 8px));
  display: grid;
  grid-template-columns: minmax(64px, 0.72fr) minmax(70px, 0.82fr) minmax(128px, 1.46fr);
  gap: 6px;
  align-items: stretch;
  background: rgba(221, 201, 163, 0.97);
  background: color-mix(in srgb, var(--sol-suave) 96%, transparent);
  border-top: 1px solid var(--rule);
}

#response-form.is-no-skip .form-actions {
  grid-template-columns: minmax(70px, 0.72fr) minmax(0, 2.28fr);
}

.primary-action,
.text-action {
  min-height: 56px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
}

.primary-action {
  padding: 13px 18px;
  border: 1px solid var(--bosco);
  border-radius: 0;
  background: var(--bosco);
  color: var(--light);
  transition: background 160ms ease, color 160ms ease, transform 160ms var(--ease-ritual);
}

.primary-action:hover:not(:disabled) {
  background: var(--bosco-deep);
  transform: translateY(-2px);
}

.primary-action:active:not(:disabled) {
  transform: translateY(0);
}

.primary-action:disabled {
  border-color: rgba(51, 41, 35, 0.22);
  background: rgba(51, 41, 35, 0.12);
  color: rgba(51, 41, 35, 0.48);
}

.primary-action--light {
  border-color: var(--light);
  background: var(--light);
  color: var(--sole-mio);
}

.text-action {
  padding: 10px 5px;
  border: 0;
  background: transparent;
  color: var(--bosco-deep);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.text-action:disabled {
  color: rgba(51, 41, 35, 0.35);
  text-decoration: none;
}

.closing {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 38px max(24px, calc(var(--safe-right) + 18px)) calc(var(--safe-bottom) + 24px)
    max(24px, calc(var(--safe-left) + 18px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--sole-mio);
  background-image: linear-gradient(rgba(101, 102, 54, 0.9), rgba(101, 102, 54, 0.9)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 680px 680px;
  color: var(--light);
  text-align: center;
}

[data-view="closing"] .brand-header {
  background: var(--sole-mio);
  border-color: rgba(244, 232, 206, 0.28);
}

[data-view="closing"] .official-wordmark {
  color: var(--light);
}

.closing__radial {
  width: clamp(128px, 38vw, 160px);
  aspect-ratio: 1;
  margin-bottom: 26px;
  background: currentColor;
  -webkit-mask: url("assets/brand/ritwal-radial-mask.png") center / contain no-repeat;
  mask: url("assets/brand/ritwal-radial-mask.png") center / contain no-repeat;
}

.closing h1 {
  max-width: 11ch;
  color: var(--light);
  font-size: clamp(2.15rem, 9.8vw, 3.5rem);
  line-height: 1;
  text-transform: none;
}

.closing__lead {
  margin: 20px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.closing__note {
  max-width: 42ch;
  margin: 18px 0 26px;
  color: var(--light);
  font-size: 0.78rem;
  line-height: 1.6;
}

.closing__elements {
  width: min(100%, 260px);
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
}

.closing__elements .brand-symbol {
  width: 28px;
  height: 28px;
}

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

.no-script {
  margin: 0;
  padding: 20px;
  background: var(--bosco);
  color: var(--light);
  font-family: var(--mono);
}

@media (min-width: 960px) and (min-height: 650px) {
  :root {
    --header-height: 96px;
  }

  .app-shell {
    padding: 36px;
    display: grid;
    place-items: center;
  }

  .misiva {
    width: min(100%, 1040px);
    min-height: min(900px, calc(100vh - 72px));
    box-shadow: 0 30px 70px rgba(13, 8, 5, 0.32), 0 8px 20px rgba(13, 8, 5, 0.18);
  }

  .brand-header {
    padding: 21px 36px 18px;
  }

  .official-wordmark {
    width: 178px;
  }

  .welcome {
    height: min(900px, calc(100vh - 72px));
    min-height: min(900px, calc(100vh - 72px));
    padding: 130px 80px 52px;
    grid-template-columns: 1fr 0.9fr;
    grid-template-rows: 1fr auto;
    column-gap: 70px;
  }

  .welcome__frame {
    inset: 110px 22px 22px;
  }

  .welcome__copy {
    text-align: left;
  }

  .welcome__quote {
    margin-right: 0;
    margin-left: 0;
  }

  .welcome h1 {
    font-size: clamp(3.5rem, 6.5vw, 5.5rem);
  }

  .ritual-seal {
    width: min(34vw, 360px);
  }

  .element-orbit {
    grid-column: 1 / -1;
    width: 360px;
  }

  .journey {
    min-height: calc(min(900px, 100vh - 72px) - var(--header-height));
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .station-map {
    position: static;
    height: auto;
    min-height: 100%;
    overflow: visible;
    border-right: 1px solid var(--rule);
    border-bottom: 0;
  }

  .station-map ol {
    min-width: 0;
    height: 100%;
    padding: 32px 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 1fr);
  }

  .station-map li {
    min-width: 0;
    padding: 15px 22px;
    grid-template-columns: 38px 1fr;
    place-items: center start;
    gap: 13px;
    text-align: left;
  }

  .station-map li::after {
    right: auto;
    bottom: -2px;
    left: 38px;
  }

  .station-map__symbol {
    width: 31px;
    height: 31px;
  }

  .question-area {
    width: 100%;
    min-height: calc(min(900px, 100vh - 72px) - var(--header-height));
    padding: 70px clamp(46px, 7vw, 92px) 44px;
  }

  .question-header h1 {
    font-size: clamp(3.2rem, 6vw, 5.2rem);
  }

  #response-form {
    padding-top: 66px;
  }

  .form-actions {
    position: static;
    min-height: 0;
    margin-top: 54px;
    padding: 18px 0 0;
    background: transparent;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-field--wide {
    grid-column: 1 / -1;
  }

  .closing {
    min-height: calc(min(900px, 100vh - 72px) - var(--header-height));
  }
}

@media (max-width: 370px) {
  .welcome {
    padding-right: max(20px, calc(var(--safe-right) + 16px));
    padding-left: max(20px, calc(var(--safe-left) + 16px));
  }

  .welcome h1 {
    font-size: clamp(2rem, 10.5vw, 2.35rem);
  }

  .question-area {
    padding-right: max(16px, calc(var(--safe-right) + 12px));
    padding-left: max(16px, calc(var(--safe-left) + 12px));
  }

  .rating-scale {
    gap: 4px;
  }

  #response-form.is-no-skip .form-actions {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .rating-option__mark {
    width: 48px;
  }

  .form-actions {
    padding-right: max(7px, calc(var(--safe-right) + 6px));
    padding-left: max(7px, calc(var(--safe-left) + 6px));
    grid-template-columns: 62px 66px minmax(0, 1fr);
    gap: 4px;
  }

  .primary-action,
  .text-action {
    font-size: 0.75rem;
  }
}

@media (max-height: 700px) and (max-width: 959px) {
  :root {
    --header-height: calc(56px + var(--safe-top));
    --station-height: 60px;
    --action-height: 68px;
  }

  .brand-header {
    padding-top: calc(6px + var(--safe-top));
    padding-bottom: 6px;
  }

  .official-wordmark {
    width: 104px;
    height: 38px;
  }

  .welcome {
    min-height: 100svh;
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: calc(var(--safe-bottom) + 10px);
    gap: 5px;
  }

  .welcome__quote {
    max-width: 36ch;
    margin-bottom: 9px;
    font-size: 0.75rem;
    line-height: 1.42;
  }

  .welcome h1 {
    font-size: clamp(1.9rem, 9.8vw, 2.25rem);
    line-height: 0.96;
  }

  .ritual-seal {
    --seal-size: clamp(154px, 45vw, 178px);
  }

  .ritual-seal__action {
    margin-top: 4px;
    font-size: 0.75rem;
  }

  .ritual-seal__time {
    font-size: 0.75rem;
  }

  .element-orbit {
    width: 154px;
  }

  .element-orbit .brand-symbol {
    width: 22px;
    height: 22px;
  }

  .station-map li {
    padding-top: 5px;
    padding-bottom: 6px;
    font-size: 0.75rem;
  }

  .station-map__symbol {
    width: 20px;
    height: 20px;
  }

  .question-area {
    padding-top: 14px;
    padding-bottom: calc(var(--action-height) + var(--safe-bottom) + 12px);
  }

  .question-header h1 {
    font-size: clamp(1.75rem, 8.9vw, 2.1rem);
  }

  .question-meta {
    margin-top: 8px;
    font-size: 0.75rem;
  }

  .question-header > p {
    margin-top: 6px;
    font-size: 0.86rem;
    line-height: 1.4;
  }

  #response-form {
    padding-top: 14px;
  }

  [data-question-type="rating"] #question-control {
    padding: 0;
  }

  .rating-fieldset legend {
    margin-bottom: 8px;
    font-size: 0.75rem;
  }

  .rating-option {
    min-height: 52px;
  }

  .rating-endpoints {
    margin-top: 5px;
    font-size: 0.75rem;
  }

  .primary-action,
  .text-action {
    min-height: 50px;
  }
}

@media (orientation: landscape) and (min-width: 600px) and (max-width: 959px) and (max-height: 600px) {
  .welcome {
    padding: calc(var(--header-height) + 12px) max(42px, calc(var(--safe-right) + 24px))
      calc(var(--safe-bottom) + 10px) max(42px, calc(var(--safe-left) + 24px));
    grid-template-columns: minmax(0, 1.15fr) minmax(190px, 0.85fr);
    grid-template-rows: minmax(0, 1fr) auto;
    column-gap: 36px;
    row-gap: 6px;
  }

  .welcome__copy {
    width: 100%;
    text-align: left;
  }

  .welcome__quote {
    margin-right: 0;
    margin-left: 0;
  }

  .welcome h1 {
    font-size: clamp(2.15rem, 5.4vw, 3rem);
  }

  .ritual-seal {
    --seal-size: clamp(152px, 23vh, 174px);
    align-self: center;
  }

  .element-orbit {
    grid-column: 1 / -1;
  }

  .question-area {
    width: min(100%, 900px);
    padding-top: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(286px, 0.95fr);
    gap: 30px;
    align-items: center;
  }

  .question-header h1 {
    font-size: clamp(1.8rem, 4.2vw, 2.4rem);
  }

  #response-form {
    align-self: stretch;
    padding-top: 0;
    justify-content: center;
  }

  .closing {
    padding-top: 20px;
    padding-bottom: calc(var(--safe-bottom) + 16px);
  }

  .closing__radial {
    width: 104px;
    margin-bottom: 10px;
  }

  .closing h1 {
    max-width: 18ch;
    font-size: 2rem;
  }

  .closing__lead,
  .closing__note,
  .closing__elements {
    margin-top: 10px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .ritual-seal:hover .ritual-seal__disc::before {
    inset: 7%;
    opacity: 0.92;
    transform: rotate(1deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* --------------------------------------------------------------------------
   V5 · A+C RECUPERADO
   La composición aprobada vuelve a ser la autoridad: objeto-misiva físico en
   la apertura y riel vertical de cinco estaciones durante el recorrido.
   -------------------------------------------------------------------------- */

:root {
  --header-height: calc(72px + var(--safe-top));
  --station-height: 0px;
  --station-rail: 86px;
  --action-height: 78px;
  --paper-shadow: 0 22px 52px rgba(51, 41, 35, 0.18), 0 6px 16px rgba(51, 41, 35, 0.12);
  --seal-shadow: 0 20px 34px rgba(51, 41, 35, 0.2), 0 5px 12px rgba(51, 41, 35, 0.14);
}

html,
body {
  background: #211b17;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  display: block;
}

.misiva {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--sol-suave);
  background-image: linear-gradient(rgba(221, 201, 163, 0.9), rgba(221, 201, 163, 0.9)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 680px 680px;
  border-radius: 0;
  box-shadow: none;
}

.brand-header,
[data-view="welcome"] .brand-header,
[data-view="closing"] .brand-header {
  position: sticky;
  inset: auto;
  top: 0;
  z-index: 40;
  width: 100%;
  height: var(--header-height);
  min-height: 0;
  padding: calc(8px + var(--safe-top)) max(18px, calc(var(--safe-right) + 12px)) 7px
    max(18px, calc(var(--safe-left) + 12px));
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(221, 201, 163, 0.97);
  background-image: linear-gradient(rgba(221, 201, 163, 0.88), rgba(221, 201, 163, 0.88)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 680px 680px;
  border-bottom: 1px solid var(--rule);
}

.official-wordmark,
[data-view="welcome"] .official-wordmark,
[data-view="closing"] .official-wordmark {
  width: 146px;
  height: 50px;
  color: var(--bosco);
}

.reset-button {
  top: auto;
  right: max(10px, calc(var(--safe-right) + 8px));
  min-width: 48px;
  min-height: 44px;
  padding: 8px 4px;
  color: var(--bosco-deep);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  display: none !important;
}

/* Apertura A: una pieza de papel que promete abrirse. */

.welcome {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  min-height: 496px;
  padding: 16px max(18px, calc(var(--safe-right) + 14px)) calc(var(--safe-bottom) + 12px)
    max(18px, calc(var(--safe-left) + 14px));
  display: grid;
  grid-template-rows: 24px auto minmax(0, 1fr) auto auto;
  place-items: center;
  align-content: stretch;
  gap: 10px;
  overflow: hidden;
  background-color: var(--sol-suave);
  background-image: linear-gradient(rgba(221, 201, 163, 0.84), rgba(221, 201, 163, 0.84)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 620px 620px;
  color: var(--ink);
}

.welcome__progress {
  position: relative;
  width: min(100%, 326px);
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome__progress::before {
  position: absolute;
  top: 50%;
  right: 7px;
  left: 7px;
  height: 1px;
  content: "";
  background: var(--eco-mar);
  opacity: 0.62;
}

.welcome__progress span {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  border: 1px solid var(--eco-mar);
  border-radius: 50%;
  background: var(--sol-suave);
  box-shadow: 0 0 0 4px rgba(221, 201, 163, 0.72);
}

.welcome__progress span.is-active {
  border-color: var(--bosco);
  background: var(--bosco);
  box-shadow: inset 0 0 0 3px var(--sol-suave), 0 0 0 4px rgba(221, 201, 163, 0.78);
}

.welcome__copy {
  position: relative;
  z-index: 5;
  width: min(100%, 370px);
  text-align: center;
}

.welcome h1 {
  max-width: 11ch;
  margin: 0 auto;
  color: var(--bosco-deep);
  font-family: var(--display);
  font-size: clamp(2.45rem, 11.2vw, 3.15rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.96;
  text-transform: uppercase;
  text-wrap: balance;
}

.welcome__intro {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.seal-stage {
  position: relative;
  z-index: 4;
  width: min(91vw, 350px);
  aspect-ratio: 0.98 / 1;
  align-self: center;
  display: block;
  filter: drop-shadow(0 16px 22px rgba(51, 41, 35, 0.08));
}

.paper-flap,
.paper-pocket,
.station-preview,
.seal-shell {
  background-color: #d2b98c;
  background-image: linear-gradient(rgba(221, 201, 163, 0.6), rgba(221, 201, 163, 0.6)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 520px 520px;
}

.paper-flap {
  position: absolute;
  border: 1px solid rgba(139, 111, 75, 0.34);
  box-shadow: 0 13px 24px rgba(51, 41, 35, 0.11);
  transition: transform 680ms var(--ease-ritual), filter 500ms ease;
}

.paper-flap--back {
  top: 16%;
  left: 10%;
  width: 80%;
  height: 58%;
  border-radius: 48% 48% 20% 20% / 26% 26% 18% 18%;
  background-color: #c6a879;
  transform: rotate(-1.5deg);
}

.paper-flap--left {
  top: 28%;
  left: 0;
  width: 59%;
  height: 54%;
  clip-path: polygon(0 7%, 100% 0, 78% 96%, 6% 72%);
  transform: rotate(-6deg);
  transform-origin: 18% 62%;
}

.paper-flap--right {
  top: 28%;
  right: 0;
  width: 59%;
  height: 54%;
  clip-path: polygon(0 0, 100% 7%, 94% 72%, 22% 96%);
  transform: rotate(6deg);
  transform-origin: 82% 62%;
}

.paper-pocket {
  position: absolute;
  right: 5%;
  bottom: 4%;
  left: 5%;
  z-index: 1;
  height: 42%;
  clip-path: polygon(0 10%, 50% 58%, 100% 10%, 100% 100%, 0 100%);
  border: 1px solid rgba(139, 111, 75, 0.24);
  background-color: #dbc69e;
  box-shadow: 0 15px 26px rgba(51, 41, 35, 0.1);
}

.paper-pocket__line {
  position: absolute;
  right: 14%;
  bottom: 13%;
  left: 14%;
  height: 1px;
  background: rgba(139, 111, 75, 0.46);
}

.station-preview {
  position: absolute;
  bottom: 0;
  left: 23%;
  z-index: 2;
  width: 54%;
  height: 39%;
  padding: 58px 12px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 1px solid rgba(139, 111, 75, 0.36);
  border-radius: 50% 50% 12% 12% / 38% 38% 12% 12%;
  background-color: rgba(244, 232, 206, 0.88);
  color: var(--eco-mar);
  text-align: center;
}

.station-preview__symbol {
  width: 34px;
  height: 34px;
  background: currentColor;
}

.station-preview strong {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.seal-shell {
  position: absolute;
  top: 5%;
  left: 13%;
  z-index: 5;
  width: 74%;
  aspect-ratio: 1;
  border: 1px solid rgba(139, 111, 75, 0.42);
  border-radius: 50%;
  background-color: #d7bd8f;
  box-shadow: var(--seal-shadow);
  transform-origin: 50% 87%;
  transition: transform 680ms var(--ease-ritual), box-shadow 500ms ease;
}

.seal-face {
  position: absolute;
  inset: 6.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--bosco);
  border-radius: 50%;
  color: var(--bosco-deep);
  text-align: center;
}

.seal-face::before {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px solid rgba(153, 57, 33, 0.55);
  border-radius: inherit;
}

.seal-face::after {
  position: absolute;
  right: 24%;
  bottom: 20%;
  left: 24%;
  height: 1px;
  content: "";
  background: var(--eco-mar);
}

.seal-face__small,
.seal-face__title {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
}

.seal-face__small {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.seal-face__pictogram {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  margin: 2px 0 0;
  background: var(--bosco-deep);
}

.seal-face__title {
  font-size: clamp(1.15rem, 5.2vw, 1.55rem);
  letter-spacing: 0.16em;
}

.seal-thread {
  position: absolute;
  bottom: -42px;
  left: calc(50% - 3px);
  width: 6px;
  height: 54px;
  border-radius: 5px;
  background: var(--bosco-deep);
  box-shadow: 0 3px 8px rgba(51, 41, 35, 0.25);
}

.seal-thread::before {
  position: absolute;
  top: -7px;
  left: -6px;
  width: 18px;
  height: 18px;
  content: "";
  border: 4px solid #b38b4e;
  border-radius: 50%;
  background: var(--bosco-deep);
  box-shadow: 0 3px 8px rgba(51, 41, 35, 0.18);
}

.primary-action--welcome {
  width: min(100%, 350px);
  min-height: 58px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid var(--bosco);
  border-radius: 2px;
  background: transparent;
  color: var(--bosco-deep);
  box-shadow: none;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.primary-action--welcome::before,
.primary-action--welcome::after {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--eco-mar);
  transform: rotate(45deg);
}

.primary-action--welcome:hover:not(:disabled) {
  background: var(--bosco);
  color: var(--light);
  box-shadow: 0 10px 20px rgba(116, 40, 23, 0.16);
}

.primary-action__gesture {
  display: none;
}

.is-opening .seal-shell {
  animation: unseal-v5 700ms var(--ease-ritual) both;
}

.is-opening .paper-flap--left {
  animation: open-left-v5 700ms var(--ease-ritual) both;
}

.is-opening .paper-flap--right {
  animation: open-right-v5 700ms var(--ease-ritual) both;
}

.is-opening .paper-flap--back,
.is-opening .paper-pocket {
  animation: pocket-drops-v5 700ms var(--ease-ritual) both;
}

.is-opening .welcome__copy,
.is-opening .welcome__progress,
.is-opening .primary-action--welcome,
.is-opening .welcome__intro {
  animation: copy-recedes-v5 420ms ease both;
}

@keyframes unseal-v5 {
  0% {
    transform: translateY(0) rotate(0) scale(1);
  }
  58% {
    transform: translateY(-14px) rotate(-3deg) scale(0.96);
    box-shadow: 0 34px 54px rgba(51, 41, 35, 0.18);
  }
  100% {
    opacity: 0;
    transform: translateY(-44vh) rotate(-8deg) scale(0.74);
  }
}

@keyframes open-left-v5 {
  to {
    opacity: 0.58;
    transform: translateX(-26%) rotate(-18deg);
  }
}

@keyframes open-right-v5 {
  to {
    opacity: 0.58;
    transform: translateX(26%) rotate(18deg);
  }
}

@keyframes pocket-drops-v5 {
  to {
    opacity: 0.18;
    transform: translateY(32px);
  }
}

@keyframes copy-recedes-v5 {
  to {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(-7px);
  }
}

/* Recorrido C: riel vertical, hoja editorial y una respuesta a la vez. */

.journey {
  position: relative;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  display: grid;
  grid-template-columns: calc(var(--station-rail) + var(--safe-left)) minmax(0, 1fr);
  overflow: hidden;
  background: var(--sol-suave);
}

.station-map {
  position: sticky;
  top: var(--header-height);
  z-index: 18;
  width: calc(var(--station-rail) + var(--safe-left));
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  overflow: hidden;
  background-color: rgba(221, 201, 163, 0.96);
  background-image: linear-gradient(rgba(221, 201, 163, 0.88), rgba(221, 201, 163, 0.88)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 620px 620px;
  border-right: 1px solid var(--rule);
  border-bottom: 0;
}

.station-map ol {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 8px 4px calc(var(--action-height) + var(--safe-bottom) + 6px)
    calc(var(--safe-left) + 4px);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, minmax(62px, 1fr));
  list-style: none;
}

.station-map ol::before {
  position: absolute;
  top: 10%;
  bottom: calc(10% + var(--action-height) + var(--safe-bottom));
  left: calc(var(--safe-left) + (var(--station-rail) / 2));
  width: 1px;
  content: "";
  background: rgba(139, 111, 75, 0.48);
}

.station-map li {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 4px 1px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 38px auto;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--eco-mar);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  background: transparent;
}

.station-map li::after,
.station-map li[aria-current="step"]::before {
  display: none;
}

.station-map__marker {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--eco-mar);
  border-radius: 50%;
  background: var(--sol-suave);
  box-shadow: 0 0 0 4px rgba(221, 201, 163, 0.76);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--ease-ritual);
}

.station-map__marker .brand-symbol {
  width: 22px;
  height: 22px;
  background: var(--eco-mar);
}

.station-map li[aria-current="step"] {
  color: var(--bosco-deep);
}

.station-map li[aria-current="step"] .station-map__marker {
  border-color: var(--bosco);
  background: var(--bosco);
  box-shadow: inset 0 0 0 3px var(--sol-suave), 0 0 0 4px rgba(221, 201, 163, 0.82),
    0 7px 14px rgba(116, 40, 23, 0.16);
  transform: scale(1.08);
}

.station-map li[aria-current="step"] .station-map__marker .brand-symbol {
  background: var(--light);
}

.station-map li.is-complete {
  color: var(--sole-mio);
}

.station-map li.is-complete .station-map__marker {
  border-color: var(--sole-mio);
  background: var(--sole-mio);
}

.station-map li.is-complete .station-map__marker .brand-symbol {
  background: var(--light);
}

.station-map__label {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.question-area {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: clamp(24px, 4vh, 40px) max(18px, calc(var(--safe-right) + 14px))
    calc(var(--action-height) + var(--safe-bottom) + 22px)
    max(18px, calc(var(--safe-left) + 14px));
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--light);
  background-image: linear-gradient(rgba(244, 232, 206, 0.86), rgba(244, 232, 206, 0.86)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 620px 620px;
  box-shadow: -10px 0 24px rgba(51, 41, 35, 0.04);
}

.question-area::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--bosco);
  opacity: 0.72;
}

.is-turning .question-header,
.is-turning #question-control {
  animation: content-enters-v5 300ms var(--ease-ritual) both;
}

@keyframes content-enters-v5 {
  from {
    opacity: 0.46;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-watermark {
  position: absolute;
  top: 29%;
  right: -54px;
  z-index: -1;
  width: 190px;
  height: 190px;
  background: var(--eco-mar);
  opacity: 0.055;
  pointer-events: none;
}

[data-stage="servicio"] .question-watermark {
  -webkit-mask-image: url("assets/brand/categoria-servicio.png");
  mask-image: url("assets/brand/categoria-servicio.png");
}

[data-stage="locacion"] .question-watermark {
  -webkit-mask-image: url("assets/brand/ritwal-isotipo-mask.png");
  mask-image: url("assets/brand/ritwal-isotipo-mask.png");
}

[data-stage="tribu"] .question-watermark {
  -webkit-mask-image: url("assets/brand/categoria-tribu.png");
  mask-image: url("assets/brand/categoria-tribu.png");
}

[data-stage="historia"] .question-watermark {
  -webkit-mask-image: url("assets/brand/elemento-1.png");
  mask-image: url("assets/brand/elemento-1.png");
}

.question-header {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
}

.question-header h1 {
  max-width: 12ch;
  margin: 0 auto;
  color: var(--bosco-deep);
  font-family: var(--display);
  font-size: clamp(2.5rem, 11vw, 3.25rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.96;
  text-transform: none;
  text-wrap: balance;
}

.question-header::after {
  width: min(100%, 230px);
  height: 9px;
  margin: 20px auto 0;
  display: block;
  content: "";
  background: linear-gradient(
    to bottom,
    transparent 4px,
    rgba(153, 57, 33, 0.55) 4px,
    rgba(153, 57, 33, 0.55) 5px,
    transparent 5px
  );
  clip-path: polygon(0 44%, 48% 44%, 50% 0, 52% 44%, 100% 44%, 100% 56%, 52% 56%, 50% 100%, 48% 56%, 0 56%);
}

.question-meta {
  margin-top: 14px;
  justify-content: center;
  color: var(--bosco-deep);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.question-header > p {
  max-width: 34ch;
  margin: 10px auto 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

#response-form {
  position: relative;
  z-index: 3;
  width: 100%;
  flex: 1 0 auto;
  margin: 0;
  padding-top: clamp(30px, 7vh, 66px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

[data-question-type="rating"] #question-control {
  margin: 0;
  padding: 0;
}

.rating-fieldset {
  width: 100%;
}

.rating-fieldset legend {
  margin-bottom: 16px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rating-scale {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: clamp(1px, 1.5vw, 7px);
}

.rating-option {
  position: relative;
  min-width: 44px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--bosco-deep);
}

.rating-option__number {
  position: static;
  color: var(--bosco-deep);
  font-size: 0.86rem;
  font-weight: 600;
}

.rating-option__mark {
  position: relative;
  width: clamp(36px, 10.5vw, 48px);
  aspect-ratio: 1;
  border: 1.5px solid var(--eco-mar);
  border-radius: 50%;
  background: transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 180ms var(--ease-ritual),
    box-shadow 180ms ease;
}

.rating-option__mark::before,
.rating-option__mark::after {
  position: absolute;
  content: "";
  border-radius: 48% 52% 50% 46%;
  opacity: 0;
  transition: opacity 140ms ease, transform 180ms var(--ease-ritual);
}

.rating-option__mark::before {
  inset: 3px 2px 2px 3px;
  background: var(--bosco);
  transform: rotate(-5deg) scale(0.84);
}

.rating-option__mark::after {
  right: -4px;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--bosco-deep);
  box-shadow: 5px 3px 0 -1px rgba(116, 40, 23, 0.72);
}

.rating-option input:checked ~ .rating-option__mark {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: translateY(-2px) rotate(1deg);
}

.rating-option input:checked ~ .rating-option__mark::before,
.rating-option input:checked ~ .rating-option__mark::after {
  opacity: 1;
  transform: rotate(-5deg) scale(1);
}

.rating-option input:checked ~ .rating-option__number {
  color: var(--bosco-deep);
}

.rating-endpoints {
  margin-top: 9px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.next-sheet-preview {
  position: absolute;
  right: max(18px, calc(var(--safe-right) + 14px));
  bottom: calc(var(--action-height) + var(--safe-bottom) + 14px);
  left: max(18px, calc(var(--safe-left) + 14px));
  z-index: 1;
  min-height: 60px;
  padding: 11px 18px 9px;
  border: 1px solid rgba(139, 111, 75, 0.32);
  border-radius: 1px 1px 10px 10px;
  background-color: #d7bd8f;
  background-image: linear-gradient(rgba(221, 201, 163, 0.64), rgba(221, 201, 163, 0.64)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 560px 560px;
  color: var(--bosco-deep);
  text-align: center;
  box-shadow: 0 11px 22px rgba(51, 41, 35, 0.08);
  transform: rotate(-0.8deg);
}

.next-sheet-preview span,
.next-sheet-preview strong {
  font-family: var(--mono);
  text-transform: uppercase;
}

.next-sheet-preview span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.next-sheet-preview strong {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.form-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: calc(var(--station-rail) + var(--safe-left));
  z-index: 35;
  min-height: calc(var(--action-height) + var(--safe-bottom));
  padding: 8px max(8px, calc(var(--safe-right) + 6px)) var(--safe-bottom)
    max(8px, calc(var(--safe-left) + 6px));
  display: grid;
  grid-template-columns: 48px minmax(46px, 0.65fr) minmax(112px, 1.35fr);
  gap: 5px;
  align-items: stretch;
  background-color: rgba(244, 232, 206, 0.97);
  background-image: linear-gradient(rgba(244, 232, 206, 0.9), rgba(244, 232, 206, 0.9)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 620px 620px;
  border-top: 1px solid var(--rule);
}

#response-form.is-no-skip .form-actions {
  grid-template-columns: 52px minmax(0, 1fr);
}

.primary-action,
.text-action {
  min-height: 54px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.primary-action {
  padding: 11px 13px;
  border: 1px solid var(--bosco);
  border-radius: 2px;
  background: transparent;
  color: var(--bosco-deep);
}

.primary-action:hover:not(:disabled),
.primary-action:active:not(:disabled) {
  background: var(--bosco);
  color: var(--light);
  transform: none;
}

.primary-action:disabled {
  border-color: rgba(139, 111, 75, 0.42);
  background: transparent;
  color: rgba(99, 82, 73, 0.64);
}

.text-action {
  padding: 8px 2px;
  color: var(--bosco-deep);
  white-space: nowrap;
}

.text-action--skip {
  color: var(--ink-muted);
}

/* Campos largos conservan el gesto de escribir sobre una hoja. */

.field-group label,
.contact-field label,
.review-edit {
  font-size: 0.75rem;
}

.line-input,
.contact-field input {
  min-height: 54px;
  background: rgba(244, 232, 206, 0.22);
}

.story-input {
  min-height: 170px;
  background: rgba(244, 232, 206, 0.26);
}

.review-sheet {
  background: transparent;
}

/* Cierre: la misiva vuelve a sellarse. */

.closing {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 34px max(24px, calc(var(--safe-right) + 18px)) calc(var(--safe-bottom) + 28px)
    max(24px, calc(var(--safe-left) + 18px));
  background-color: var(--sole-mio);
  background-image: linear-gradient(rgba(101, 102, 54, 0.87), rgba(101, 102, 54, 0.87)),
    url("assets/papel-ritwal.webp");
  background-size: auto, 620px 620px;
}

[data-view="closing"] .brand-header {
  background-color: var(--sol-suave);
  color: var(--bosco);
}

.closing__seal {
  position: relative;
  width: 164px;
  aspect-ratio: 1;
  margin-bottom: 22px;
}

.closing__radial {
  position: absolute;
  inset: 0;
  width: auto;
  margin: 0;
  background: var(--light);
  -webkit-mask: url("assets/brand/ritwal-radial-mask.png") center / contain no-repeat;
  mask: url("assets/brand/ritwal-radial-mask.png") center / contain no-repeat;
}

.closing__isotype {
  position: absolute;
  inset: 34% 37%;
  background: url("assets/brand/ritwal-isotipo-bosco.png") center / contain no-repeat;
}

.closing__lead {
  margin: 0 0 14px;
  font-size: 0.78rem;
}

.closing h1 {
  max-width: 12ch;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
}

.closing__note {
  margin: 18px 0 24px;
}

.primary-action--light {
  border-color: var(--light);
  background: var(--light);
  color: var(--sole-mio);
}

@media (max-width: 340px) {
  :root {
    --station-rail: 72px;
  }

  .station-map li {
    font-size: 0.75rem;
  }

  .question-area {
    padding-right: max(12px, calc(var(--safe-right) + 10px));
    padding-left: max(12px, calc(var(--safe-left) + 10px));
  }

  .rating-scale {
    gap: 1px;
  }

  .form-actions {
    grid-template-columns: 44px minmax(42px, 0.62fr) minmax(106px, 1.38fr);
    gap: 3px;
  }
}

@media (max-height: 700px) and (max-width: 959px) {
  :root {
    --header-height: calc(56px + var(--safe-top));
    --action-height: 68px;
    --station-rail: 72px;
  }

  .brand-header,
  [data-view="welcome"] .brand-header,
  [data-view="closing"] .brand-header {
    padding-top: calc(5px + var(--safe-top));
    padding-bottom: 5px;
  }

  .official-wordmark,
  [data-view="welcome"] .official-wordmark,
  [data-view="closing"] .official-wordmark {
    width: 104px;
    height: 40px;
  }

  .welcome {
    min-height: calc(100svh - var(--header-height));
    padding-top: 8px;
    padding-bottom: calc(var(--safe-bottom) + 7px);
    grid-template-rows: 19px auto minmax(0, 1fr) auto auto;
    gap: 5px;
  }

  .welcome__progress {
    width: min(100%, 266px);
    height: 19px;
  }

  .welcome__progress span {
    width: 12px;
    height: 12px;
  }

  .welcome h1 {
    max-width: 12ch;
    font-size: clamp(1.95rem, 9.8vw, 2.3rem);
  }

  .seal-stage {
    width: min(74vw, 238px);
  }

  .seal-face {
    gap: 3px;
  }

  .seal-face__small,
  .station-preview strong {
    font-size: 0.75rem;
  }

  .seal-face__pictogram {
    width: 40px;
    height: 40px;
  }

  .seal-face__title {
    font-size: 1.05rem;
  }

  .station-preview {
    padding-top: 42px;
  }

  .station-preview__symbol {
    width: 26px;
    height: 26px;
  }

  .seal-thread {
    bottom: -31px;
    height: 42px;
  }

  .primary-action--welcome {
    min-height: 50px;
    font-size: 0.75rem;
  }

  .welcome__intro {
    font-size: 0.75rem;
  }

  .station-map ol {
    padding-top: 4px;
    padding-bottom: calc(var(--action-height) + var(--safe-bottom) + 3px);
    grid-template-rows: repeat(5, minmax(54px, 1fr));
  }

  .station-map li {
    grid-template-rows: 32px auto;
    gap: 2px;
  }

  .station-map__marker {
    width: 32px;
    height: 32px;
  }

  .station-map__marker .brand-symbol {
    width: 18px;
    height: 18px;
  }

  .question-area {
    padding-top: 15px;
    padding-bottom: calc(var(--action-height) + var(--safe-bottom) + 9px);
  }

  .question-header h1 {
    font-size: clamp(2.05rem, 10.2vw, 2.45rem);
  }

  .question-header::after {
    margin-top: 11px;
  }

  .question-meta {
    margin-top: 8px;
  }

  .question-header > p {
    margin-top: 5px;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  #response-form {
    padding-top: 14px;
  }

  .rating-fieldset legend {
    margin-bottom: 7px;
  }

  .rating-option {
    min-height: 60px;
    gap: 4px;
  }

  .rating-endpoints {
    margin-top: 4px;
  }

  .next-sheet-preview {
    right: max(10px, calc(var(--safe-right) + 8px));
    bottom: calc(var(--action-height) + var(--safe-bottom) + 10px);
    left: max(10px, calc(var(--safe-left) + 8px));
    min-height: 54px;
    padding: 8px 10px 7px;
    display: block;
  }

  .next-sheet-preview span {
    font-size: 0.75rem;
  }

  .next-sheet-preview strong {
    max-width: 100%;
    margin: 2px auto 0;
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .primary-action,
  .text-action {
    min-height: 50px;
  }
}

@media (orientation: landscape) and (min-width: 600px) and (max-width: 959px) and (max-height: 600px) {
  :root {
    --station-rail: 82px;
  }

  .welcome {
    padding-right: max(32px, calc(var(--safe-right) + 24px));
    padding-left: max(32px, calc(var(--safe-left) + 24px));
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.9fr);
    grid-template-rows: 20px 1fr auto auto;
    column-gap: 30px;
  }

  .welcome__progress,
  .welcome__copy,
  .primary-action--welcome,
  .welcome__intro {
    grid-column: 1;
  }

  .welcome__copy {
    text-align: left;
  }

  .welcome h1 {
    max-width: 10ch;
    margin-left: 0;
    font-size: clamp(2.15rem, 5.2vw, 2.8rem);
    text-align: left;
  }

  .seal-stage {
    grid-column: 2;
    grid-row: 1 / -1;
    width: min(42vw, 286px);
  }

  .question-area {
    padding-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(260px, 1.1fr);
    gap: 24px;
    align-items: center;
  }

  #response-form {
    padding-top: 0;
  }
}

@media (min-width: 960px) and (min-height: 650px) {
  :root {
    --header-height: 96px;
    --station-rail: 205px;
    --action-height: 0px;
  }

  .app-shell {
    min-height: 100vh;
    padding: 36px;
    display: grid;
    place-items: center;
  }

  .misiva {
    width: min(100%, 1040px);
    min-height: min(900px, calc(100vh - 72px));
    border-radius: 3px;
    box-shadow: var(--paper-shadow);
  }

  .brand-header,
  [data-view="welcome"] .brand-header,
  [data-view="closing"] .brand-header {
    height: var(--header-height);
    padding: 18px 36px 15px;
  }

  .official-wordmark,
  [data-view="welcome"] .official-wordmark,
  [data-view="closing"] .official-wordmark {
    width: 180px;
    height: 64px;
  }

  .welcome {
    height: calc(min(900px, 100vh - 72px) - var(--header-height));
    min-height: 610px;
    padding: 44px 72px 46px;
    grid-template-columns: minmax(0, 0.92fr) minmax(390px, 1.08fr);
    grid-template-rows: 30px 1fr auto auto;
    column-gap: 72px;
    row-gap: 18px;
  }

  .welcome__progress,
  .welcome__copy,
  .primary-action--welcome,
  .welcome__intro {
    grid-column: 1;
  }

  .welcome__copy {
    align-self: center;
    text-align: left;
  }

  .welcome h1 {
    max-width: 9ch;
    margin-left: 0;
    font-size: clamp(3.7rem, 5.8vw, 5rem);
    text-align: left;
  }

  .welcome__progress {
    width: 100%;
  }

  .seal-stage {
    grid-column: 2;
    grid-row: 1 / -1;
    width: min(100%, 470px);
  }

  .primary-action--welcome {
    justify-self: start;
  }

  .welcome__intro {
    justify-self: start;
  }

  .journey {
    height: calc(min(900px, 100vh - 72px) - var(--header-height));
    min-height: calc(min(900px, 100vh - 72px) - var(--header-height));
    grid-template-columns: var(--station-rail) minmax(0, 1fr);
  }

  .station-map {
    position: static;
    width: var(--station-rail);
    height: auto;
    min-height: 100%;
  }

  .station-map ol {
    padding: 30px 10px;
    grid-template-rows: repeat(5, 1fr);
  }

  .station-map ol::before {
    top: 10%;
    bottom: 10%;
  }

  .station-map li {
    grid-template-columns: 44px 1fr;
    grid-template-rows: 1fr;
    justify-items: start;
    gap: 14px;
    padding: 10px 24px;
    text-align: left;
  }

  .station-map__marker {
    width: 42px;
    height: 42px;
  }

  .station-map ol::before {
    left: 45px;
  }

  .question-area {
    min-height: calc(min(900px, 100vh - 72px) - var(--header-height));
    padding: 40px clamp(52px, 7vw, 92px) 28px;
  }

  .question-header h1 {
    max-width: 13ch;
    font-size: clamp(3.5rem, 5.4vw, 4.9rem);
  }

  #response-form {
    max-width: 690px;
    margin-inline: auto;
    padding-top: 36px;
  }

  .rating-option__mark {
    width: 54px;
  }

  .form-actions,
  #response-form.is-no-skip .form-actions {
    position: static;
    min-height: 0;
    margin-top: 28px;
    padding: 18px 0 0;
    grid-template-columns: 1fr auto minmax(150px, 0.75fr);
    background: transparent;
    border-top: 1px solid var(--rule);
  }

  #response-form.is-no-skip .form-actions {
    grid-template-columns: 1fr minmax(180px, 0.75fr);
  }

  .next-sheet-preview {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-opening .seal-shell,
  .is-opening .paper-flap,
  .is-opening .paper-pocket,
  .is-opening .welcome__copy,
  .is-opening .welcome__progress,
  .is-opening .primary-action--welcome,
  .is-opening .welcome__intro {
    animation: none !important;
  }
}
