/* TerrariAPI — hoja de estilos compartida (index.html y changelog.html)
   Concepto: la página es un corte del mundo. Arriba la superficie (cielo, colinas y el árbol),
   y al bajar se atraviesan capas cada vez más profundas.
   Paleta: la base sale del pixel art del logo (cielo, copa azul, colinas verdes, tronco gris y contorno negro);
   se suman tonos cálidos (sol, lava, gemas) y capas de color para el subsuelo. */

:root {
  /* Cielo y nubes */
  --sky: #6189b9;
  --haze: #8ea7c5;
  --cloud: #ececec;
  --cloud-2: #dedede;
  /* Copa del árbol */
  --canopy: #78a2fc;
  --canopy-mid: #6c9bff;
  --canopy-deep: #5189ff;
  --canopy-hi: #7fa7f7;
  /* Colinas */
  --grass-1: #5cdf90;
  --grass-2: #4ac67c;
  --grass-3: #3eb06c;
  --grass-4: #2b8550;
  /* Tronco y contorno */
  --trunk: #535353;
  --trunk-2: #454545;
  --outline: #000000;
  /* Acentos extra (sol, lava y gemas) */
  --gold: #ffd35c;
  --orange: #ff9f43;
  --orange-deep: #e0702b;
  --pink: #ff8fb1;
  --purple: #b79cff;
  /* Capas del subsuelo: bosque, cueva, caverna e inframundo */
  --layer-1: #1f4a38;
  --layer-2: #22304e;
  --layer-3: #2a2244;
  --layer-4: #2b1215;
  --footer: #150a0b;
  /* Texto y superficies */
  --text: #ececec;
  --muted: #c2c2c2;
  --line: rgba(236, 236, 236, 0.12);
  --panel: rgba(0, 0, 0, 0.18);
  --panel-strong: rgba(0, 0, 0, 0.3);
  --code-bg: #1b1b1b;
  --code-bar: #2d4f86;
  /* Semántico (solo para cambios que rompen compatibilidad) */
  --danger: #ff6b6b;
  /* Tipografía */
  --f-pixel: "Silkscreen", ui-monospace, "Courier New", monospace;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t-xs: 0.78rem;
  --t-sm: 0.9rem;
  --t-md: 1.05rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.8rem, 3.2vw, 2.6rem);
  --t-hero: clamp(2.3rem, 5.6vw, 4.2rem);
  --wrap: 1140px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--layer-3);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--sky);
}
img { max-width: 100%; }
a { color: var(--canopy); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--grass-1); outline-offset: 3px; }
code { font-family: var(--f-mono); font-size: 0.92em; background: var(--panel-strong); padding: 0.1em 0.4em; border-radius: 3px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- Navegación ---------- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(34, 48, 78, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--outline);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 47px; height: auto; }
.brand span { font-family: var(--f-pixel); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.5px; }
.brand b { color: var(--gold); font-weight: 700; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: var(--t-sm); font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-body); font-weight: 700; font-size: var(--t-sm);
  padding: 12px 18px; min-height: 44px;
  border: 3px solid var(--outline);
  box-shadow: 4px 4px 0 var(--outline);
  text-decoration: none; cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--outline); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--outline); }
.btn-primary { background: var(--canopy); color: var(--outline); }
.btn-primary:hover { color: var(--outline); }
.btn-green { background: var(--grass-1); color: var(--outline); }
.btn-green:hover { color: var(--outline); }
.btn-gold { background: var(--gold); color: var(--outline); }
.btn-gold:hover { color: var(--outline); }
.btn-ghost { background: var(--trunk); color: var(--text); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: var(--t-xs); box-shadow: 3px 3px 0 var(--outline); border-width: 2px; }
.nav .btn-sm { background: var(--canopy); color: var(--outline); }

