/* ============================================================
   RustLookup — Shared Design System
   ============================================================ */

/* ---- Color Palette ---- */
:root {
  --bg-deep: #0b0e14;
  --bg: #0f1219;
  --surface: rgba(17, 21, 28, 0.96);
  --surface-2: rgba(14, 17, 23, 0.97);
  --surface-elevated: #161b24;
  --surface-subtle: rgba(255, 255, 255, 0.04);

  --line: #2a3040;
  --line-soft: #353d4e;
  --line-glow: rgba(224, 122, 58, 0.25);

  --orange: #e07a3a;
  --orange-bright: #f0944e;
  --orange-glow: rgba(224, 122, 58, 0.15);
  --rust-red: #b74a38;

  --text: #e8ecf2;
  --text-strong: #f4f6fa;
  --soft: #8d95a5;
  --muted: #5c6578;
  --dim: #3d4555;

  --green: #34d058;
  --green-muted: #2ea04e;
  --red: #f85149;
  --amber: #d29922;

  --ok: #34d058;
  --warn: #d29922;
  --danger: #f85149;

  --clean: #2ea04e;
  --clean-bg: rgba(52, 208, 88, 0.06);
  --clean-border: rgba(52, 208, 88, 0.25);
  --banned-bg: rgba(248, 81, 73, 0.08);
  --banned-border: rgba(248, 81, 73, 0.3);
  --warn-bg: rgba(210, 153, 34, 0.08);
  --warn-border: rgba(210, 153, 34, 0.3);

  --focus: #f0944e;
  --nav-bg: rgba(11, 14, 20, 0.92);

  /* Legacy aliases — keeps old var() refs working during migration */
  --rust-orange: var(--orange);
  --rust-orange-bright: var(--orange-bright);
  --ink: var(--bg-deep);
  --panel: var(--surface-elevated);
  --panel-2: var(--bg);
  --line-soft-legacy: var(--line-soft);
}

/* ---- Reset / Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Roboto Condensed", Arial, sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(224, 122, 58, 0.08) 0%,
      transparent 34%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(60, 80, 120, 0.1) 0%,
      transparent 34%
    ),
    radial-gradient(
      circle at 100% 100%,
      rgba(40, 55, 85, 0.08) 0%,
      transparent 30%
    ),
    linear-gradient(180deg, #0f1219 0%, #0b0e14 100%);
  overflow-x: hidden;
}

/* Grid overlay texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.12;
  z-index: 0;
}

input,
button,
select,
textarea {
  font: inherit;
}

/* ---- Background System ---- */
.rust-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background:
    linear-gradient(180deg, rgba(8, 10, 14, 0.45), rgba(11, 14, 20, 0.68)),
    radial-gradient(
      circle at 50% 18%,
      rgba(224, 122, 58, 0.06),
      transparent 34%
    ),
    url("rust-bg.webp");
  background-size: cover;
  background-position: center;
  filter: saturate(0.35) contrast(1.1) brightness(0.75);
  z-index: 0;
}

.rust-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.28)),
    radial-gradient(
      circle at 20% 25%,
      rgba(255, 255, 255, 0.06),
      transparent 22%
    ),
    radial-gradient(
      circle at 76% 20%,
      rgba(255, 255, 255, 0.04),
      transparent 18%
    );
  opacity: 0.9;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle,
    transparent 50%,
    rgba(0, 0, 0, 0.28) 100%
  );
  z-index: 1;
}

/* ---- Panel ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(224, 122, 58, 0.5) 30%,
    rgba(240, 148, 78, 0.9) 50%,
    rgba(224, 122, 58, 0.5) 70%,
    transparent 100%
  );
  opacity: 1;
  z-index: 1;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02),
    transparent 30%,
    transparent 72%,
    rgba(255, 255, 255, 0.012)
  );
  pointer-events: none;
  opacity: 0.5;
}

/* ---- Panel Entry Animation ---- */
@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-animate {
  animation: panelIn 0.4s ease both;
}

/* ---- Skeleton Shimmer ---- */
@keyframes shimmer {
  0% {
    background-position: -600px 0;
  }
  100% {
    background-position: 600px 0;
  }
}

.skel {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}

/* ---- Site Nav (sticky header for inner pages) ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  margin-bottom: 24px;
}

.site-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  height: 54px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nav-brand img {
  width: 28px;
  height: 28px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--soft);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.nav-back:hover {
  color: var(--orange-bright);
}

.nav-back:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .site-nav-inner {
    padding: 0 16px;
  }
  .nav-back {
    font-size: 0.72rem;
  }
}

/* ---- Topbar (homepage-style header) ---- */
.topbar {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(224, 122, 58, 0.35);
  background:
    linear-gradient(180deg, rgba(224, 122, 58, 0.12), rgba(180, 70, 35, 0.08)),
    linear-gradient(180deg, rgba(22, 27, 36, 0.96), rgba(14, 17, 23, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}

.brand-mark img {
  width: 40px;
  height: 40px;
  display: block;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1;
}

.brand-tag {
  color: var(--soft);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- Buttons ---- */
.rust-btn {
  border: 1px solid rgba(224, 122, 58, 0.5);
  background: linear-gradient(180deg, var(--orange-bright), var(--orange));
  color: white;
  text-transform: uppercase;
  font-family: "Roboto Condensed", Arial, sans-serif;
  letter-spacing: 0.1em;
  transition: 0.15s ease;
  box-shadow: 0 6px 12px rgba(224, 122, 58, 0.18);
  border-radius: 12px;
  cursor: pointer;
}

.rust-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 20px rgba(224, 122, 58, 0.25);
}

.rust-btn:active {
  transform: translateY(1px);
}

.share-btn,
.icon-btn {
  border: 1px solid var(--line-soft);
  background: var(--surface-subtle);
  color: var(--soft);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Roboto Condensed", Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  transition: 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}

.share-btn:hover,
.icon-btn:hover {
  border-color: var(--orange-bright);
  color: var(--text);
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: "Roboto Condensed", Arial, sans-serif;
  opacity: 0.9;
}

.site-footer a {
  color: var(--soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: 0.15s ease;
}

.site-footer a:hover {
  color: var(--orange-bright);
  border-color: var(--orange-bright);
}

.site-footer a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---- Section Label ---- */
.section-label {
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
}

/* ---- Accessibility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Utility Classes ---- */
.u-hidden {
  display: none !important;
}
.u-flex {
  display: flex;
}
.u-flex-col {
  display: flex;
  flex-direction: column;
}
.u-flex-wrap {
  flex-wrap: wrap;
}
.u-flex-1 {
  flex: 1;
}
.u-items-center {
  align-items: center;
}
.u-items-start {
  align-items: flex-start;
}
.u-justify-between {
  justify-content: space-between;
}
.u-gap-4 {
  gap: 4px;
}
.u-gap-6 {
  gap: 6px;
}
.u-gap-8 {
  gap: 8px;
}
.u-gap-10 {
  gap: 10px;
}
.u-gap-12 {
  gap: 12px;
}
.u-gap-16 {
  gap: 16px;
}
.u-gap-20 {
  gap: 20px;
}
.u-gap-24 {
  gap: 24px;
}
.u-text-center {
  text-align: center;
}
.u-text-right {
  text-align: right;
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--line-soft);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
