@font-face {
  font-family: 'Manrope';
  src: url('public/fonts/manrope-variable.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: Inter, Arial, sans-serif;
  color: #383838;
  background: #f8f8f8;
  --green: #486838;
  --green-dark: #284818;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #486838;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
#viewer {
  height: 100svh;
  min-height: 540px;
  position: relative;
  overflow: hidden;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#logo {
  position: absolute;
  top: 12px;
  left: 4vw;
  height: 46px;
  z-index: 11;
  mix-blend-mode: normal;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(248, 248, 248, 0.28));
}
#navigation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 12px 4vw 0;
  min-height: 35px;
  text-align: right;
}
#nav-toggle {
  border: 0;
  background: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(56, 56, 56, 0.85);
  padding: 8px 12px;
  transition: color 0.15s;
}
#nav-toggle:hover {
  color: var(--green);
}
#feature-list {
  display: flex;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
  background: linear-gradient(
    180deg,
    rgba(248, 248, 248, 0.92),
    rgba(248, 248, 248, 0.55) 55%,
    rgba(248, 248, 248, 0)
  );
  padding: 12px 10px 34px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: 0.2s;
}
#navigation:hover #feature-list,
#navigation:focus-within #feature-list,
#navigation.open #feature-list {
  opacity: 1;
  visibility: visible;
  transform: none;
}
#feature-list button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 15px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(56, 56, 56, 0.8);
  transition:
    color 0.15s,
    border-color 0.15s;
}
#feature-list button:hover {
  color: var(--green);
  border-color: var(--green);
}
#feature-list button.active {
  border-color: var(--green);
  color: var(--green-dark);
  font-weight: 600;
}
#story {
  position: absolute;
  left: 5vw;
  top: 14%;
  width: min(680px, 65vw);
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
  text-shadow: 0 2px 20px #f8f8e8;
}
#story.fading {
  opacity: 0;
  transform: translateY(8px);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #486838;
}
h1 {
  font-size: clamp(40px, 5.5vw, 84px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
  margin: 14px 0 18px;
  max-width: 680px;
}
#feature-copy {
  font-size: 16px;
  line-height: 1.7;
  max-width: 430px;
  margin: 0;
  color: rgba(56, 56, 56, 0.85);
}
#phase-note {
  font-size: 11px;
  margin-top: 14px;
  color: #486838;
}
.arrow {
  position: absolute;
  top: 56%;
  border: 1px solid #b8b8b8;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background: rgba(248, 248, 248, 0.7);
  font-size: 25px;
}
#prev {
  left: 22px;
}
#next {
  right: 22px;
}
.viewer-footer {
  position: absolute;
  bottom: 22px;
  left: 5vw;
  right: 5vw;
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 11px;
  color: rgba(56, 56, 56, 0.75);
}
.viewer-footer a {
  margin-left: auto;
  background: var(--green);
  color: #f8f8f8;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  transition: background 0.15s;
}
.viewer-footer a:hover {
  background: var(--green-dark);
}
.viewer-footer button {
  border: 0;
  background: none;
  font-size: 11px;
}
.demo {
  font-size: 9px;
  letter-spacing: 0.1em;
}
#loading {
  position: absolute;
  top: 55%;
  left: 20%;
  right: 20%;
  text-align: center;
  background: #f8f8e8;
  padding: 20px;
}
#documentation {
  padding: 100px 7vw;
}
.doc-heading {
  max-width: 800px;
  margin-bottom: 30px;
}
h2 {
  font-size: clamp(32px, 4vw, 55px);
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 15px 0;
}
p {
  line-height: 1.7;
}
.chapter {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 6vw;
  align-items: center;
  margin-bottom: 100px;
}
.chapter:nth-child(even) {
  direction: rtl;
}
.chapter > * {
  direction: ltr;
}
.chapter img {
  display: block;
  width: 100%;
  border-radius: 3px;
  background: #e8e8e8;
  filter: contrast(1.06);
}
.chapter h3 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 0;
}
.chapter p {
  font-size: 14px;
  color: rgba(56, 56, 56, 0.75);
}
.chapter button {
  border: 0;
  border-bottom: 1px solid #486838;
  padding: 10px 0;
  background: none;
  font-size: 12px;
  color: #486838;
}
.chapter-spec {
  margin: 18px 0 6px;
  padding: 14px 16px;
  background: rgba(72, 104, 56, 0.07);
  border-left: 3px solid #486838;
  border-radius: 2px;
}
.chapter-spec h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #486838;
}
.chapter-spec h5 {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(56, 56, 56, 0.85);
}
.chapter-spec dl {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 4px 14px;
  margin: 0;
}
.chapter-spec dt {
  font-size: 13px;
  font-weight: 600;
  color: #486838;
}
.chapter-spec dd {
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: rgba(56, 56, 56, 0.85);
}
.chapter-spec-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(56, 56, 56, 0.6);
}
.chapter .chapter-verbs {
  margin: 22px 0 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(72, 104, 56, 0.35);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px 18px;
}
.chapter-verbs .verb {
  min-width: 0;
}
.chapter-verbs .verb strong {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #486838;
}
.chapter-verbs .verb span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(56, 56, 56, 0.8);
  overflow-wrap: break-word;
}
footer {
  padding: 30px 7vw;
  border-top: 1px solid #e8e8e8;
  font-size: 11px;
  color: #b8b8b8;
  display: flex;
  align-items: center;
  gap: 18px;
}
.footer-logo {
  height: 34px;
  mix-blend-mode: normal;
}
@media (max-width: 700px) {
  #logo {
    height: 36px;
    top: 10px;
  }
  #story {
    top: 13%;
    width: 88vw;
    left: 6vw;
  }
  h1 {
    font-size: 40px;
    max-width: 90vw;
  }
  #feature-copy {
    font-size: 13px;
    max-width: 82vw;
    line-height: 1.5;
  }
  .arrow {
    top: 66%;
    width: 38px;
    height: 38px;
  }
  #prev {
    left: 12px;
  }
  #next {
    right: 12px;
  }
  .viewer-footer {
    gap: 10px;
    bottom: 26px;
  }
  .viewer-footer a {
    padding: 8px 12px;
  }
  #feature-list {
    max-height: 35vh;
    overflow: auto;
  }
  #feature-list button {
    padding: 10px;
    font-size: 11px;
  }
  .chapter {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 65px;
  }
  .chapter:nth-child(even) {
    direction: ltr;
  }
  #documentation {
    padding: 65px 6vw;
  }
  #phase-note {
    margin-top: 6px;
  }
  .chapter .chapter-verbs {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Fondo 3D: estudio oscuro (carbón) — la UI del visor pasa a claro. Solo el overlay del viewer; #documentation y footer quedan en página clara. */
#story {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
h1 {
  color: #f8f8f8;
}
.eyebrow {
  color: #9cc47e;
}
#feature-copy {
  color: rgba(248, 248, 248, 0.85);
}
#phase-note {
  color: #9cc47e;
}
#nav-toggle {
  color: rgba(248, 248, 248, 0.8);
}
#nav-toggle:hover {
  color: #f8f8f8;
}
#feature-list {
  background: linear-gradient(
    180deg,
    rgba(35, 37, 39, 0.92),
    rgba(35, 37, 39, 0.55) 55%,
    rgba(35, 37, 39, 0)
  );
}
#feature-list button {
  color: rgba(248, 248, 248, 0.75);
}
#feature-list button:hover {
  color: #f8f8f8;
  border-color: #9cc47e;
}
#feature-list button.active {
  border-color: #9cc47e;
  color: #f8f8f8;
}
.arrow {
  border-color: #5b5d60;
  background: rgba(51, 53, 55, 0.55);
  color: #f8f8f8;
}
.viewer-footer {
  color: rgba(248, 248, 248, 0.75);
}
.viewer-footer button {
  color: rgba(248, 248, 248, 0.85);
}
.demo {
  color: rgba(248, 248, 248, 0.55);
}
#loading {
  background: #333537;
  color: #f8f8f8;
}
/* Feedback 08: menú nunca en 2 filas en desktop (compactar en una sola línea) */
@media (min-width: 701px) {
  #feature-list {
    flex-wrap: nowrap;
    gap: 2px;
  }
  #feature-list button {
    padding: 12px 11px;
    font-size: 10px;
    letter-spacing: 0.07em;
  }
  #nav-toggle {
    font-size: 10.5px;
  }
}
/* Feedback 09-móvil: separar texto (arriba) y modelo (abajo); el follaje no invade el título */
@media (max-width: 600px) {
  #story {
    top: 7%;
    left: 6vw;
  }
  h1 {
    font-size: 36px;
    line-height: 0.98;
    max-width: 340px;
    margin-top: 8px;
  }
  #feature-copy {
    max-width: 320px;
    font-size: 14px;
    line-height: 1.5;
  }
}

