/* UNIGEO FLIX: paleta das camadas da Terra.
   rocha profunda (fundo) · água/aquífero (saneamento) · estrato mineral (âmbar) · folha (vida) */
:root {
  --bg: #050d14; --bg2: #08151f; --surface: #0e2130; --line: #183447;
  --aqua: #19c3b1; --aqua-d: #0e8f83; --amber: #f0a33a; --leaf: #7bc96f; --clay: #c8643c;
  --text: #eef4f2; --muted: #8fa6ad;
  --radius: 10px; --ease: cubic-bezier(.22, 1, .36, 1);
  --pad: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 Inter, system-ui, sans-serif; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .logo, .intro-logo { font-family: Sora, Inter, sans-serif; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.play svg { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--amber); color: #111; padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* ---------- Intro: camadas geológicas se depositam, logo emerge ---------- */
#intro { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center;
  animation: introOut .6s var(--ease) 2.1s forwards; }
#intro .strata { position: absolute; inset: auto 0 0 0; height: 46vh; display: flex; flex-direction: column-reverse; }
#intro .strata i { flex: 1; transform: scaleX(0); transform-origin: left; animation: layer .7s var(--ease) forwards; }
#intro .strata i:nth-child(1) { background: #2b1a12; animation-delay: .05s; }
#intro .strata i:nth-child(2) { background: var(--clay); animation-delay: .17s; opacity: .85; }
#intro .strata i:nth-child(3) { background: var(--amber); animation-delay: .29s; opacity: .8; transform-origin: right; }
#intro .strata i:nth-child(4) { background: var(--aqua-d); animation-delay: .41s; }
#intro .strata i:nth-child(5) { background: var(--leaf); animation-delay: .53s; opacity: .7; transform-origin: right; }
.intro-logo { position: relative; font-size: clamp(42px, 9vw, 110px); font-weight: 800; letter-spacing: -.03em;
  opacity: 0; transform: translateY(24px) scale(.96); filter: blur(8px); animation: logoIn .9s var(--ease) .75s forwards; }
.intro-logo b, .logo b { color: var(--amber); margin-left: .12em; }
@keyframes layer { to { transform: scaleX(1); } }
@keyframes logoIn { to { opacity: 1; transform: none; filter: none; } }
@keyframes introOut { to { opacity: 0; visibility: hidden; } }

/* ---------- Header ---------- */
header { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: 14px var(--pad); background: linear-gradient(var(--bg) -40%, transparent); transition: background .35s var(--ease); }
header.solid { background: rgba(5, 13, 20, .92); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.logo { display: flex; align-items: center; font-size: 22px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.logo-mark { display: grid; gap: 3px; width: 22px; margin-right: 10px; }
.logo-mark i { height: 4px; border-radius: 2px; background: var(--amber); }
.logo-mark i:nth-child(2) { background: var(--aqua); width: 80%; }
.logo-mark i:nth-child(3) { background: var(--leaf); width: 60%; }
nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; flex: 1; mask-image: linear-gradient(90deg, #000 85%, transparent); }
nav a { font-size: 13.5px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .2s; }
nav a:hover { color: var(--text); }
.search { display: flex; align-items: center; gap: 8px; background: rgba(14, 33, 48, .7); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; transition: border-color .2s, width .35s var(--ease); width: 240px; }
.search:focus-within { border-color: var(--aqua); width: 320px; }
.search input { background: none; border: 0; color: var(--text); font: inherit; width: 100%; outline: none; }

/* ---------- Hero ---------- */
#hero { position: relative; height: min(88vh, 860px); min-height: 520px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity 1.4s var(--ease); transform: scale(1.12); }
.hero-bg img.on { opacity: 1; animation: kenburns 14s linear forwards; }
@keyframes kenburns { from { transform: scale(1.12) translate(0, 0); } to { transform: scale(1.02) translate(-1.5%, -1%); } }
.hero-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5,13,20,.96) 0%, rgba(5,13,20,.7) 38%, transparent 70%),
              linear-gradient(0deg, var(--bg) 2%, transparent 40%); }
.hero-body { position: relative; padding: 0 var(--pad) 12vh; max-width: 760px; }
.hero-body > * { animation: rise .8s var(--ease) both; }
.hero-body > :nth-child(2) { animation-delay: .06s; } .hero-body > :nth-child(3) { animation-delay: .12s; }
.hero-body > :nth-child(4) { animation-delay: .18s; } .hero-body > :nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.eyebrow { margin: 0 0 10px; font: 600 12px/1 Inter; letter-spacing: .16em; text-transform: uppercase; color: var(--aqua); }
#hero h1 { margin: 0; font-size: clamp(32px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.hero-serie { margin: 10px 0 0; color: var(--amber); font-weight: 600; }
.hero-desc { margin: 14px 0 26px; color: #c9d6d6; font-size: clamp(15px, 1.3vw, 17px); max-width: 60ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 9px; border: 0; border-radius: 8px; padding: 12px 22px;
  font: 600 15px/1 Inter; cursor: pointer; text-decoration: none; transition: transform .25s var(--ease), background .2s, box-shadow .25s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn.play { background: var(--text); color: var(--bg); }
.btn.play:hover { background: #fff; box-shadow: 0 10px 30px -10px rgba(25, 195, 177, .7); }
.btn.ghost { background: rgba(143, 166, 173, .22); color: var(--text); backdrop-filter: blur(6px); }
.btn.ghost:hover { background: rgba(143, 166, 173, .34); }
.btn.link { background: none; color: var(--muted); padding-inline: 8px; }
.btn.link:hover { color: var(--text); }
.hero-dots { position: absolute; right: var(--pad); bottom: 12vh; display: flex; gap: 8px; }
.hero-dots button { width: 26px; height: 4px; border: 0; border-radius: 2px; background: rgba(238, 244, 242, .25); cursor: pointer; padding: 0; overflow: hidden; position: relative; }
.hero-dots button[aria-selected="true"]::after { content: ""; position: absolute; inset: 0; background: var(--amber); transform-origin: left; animation: fill 9s linear forwards; }
@keyframes fill { from { transform: scaleX(0); } }

/* ---------- Fileiras ---------- */
#rows { position: relative; margin-top: -9vh; padding-bottom: 40px; }
.row { margin: 0 0 34px; opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.row.in { opacity: 1; transform: none; }
.row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--pad); margin-bottom: 10px; }
.row-head h2 { margin: 0; font-size: clamp(17px, 1.6vw, 22px); letter-spacing: -.01em; }
.row-head .count { color: var(--muted); font-size: 13px; }
.row-head .bar { height: 3px; width: 28px; border-radius: 2px; background: var(--c, var(--aqua)); align-self: center; }
.track-wrap { position: relative; }
.track { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 21vw, 320px); gap: 10px;
  overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  padding: 18px var(--pad) 26px; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.arrow { position: absolute; top: 18px; bottom: 26px; width: calc(var(--pad) - 4px); min-width: 36px; border: 0; z-index: 3;
  background: rgba(5, 13, 20, .65); color: var(--text); font-size: 28px; cursor: pointer; opacity: 0; transition: opacity .25s; }
.arrow.l { left: 0; border-radius: 0 8px 8px 0; } .arrow.r { right: 0; border-radius: 8px 0 0 8px; }
.track-wrap:hover .arrow, .arrow:focus-visible { opacity: 1; }

/* ---------- Card ---------- */
.card { position: relative; scroll-snap-align: start; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: var(--radius);
  background: var(--surface); overflow: hidden; cursor: pointer; color: var(--text); text-align: left;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease); transform-origin: center; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease), filter .4s; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,13,20,.95) 0%, rgba(5,13,20,.15) 55%, transparent); }
