/* ============================================================
   CHROME  —  navbar + footer (unified studio theme)
   Same DB-driven menu data across the site.
   Layout utilities stay in the template (Tailwind); this file owns
   the visual grammar. See RELAUNCH_PLAN.md Phase 2.
   ============================================================ */

/* ===================== NAVBAR ===================== */
.lw-nav {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
}

/* Top quick-links bar */
.lw-nav__quicklinks {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.lw-nav__quicklink {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.lw-nav__quicklink:hover { color: var(--accent); }
.lw-nav__sep { color: var(--line); }

/* Logo */
.lw-nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.lw-nav__logo-accent { color: var(--accent); }

/* Links */
.lw-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: color .15s ease, background .15s ease;
}
.lw-nav__link:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

/* Dropdown panel */
.lw-nav__dropdown {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lw-nav__dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background .15s ease, color .15s ease;
}
.lw-nav__dropdown-item:hover { background: var(--surface-2); color: var(--accent); }

/* Icon action buttons (Discord / community / messaging) */
.lw-nav__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.lw-nav__action--label { width: auto; padding: 0 0.8rem; font-size: 0.85rem; font-weight: 600; }
.lw-nav__action:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }

/* Bundle CTA — the single loud element in the header.
   Gradient stays anchored on --accent-strong so white text keeps AA contrast
   (plain --accent is 4.46:1 — see legacy.css a11y note). */
.lw-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent-strong), color-mix(in srgb, var(--accent-2) 55%, var(--accent-strong)));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 32%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.lw-nav__cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent);
  color: #fff;
}
.lw-nav__cta svg { flex-shrink: 0; }
.lw-nav__cta--compact { font-size: 0.8rem; padding: 0.38rem 0.8rem; }

/* Count badge */
.lw-nav__badge {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface);
}

/* Notification bell dropdown */
.lw-nav__notif-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .15s ease;
}
.lw-nav__notif-item:hover { background: var(--surface-2); }
.lw-nav__notif-item--unread { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.lw-nav__notif-item--unread:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lw-nav__notif-footer {
  display: block;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--line);
  transition: background .15s ease, color .15s ease;
}
.lw-nav__notif-footer:hover { background: var(--surface-2); color: var(--accent-strong); }

/* Mobile toggle */
.lw-nav__mobile-toggle {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

/* Mobile "Projects" group label (folded-in quick links) */
.lw-nav__mobile-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ===================== FOOTER ===================== */
/* Both themes keep a dark footer (grounds the light studio); grammar differs. */
.lw-footer { position: relative; z-index: 10; margin-top: auto; font-family: var(--font-body); }
.lw-footer__divider { height: 3px; }
.lw-footer__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; }
.lw-footer__brand-accent { color: var(--accent); }
.lw-footer__heading { font-weight: 700; font-size: 1.05rem; margin-bottom: 1rem; }
.lw-footer__link { text-decoration: none; transition: color .15s ease; }
.lw-footer__social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

/* ---- Studio (dark) ---- */
[data-theme="build"] .lw-footer, [data-theme="home"] .lw-footer { background: var(--c-ink); color: var(--c-ink-400); }
[data-theme="build"] .lw-footer__divider, [data-theme="home"] .lw-footer__divider {
  background: linear-gradient(to right, var(--accent), var(--accent-2), var(--signal));
}
[data-theme="build"] .lw-footer__brand, [data-theme="home"] .lw-footer__brand,
[data-theme="build"] .lw-footer__heading, [data-theme="home"] .lw-footer__heading { color: var(--c-paper); }
[data-theme="build"] .lw-footer__link, [data-theme="home"] .lw-footer__link,
[data-theme="build"] .lw-footer__tagline, [data-theme="home"] .lw-footer__tagline,
[data-theme="build"] .lw-footer__muted, [data-theme="home"] .lw-footer__muted { color: var(--c-ink-400); }
[data-theme="build"] .lw-footer__link:hover, [data-theme="home"] .lw-footer__link:hover { color: var(--accent); }
[data-theme="build"] .lw-footer__social, [data-theme="home"] .lw-footer__social {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm); color: var(--c-ink-300);
}
[data-theme="build"] .lw-footer__social:hover, [data-theme="home"] .lw-footer__social:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
[data-theme="build"] .lw-footer__bottom, [data-theme="home"] .lw-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); }

/* =====================================================================
   FLASH MESSAGES  (templates/components/messages.html)
   A fixed toast stack in the top-right corner, under the nav.

   Was an inline block at the top of <main>. That put a 72rem-wide card in a
   strip of bare body background above every full-bleed hero and pushed the
   whole page down ~70px, so a routine "Signed in" confirmation looked like a
   layout bug. Fixed positioning keeps the page still.

   Card language matches components/social_proof_popup.html on purpose — same
   radius, border, shadow and icon tile — so the two read as one system. That
   one owns bottom-left, this one owns top-right; they never collide.

   Entrance and countdown are pure CSS, so a toast still arrives and still
   reads if static/js/flash-toasts.js fails to load; the script only adds the
   exit animation, the nav-aware offset, and the actual auto-removal.
   ===================================================================== */
