/* aguante tacuazín — at the lake
   dressed like hugofloresgarcia.github.io (no-style-please):
   white paper, black monospace, ///// dividers, yellow as the one accent. */

html, body { background: white; }

html { scroll-behavior: smooth; }

body {
  color: black;
  font-family: monospace;
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  min-height: 100dvh;
  overflow-wrap: break-word;
}

.wrap {
  min-height: 100dvh;
  box-sizing: border-box;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  position: relative;
  z-index: 1;
}

/* ---- polaroid stage ---- */

#stage {
  position: relative;
  width: min(92vw, 700px);
  height: min(48dvh, 500px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#stage img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  opacity: 0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.20), 0 2px 8px rgba(0, 0, 0, 0.12);
  user-select: none;
  -webkit-user-select: none;
}

#stage:focus-visible {
  outline: 2px solid black;
  outline-offset: 6px;
}

/* ---- title + transport ---- */

.deck {
  width: min(92vw, 700px);
  text-align: center;
  position: relative;
  z-index: 3;
}

h1 {
  font-size: 1.25rem;
  margin: 0;
}

.sub {
  margin: 0.15rem 0 1.1rem;
}

.transport {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

#play {
  font-family: inherit;
  background: white;
  color: black;
  border: thin solid black;
  padding: 0;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#play svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: black;
}

/* svg ignores the html `hidden` attribute, so state is a class on the button */
#play #ic-pause { display: none; }
#play.playing #ic-play { display: none; }
#play.playing #ic-pause { display: block; }

#play:hover,
#play:focus-visible {
  background: yellow;
  outline: none;
}

.time {
  font-variant-numeric: tabular-nums;
  min-width: 3.1rem;
  font-size: 0.9rem;
}

#cur { text-align: right; }
#dur { text-align: left; }

/* seek: garden-colored waveform (canvas) with an invisible range on top
   so keyboard + screen readers still get a real slider */

.wave {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 56px;
}

#wavecv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#seek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.wave:focus-within {
  outline: 2px solid black;
  outline-offset: 4px;
}

/* ---- self-similarity map ---- */

.map {
  margin-top: 1.1rem;
}

#ssm {
  width: clamp(140px, 22dvh, 210px);
  aspect-ratio: 1;
  border: thin solid black;
  cursor: pointer;
  touch-action: none;
  image-rendering: auto;
}

.mapcap {
  opacity: 0.5;
  font-size: 0.75rem;
  margin: 0.35rem 0 0;
}

.hint {
  opacity: 0.5;
  font-size: 0.8rem;
  margin: 1.1rem 0 0;
}

.hint a { color: black; }

/* ---- liner notes (scroll down from the player) ---- */

.liner {
  width: min(88vw, 540px);
  margin: 0 auto;
  padding: 1.5rem 0 4.5rem;
  position: relative;
  z-index: 3; /* like the homepage: text above the flora */
}

.divider {
  text-align: center;
  margin: 2.2rem 0;
}

.divider:target { background: yellow; } /* site's *:target, kept on purpose */

.credits {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.credits li { margin: 0.4rem 0; }

.thanks {
  text-align: center;
  margin: 2.2rem 0 0;
}

.fin { margin-bottom: 0; }

.noscript {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 1rem;
}

/* ---- garden canvas: floats over everything, never blocks clicks ---- */

#garden canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
}

/* short landscape screens (phones sideways): shrink the stage, keep controls */
@media (max-height: 480px) {
  #stage { height: 40dvh; }
  .sub { margin-bottom: 0.5rem; }
  .hint, .map { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #stage img { transition: none !important; }
}