/* ---------- Hero (superficie) ---------- */
.hero { position: relative; overflow: hidden; background: var(--sky); min-height: calc(100vh - 62px); min-height: calc(100svh - 62px); }
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding-block: 44px 330px;
}
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-block: 36px 330px; } }
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.eyebrow {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.eyebrow .depth { color: var(--gold); }
.hero .eyebrow { color: #ffffff; text-shadow: 2px 2px 0 var(--outline); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 9px; border: 2px solid var(--outline); background: var(--gold); color: var(--outline);
  text-transform: uppercase; text-shadow: none;
}
.hero h1 {
  margin: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.32em;
  font-family: var(--f-pixel); font-weight: 700; font-size: clamp(1.9rem, 4.1vw, 3.1rem);
  line-height: 1.05; letter-spacing: 0.01em; color: #ffffff;
  text-shadow: 3px 3px 0 rgba(29, 52, 92, 0.55);
}
/* "en una API." enmarcado con las esquinas del cursor de selección del juego */
.hero h1 em {
  --c: var(--gold); --t: 5px; --l: 20px;
  position: relative; font-style: normal;
  padding: 0.22em 0.42em 0.24em;
  background: rgba(29, 52, 92, 0.22);
}
.hero h1 em::before {
  content: ""; position: absolute; inset: -6px; pointer-events: none;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) top left / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) top right / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) bottom left / var(--t) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--t),
    linear-gradient(var(--c) 0 0) bottom right / var(--t) var(--l);
  background-repeat: no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(29, 52, 92, 0.55));
  animation: cursor-pulse 1.6s steps(2, jump-none) infinite;
}
@keyframes cursor-pulse { 0%, 100% { inset: -6px; } 50% { inset: -10px; } }
.hero .lead { margin: 0; font-size: var(--t-lg); line-height: 1.5; color: #ffffff; max-width: 34ch; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.base-url {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  background: var(--outline); border: 2px solid var(--outline);
  padding: 4px 4px 4px 14px; align-self: flex-start;
}
.base-url code { background: none; padding: 0; color: var(--cloud); font-size: var(--t-sm); overflow-x: auto; white-space: nowrap; }
.copy {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 700;
  background: transparent; color: var(--canopy); border: 0; cursor: pointer;
  padding: 8px 10px; min-height: 36px;
}
.copy:hover { color: var(--text); }

/* ---------- Consola de prueba ---------- */
.console {
  min-width: 0;
  background: var(--code-bg);
  border: 4px solid var(--outline);
  box-shadow: 8px 8px 0 var(--outline);
}
.console-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #2d4f86; border-bottom: 4px solid var(--outline); }
.console-bar i { width: 12px; height: 12px; display: block; border: 2px solid var(--outline); }
.console-bar i:nth-child(1) { background: var(--gold); }
.console-bar i:nth-child(2) { background: var(--grass-1); }
.console-bar i:nth-child(3) { background: var(--canopy); }
.console-bar span { margin-left: 8px; font-family: var(--f-mono); font-size: var(--t-xs); color: var(--cloud); }
.console form { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.req { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; background: var(--layer-2); border: 2px solid var(--trunk); font-family: var(--f-mono); font-size: var(--t-sm); }
.req:focus-within { border-color: var(--canopy); }
.req .method { padding: 0 10px; color: var(--outline); background: var(--grass-1); align-self: stretch; display: flex; align-items: center; font-weight: 700; font-size: var(--t-xs); }
.req .prefix { padding-left: 10px; color: var(--muted); white-space: nowrap; }
.req input { flex: 1; min-width: 60px; background: transparent; border: 0; color: var(--text); font: inherit; padding: 10px 10px 10px 2px; outline: none; }
.console .btn { box-shadow: 3px 3px 0 var(--outline); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 14px; border-bottom: 1px solid var(--line); }
.chip {
  font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; cursor: pointer; min-height: 32px;
}
.chip:hover, .chip[aria-pressed="true"] { color: var(--text); border-color: var(--canopy); }
.output { margin: 0; padding: 16px; height: 200px; overflow: auto; font-family: var(--f-mono); font-size: 0.83rem; line-height: 1.6; color: var(--cloud-2); white-space: pre; }
.status { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); flex-wrap: wrap; }
.status .dot { width: 10px; height: 10px; background: var(--muted); display: inline-block; }
.status[data-state="live"] .dot { background: var(--grass-1); }
.status[data-state="sample"] .dot { background: var(--canopy); }
.status[data-state="error"] .dot { background: var(--danger); }
.j-key { color: var(--canopy); } .j-str { color: var(--gold); } .j-num { color: var(--pink); } .j-bool { color: var(--grass-1); } .j-null { color: var(--muted); }

