:root {
  --tinta: #2a1d14;
  --papel: #f3e7d3;
  --papel-2: #e8d6b8;
  --cobre: #c06a2b;
  --cobre-claro: #f0a45a;
  --noche: #1b130e;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --titulo: "IM Fell English SC", "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--noche);
  color: var(--papel);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#escena {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  display: block;
}

/* darkens the painting as you scroll into the sheet */
.velo {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(27, 19, 14, .85), rgba(27, 19, 14, 0) 60%);
  pointer-events: none;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.barra {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) 16px;
  z-index: 5;
  color: var(--tinta);
  mix-blend-mode: multiply;
  transition: color .4s;
}
body.bajo .barra { color: var(--papel); mix-blend-mode: normal; }
.marca { display: grid; line-height: 0; }
.marca img { grid-area: 1 / 1; height: 24px; width: auto; transition: opacity .4s; }
.marca-blanco { opacity: 0; }
body.bajo .marca-negro { opacity: 0; }
body.bajo .marca-blanco { opacity: .85; }

.musica {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 18px;
  font-style: italic;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 4px;
}
.ondas { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.ondas i {
  width: 3px;
  height: 4px;
  background: currentColor;
  border-radius: 2px;
  transition: height .2s;
}
.musica[aria-pressed="true"] .ondas i { animation: onda 1.1s ease-in-out infinite; }
.musica[aria-pressed="true"] .ondas i:nth-child(2) { animation-delay: -.3s; }
.musica[aria-pressed="true"] .ondas i:nth-child(3) { animation-delay: -.6s; }
.musica[aria-pressed="true"] .ondas i:nth-child(4) { animation-delay: -.9s; }
@keyframes onda { 0%, 100% { height: 4px; } 50% { height: 16px; } }

main { position: relative; z-index: 2; }

.portada {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(16px, 5vw, 72px) clamp(56px, 9vh, 96px);
}

.pie {
  max-width: 660px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s ease 1.6s, transform 1.4s ease 1.6s;
}
body.abierto .pie { opacity: 1; transform: none; }

.pronto {
  margin: 0 0 6px;
  font-family: var(--titulo);
  font-size: 15px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--cobre-claro);
}
.lema {
  margin: 0 0 22px;
  font-size: clamp(20px, 2.1vw, 25px);
  line-height: 1.35;
  color: var(--papel);
  text-shadow: 0 1px 18px rgba(27, 19, 14, .9);
}

.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }

.boton {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px 14px 18px;
  font: inherit;
  color: var(--papel);
  text-decoration: none;
  background: linear-gradient(180deg, #8a4a22, #5c2f17);
  border: 1px solid rgba(240, 164, 90, .55);
  border-radius: 3px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 220, 170, .25);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.boton:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 220, 170, .3); }
