:root{
  --bg: #001B3D;
  --accent: #003161;
  --accentSoft: rgba(0,49,97,.12);

  --card: rgba(255,255,255,.92);
  --radius: 18px;
  --shadow: 0 18px 46px rgba(0,0,0,.26);

  --textOnBg: rgba(255,255,255,.92);
  --mutedOnBg: rgba(255,255,255,.72);

  --ease: cubic-bezier(.2,.9,.2,1);
  --ui: 420ms;

  --from: #001B3D;
  --to: #001B3D;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--textOnBg);
  transition: background-color 900ms var(--ease);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 600px at 18% 10%, rgba(255,255,255,0.10), transparent 62%),
    radial-gradient(900px 520px at 82% 0%, rgba(255,255,255,0.06), transparent 62%),
    radial-gradient(900px 520px at 50% 120%, rgba(0,0,0,0.46), transparent 55%);
  opacity: .9;
}

.curtain{
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, var(--from), #000, var(--to));
  transform: translateX(-120%) skewX(-12deg);
  filter: saturate(1.05);
}

.curtain::before{
  content:"";
  position:absolute;
  inset:-10%;
  background:
    radial-gradient(900px 520px at 50% 40%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(90deg, rgba(0,0,0,.92), rgba(0,0,0,1), rgba(0,0,0,.92));
  filter: blur(2px);
  opacity: .95;
}

.curtain::after{
  content:"";
  position:absolute;
  inset:-10%;
  background: linear-gradient(90deg, var(--from), #000, var(--to));
  opacity: .85;
  mix-blend-mode: screen;
  filter: saturate(1.1);
}

.blackout{
  position: fixed;
  inset: 0;
  z-index: 880;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 220ms linear;
}

html.is-blackout .blackout{
  opacity: 1;
}

html.is-dimming #wrap{
  filter: brightness(.80) saturate(.92);
  transform: scale(0.997);
  transition: filter 220ms linear, transform 220ms linear;
}
#wrap{ transition: filter 220ms linear, transform 220ms linear; }

html.is-curtain .curtain{
  opacity: 1;
  animation: curtainPro 780ms var(--ease) forwards;
}
@keyframes curtainPro{
  0%   { transform: translateX(-120%) skewX(-12deg); opacity: 0; }
  14%  { opacity: 1; }
  48%  { transform: translateX(-6%) skewX(-10deg); opacity: 1; }
  58%  { transform: translateX(6%)  skewX(-10deg); opacity: 1; }
  100% { transform: translateX(120%) skewX(-12deg); opacity: 0; }
}

.wrap{
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 22px auto 64px;
  padding: 0 16px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.top-left{
  flex: 1 1 auto;
  min-width: 0;
}

.brand-switch{
  width: 100%;
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.brand-chip{
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .16em;
  color: rgba(255,255,255,.62);
  transition: color var(--ui) var(--ease), transform var(--ui) var(--ease), opacity var(--ui) var(--ease);
  user-select:none;
  white-space: nowrap;
}

html[data-brand="publicom"] #chipPublicom{ color: #fff; }
html[data-brand="ecorural"] #chipEcoRural{ color: #fff; }

html.play-title #chipPublicom,
html.play-title #chipEcoRural{
  animation: chipPop 520ms var(--ease);
}
@keyframes chipPop{
  0%{ transform: translateY(6px); opacity: .0; }
  60%{ transform: translateY(0); opacity: 1; }
  100%{ transform: translateY(0); opacity: 1; }
}

.switch{
  position: relative;
  width: 54px;
  height: 34px;
  display:inline-block;
  flex: 0 0 auto;
}
.switch input{ opacity:0; width:0; height:0; }

.slider{
  position:absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  transition: box-shadow var(--ui) var(--ease), border-color var(--ui) var(--ease), background var(--ui) var(--ease);
}
.slider::before{
  content:"";
  position:absolute;
  width: 26px;
  height: 26px;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 16px 26px rgba(0,0,0,.30);
  transition: transform 520ms var(--ease);
}
.switch input:checked + .slider::before{
  transform: translateY(-50%) translateX(20px);
}
.switch input:focus-visible + .slider{
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}

.top-actions{ display:flex; gap:10px; flex: 0 0 auto; }

.iconbtn{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: #fff;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: transform 180ms ease, box-shadow var(--ui) var(--ease), background var(--ui) var(--ease), border-color var(--ui) var(--ease);
}
.iconbtn svg{ width:20px; height:20px; }
.iconbtn:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 24%, rgba(255,255,255,.22));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent);
  background: rgba(255,255,255,.14);
}

