/* ══════════════════════════════════════════════════════════════
   WEIRDMAKER v2 SHARED PATTERNS — Heroes, Grids, States
   Requires: tokens-v2.css, base-v2.css, components-v2.css
══════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════
   PAGE HERO SECTIONS
   Rack-mounted header with silk-screened title
═══════════════════════════════════════════ */

.page-hero {
  padding: 64px 0 48px;
  text-align: center;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--hw-metal-dark) 15%,
    var(--hw-metal-dark) 85%,
    transparent 100%);
}
.page-hero h1 {
  margin-bottom: 12px;
}
.page-hero p {
  color: var(--hw-text-dim);
  font-size: 0.95rem;
  max-width: 50ch;
  margin: 0 auto;
}

/* Hero with LED status */
.page-hero .hw-led-badge {
  margin-bottom: 16px;
}

/* ── Section Headers (rack-rail dividers) ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.section-header__label {
  font-family: var(--hw-font-brand);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--hw-tracking-ultra);
  color: var(--hw-text-dim);
  white-space: nowrap;
}
.section-header__rail {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,
    var(--hw-metal-dark) 0%,
    transparent 100%);
}

/* ══════════════════════════════════════════
   GRID LAYOUTS
═══════════════════════════════════════════ */

/* Module panel grid */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.panel-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.panel-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Feature grid (2-4 columns) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* ══════════════════════════════════════════
   LOADING STATES
═══════════════════════════════════════════ */

/* Loading panel (replaces spinner) */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  color: var(--hw-text-dim);
}
.loading-state__leds {
  display: flex;
  gap: 8px;
}
.loading-state__leds .hw-led {
  animation: led-chase 1.2s ease-in-out infinite;
}
.loading-state__leds .hw-led:nth-child(2) { animation-delay: 0.15s; }
.loading-state__leds .hw-led:nth-child(3) { animation-delay: 0.3s; }
.loading-state__leds .hw-led:nth-child(4) { animation-delay: 0.45s; }

@keyframes led-chase {
  0%, 100% { background: var(--hw-metal-dark); box-shadow: none; }
  50%      { background: var(--led-signal); box-shadow: 0 0 var(--led-glow) var(--led-signal); }
}

.loading-state__text {
  font-family: var(--hw-font-brand);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--hw-tracking-ultra);
}

/* ══════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: var(--hw-radius-round);
  background: var(--hw-bg-inset);
  border: 2px solid var(--hw-metal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--hw-text-faint);
}
.empty-state h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}
.empty-state p {
  color: var(--hw-text-dim);
  font-size: 0.875rem;
  margin: 0 auto 24px;
  max-width: 40ch;
}

/* ══════════════════════════════════════════
   ERROR STATES
═══════════════════════════════════════════ */

.error-state {
  text-align: center;
  padding: 64px 24px;
}
.error-state__code {
  font-family: var(--hw-font-label);
  font-size: clamp(4rem, 10vw, 6rem);
  font-weight: 700;
  color: var(--led-alert);
  line-height: 1;
  margin-bottom: 8px;
}
.error-state h2 {
  color: var(--hw-text);
  margin-bottom: 12px;
}
.error-state p {
  color: var(--hw-text-dim);
  margin: 0 auto 24px;
  max-width: 45ch;
}

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════ */

.hw-toast-container {
  position: fixed;
  top: calc(var(--hw-nav-height) + 12px);
  right: 16px;
  z-index: var(--hw-z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.hw-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--hw-bg-panel);
  border: var(--hw-border);
  box-shadow: var(--hw-shadow-deep);
  animation: hw-slide-in-right var(--hw-duration-slow) var(--hw-ease) both;
}
.hw-toast__led {
  flex-shrink: 0;
  margin-top: 3px;
}
.hw-toast__message {
  font-family: var(--hw-font-body);
  font-size: 0.85rem;
  color: var(--hw-text);
  line-height: 1.4;
}
.hw-toast__close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--hw-text-faint);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
}
.hw-toast__close:hover { color: var(--hw-text); }

@keyframes hw-slide-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════
   TABS (hardware-styled)
═══════════════════════════════════════════ */

.hw-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--hw-metal-dark);
}
.hw-tab {
  padding: 10px 20px;
  font-family: var(--hw-font-brand);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--hw-tracking-wide);
  color: var(--hw-text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--hw-duration) var(--hw-ease);
}
.hw-tab:hover { color: var(--hw-text); }
.hw-tab.active {
  color: var(--hw-text);
  border-bottom-color: var(--hw-text);
}

/* ══════════════════════════════════════════
   DIVIDERS & SPACING
═══════════════════════════════════════════ */

.hw-divider {
  width: 100%;
  height: 1px;
  background: var(--hw-metal-dark);
  margin: 24px 0;
}
.hw-spacer    { height: 24px; }
.hw-spacer-lg { height: 48px; }
.hw-spacer-xl { height: 80px; }

/* ══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .page-hero { padding: 40px 0 32px; }
  .panel-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hw-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hw-toast-container { left: 16px; right: 16px; max-width: none; }
}


