/* La Juntada — noche porteña: azul profundo, luz celeste y el oro del Sol de Mayo.
   Layout: hero centrado sobre campo de luz animado, luego bandas con grillas asimétricas. */
:root {
  --bg: #060D17;
  --bg-2: #0A1524;
  --surface: rgba(150, 195, 240, 0.045);
  --surface-hi: rgba(150, 195, 240, 0.08);
  --line: rgba(150, 195, 240, 0.13);
  --fg: #EAF2FB;
  --muted: #8EA3BA;
  --celeste: #75BBF2;
  --celeste-2: #3F8CD8;
  --sol: #F6B40E;
  --sol-2: #FFD76E;
  --ok: #4ADE80;
  --danger: #F87171;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--f-body); font-size: 16.5px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--celeste-2); color: #fff; }
a { color: var(--celeste); }
:focus-visible { outline: 2px solid var(--sol); outline-offset: 3px; border-radius: 6px; }
img, svg { max-width: 100%; }

.wrap {
  max-width: 1140px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.label {
  font-family: var(--f-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--celeste);
}
.muted { color: var(--muted); }

/* ---------- Nav ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--bg);
}
.nav {
  position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); z-index: 50;
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(6, 13, 23, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; margin-right: auto; }
.brand svg { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--fg); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--surface-hi);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 .95rem/1 var(--f-body); color: var(--fg); text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--b);
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(150,195,240,.3); }
.btn:active { transform: translateY(0); }
.btn-sol {
  color: #2A1500; border-color: transparent;
  background: linear-gradient(135deg, var(--sol-2), var(--sol) 55%, #E09A00);
  box-shadow: 0 10px 30px -10px rgba(246, 180, 14, .6), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-sol:hover { box-shadow: 0 16px 40px -10px rgba(246, 180, 14, .75), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-sm { padding: 9px 16px; font-size: .88rem; }
.btn-lg { padding: 17px 30px; font-size: 1.04rem; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-top: calc(68px + env(safe-area-inset-top, 0px)); }
#field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 180px; z-index: -1;
  background: linear-gradient(transparent, var(--bg));
}
.hero .wrap { display: grid; justify-items: center; text-align: center; padding-block: 72px 96px; gap: 26px; }
.sun-wrap { position: absolute; left: 50%; top: 46%; width: min(760px, 120vw); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; }
.sun-wrap::before {
  content: ""; position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle, rgba(246,180,14,.22), rgba(117,187,242,.10) 45%, transparent 70%);
  filter: blur(30px); animation: pulse 7s ease-in-out infinite;
}
.sun-rays { width: 100%; height: 100%; opacity: .34; animation: rotate 120s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .75; } }

.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 21, 36, .7);
  backdrop-filter: blur(8px); font-size: .86rem; color: var(--muted);
}
.pill b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }

.hero h1 { font-size: clamp(3.2rem, 11vw, 8.2rem); font-weight: 800; letter-spacing: -0.045em; line-height: .92; }
.flag-text {
  background: linear-gradient(180deg, var(--celeste) 0 34%, #FFFFFF 34% 66%, var(--celeste) 66%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 40px rgba(117,187,242,.25));
}
.hero .lead { max-width: 560px; font-size: clamp(1.05rem, 2vw, 1.22rem); color: #B8C8DA; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 40px; width: 100%; max-width: 820px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.stat { background: rgba(8, 17, 29, .85); padding: 20px 12px; display: grid; gap: 2px; }
.stat b { font-family: var(--f-display); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* entrada del hero */
.intro > * { animation: rise 1s var(--ease) both; }
.intro > *:nth-child(2) { animation-delay: .08s; }
.intro > *:nth-child(3) { animation-delay: .16s; }
.intro > *:nth-child(4) { animation-delay: .24s; }
.intro > *:nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } }

/* ---------- Marquee de canales ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding-block: 18px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 44px; width: max-content; animation: slide 38s linear infinite; }
.marquee span { font-family: var(--f-mono); font-size: .9rem; color: var(--muted); white-space: nowrap; }
.marquee span::before { content: "#"; color: var(--celeste); margin-right: 3px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
section.block { padding-block: 112px; }
.sec-head { display: grid; gap: 14px; margin-bottom: 52px; max-width: 640px; }
.sec-head p { color: var(--muted); font-size: 1.08rem; }

.reveal.in { animation: rise .9s var(--ease) both; }

/* tarjetas con brillo que sigue al mouse */
.glow {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .3s, transform .4s var(--ease);
}
.glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(117,187,242,.14), transparent 60%);
}
.glow:hover::before { opacity: 1; }
.glow:hover { border-color: rgba(150,195,240,.26); }