/* Editorial reading scale; the approved viewer keeps its original typography. */
#documentation,
body > footer {
  font-family: 'Manrope', sans-serif;
}
.doc-heading > p {
  font-size: 17px;
  max-width: 58ch;
}
.chapter p {
  font-size: 16px;
  color: #535b53;
  line-height: 1.75;
}
.chapter h3 {
  font-weight: 500;
  line-height: 1.15;
}
.chapter button {
  font-size: 14px;
  font-weight: 600;
}
.chapter-spec {
  padding: 20px 0 4px;
  background: none;
  border-left: 0;
  border-top: 1px solid #bfc9bb;
  border-radius: 0;
}
.chapter-spec h4,
.chapter-spec h5 {
  font-size: 12px;
  letter-spacing: 0.09em;
}
.chapter-spec dl {
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px 20px;
}
.chapter-spec dt,
.chapter-spec dd {
  font-size: 14px;
  line-height: 1.6;
}
.chapter .chapter-spec-note {
  font-size: 12px;
  line-height: 1.65;
}
.chapter-verbs .verb strong {
  font-size: 11px;
  letter-spacing: 0.1em;
}
.chapter-verbs .verb span {
  font-size: 14px;
  line-height: 1.65;
}
@media (max-width: 700px) {
  #documentation {
    padding-top: 64px;
  }
  .chapter p {
    font-size: 15px;
  }
  .chapter-spec dl {
    gap: 10px 16px;
  }
}

/* Blueprint notebook: static lines, no additional WebGL geometry or animation. */
#viewer {
  background-color: #172b3b;
  background-image:
    radial-gradient(ellipse at 68% 45%, transparent 15%, #101f2dd9 100%),
    linear-gradient(#89b5d00c 1px, transparent 1px),
    linear-gradient(90deg, #89b5d00c 1px, transparent 1px),
    linear-gradient(#89b5d014 1px, transparent 1px),
    linear-gradient(90deg, #89b5d014 1px, transparent 1px);
  background-size:
    auto,
    24px 24px,
    24px 24px,
    120px 120px,
    120px 120px;
  background-position: center;
}
/* Invitación a navegar (Hermann 2026-09-08, r16): PULSA el botón de la derecha (#next)
   en lugar de una píldora genérica — el ojo encuentra el control real. El pulso se
   apaga con la primera interacción real del usuario (clase .inviting desde JS). */
#next.inviting {
  animation: nextLead 2.4s ease-in-out infinite;
}
#next.inviting:hover {
  animation: none;
}
@keyframes nextLead {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(156, 196, 126, 0);
  }
  50% {
    box-shadow: 0 0 0 11px rgba(156, 196, 126, 0.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  #next.inviting {
    animation: none;
  }
}