.boton:focus-visible, .enlace:focus-visible, .musica:focus-visible { outline: 2px solid var(--cobre-claro); outline-offset: 4px; }
.boton svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.boton b { display: block; font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.boton small { display: block; font-size: 14px; font-style: italic; opacity: .8; }
.boton[aria-disabled="true"] { filter: grayscale(.7) brightness(.8); cursor: default; transform: none; }

.enlace {
  font: inherit;
  font-style: italic;
  color: var(--papel);
  background: none;
  border: 0;
  padding: 4px 0;
  border-bottom: 1px solid rgba(243, 231, 211, .4);
  text-decoration: none;
  cursor: pointer;
}
.enlace:hover { border-bottom-color: var(--cobre-claro); }

.bajar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 22px;
  height: 36px;
  margin-left: -11px;
  border: 1px solid rgba(243, 231, 211, .5);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 1s ease 2.6s;
}
body.abierto .bajar { opacity: 1; }
.bajar span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  background: var(--papel);
  border-radius: 2px;
  animation: bajar 1.8s ease-in-out infinite;
}
@keyframes bajar { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* the sheet of paper that slides over the painting */
.prueba {
  padding: 12vh clamp(16px, 5vw, 72px) 14vh;
  display: flex;
  justify-content: center;
}
.hoja {
  position: relative;
  max-width: 760px;
  width: 100%;
  padding: clamp(28px, 6vw, 64px);
  color: var(--tinta);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 250, 240, .7), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(192, 106, 43, .18), transparent 55%),
    var(--papel);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
  /* ragged painted edge */
  clip-path: polygon(0.6% 1.2%, 18% 0.2%, 41% 1%, 63% 0%, 84% 0.8%, 99.4% 0.3%, 100% 22%, 99.2% 47%, 100% 71%, 99.5% 98.8%, 77% 100%, 52% 99.1%, 29% 100%, 8% 99.3%, 0% 99.6%, 0.7% 74%, 0% 49%, 0.5% 23%);
}
.hoja::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hoja .pronto { color: var(--cobre); }
.hoja h2 {
  margin: 0 0 18px;
  font-family: var(--titulo);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.1;
}
.hoja h3 {
  margin: 36px 0 12px;
  font-family: var(--titulo);
  font-weight: 400;
  font-size: 24px;
}
.hoja h4 {
  margin: 18px 0 6px;
  font-family: var(--titulo);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cobre);
}
.trae { margin: 0; padding-left: 1.1em; }
.trae li { margin: 0 0 8px; }
.trae li::marker { color: var(--cobre); }

.controles { margin: 0; display: grid; gap: 8px; }
.controles div { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 16px; align-items: baseline; border-bottom: 1px dashed rgba(42, 29, 20, .2); padding-bottom: 6px; }
.controles dt { font-style: italic; }
.controles dd { margin: 0; }
kbd {
  display: inline-block;
  min-width: 1.7em;
  margin-right: 4px;
  padding: 0 6px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  background: var(--papel-2);
  border: 1px solid rgba(42, 29, 20, .35);
  border-bottom-width: 2px;
  border-radius: 3px;
}
.pasos { margin: 0; padding-left: 1.3em; }
.pasos li { margin: 0 0 6px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; background: var(--papel-2); padding: 1px 5px; border-radius: 3px; }

/* the studio, as in the other games of hiandino (llanos-reckoning's footer) */
.fin {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(240, 164, 90, .12);
}
.estudio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--titulo);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(243, 231, 211, .55);
  text-decoration: none;
}
.estudio img { height: 22px; width: auto; opacity: .75; transition: opacity .2s; }
.estudio:hover img { opacity: 1; }
.fin small { font-size: 14px; font-style: italic; color: rgba(243, 231, 211, .4); }

/* browsers only start the music after a click, so a small notice offers it */
.aviso {
  position: fixed;
  right: clamp(16px, 4vw, 48px);
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #8a4a22, #5c2f17);
  border: 1px solid rgba(240, 164, 90, .55);
  border-radius: 3px;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 220, 170, .25);
  animation: aviso 1s ease 2.2s both;
  transition: opacity .4s, transform .4s;
}
.aviso.fuera { opacity: 0; transform: translateY(12px); pointer-events: none; }
@keyframes aviso { from { opacity: 0; transform: translateY(12px); } }
.aviso button { font: inherit; color: var(--papel); background: none; border: 0; cursor: pointer; }
.aviso-activar { display: inline-flex; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; font-size: 18px; }
.aviso-activar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.aviso-activar:hover { color: #fff; }
.aviso-cerrar { padding: 8px 14px 10px 10px; font-size: 24px; line-height: 1; opacity: .7; }
.aviso-cerrar:hover { opacity: 1; }
.aviso button:focus-visible { outline: 2px solid var(--cobre-claro); outline-offset: 2px; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .velo { background: linear-gradient(to top, rgba(27, 19, 14, .92) 0%, rgba(27, 19, 14, .6) 38%, rgba(27, 19, 14, 0) 62%); }
  .marca img { height: 18px; }
  .acciones { flex-direction: column; align-items: stretch; }
  .boton { justify-content: center; }
  .enlace { align-self: center; }
  .controles div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bajar span, .musica .ondas i, .aviso { animation: none !important; }
}