/* Bento "qué hay adentro" */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 30px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.tile .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-hi); border: 1px solid var(--line); color: var(--celeste); }
.tile .ico svg { width: 22px; height: 22px; }
.tile p { color: var(--muted); }
.t-wide { grid-column: span 4; }
.t-narrow { grid-column: span 2; }
.t-third { grid-column: span 2; }
.t-wide .chat { margin-top: 10px; display: grid; gap: 10px; }
.msg { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; }
.msg .av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; }
.msg b { font-weight: 600; margin-right: 6px; }
.msg time { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }
.msg p { color: #C6D4E3; }

/* Reglas */
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; list-style: none; padding: 0; margin: 0; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding-block: 24px; border-top: 1px solid var(--line); }
.rules li::before { content: counter(r, decimal-leading-zero); font-family: var(--f-mono); font-size: .85rem; color: var(--sol); padding-top: 4px; }
.rules strong { display: block; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
.rules p { color: var(--muted); }

/* Staff */
.staff { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.member { padding: 26px; display: grid; gap: 14px; justify-items: start; min-width: 0; }
.member .avatar { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; color: #fff; position: relative; }
.member .avatar::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bg-2); background: var(--ok); }
.member .avatar.idle::after { background: var(--sol); }
.member p { color: var(--muted); font-size: .94rem; }
.role { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid; }
.role.admin { color: var(--sol-2); border-color: rgba(246,180,14,.35); background: rgba(246,180,14,.08); }
.role.mod { color: var(--celeste); border-color: rgba(117,187,242,.35); background: rgba(117,187,242,.08); }
.role.miembro { color: var(--muted); border-color: var(--line); }

/* Eventos */
.events { display: grid; gap: 12px; }
.event { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 20px 24px; }
.date { text-align: center; padding-right: 22px; border-right: 1px solid var(--line); }
.date b { display: block; font-family: var(--f-display); font-size: 2.3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.date span { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--celeste); }
.event h3 { margin-bottom: 4px; }
.event .meta { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); margin-top: 6px; }
.event .count { font-size: .85rem; color: var(--muted); text-align: right; display: grid; gap: 8px; justify-items: end; }
.btn.joined { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.4); color: var(--ok); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 56px; align-items: start; }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: background .3s; }
.faq details[open] { background: var(--surface-hi); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 22px; font-weight: 600; font-size: 1.04rem; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); font-size: 1.3rem; color: var(--celeste); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--muted); }

/* CTA final */
.cta { position: relative; overflow: hidden; border-radius: 24px; padding: 72px 32px; text-align: center; display: grid; justify-items: center; gap: 20px; border: 1px solid var(--line);
  background: radial-gradient(600px 300px at 50% 0%, rgba(246,180,14,.16), transparent 70%), linear-gradient(180deg, rgba(117,187,242,.10), rgba(117,187,242,.02)); }
.cta p { color: #B8C8DA; max-width: 480px; }

footer { border-top: 1px solid var(--line); margin-top: 96px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; padding-block: 36px; color: var(--muted); font-size: .9rem; }

/* ---------- Modal de acceso ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal-bg { position: absolute; inset: 0; background: rgba(3, 7, 13, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .3s both; }
.modal-card { position: relative; width: 100%; max-width: 430px; max-height: 100%; overflow-y: auto; padding: 34px; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #0D1A2C, #091321); box-shadow: 0 40px 100px -20px rgba(0,0,0,.7); animation: pop .45s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.modal-close:hover { color: var(--fg); }
.modal-head { display: grid; gap: 8px; justify-items: center; text-align: center; margin-bottom: 24px; }
.modal-head svg { width: 46px; height: 46px; }
.modal-head h2 { font-size: 1.7rem; }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { position: relative; z-index: 1; border: 0; background: none; color: var(--muted); font: 600 .9rem var(--f-body); padding: 10px; cursor: pointer; border-radius: 999px; transition: color .25s; }
.tabs button[aria-selected="true"] { color: var(--fg); }
.tabs .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--surface-hi); border: 1px solid var(--line); transition: transform .35s var(--ease); }
.tabs[data-tab="register"] .thumb { transform: translateX(100%); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .84rem; font-weight: 600; color: #C6D4E3; }
.field input {
  width: 100%; font: 500 1rem var(--f-body); color: var(--fg); padding: 13px 15px; border-radius: 12px;
  background: rgba(0,0,0,.28); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--celeste-2); box-shadow: 0 0 0 4px rgba(63,140,216,.18); }
.field small { color: var(--muted); font-size: .78rem; }
.form-error { color: var(--danger); font-size: .9rem; min-height: 1.3em; }
.form .btn { width: 100%; margin-top: 4px; }
.demo-note { margin-top: 18px; font-size: .8rem; color: var(--muted); text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 120; padding: 12px 18px; border-radius: 12px; background: #12233A; border: 1px solid var(--line); box-shadow: 0 20px 40px -10px rgba(0,0,0,.6); font-size: .92rem; animation: pop .35s var(--ease) both; max-width: calc(100% - 32px); }

.demo-badge { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 90; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 7px 11px; border-radius: 8px; background: rgba(246,180,14,.12); border: 1px solid rgba(246,180,14,.35); color: var(--sol-2); }

/* ---------- Panel ---------- */
.panel-main { padding-top: calc(68px + env(safe-area-inset-top, 0px)); }
.panel-head { padding-block: 56px 36px; display: flex; flex-wrap: wrap; gap: 20px; align-items: end; justify-content: space-between; }
.panel-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.card { padding: 28px; min-width: 0; }
.card + .card { margin-top: 20px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.profile { display: grid; gap: 18px; }
.profile .avatar-lg { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 2.1rem; color: #fff; background: linear-gradient(135deg, var(--celeste), var(--celeste-2)); box-shadow: 0 16px 40px -14px rgba(63,140,216,.7); }
.kv { display: grid; gap: 12px; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 12px 12px 0; }
td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.skeleton { height: 76px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hi) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-wide { grid-column: span 2; } .t-narrow, .t-third { grid-column: span 1; }
  .staff { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq-grid, .panel-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 18px; }
  .date { padding-right: 14px; } .date b { font-size: 1.8rem; }
  .event .count { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; text-align: left; }
  section.block { padding-block: 80px; }
}
@media (max-width: 520px) {
  .bento, .staff { grid-template-columns: minmax(0, 1fr); }
  .t-wide, .t-narrow, .t-third { grid-column: auto; }
  .nav-actions .btn-ghost-login { display: none; }
  .modal-card { padding: 26px 20px; }
  .cta { padding: 52px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}
