/* Pakstoor :: shell.css :: v1.1-000002 :: 2026-04-29 */

/* ------------------------------------------------------------
   BODY SCROLL LOCK — used when mobile drawer or modal open
   ------------------------------------------------------------ */
body.is-locked {
  overflow: hidden;
  height: 100vh;
}

/* ------------------------------------------------------------
   SYS-BAR — refined. Quiet, operational strip.
   Layout: left (status) · center (subtle ledger heartbeat) · right (meta)
   ------------------------------------------------------------ */
.sysbar {
  background: var(--black-deep);
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  font-weight: var(--fw-500);
}

.sysbar-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 9px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
}

.sysbar-left,
.sysbar-right {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.sysbar-right { justify-self: end; }

.sysbar-center {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
}

.sysbar-sep      { color: var(--ink-faint); }
.sysbar-label-ok { color: var(--success); font-weight: var(--fw-600); }

/* ---- Language switcher (sys-bar right) ---- */
.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  font-weight: var(--fw-600);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--dur-1) var(--ease-standard);
  line-height: 1;
}
.lang-btn:hover {
  color: var(--ink);
  border-color: var(--line-bright);
  background: var(--bg-1);
}
.lang-btn svg {
  width: 9px;
  height: 9px;
  transition: transform var(--dur-1) var(--ease-standard);
  color: var(--ink-dim);
}
.lang.is-open .lang-btn {
  color: var(--ink);
  border-color: var(--gold);
}
.lang.is-open .lang-btn svg { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--bg-3);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-2);
  box-shadow: var(--elev-2);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--dur-2) var(--ease-decel);
  z-index: var(--z-dropdown);
}
.lang.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--r-1);
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-standard), color var(--dur-1) var(--ease-standard);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
}
.lang-item:hover {
  color: var(--ink);
  background: var(--bg-2);
}
.lang-item-code {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: var(--tracking-wider);
  color: var(--ink-dim);
  font-weight: var(--fw-600);
}
.lang-item.is-active {
  color: var(--ink);
}
.lang-item.is-active .lang-item-code {
  color: var(--gold);
}
.lang-item.is-active::after {
  content: '';
  position: absolute;
  right: 10px;
}

/* Subtle pulsing heartbeat dot — quiet, not attention-grabbing */
.sysbar-heartbeat {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--success);
  box-shadow: 0 0 6px rgba(94, 168, 114, 0.5);
  animation: sysbar-beat 2.6s var(--ease-standard) infinite;
  flex-shrink: 0;
}
@keyframes sysbar-beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.9); }
}

/* The ledger line in the center — text that rotates every few seconds */
.sysbar-ledger {
  overflow: hidden;
  max-width: 44ch;
}
.sysbar-ledger-item {
  color: var(--ink-muted);
}
.sysbar-ledger-item strong {
  color: var(--ink);
  font-weight: var(--fw-600);
}

/* Hide center ledger on narrow screens so it doesn't wrap */
@media (max-width: 860px) {
  .sysbar-inner { grid-template-columns: 1fr 1fr; }
  .sysbar-center { display: none; }
}
@media (max-width: 560px) {
  .sysbar-right { display: none; }
  .sysbar-inner { grid-template-columns: 1fr; }
  .sysbar-left  { justify-self: start; }
}

/* ------------------------------------------------------------
   TOP NAV
   Structure:
   [ Logo ]  [ Nav links — center-left ]      [ Actions — right ]
   ------------------------------------------------------------ */
.nav {
  background: rgba(20, 24, 29, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.nav-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  /* Tightened — was 10px / 80px, felt too tall for a nav strip. */
  padding: 6px var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-6);
  align-items: center;
  min-height: 64px;   /* 52 logo + 6+6 padding */
}

/* ---- Logo ---- */
.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-mark {
  /* Full wordmark PNG (native 1226x366, aspect 3.35:1).
     Matches the footer wordmark at 52px so the brand feels
     consistent top-to-bottom. */
  height: 52px;
  width: auto;
  max-width: none;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
@media (max-width: 900px) {
  .nav-logo-mark { height: 44px; }
}
@media (max-width: 640px) {
  .nav-logo-mark { height: 38px; }
}
@media (max-width: 420px) {
  .nav-logo-mark { height: 32px; }
}

/* ---- Primary nav links ---- */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  justify-self: start;
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: var(--ink-muted);
  border-radius: var(--r-2);
  transition: color var(--dur-1) var(--ease-standard), background var(--dur-1) var(--ease-standard);
}
.nav-link:hover {
  color: var(--ink);
  background: var(--bg-2);
}
.nav-link.is-active {
  color: var(--ink);
}
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: var(--gold);
}

