/* ============================================================ Tokens */
/* Tema claro pastel por defecto; el oscuro (ciruela suave) solo si se elige. */
:root {
  --bg: #fdf6f8;
  --bg-2: #fbeef3;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: #ffffff;
  --border: rgba(196, 120, 150, .16);
  --border-strong: rgba(196, 120, 150, .32);
  --text: #3d2a35;
  --muted: #8c7381;
  --accent: #d6719a;
  --accent-2: #9c7fd6;
  --grad: linear-gradient(135deg, #f8bfd2 0%, #f6cfe0 45%, #dccbf6 100%);
  --accent-ink: #3d2233;
  --accent-soft: rgba(232, 140, 172, .14);
  --warn: #c9822b;
  --danger: #d9566f;
  --shadow: 0 24px 50px -28px rgba(170, 90, 125, .35);
  --grid: rgba(196, 120, 150, .06);
  --aurora-a: rgba(248, 191, 210, .7);
  --aurora-b: rgba(214, 196, 246, .6);
  --aurora-c: rgba(255, 216, 196, .55);
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b1219;
  --bg-2: #241822;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .085);
  --border: rgba(255, 210, 228, .1);
  --border-strong: rgba(255, 210, 228, .2);
  --text: #f7eaf0;
  --muted: #b79fac;
  --accent: #f4a9c3;
  --accent-2: #c9b3f3;
  --accent-ink: #3d2233;
  --accent-soft: rgba(244, 169, 195, .14);
  --warn: #f5c27a;
  --danger: #f58ea3;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .8);
  --grid: rgba(255, 210, 228, .04);
  --aurora-a: rgba(244, 169, 195, .2);
  --aurora-b: rgba(201, 179, 243, .16);
  --aurora-c: rgba(255, 200, 170, .1);
  color-scheme: dark;
}

/* ============================================================ Base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
[hidden] { display: none !important; }

/* ============================================================ Backdrop */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 80%);
}
.aurora { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.aurora--a { width: 520px; height: 420px; top: -220px; left: 50%; margin-left: -380px; background: var(--aurora-a); animation: drift 22s ease-in-out infinite; }
.aurora--b { width: 460px; height: 380px; top: -160px; left: 50%; margin-left: -40px; background: var(--aurora-b); animation: drift 28s ease-in-out infinite reverse; }
.aurora--c { width: 380px; height: 320px; top: 40px; left: 50%; margin-left: -520px; background: var(--aurora-c); animation: drift 32s ease-in-out infinite; }
@keyframes drift {
  33% { transform: translate(60px, 40px) scale(1.08); }
  66% { transform: translate(-40px, 70px) scale(.95); }
}

/* ============================================================ Layout */
.shell {
  position: relative; z-index: 1;
  width: 100%; max-width: 560px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 10px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: .95rem; letter-spacing: -.01em; color: var(--muted); }
.brand img { width: 28px; height: 28px; border-radius: 50%; }
.brand b { color: var(--text); font-weight: 600; }
.topbar__actions { display: flex; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background-color .25s, border-color .25s, transform .25s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }

/* ============================================================ Profile */
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px 0 8px; }

.avatar { position: relative; width: 132px; height: 132px; margin-bottom: 18px; }
.avatar picture, .avatar picture img { width: 100%; height: 100%; border-radius: 50%; }
.avatar picture { position: absolute; inset: 0; display: block; padding: 4px; background: var(--bg); border-radius: 50%; }
.avatar picture img { object-fit: cover; }
.avatar__ring {
  position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), transparent 55%, var(--accent));
  animation: spin 6s linear infinite;
}
.avatar__ring::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  z-index: -1;
}
.avatar__badge {
  position: absolute; right: -4px; bottom: 2px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: var(--shadow);
}
@keyframes spin { to { transform: rotate(1turn); } }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; margin-bottom: 14px;
  border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: ping 2s var(--ease) infinite; }
.status.is-open { color: var(--accent); }
.status.is-soon { color: var(--warn); }
.status.is-closed { color: var(--danger); }
.status.is-closed .status__dot::after { animation: none; }
.status.is-info .status__dot { background: var(--accent); }
.status.is-info .status__dot::after { background: var(--accent); }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
}
.role { margin: 8px 0 2px; font-size: 1.05rem; font-weight: 600; }
.role span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.uni { margin: 0; font-size: .88rem; color: var(--muted); }

/* ============================================================ Quick row */
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 6px; }
.quick__btn {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  width: 50px; height: 50px; padding: 0;
  border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .3s var(--ease), border-color .3s, color .3s, background-color .3s;
}
.quick__btn svg { width: 21px; height: 21px; position: relative; }
.quick__btn:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }
.quick__btn:active { transform: scale(.95); }

/* ============================================================ Announcement */
.announce {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 0; padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text); font-size: .9rem; font-weight: 500;
}
.announce svg { flex: none; width: 18px; height: 18px; color: var(--accent); }