/* ---------- Estratos (separadores entre capas) ---------- */
.strata { display: block; width: 100%; height: 32px; }

/* ---------- Secciones ---------- */
.band { padding-block: 84px; }
.band-1 { background: var(--layer-1); }
.band-2 { background: var(--layer-2); }
.band-3 { background: var(--layer-3); }
.band-4 { background: var(--layer-4); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; max-width: 62ch; }
.section-head h2 { margin: 0; color: #ffffff; font-family: var(--f-pixel); font-weight: 700; font-size: var(--t-xl); line-height: 1.1; text-wrap: balance; text-shadow: 3px 3px 0 var(--outline); }
.section-head p { margin: 0; color: var(--muted); font-size: var(--t-md); }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; }
.head-row .section-head { margin-bottom: 0; }

/* Recursos */
.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .res-grid { grid-template-columns: minmax(0, 1fr); } }
.res {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px 18px; align-items: start;
  padding: 20px; background: var(--panel); border: 2px solid var(--outline);
  box-shadow: inset 0 0 0 2px rgba(236, 236, 236, 0.06);
}
.sprite { grid-row: span 3; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; background: var(--tint, var(--panel-strong)); border: 2px solid var(--outline); box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.12), inset -3px -3px 0 rgba(0, 0, 0, 0.25); }
.sprite img { display: block; }
.res h3 { margin: 0; font-size: var(--t-md); font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res p { margin: 0; color: var(--muted); font-size: var(--t-sm); line-height: 1.5; }
.res code { justify-self: start; font-size: 0.8rem; color: var(--canopy); }
.state { font-family: var(--f-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; }
.state-live { color: var(--grass-1); }
.state-beta { color: var(--canopy); }
.state-soon { color: var(--muted); }
.state-dev { color: var(--gold); }
.res[data-status="soon"] .sprite img { opacity: 0.8; }

/* Código + reglas */
.code-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .code-grid { grid-template-columns: minmax(0, 1fr); } }
.rules { margin: 0; display: grid; border-top: 2px solid var(--line); }
.rules div { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 4px 16px; padding: 18px 0; border-bottom: 2px solid var(--line); }
.rules div::before { content: ""; width: 12px; height: 12px; margin-top: 6px; background: var(--ore, var(--canopy)); border: 2px solid var(--outline); grid-row: span 2; }
.rules dt { font-weight: 700; font-size: var(--t-md); }
.rules dd { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.tabs { min-width: 0; background: var(--code-bg); border: 3px solid var(--outline); box-shadow: 6px 6px 0 var(--outline); }
.tablist { display: flex; flex-wrap: wrap; border-bottom: 2px solid var(--outline); background: var(--code-bar); }
.tablist button {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500; color: var(--cloud-2);
  background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; cursor: pointer; min-height: 44px;
}
.tablist button[aria-selected="true"] { color: #ffffff; border-bottom-color: var(--gold); }
.tablist .copy { margin-left: auto; color: var(--cloud); }
.tabs pre { margin: 0; padding: 22px; overflow-x: auto; font-family: var(--f-mono); font-size: 0.85rem; line-height: 1.7; color: var(--cloud-2); min-height: 170px; }

/* Changelog: cada versión es un bloque del mundo (pasto arriba, piedra abajo) unido a una línea de tiempo */
.log { list-style: none; margin: 0; padding: 0 0 0 52px; display: grid; gap: 34px; position: relative; }
.log::before {
  content: ""; position: absolute; left: 13px; top: 18px; bottom: 18px; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--trunk) 0 6px, transparent 6px 12px);
}
@media (max-width: 560px) { .log { padding-left: 0; } .log::before, .node { display: none; } }
.entry { position: relative; scroll-margin-top: 90px; }
.node {
  position: absolute; left: -52px; top: 12px; width: 32px; height: 32px;
  background: var(--grass-2); border: 3px solid var(--outline);
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, 0.3), inset -4px -4px 0 rgba(0, 0, 0, 0.3);
}
.entry.upcoming .node { background: var(--canopy); }
.block {
  border: 3px solid var(--outline);
  box-shadow: 8px 8px 0 var(--outline);
  background: var(--layer-2) url("assets/textures/stone.png") repeat;
}
.block-head {
  position: relative; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--grass-2);
  box-shadow: inset 0 4px 0 var(--grass-1);
  color: var(--outline);
}
.block-head::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 20px;
  background: url("assets/textures/drip-grass.png") repeat-x left top;
  pointer-events: none;
}
.entry.upcoming .block-head { background: var(--canopy); box-shadow: inset 0 4px 0 #a9c6ff; }
.entry.upcoming .block-head::after { background-image: url("assets/textures/drip-sky.png"); }
.entry.upcoming .block { border-style: dashed; }
.ver { font-family: var(--f-pixel); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--outline); text-decoration: none; }
.ver:hover { color: #ffffff; }
.date { font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 700; color: rgba(0, 0, 0, 0.72); font-variant-numeric: tabular-nums; }
.soon-tag { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; background: var(--outline); color: var(--canopy); }
.count { margin-left: auto; font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 700; color: rgba(0, 0, 0, 0.72); }
.block-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 34px 22px 22px; }
.block-body h3 { margin: 0; font-size: var(--t-lg); font-weight: 700; line-height: 1.3; text-shadow: 2px 2px 0 var(--outline); }
.block-body > p { margin: 0; color: var(--muted); max-width: 65ch; }
.changes { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.changes li {
  display: grid; grid-template-columns: 14px 92px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 10px 12px; background: rgba(0, 0, 0, 0.28); border: 2px solid rgba(0, 0, 0, 0.5);
}
.changes li::before { content: ""; width: 12px; height: 12px; background: var(--type-color, var(--muted)); border: 2px solid var(--outline); align-self: center; }
@media (max-width: 480px) { .changes li { grid-template-columns: 14px minmax(0, 1fr); } .changes li > span:last-child { grid-column: 2; } }
.changes li.t-added { --type-color: var(--grass-1); }
.changes li.t-changed { --type-color: var(--canopy); }
.changes li.t-fixed { --type-color: var(--gold); }
.changes li.t-removed { --type-color: var(--muted); }
.changes li.t-breaking { --type-color: var(--danger); border-color: var(--danger); }
.type { font-family: var(--f-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--type-color, var(--muted)); }
.log-empty { padding: 30px; border: 2px dashed var(--line); color: var(--muted); }

/* CTA + footer */
.cta { padding-block: 120px; }
.cta .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta h2 { margin: 0 0 10px; font-family: var(--f-pixel); font-size: var(--t-xl); line-height: 1.1; }
.cta p { margin: 0; color: var(--muted); max-width: 52ch; }
.footer { background: var(--footer); border-top: 2px solid var(--outline); }
.footer .wrap { display: flex; gap: 24px 40px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); }
.footer small { display: block; margin-top: 12px; color: var(--muted); font-size: var(--t-xs); max-width: 60ch; line-height: 1.6; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer nav a { color: var(--muted); font-size: var(--t-sm); text-decoration: none; }
.footer nav a:hover { color: var(--text); }

/* Página de changelog */
.page-head { background: var(--sky); padding-block: 64px 40px; border-bottom: 4px solid var(--outline); }
.page-head .eyebrow { color: #ffffff; text-shadow: 2px 2px 0 var(--outline); }
.page-head h1 { margin: 10px 0 12px; font-family: var(--f-pixel); font-size: var(--t-hero); line-height: 1; color: #ffffff; text-shadow: 4px 4px 0 var(--outline); }
.page-head p { margin: 0; color: #ffffff; max-width: 60ch; font-size: var(--t-md); text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.page-head .chip { background: var(--outline); color: var(--cloud-2); border-color: var(--outline); }
.page-head .chip[aria-pressed="true"], .page-head .chip:hover { color: var(--outline); background: var(--canopy); }

/* ---------- Criaturas en las secciones ---------- */
.band, .ocean { position: relative; overflow: hidden; }
.band > .wrap { position: relative; z-index: 1; }
.critter { position: absolute; z-index: 0; pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.critter-caster { right: max(24px, calc((100% - var(--wrap)) / 2 + 20px)); bottom: 0; width: 51px; height: 75px; }
.critter-caster-left { right: auto; left: max(24px, calc((100% - var(--wrap)) / 2 + 20px)); transform: scaleX(-1); }
.critter-ghost {
  top: 40px; left: 0; width: 54px; height: 78px; opacity: 0.85;
  animation: ghost-drift 46s linear infinite, ghost-bob 3s ease-in-out infinite alternate;
}
@keyframes ghost-drift { from { transform: translateX(calc(100vw + 60px)); } to { transform: translateX(-120px); } }
@keyframes ghost-bob { from { margin-top: 0; } to { margin-top: 18px; } }

/* Océano entre el bosque y las cuevas: varias orcas a distintas profundidades */
.ocean { height: 300px; background: #3d63a8; }
.ocean .strata { position: absolute; inset: 0; width: 100%; height: 100%; }
.ocean .flyer img { animation-duration: 2.6s; }
.orca-near img { width: 198px; height: 90px; }
.orca-mid img { width: 132px; height: 60px; opacity: 0.85; }
.orca-far img { width: 66px; height: 30px; opacity: 0.6; }
.bubble { position: absolute; z-index: 0; width: 6px; height: 6px; background: rgba(236, 236, 236, 0.55); box-shadow: inset -2px -2px 0 rgba(120, 162, 252, 0.6); animation: bubble-up 5s steps(20) infinite; }
@keyframes bubble-up { from { transform: translateY(0); opacity: 0.9; } to { transform: translateY(-230px); opacity: 0; } }
@media (max-width: 560px) { .critter-caster { display: none; } }

/* Voladores de sección: .fly-l va hacia la izquierda; .fly-r hacia la derecha (voltea el sprite) */
.flyer { position: absolute; left: 0; z-index: 0; pointer-events: none; animation: fly-left var(--dur, 30s) linear infinite; animation-delay: var(--delay, 0s); }
.flyer img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; animation: flyer-bob 1.8s ease-in-out infinite alternate; }
.flyer.fly-r { animation-name: fly-right; }
.flyer.fly-r img { transform: scaleX(-1); }
@keyframes fly-left { from { transform: translateX(calc(100vw + 40px)); } to { transform: translateX(-160px); } }
@keyframes fly-right { from { transform: translateX(-160px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes flyer-bob { from { margin-top: 0; } to { margin-top: 14px; } }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .critter, .bubble, .hero h1 em::before, .flyer, .flyer img { animation: none; }
  .flyer { transform: translateX(30vw); }
  .critter-orca { transform: translateX(40vw); }
  .critter-ghost { transform: translateX(70vw); }
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}