/* ---- Right-side actions ---- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  justify-self: end;
}

.nav-action-icon {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  border-radius: var(--r-2);
  transition: color var(--dur-1) var(--ease-standard), background var(--dur-1) var(--ease-standard);
}
.nav-action-icon:hover {
  color: var(--ink);
  background: var(--bg-2);
}
.nav-action-icon svg { width: 18px; height: 18px; }

.nav-action-icon .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: var(--fw-700);
  letter-spacing: 0;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--bg);
  box-sizing: content-box;
}

/* ---- Avatar / profile menu trigger ---- */
.nav-profile {
  position: relative;
}
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: var(--fw-700);
  color: var(--steel);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-standard);
}
.nav-avatar:hover { border-color: var(--steel-dim); }
.nav-avatar:focus-visible {
  outline: none;
  box-shadow: var(--glow-gold);
}

/* Profile dropdown */
.nav-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-3);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-3);
  box-shadow: var(--elev-2);
  padding: var(--s-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--dur-2) var(--ease-decel);
  z-index: var(--z-dropdown);
}
.nav-profile.is-open .nav-profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-profile-head {
  padding: var(--s-3);
  border-bottom: 1px solid var(--line-2);
  margin-bottom: var(--s-1);
}
.nav-profile-name {
  font-weight: var(--fw-600);
  font-size: var(--fs-13);
  color: var(--ink);
}
.nav-profile-email {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--ink-dim);
  letter-spacing: var(--tracking-wide);
  margin-top: 2px;
}
.nav-profile-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 9px 12px;
  font-size: var(--fs-13);
  color: var(--ink-muted);
  border-radius: var(--r-2);
  transition: background var(--dur-1) var(--ease-standard), color var(--dur-1) var(--ease-standard);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.nav-profile-item:hover {
  color: var(--ink);
  background: var(--bg-2);
}
.nav-profile-item svg { width: 15px; height: 15px; color: var(--ink-dim); }
.nav-profile-item:hover svg { color: var(--ink-muted); }
.nav-profile-item-danger { color: var(--danger); }
.nav-profile-item-danger:hover { background: var(--danger-wash); color: var(--danger); }
.nav-profile-sep {
  height: 1px;
  background: var(--line-2);
  margin: var(--s-1) 0;
}

/* ---- Auth-state visibility ---- */
body[data-auth="out"] .nav-when-in { display: none !important; }
body[data-auth="in"]  .nav-when-out { display: none !important; }

/* ---- Sell button — always visible, always gold ---- */
.nav-sell {
  /* Inherits .btn .btn-primary .btn-sm from core */
  font-size: var(--fs-12);
  letter-spacing: 0.08em;
  padding: 9px 16px;
  /* Keep intrinsic width; never shrink below it. Without this, a wide
     .nav-links sibling can compress this button and clip its label. */
  flex-shrink: 0;
}
.nav-sell svg { width: 14px; height: 14px; }

/* ---- Mobile menu toggle ---- */
.nav-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  border-radius: var(--r-2);
}
.nav-menu-btn svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------
   RESPONSIVE NAV
   ------------------------------------------------------------ */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-inner { grid-template-columns: auto 1fr auto; gap: var(--s-3); }
  .nav-action-icon { display: none; }
  .nav-menu-btn { display: inline-flex; }
}

@media (max-width: 560px) {
  .nav-logo-word { display: none; }
  .nav-sell { padding: 8px 12px; font-size: var(--fs-11); }
  .nav-sell-label-long { display: none; }
}

/* ------------------------------------------------------------
   MOBILE DRAWER
   ------------------------------------------------------------ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 7, 10, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-3) var(--ease-decel), visibility var(--dur-3) var(--ease-decel);
}
.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(360px, 88vw);
  background: var(--bg-1);
  border-left: 1px solid var(--line-2);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--dur-3) var(--ease-decel);
  display: flex;
  flex-direction: column;
  box-shadow: var(--elev-3);
}
.drawer.is-open { transform: translateX(0); }

.drawer-head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-title {
  font-family: var(--font-display);
  font-size: var(--fs-14);
  font-weight: var(--fw-700);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.drawer-foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex-shrink: 0;
}

.drawer-section-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: var(--fw-600);
  padding: var(--s-3) var(--s-3) var(--s-1);
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 12px var(--s-3);
  font-size: var(--fs-14);
  color: var(--ink-muted);
  border-radius: var(--r-2);
  transition: background var(--dur-1) var(--ease-standard), color var(--dur-1) var(--ease-standard);
}
.drawer-link:hover,
.drawer-link.is-active {
  color: var(--ink);
  background: var(--bg-2);
}
.drawer-link svg { width: 16px; height: 16px; color: var(--ink-dim); flex-shrink: 0; }
.drawer-link .drawer-link-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
  color: var(--gold);
  font-weight: var(--fw-700);
}

/* Drawer sell CTA — full-width primary */
.drawer-cta {
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------------
   STICKY SEARCH SLOT
   Appears in the nav only when user has scrolled past the hero.
   Hero (Section 3) toggles `data-scrolled="hero-past"` on <body>.
   ------------------------------------------------------------ */
.nav-search-slot {
  max-width: 480px;
  width: 100%;
  position: relative;
  justify-self: center;
  display: none;
}
body[data-scrolled="hero-past"] .nav-search-slot { display: block; }

/* When sticky search is visible on larger screens, links hide */
@media (min-width: 981px) {
  body[data-scrolled="hero-past"] .nav-links { display: none; }
}

.nav-search {
  width: 100%;
  position: relative;
}
.nav-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease-standard), background var(--dur-1) var(--ease-standard);
}
.nav-search-input::placeholder { color: var(--ink-dim); }
.nav-search-input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px rgba(217, 166, 37, 0.10);
}
.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ------------------------------------------------------------
   PAGE CONTAINER — every page body slot
   ------------------------------------------------------------ */
