/* The opening (#/abertura): one canvas, the narration over its lower dark third, three small controls in the quiet
   top band, the gate before it and the end card after. Type from DIRECAO section 6: the narration is IM Fell English.
   These two faces are the house display face (--letra-titulo in base.css), so every heading of the site, the owner's
   panel included, now renders in it instead of the fallback serif. */
@font-face { font-family: 'IM Fell English'; src: url('/fonts/IMFellEnglish-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IM Fell English'; src: url('/fonts/IMFellEnglish-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }

html.em-abertura, html.em-abertura body { overflow: hidden; background: #051118; }
.abertura { position: fixed; inset: 0; overflow: hidden; background: #051118; animation: ab-chega .6s ease-out both; }
.abertura.saindo { animation: ab-some .42s ease-in both; }
.ab-tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity .25s ease; }
.abertura.tocando .ab-tela { cursor: pointer; }
.abertura.pausada .ab-tela { opacity: .85; }
/* the canvas takes every gesture itself (a tap pauses, a sideways drag moves the phone's port) */
.ab-tela { touch-action: none; }
/* the hint over the phone's port: high in the quiet band under the controls, never near the narration */
.ab-dica {
  position: absolute; z-index: 2; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 70px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 16px; white-space: nowrap; isolation: isolate; overflow: hidden;
  /* the same worn sea-glass shape and pewter frame as the rest of the chrome */
  border-radius: 46% 54% 52% 48% / 58% 50% 50% 42%;
  background: rgba(15, 44, 58, .6); border: 2px solid #5D8189; color: var(--nevoa);
  box-shadow: inset 1px 1px 0 rgba(217, 232, 227, .26), inset -1px -1px 0 rgba(30, 84, 102, .7);
  font: italic 400 17px/1.2 var(--letra-titulo); pointer-events: none; opacity: 0; transition: opacity .6s ease;
}
/* the frost of worn sea glass, as on the pebble */
.ab-dica::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .3; mix-blend-mode: soft-light; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .9 0 0 0 0 .86 0 0 0 1.4 -.35'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23g)'/%3E%3C/svg%3E");
}
.ab-dica.vista { opacity: .92; }
/* in motion, the arrows slide twice either way, so the hint is seen to mean "sideways" */
.ab-dica.vista svg { animation: ab-lados 1.1s ease-in-out 2; }
@keyframes ab-lados { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .ab-dica.vista svg { animation: none; } }
.abertura.calma .ab-dica.vista svg { animation: none; }
/* "ver de novo": the picture dips and comes back, and the film restarts under the dip */
.abertura.mergulha .ab-tela, .abertura.mergulha .ab-legenda { animation: ab-mergulha var(--ab-mergulho, 400ms) ease-in-out both; }
@keyframes ab-chega { from { opacity: 0; } }
@keyframes ab-some { to { opacity: 0; } }
@keyframes ab-mergulha { 50% { opacity: .08; } }

/* the narration: pérola on the scrim the canvas paints under it; never wider than a comfortable line */
.ab-legenda {
  position: absolute; left: 50%; bottom: max(9.5%, calc(env(safe-area-inset-bottom) + 56px));
  width: min(86vw, 21em); margin-left: calc(min(86vw, 21em) / -2);
  font-size: 23px; pointer-events: none; transition: transform .9s ease;
}
.ab-fala {
  min-height: 4.2em; display: flex; align-items: flex-end; justify-content: center;
  font: 400 1em/1.34 var(--letra-titulo); color: var(--perola); text-align: center; text-wrap: balance;
  text-shadow: 0 1px 2px rgba(5, 17, 24, .9), 0 0 18px rgba(5, 17, 24, .85);
  opacity: 0; will-change: opacity, transform;
}
.ab-fala.do-eco { font-style: italic; font-size: 1.26em; }
/* with the end card up, the last line rises above the buttons (a transform, so nothing is laid out again) */
.abertura.no-fim .ab-legenda { transform: translateY(-88px); }
@media (min-width: 900px) {
  .ab-legenda { font-size: 35px; width: min(72vw, 23em); margin-left: calc(min(72vw, 23em) / -2); bottom: 8.5%; }
  .ab-fala.do-eco { font-size: 1.31em; }
}
@media (max-height: 480px) { .ab-legenda { font-size: 20px; bottom: 6%; } .ab-fala { min-height: 0; } }

/* the controls: sea-glass chips in the top band, quieter than anything in the picture. One frame each (a pewter
   edge), and the focus ring replaces it instead of doubling it */
.ab-barra {
  position: absolute; z-index: 3; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right));
  display: flex; gap: 10px; align-items: center; pointer-events: none;
}
.ab-barra-meio { flex: 1; }
.ab-botao, .ab-chip, .ab-seixo {
  -webkit-tap-highlight-color: transparent; font-family: var(--letra-texto); cursor: pointer; text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, transform .12s ease, filter .12s ease;
}
/* the pills sit in a fogged pewter frame (DIRECAO section 2: body #5D8189, lit face névoa on the upper left,
   shadow maré on the lower right) */
.ab-botao {
  pointer-events: auto; min-height: 48px; min-width: 48px; padding: 8px 16px; border-radius: 24px;
  border: 2px solid #5D8189; background: rgba(15, 44, 58, .66); color: var(--nevoa);
  box-shadow: inset 1px 1px 0 rgba(217, 232, 227, .28), inset -1px -1px 0 rgba(30, 84, 102, .7), 0 2px 6px rgba(5, 17, 24, .5);
  font-weight: 500; font-size: 16px; line-height: 1.2; letter-spacing: .02em;
}
.ab-botao:hover { background: rgba(30, 84, 102, .8); border-color: var(--espuma); }
.ab-botao[aria-pressed="false"].ab-som { color: var(--nevoa-baixa); border-style: dashed; }
.ab-botao[aria-pressed="true"].ab-pausar { background: rgba(62, 140, 147, .5); border-color: var(--espuma); color: var(--perola); }
/* a press: the chip sinks a hair, for about 120 ms (Borrifo) */
.ab-botao:active, .ab-chip:active, .ab-seixo:active { transform: scale(.96) translateY(1px); filter: brightness(.9); }
.abertura :is(.ab-botao, .ab-chip, .ab-seixo):focus-visible { outline: 2px solid var(--espuma); outline-offset: 3px; box-shadow: none; border-color: transparent; }
/* until a key is used, focus the page moved by itself shows no ring (see the player) */
.abertura.sem-anel :is(.ab-botao, .ab-chip, .ab-seixo, h1):focus-visible { outline: none; border-color: #5D8189; }
.abertura.sem-anel .ab-seixo:focus-visible { border-color: transparent; }

.ab-pausado {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 2; pointer-events: none;
  padding: 6px 18px; border-radius: 20px; background: rgba(5, 17, 24, .55);
  font: italic 400 22px/1.3 var(--letra-titulo); color: var(--perola); letter-spacing: .04em;
  animation: ab-chega .2s ease-out both;
}

/* the gate and the end card. The veil over the picture is even and very soft: no lighter shape behind the title */
.ab-portao, .ab-fim {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 18px;
  padding: 24px 20px; text-align: center;
}
.ab-portao { background: radial-gradient(160% 130% at 50% 46%, rgba(5, 17, 24, .58) 0%, rgba(5, 17, 24, .7) 55%, rgba(5, 17, 24, .86) 100%); transition: opacity .5s ease; }
.ab-portao.sai { opacity: 0; pointer-events: none; }
.ab-portao h1 { font-size: clamp(40px, 9vw, 72px); letter-spacing: .01em; }
.ab-convite { max-width: 22em; color: var(--nevoa); font: italic 400 clamp(19px, 2.2vw, 24px)/1.4 var(--letra-titulo); text-wrap: balance; }
.ab-botoes { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 8px; }
.ab-estado { min-height: 1.6em; color: var(--nevoa-baixa); font-size: 15px; }
.ab-fim { align-content: end; padding-bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px)); animation: ab-chega .9s ease-out both; pointer-events: none; }
.ab-fim .ab-botoes { pointer-events: auto; }