/* ============================================================ Links */
.links { display: grid; gap: 10px; margin: 22px 0; }
.link {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 68px; padding: 12px 14px 12px 12px;
  border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-align: left; text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .35s var(--ease), border-color .35s, background-color .35s, box-shadow .35s var(--ease);
}
.link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity .35s;
}
.link:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.link:hover::before { opacity: 1; }
.link:active { transform: scale(.985); }

.link__icon {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent);
  transition: transform .35s var(--ease);
}
.link__icon svg { width: 21px; height: 21px; }
.link:hover .link__icon { transform: rotate(-6deg) scale(1.06); }
.link__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link__text strong { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
.link__text small { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link__arrow { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: transform .35s var(--ease), color .35s, background-color .35s; }
.link__arrow svg { width: 16px; height: 16px; }
.link:hover .link__arrow { transform: translate(2px, -2px); color: var(--text); background: var(--surface-2); }

.link--primary {
  background: var(--grad);
  border-color: transparent;
  color: var(--accent-ink);
}
.link--primary::before { background: radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 255, 255, .35), transparent 65%); }
.link--primary .link__icon { background: rgba(255, 255, 255, .55); color: var(--accent); }
.link--primary .link__text small, .link--primary .link__arrow { color: var(--accent-ink); opacity: .8; }
.link--primary:hover { border-color: transparent; box-shadow: 0 18px 40px -18px var(--accent); }
.link--primary:hover .link__arrow { background: rgba(255, 255, 255, .55); color: var(--accent-ink); }
.link--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sheen 4.5s var(--ease) 1.5s infinite;
}
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ============================================================ Panels */
.panel {
  margin: 0 0 12px; padding: 18px;
  border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel h2 { margin: 0 0 12px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 7px 13px; border-radius: 999px;
  font-size: .86rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .25s, color .25s;
}
.chips--soft li { font-weight: 500; background: var(--accent-soft); border-color: transparent; }
.chips li:hover { border-color: var(--accent); color: var(--accent); }

.hours { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.hours li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; font-size: .9rem; }
.hours li span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
.hours li.is-off span:last-child { color: var(--muted); }
.hours li.is-today { background: var(--accent-soft); font-weight: 700; }
.hours li.is-today span:first-child::after { content: " · hoy"; color: var(--accent); font-weight: 600; }

.panel--map { padding: 0; overflow: hidden; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; }
.panel--map h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; text-transform: none; color: var(--text); }
.panel__head p { margin: 0; font-size: .86rem; color: var(--muted); }
.map { position: relative; aspect-ratio: 16 / 10; border-block: 1px solid var(--border); background: var(--bg-2); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
:root[data-theme="dark"] .map iframe { filter: invert(.92) hue-rotate(180deg) saturate(.6) brightness(.95); }

.nav-apps { display: grid; grid-template-columns: repeat(3, 1fr); }
.nav-apps a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 4px; white-space: nowrap;
  font-size: clamp(.76rem, 3.3vw, .84rem); font-weight: 600; text-decoration: none;
  color: var(--text);
  transition: background-color .25s, color .25s;
}
.nav-apps a + a { border-left: 1px solid var(--border); }
.nav-apps a svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.nav-apps a:hover { background: var(--surface-2); color: var(--accent); }

/* ============================================================ Footer */
.foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 18px 0 4px; font-size: .8rem; color: var(--muted); }

/* ============================================================ QR modal */
.modal {
  width: min(360px, calc(100% - 32px)); padding: 0;
  border: 0; border-radius: 26px;
  background: transparent; color: var(--text);
}
.modal::backdrop { background: rgba(61, 34, 51, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: pop .35s var(--ease); }
.modal__card {
  position: relative; padding: 28px 22px 22px; text-align: center;
  border-radius: 26px; border: 1px solid var(--border-strong);
  background: var(--bg-2);
}
.modal__close { position: absolute; top: 12px; right: 12px; }
.modal h2 { margin: 0; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; }
.modal p { margin: 6px 0 18px; font-size: .88rem; color: var(--muted); }
.qr { width: 220px; margin: 0 auto 18px; padding: 14px; border-radius: 18px; background: #fff; }
.qr img { width: 100%; height: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px;
  font-weight: 700; font-size: .9rem; text-decoration: none;
  background: var(--grad); color: var(--accent-ink);
  transition: transform .25s var(--ease), filter .25s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ============================================================ Toast */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 10;
  padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-size: .88rem; font-weight: 600;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease), opacity .35s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ============================================================ Reveal */
.reveal { opacity: 0; translate: 0 14px; }
.reveal.is-in { opacity: 1; translate: 0 0; transition: opacity .7s var(--ease) var(--d, 0ms), translate .7s var(--ease) var(--d, 0ms); }
.link.reveal.is-in { transition: opacity .7s var(--ease) var(--d, 0ms), translate .7s var(--ease) var(--d, 0ms), transform .35s var(--ease), border-color .35s, background-color .35s, box-shadow .35s var(--ease); }

/* ============================================================ Larger screens */
@media (min-width: 640px) {
  .shell { padding-top: 28px; }
  .avatar { width: 148px; height: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; translate: 0 0; }
}

:root[data-theme="dark"] .link--primary .link__icon { color: #c45a86; }