.card .meta { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; }
.card .t { font: 600 14px/1.25 Sora; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .s { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .ep { position: absolute; top: 10px; left: 10px; z-index: 1; font: 700 11px/1 Inter; background: rgba(5,13,20,.72);
  border: 1px solid var(--line); padding: 4px 7px; border-radius: 5px; letter-spacing: .04em; }
.card .seen { position: absolute; top: 10px; right: 10px; z-index: 1; font: 600 10.5px/1 Inter; color: var(--bg); background: var(--leaf); padding: 4px 7px; border-radius: 5px; }
.card .glow { position: absolute; inset: auto 0 0 0; height: 3px; z-index: 2; background: linear-gradient(90deg, var(--aqua), var(--amber));
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
@media (hover: hover) {
  .card:hover, .card:focus-visible { transform: scale(1.07); z-index: 5; box-shadow: 0 22px 44px -16px rgba(0,0,0,.9), 0 0 0 1px var(--line); }
  .card:hover img { transform: scale(1.08); filter: saturate(1.15); }
  .card:hover .glow, .card:focus-visible .glow { transform: scaleX(1); }
}

/* ---------- Busca ---------- */
#results { padding: 110px var(--pad) 40px; min-height: 70vh; }
#results h2 { margin: 0 0 18px; font-size: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
body.searching #hero, body.searching #rows { display: none; }

/* ---------- Modal ---------- */
dialog { width: min(920px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg2); color: var(--text); overflow: auto; box-shadow: 0 40px 120px -20px #000; }
dialog::backdrop { background: rgba(2, 6, 10, .78); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .5s var(--ease); }
dialog[open]::backdrop { animation: fade .4s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.m-media { position: relative; aspect-ratio: 16 / 9; background: #000; }
.m-media iframe, .m-media img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.m-body { padding: 18px clamp(18px, 4vw, 40px) 34px; }
.m-body h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.02em; }
.m-serie { color: var(--amber); font-weight: 600; margin: 6px 0 18px; }
.m-desc { font-size: 16px; color: #d3dfdf; max-width: 68ch; margin: 22px 0 8px; }
.close { position: absolute; top: 12px; right: 12px; z-index: 4; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(5,13,20,.8); color: var(--text); font-size: 16px; cursor: pointer; transition: transform .25s var(--ease); }
.close:hover { transform: rotate(90deg); }
#mEpsWrap h3 { font-size: 16px; margin: 28px 0 10px; }
.eps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.eps button { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid transparent;
  color: var(--text); border-radius: 8px; padding: 10px 14px; font: inherit; cursor: pointer; transition: border-color .2s, background .2s; }
.eps button:hover { border-color: var(--line); background: #12293b; }
.eps button[aria-current="true"] { border-color: var(--aqua); }
.eps b { color: var(--muted); font: 700 13px Sora; min-width: 26px; }

footer { padding: 30px var(--pad) 50px; border-top: 1px solid var(--line); color: #b9c7c9; font-size: 13.5px; }

@media (max-width: 760px) {
  header { gap: 12px; flex-wrap: wrap; padding-block: 10px; }
  nav { order: 3; flex-basis: 100%; }
  .search, .search:focus-within { width: auto; flex: 1; }
  .hero-dots { display: none; }
  .track { grid-auto-columns: 68vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  #intro { display: none; }
}

/* Novidades: selo estilo streaming */
.card .novo { position: absolute; left: 10px; bottom: 10px; z-index: 1; font: 800 10.5px/1 Inter; letter-spacing: .08em; color: #111; background: var(--amber); padding: 4px 7px; border-radius: 4px; box-shadow: 0 2px 10px rgba(240,163,58,.45); }
.row.row-new .row-head h2::after { content: "RECÉM-CHEGADOS"; margin-left: 10px; font: 800 10px/1 Inter; letter-spacing: .12em; color: #111; background: var(--amber); padding: 4px 6px; border-radius: 4px; vertical-align: middle; }

/* Player: vídeo dentro do próprio UNIGEO FLIX */
#player { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: var(--text); }
#player::backdrop { background: #000; }
#player[open] { display: grid; place-items: center; align-content: center; gap: 12px; }
#player .close { position: fixed; top: 14px; right: 14px; z-index: 2; }
.p-box { width: min(100vw, calc((100dvh - 60px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.p-box video, .p-box iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.p-title { margin: 0; padding: 0 16px; font: 600 15px/1.3 Inter; color: var(--muted); text-align: center; }

/* Portão de login (tela de entrada estilo streaming) */
#gate { display: none; }
body.locked { overflow: hidden; }
body.locked #gate { display: grid; place-items: center; position: fixed; inset: 0; z-index: 200; background: var(--bg); padding: 16px; overflow: hidden; }
body.locked #intro { display: none; }
.g-wall { position: absolute; inset: -10%; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-content: start;
  transform: rotate(-8deg) scale(1.15); opacity: .4; filter: saturate(.85); animation: gwall 60s linear infinite alternate; }
.g-wall img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
#gate::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(5,13,20,.5) 0%, rgba(5,13,20,.9) 60%, var(--bg) 100%); }
@keyframes gwall { to { transform: rotate(-8deg) scale(1.15) translateY(-10%); } }
.g-card { position: relative; z-index: 1; width: min(440px, 100%); padding: 40px 28px; border-radius: 16px; text-align: center;
  background: rgba(5, 13, 20, .78); border: 1px solid rgba(143, 166, 173, .18); backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px #000; display: grid; gap: 16px; justify-items: center; }
.g-logo { font-size: 30px; margin: 0; }
.g-card h1 { margin: 0; font: 800 clamp(22px, 4vw, 28px)/1.2 Sora; text-wrap: balance; }
.g-sub { margin: 0; color: var(--muted); line-height: 1.5; }
.g-btn { min-height: 44px; color-scheme: light; } /* sem isso o iframe do Google ganha fundo branco no tema escuro */
.g-err { margin: 0; color: #ffb4a2; background: rgba(200, 100, 60, .14); border: 1px solid rgba(200, 100, 60, .4); padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; }
.g-fine { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.user { display: flex; align-items: center; gap: 8px; font: 500 14px/1 Inter; white-space: nowrap; }
.user img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
@media (max-width: 700px) { .user span { display: none; } }
@media (prefers-reduced-motion: reduce) { .g-wall { animation: none; } }