/* the primary action is a sea-glass pebble lit from inside (DIRECAO section 7): frosted, a soft uneven edge, no
   outline of its own. The secondary is a sea-glass chip in a pewter frame */
.ab-seixo {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; min-width: 150px; padding: 12px 30px;
  border: 0; border-radius: 46% 54% 52% 48% / 58% 50% 50% 42%;
  /* a highlight inside the upper left, over the glass body */
  background:
    radial-gradient(60% 55% at 28% 24%, rgba(239, 230, 218, .62), rgba(239, 230, 218, 0) 70%),
    radial-gradient(140% 120% at 50% 60%, #9FD2CC 0%, #6FB3B1 55%, #3E8C93 100%);
  box-shadow: inset 0 -5px 10px rgba(15, 44, 58, .34), inset 2px 3px 4px rgba(239, 230, 218, .45), 0 0 26px rgba(140, 199, 194, .28), 0 5px 14px rgba(5, 17, 24, .55);
  color: #0C2633; font-weight: 700; font-size: 18px; line-height: 1.2; letter-spacing: .01em;
}
/* the frost of worn sea glass: a fine grain laid over the pebble, under its words */
.ab-seixo::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .34; mix-blend-mode: soft-light; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .9 0 0 0 0 .86 0 0 0 1.4 -.35'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23g)'/%3E%3C/svg%3E");
}
.ab-seixo:hover { filter: brightness(1.07); }
/* the secondary: the same worn shape, in a pewter frame */
.ab-chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px;
  border-radius: 46% 54% 52% 48% / 58% 50% 50% 42%;
  border: 2px solid #5D8189; background: rgba(30, 84, 102, .34); color: var(--nevoa);
  box-shadow: inset 1px 1px 0 rgba(217, 232, 227, .26), inset -1px -1px 0 rgba(30, 84, 102, .7);
  font-weight: 500; font-size: 16px; line-height: 1.2;
}
.ab-chip:hover { background: rgba(62, 140, 147, .3); border-color: var(--espuma); }
:is(.ab-seixo, .ab-chip)[disabled] { opacity: .45; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .abertura, .abertura.saindo, .ab-fim, .ab-pausado { animation-duration: .12s; }
  .abertura.mergulha .ab-tela, .abertura.mergulha .ab-legenda { animation-duration: .12s; }
  .ab-portao, .ab-legenda, .ab-tela, .ab-dica { transition-duration: .12s; }
}
/* calmo=1 in the address: the same rules, by class (the player adds .calma) */
.abertura.calma, .abertura.calma.saindo, .abertura.calma .ab-fim, .abertura.calma .ab-pausado { animation-duration: .12s; }
.abertura.calma.mergulha .ab-tela, .abertura.calma.mergulha .ab-legenda { animation-duration: .12s; }
.abertura.calma .ab-dica { transition-duration: .12s; }
.abertura.calma .ab-portao, .abertura.calma .ab-legenda, .abertura.calma .ab-tela, .abertura.calma :is(.ab-botao, .ab-chip, .ab-seixo) { transition-duration: .12s; }