.card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero{
  padding: 18px;
  margin-bottom: 14px;
}
.hero-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}
.brand-left{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.logo{
  width: 86px;
  height: 64px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  padding: 0;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.12));
}

.brand-title{
  margin:0;
  font-size: 18px;
  letter-spacing: .14em;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
}

.slogan{
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.25;
  color: rgba(15, 23, 42, 0.62);
  font-weight: 400;
}

.badge{
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .10em;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,.86);
  color: rgba(15, 23, 42, 0.66);
}

.desc{
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(15, 23, 42, 0.74);
  font-weight: 400;
}

html.play-title .fx-title{ animation: titleSwap 620ms cubic-bezier(.2,.9,.2,1); }
html.play-title .fx-sub{ animation: subSwap 640ms cubic-bezier(.2,.9,.2,1); }
html.play-title .fx-desc{ animation: descSwap 680ms cubic-bezier(.2,.9,.2,1); }
html.play-title .fx-badge{ animation: badgeSwap 620ms cubic-bezier(.2,.9,.2,1); }

@keyframes titleSwap{
  0%{ opacity: 0; transform: translateY(10px); letter-spacing: .22em; }
  70%{ opacity: 1; transform: translateY(0); letter-spacing: .14em; }
  100%{ opacity: 1; transform: translateY(0); }
}
@keyframes subSwap{
  0%{ opacity: 0; transform: translateY(10px); }
  70%{ opacity: 1; transform: translateY(0); }
  100%{ opacity: 1; }
}
@keyframes descSwap{
  0%{ opacity: 0; transform: translateY(10px); }
  70%{ opacity: 1; transform: translateY(0); }
  100%{ opacity: 1; }
}
@keyframes badgeSwap{
  0%{ opacity: 0; transform: translateY(8px); }
  70%{ opacity: 1; transform: translateY(0); }
  100%{ opacity: 1; }
}

.links{ padding: 12px; }

.link{
  width: 100%;
  display:grid;
  grid-template-columns: 44px 1fr 16px;
  align-items:center;
  gap: 12px;
  text-decoration:none;
  color: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 10px 0;
  background: rgba(255,255,255,0.95);
  transition: transform 220ms ease, box-shadow 420ms cubic-bezier(.2,.9,.2,1), border-color 420ms cubic-bezier(.2,.9,.2,1);
}
.link:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 22%, rgba(15,23,42,0.10));
  box-shadow: 0 18px 38px rgba(0,0,0,0.12);
}

.l-ic{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, rgba(15,23,42,0.08));
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
  transition: background 420ms cubic-bezier(.2,.9,.2,1), color 420ms cubic-bezier(.2,.9,.2,1), border-color 420ms cubic-bezier(.2,.9,.2,1);
}
.l-ic svg{ width: 20px; height: 20px; }

.l-left{ display:grid; gap: 2px; }
.l-title{ font-weight: 600; font-size: 14px; color: rgba(15, 23, 42, 0.92); }
.l-sub{ font-size: 12px; color: rgba(15, 23, 42, 0.56); font-weight: 400; }
.l-right{ font-size: 22px; color: rgba(15, 23, 42, 0.28); }

html.play-stagger .reveal{ opacity: 0; transform: translateY(16px); filter: blur(3px); }
html.play-stagger .reveal{
  animation: itemIn 560ms cubic-bezier(.2,.9,.2,1) forwards;
  animation-delay: calc(var(--d, 0) * 85ms);
}
@keyframes itemIn{
  0%{ opacity: 0; transform: translateY(16px); filter: blur(3px); }
  70%{ opacity: 1; transform: translateY(0); filter: blur(0); }
  100%{ opacity: 1; transform: translateY(0); filter: blur(0); }
}

.footer{
  margin-top: 14px;
  color: var(--mutedOnBg);
  font-size: 12px;
  text-align:center;
  padding: 10px 0;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10, 14, 22, 0.92);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 18px 36px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events:none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 1001;
  font-size: 13px;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px){
  .topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .top-left{
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-switch{
    width: 100%;
    display:flex;
    align-items:center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .brand-chip{
    font-size: 10px;
    letter-spacing: .12em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 92px;
  }

  .switch{
    flex: 0 0 auto;
    transform: scale(.92);
    transform-origin: left center;
  }

  .top-actions{
    flex: 0 0 auto;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap: 8px;
  }

  .iconbtn{
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .hero-top{ flex-direction: column; align-items: flex-start; }
  .logo{ width: 110px; height: 60px; }
}