.lw-toasts {
  position: fixed;
  top: var(--lw-toast-top, 5.5rem);   /* JS refines this from the live nav height */
  right: 1rem; left: 1rem;            /* mobile: full width, inset both sides */
  z-index: 45;                        /* under the sticky nav (z-50) so its dropdowns win */
  display: flex; flex-direction: column; gap: .625rem;
  pointer-events: none;               /* the page stays clickable around the stack */
}
@media (min-width: 640px) {
  .lw-toasts {
    left: auto; width: 24rem; max-width: calc(100vw - 2rem);
    align-items: flex-end;
  }
}

.lw-toast {
  /* --toast-tint is the raw palette hue, used for washes; --toast-accent is
     the legible version, used for anything with a shape to read (icon,
     countdown). Raw teal and yellow both fail 3:1 on paper at icon size. */
  --toast-tint: var(--muted);
  --toast-accent: var(--muted);
  --toast-offset: translateY(-.5rem) scale(.98);

  pointer-events: auto;
  position: relative; overflow: hidden; width: 100%;
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--toast-tint) 28%, var(--line));
  background: color-mix(in srgb, var(--toast-tint) 6%, var(--surface));
  box-shadow: var(--shadow);
  color: var(--ink); font-family: var(--font-body);
  animation: lw-toast-in .34s cubic-bezier(.16, 1, .3, 1) both;
}
@media (min-width: 640px) { .lw-toast { --toast-offset: translateX(1.5rem); } }

/* Stagger a stack so several messages cascade instead of landing as a block. */
.lw-toast:nth-child(2) { animation-delay: .07s; }
.lw-toast:nth-child(3) { animation-delay: .14s; }
.lw-toast:nth-child(n+4) { animation-delay: .21s; }

/* Exit is JS-only (flash-toasts.js), and has to be an animation rather than a
   class-swapped transform: the entrance animation's `both` fill would
   otherwise keep holding the toast in place. */
.lw-toast.is-out { animation: lw-toast-out .18s ease forwards; }

@keyframes lw-toast-in  { from { opacity: 0; transform: var(--toast-offset); } to { opacity: 1; transform: none; } }
@keyframes lw-toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: var(--toast-offset); } }

.lw-toast__icon {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--toast-tint) 16%, var(--surface));
  color: var(--toast-accent);
}
.lw-toast__icon svg { width: 1rem; height: 1rem; }

.lw-toast__text {
  flex: 1 1 auto; margin: 0; padding-top: .1875rem;
  font-size: .875rem; font-weight: 500; line-height: 1.45;
  color: var(--ink);
}

.lw-toast__close {
  flex: 0 0 auto; display: inline-flex;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); padding: .25rem; margin: -.0625rem -.375rem 0 0;
  border-radius: var(--radius-sm);
  transition: color .15s ease, background .15s ease;
}
.lw-toast__close svg { width: 1rem; height: 1rem; }
.lw-toast__close:hover { color: var(--ink); background: var(--surface-2); }
.lw-toast__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The countdown bar IS the auto-dismiss timer: flash-toasts.js listens for its
   animationend rather than running a setTimeout. That buys WCAG 2.2.1 for
   free — hover or tab into the toast and the CSS animation pauses, so a
   message cannot expire while someone is reading or operating it. The delay
   covers the entrance so the full 6s is readable time. */
.lw-toast__progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--toast-accent);
  transform: scaleX(0); transform-origin: left center;
}
.lw-toast[data-toast-autodismiss] .lw-toast__progress {
  animation: lw-toast-countdown 6s linear .34s forwards;
}
.lw-toast:hover .lw-toast__progress,
.lw-toast:focus-within .lw-toast__progress { animation-play-state: paused; }
@keyframes lw-toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Levels. Only the icon tile and the countdown carry real colour, so an
   informational message never reads as an error the way the old
   everything-is-red rendering on /testimonials/submit/ did. */
.lw-toast--success {
  --toast-tint: var(--signal);
  --toast-accent: color-mix(in srgb, var(--signal) 74%, var(--c-ink));
}
.lw-toast--info  { --toast-tint: var(--accent); --toast-accent: var(--accent); }
.lw-toast--error {
  --toast-tint: var(--danger);
  --toast-accent: color-mix(in srgb, var(--danger) 82%, var(--c-ink));
}
/* Explicit amber rather than a mix: --warn (#f5d76e) toward ink lands on a
   muddy olive, and mixing it toward anything lighter fails contrast. */
.lw-toast--warning { --toast-tint: var(--warn); --toast-accent: #b07d0a; }
.lw-toast--debug   { --toast-tint: var(--muted); --toast-accent: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  /* Land the toast in place with no travel. The countdown keeps running — it
     is the dismiss timer and a progress indicator, not decoration. */
  .lw-toast, .lw-toast.is-out { animation-duration: .01ms; animation-delay: 0s; }
}
