/* ============================================================
   Monash PES 2026 — Shared app shell
   Design language: Monash deep navy + Italian sunset warmth.
   Fraunces (serif, expressive) for display text + Inter for body.
   Floating pill tab bar instead of a flat docked nav.
   ============================================================ */

:root {
  /* ---- Brand tokens ---- */
  --pes-ink:           #0F1B2D;       /* deepest navy / display text */
  --pes-navy:          #0F1B2D;
  --pes-navy-soft:     #1B2A45;
  --pes-navy-line:     rgba(15, 27, 45, 0.10);
  --pes-twilight:      #2C2050;       /* dusk transition */
  --pes-terracotta:    #D9633C;       /* primary accent */
  --pes-terracotta-d:  #B8521E;
  --pes-saffron:       #E8A24A;       /* secondary accent */
  --pes-saffron-soft:  #F4C475;
  --pes-cream:         #FBF6EC;       /* warm page background */
  --pes-cream-deep:    #F1E9D7;
  --pes-stone:         #6B6555;       /* muted body text */
  --pes-rose:          #E2B8A4;       /* gentle pink-blush */
  --pes-olive:         #6F7A3C;
  --pes-shadow:        0 18px 40px -18px rgba(15, 27, 45, 0.32);
  --pes-shadow-soft:   0 4px 18px -8px rgba(15, 27, 45, 0.16);

  /* Hero gradient — twilight over Tuscany */
  --pes-hero-grad:
    radial-gradient(ellipse at 110% -10%, rgba(232, 162, 74, 0.55), transparent 55%),
    radial-gradient(ellipse at -10% 110%, rgba(217, 99, 60, 0.45), transparent 60%),
    linear-gradient(160deg, #0F1B2D 0%, #2C2050 55%, #5A2C3E 100%);

  /* Type scale */
  --pes-font-display:  'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --pes-font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --pes-radius:        18px;
  --pes-radius-sm:     12px;
  --pes-tab-h:         70px;
  --pes-content-max:   1080px;
}

/* ---------- Body baseline + tab-bar safe space ---------- */
body.pes-app-shell {
  padding-bottom: calc(var(--pes-tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

/* ---------- Floating tab bar ---------- */
.pes-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 27, 45, 0.08);
  border-radius: 999px;
  box-shadow: 0 18px 38px -16px rgba(15, 27, 45, 0.32),
              0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  z-index: 1000;
  font-family: var(--pes-font-body);
}

.pes-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 999px;
  color: var(--pes-ink);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.pes-nav a span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pes-nav a svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pes-nav a:hover {
  color: var(--pes-terracotta-d);
}

.pes-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, #D9633C 0%, #B8521E 100%);
  box-shadow: 0 6px 14px -4px rgba(184, 82, 30, 0.45);
}

.pes-nav a.active svg { stroke-width: 2; }

/* Dark variant — for dark/full-bleed backgrounds */
.pes-nav--dark {
  background: rgba(15, 27, 45, 0.82);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 38px -16px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.pes-nav--dark a { color: rgba(255, 255, 255, 0.78); }
.pes-nav--dark a:hover { color: var(--pes-saffron-soft); }
.pes-nav--dark a.active { color: #fff; }

/* ---------- Update banner (new SW available) ---------- */
.pes-update-banner {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top, 0px));
  transform: translate(-50%, -120%);
  z-index: 1100;
  width: min(520px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--pes-ink);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 36px -10px rgba(15, 27, 45, 0.55);
  font-family: var(--pes-font-body);
  font-size: 14px;
  line-height: 1.35;
  transition: transform 380ms cubic-bezier(.22,.95,.32,1.05);
}

.pes-update-banner.show { transform: translate(-50%, 0); }

.pes-update-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--pes-terracotta);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

.pes-update-icon svg {
  width: 17px; height: 17px;
  stroke: #fff; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.pes-update-body { flex: 1; min-width: 0; }
.pes-update-body strong { display: block; font-size: 13.5px; }
.pes-update-body span { display: block; font-size: 12.5px; opacity: 0.85; margin-top: 1px; }

.pes-update-btn {
  background: var(--pes-saffron);
  color: var(--pes-ink);
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.pes-update-btn:hover { background: var(--pes-saffron-soft); }

.pes-update-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pes-update-close:hover { color: #fff; }

/* ---------- Install hint chip (Android prompt + iOS A2HS hint) ---------- */
.pes-install-chip {
  position: fixed;
  left: 50%;
  bottom: calc(var(--pes-tab-h) + env(safe-area-inset-bottom, 0px) + 22px);
  transform: translate(-50%, 140%);
  z-index: 1050;
  width: min(440px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--pes-cream);
  color: var(--pes-ink);
  border: 1px solid var(--pes-navy-line);
  border-radius: 14px;
  box-shadow: 0 20px 36px -16px rgba(15, 27, 45, 0.35);
  font-family: var(--pes-font-body);
  font-size: 13px;
  line-height: 1.35;
  transition: transform 420ms cubic-bezier(.22,.95,.32,1.05);
}

.pes-install-chip.show { transform: translate(-50%, 0); }

.pes-install-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0F1B2D 0%, #2C2050 100%);
  color: var(--pes-saffron);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--pes-font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  flex: none;
}

.pes-install-body { flex: 1; min-width: 0; }
.pes-install-body strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--pes-ink); }
.pes-install-body span { display: block; font-size: 12.5px; color: var(--pes-stone); margin-top: 1px; }
.pes-install-body em { font-style: italic; color: var(--pes-terracotta-d); }

.pes-install-btn {
  background: var(--pes-terracotta);
  color: #fff;
  border: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.pes-install-btn:hover { background: var(--pes-terracotta-d); }

.pes-install-close {
  background: transparent;
  border: none;
  color: var(--pes-stone);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pes-install-close:hover { color: var(--pes-ink); }

/* ---------- Animation utilities ---------- */
@keyframes pes-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.4); }
}

@keyframes pes-float-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pes-nav a, .pes-update-banner, .pes-install-chip { transition: none; }
}