.page {
  min-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
}
.page-main {
  /* Flex column so children with flex: 1 (e.g. messages' chat panel)
     can actually grow to fill the main area. Without display: flex
     here, a flex:1 child has no flex parent to size against and
     falls back to intrinsic content height. */
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ------------------------------------------------------------
   FOOTER
   Structural, quiet, comprehensive. No decoration.
   ------------------------------------------------------------ */
.footer {
  background: var(--black-deep);
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  /* Further tightened — compact strip, not a section. */
  padding: var(--s-4) var(--gutter) var(--s-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--s-4);
  padding-bottom: var(--s-3);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 300px;
}
.footer-brand-mark {
  height: 52px;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
  object-position: left center;   /* lock to container's left edge */
  align-self: flex-start;         /* don't let the flex parent centre it */
  margin-left: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-700);
  letter-spacing: 2.8px;
  color: var(--ink);
  line-height: 1;
}
.footer-brand-tagline {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--gold);
  font-weight: var(--fw-600);
}
.footer-brand-copy {
  font-size: var(--fs-13);
  color: var(--ink-muted);
  line-height: var(--lh-relaxed);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.footer-col-head {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  font-weight: var(--fw-600);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--s-1);
}
.footer-col a {
  font-size: var(--fs-13);
  color: var(--ink-dim);
  transition: color var(--dur-1) var(--ease-standard);
  line-height: 1.5;
}
.footer-col a:hover { color: var(--ink); }

.footer-divider {
  height: 1px;
  background: var(--line);
  margin: var(--s-3) 0 var(--s-3);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: var(--fw-500);
}
.footer-bottom-left  { display: inline-flex; align-items: center; gap: var(--s-3); }
.footer-bottom-right { display: inline-flex; align-items: center; gap: var(--s-3); }

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: var(--fw-600);
}
.footer-badge svg { width: 12px; height: 12px; }

.footer-trust-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-weight: var(--fw-600);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-1);
  transition: color var(--dur-1) var(--ease-standard),
              border-color var(--dur-1) var(--ease-standard),
              background var(--dur-1) var(--ease-standard);
}
.footer-trust-link:hover {
  color: var(--gold-ink);
  background: var(--gold);
  border-color: var(--gold);
}
.footer-trust-link svg { width: 13px; height: 13px; }
.footer-trust-link .arr { transition: transform var(--dur-1) var(--ease-standard); }
.footer-trust-link:hover .arr { transform: translateX(2px); }

.footer-sep { color: var(--ink-faint); }

.footer-locale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
}
.footer-locale strong {
  color: var(--ink);
  font-weight: var(--fw-600);
}

/* ------------------------------------------------------------
   RESPONSIVE — FOOTER
   ------------------------------------------------------------ */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: var(--s-5); }
  .footer-brand { grid-column: 1 / -1; max-width: none; margin-bottom: var(--s-3); }
  .footer-inner { padding-top: var(--s-5); }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
}

/* Phone input helper — persistent hint under any SA phone field.
   Paired with the input-normalisation logic in login.js / settings.js.
   Flashes gold for ~2.8 s when auto-strip kicks in. Rule lives in
   shell.css so any page with a phone input gets it for free. */
.phone-help {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--ink-dim, #737C87);
  margin-top: 6px;
  transition: color 180ms, transform 180ms;
}
.phone-help.is-flash {
  color: var(--gold, #D9A625);
  animation: phone-help-nudge 180ms ease-out 1;
}
@keyframes phone-help-nudge {
  0%   { transform: translateX(0); }
  40%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

/* ── Page entry animation ────────────────────────────────────── */
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .page-main {
    animation: page-in 300ms cubic-bezier(0.05, 0.7, 0.1, 1) both;
  }
}

/* ── Scroll progress bar ─────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 10000;
  background: var(--gold, #D9A625);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 80ms linear;
  pointer-events: none;
  will-change: transform;
}
