:root {
  color-scheme: dark;
  --bg: #090a0c;
  --panel: #111418;
  --panel-soft: #171b20;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4efe6;
  --muted: #b8afa2;
  --dim: #82796e;
  --brand: #ff6a2a;
  --brand-strong: #ff4d12;
  --brand-soft: rgba(255, 106, 42, 0.14);
  --good: #55d68f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --container: min(1180px, calc(100% - 32px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 106, 42, 0.2), transparent 28rem),
    linear-gradient(180deg, #050607, #0b0d10 34rem, #070809),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.topbar {
  align-items: center;
  background: rgba(9, 10, 12, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  left: 0;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand,
.nav,
.hero-actions,
.inline-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: var(--brand);
  border-radius: var(--radius);
  color: #190a03;
  display: grid;
  font-weight: 900;
  height: 42px;
  place-items: center;
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.nav a,
.eyebrow,
.product-body p,
.cart-item p,
.store-panel p,
.result-card p,
.admin-card p {
  color: var(--muted);
}

.nav {
  color: var(--muted);
  font-size: 0.95rem;
}

.button,
.icon-button,
.category-pill {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.button {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
}

.button-primary {
  background: var(--brand);
  color: #170904;
}

.button-secondary {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.cart-button span {
  background: rgba(0, 0, 0, 0.24);
  border-radius: 999px;
  margin-left: 6px;
  min-width: 24px;
  padding: 2px 7px;
  text-align: center;
}

main {
  margin: 0 auto;
  width: 100%;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 360px;
  padding: 52px 0 28px;
}

.hero-copy h1,
.toolbar h2,
.cart-header h2,
.admin-card h1,
.result-card h1 {
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 7vw, 5rem);
  max-width: 780px;
}

.hero-copy p[data-hero-description] {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 18px 0 24px;
  max-width: 720px;
}

.eyebrow {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.store-panel {
  align-items: center;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  padding: 20px;
}

.store-logo {
  background: #fff;
  border-radius: var(--radius);
  height: 78px;
  object-fit: contain;
  padding: 8px;
  width: 78px;
}

.status-dot {
  background: var(--good);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(85, 214, 143, 0.12);
  display: inline-block;
  height: 10px;
  margin-right: 8px;
  width: 10px;
}

.toolbar {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 24px 0 14px;
}

.search-box {
  display: grid;
  gap: 8px;
  min-width: min(340px, 100%);
}

.search-box span,
.admin-form label span,
.checkout-fields label span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.category-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 18px;
}

.category-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: 0 0 auto;
  font-weight: 800;
  padding: 10px 14px;
}

.category-pill.is-active {
  background: var(--brand-soft);
  border-color: rgba(255, 106, 42, 0.5);
  color: var(--text);
}

.product-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 72px;
}

.product-card,
.empty-state,
.cart-panel,
.result-card,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.product-image {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #15100d;
  display: grid;
  place-items: center;
}

.product-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.product-image span {
  color: var(--brand);
  font-size: 2rem;
  font-weight: 900;
}

.product-body {
  flex: 1;
  padding: 16px;
}

.product-body h3,
.cart-item h3 {
  line-height: 1.25;
  margin: 0 0 8px;
}

.product-body p {
  line-height: 1.55;
  margin: 0;
}

.product-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.product-footer strong {
  color: var(--brand);
  font-size: 1.05rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}

.empty-state.compact {
  padding: 18px;
}

.cart-drawer {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 40;
}

.cart-drawer.is-open {
  pointer-events: auto;
}

.cart-backdrop {
  background: rgba(0, 0, 0, 0.58);
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 0.2s ease;
}

.cart-drawer.is-open .cart-backdrop {
  opacity: 1;
}

.cart-panel {
  bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 32px);
  opacity: 0;
  position: absolute;
  right: 16px;
  top: 16px;
  transform: translateX(24px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 430px;
}

.cart-drawer.is-open .cart-panel {
  opacity: 1;
  transform: translateX(0);
}

.cart-header,
.cart-footer {
  padding: 18px;
}

.cart-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}

.icon-button {
  background: var(--panel-soft);
  color: var(--text);
  height: 34px;
  width: 34px;
}

.cart-items {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.cart-item {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
}

.quantity-control {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  overflow: hidden;
}

.quantity-control button {
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  height: 32px;
  width: 32px;
}

.quantity-control span {
  min-width: 28px;
  text-align: center;
}

.checkout-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.checkout-fields {
  display: grid;
  gap: 12px;
}

.terms-row {
  align-items: start;
  color: var(--muted);
  display: flex;
  gap: 10px;
  line-height: 1.45;
}

.terms-row input {
  min-height: auto;
  margin-top: 4px;
  width: auto;
}

.cart-footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.cart-total {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.cart-total span {
  color: var(--muted);
}

.toast {
  background: var(--text);
  border-radius: var(--radius);
  bottom: 18px;
  box-shadow: var(--shadow);
  color: var(--bg);
  left: 50%;
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.result-page,
.admin-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.result-card,
.admin-card {
  margin: 0 auto;
  max-width: 620px;
  padding: 28px;
  width: 100%;
}

.admin-shell {
  width: 100%;
}

.admin-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
}

.admin-form label {
  display: grid;
  gap: 8px;
}

.admin-message {
  border-radius: var(--radius);
  margin: 18px 0 0;
  padding: 12px 14px;
}

.admin-message:empty {
  display: none;
}

.admin-message[data-type="error"] {
  background: rgba(255, 76, 76, 0.12);
  color: #ffb0a8;
}

.admin-message[data-type="success"] {
  background: rgba(85, 214, 143, 0.12);
  color: #9df1c3;
}

.admin-message[data-type="warning"] {
  background: rgba(255, 196, 87, 0.13);
  color: #ffd98d;
}

.rust-hero {
  align-items: end;
  background:
    linear-gradient(90deg, rgba(5, 6, 7, 0.94), rgba(5, 6, 7, 0.65) 52%, rgba(5, 6, 7, 0.9)),
    linear-gradient(180deg, rgba(5, 6, 7, 0.16), #070809),
    url("hero-refinery.jpg") center / cover;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 360px;
  margin: 0;
  min-height: 620px;
  padding: 80px max(16px, calc((100vw - 1180px) / 2)) 56px;
  position: relative;
  overflow: hidden;
}

.rust-hero::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  inset: 0;
  opacity: 0.32;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.rust-hero::after {
  background:
    linear-gradient(90deg, rgba(5, 6, 7, 0.9), rgba(5, 6, 7, 0.5) 54%, rgba(5, 6, 7, 0.9)),
    linear-gradient(180deg, rgba(5, 6, 7, 0.16), #070809);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.hero-video {
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0.68;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.hero-content,
.hero-store-card {
  position: relative;
  z-index: 3;
}

.hero-content {
  display: grid;
  gap: 34px;
}

.rust-hero .hero-copy h1 {
  font-size: clamp(3.4rem, 9vw, 7.2rem);
  letter-spacing: 0;
  max-width: 900px;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
}

.rust-hero .hero-copy p[data-hero-description] {
  color: #f0d9bf;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  max-width: 670px;
}

.rust-hero .eyebrow,
.section-heading .eyebrow,
.shop-sidebar .eyebrow {
  color: #ffd2aa;
}

.hero-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  max-width: 720px;
}

.hero-stats article {
  background: rgba(12, 14, 17, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  padding: 16px;
}

.hero-stats strong,
.server-card h3,
.feature-band h3,
.shop-sidebar h3 {
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
}

.hero-stats span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 6px;
  text-transform: uppercase;
}

.hero-store-card {
  align-self: center;
  background: rgba(17, 20, 24, 0.88);
}

.section-block,
.shop-layout,
.feature-band {
  margin: 0 auto;
  width: var(--container);
}

.section-block {
  padding: 72px 0 28px;
}

.section-heading {
  align-items: end;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
  margin-bottom: 22px;
}

.section-heading h2,
.toolbar h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin: 0;
  text-transform: uppercase;
}

.section-heading p,
.toolbar p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.server-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.server-card {
  background:
    linear-gradient(135deg, rgba(255, 106, 42, 0.16), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.server-card.accent {
  background:
    linear-gradient(135deg, rgba(255, 106, 42, 0.28), transparent 48%),
    #16110d;
}

.server-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 12px 0 18px;
}

.server-status {
  align-items: center;
  color: var(--good);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 8px;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.server-status i {
  background: var(--good);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(85, 214, 143, 0.12);
  height: 9px;
  width: 9px;
}

.server-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.server-meta span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #f4d9b7;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 10px;
}

.feature-band {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 28px 0 54px;
}

.feature-band article {
  background: #0f1216;
  border: 1px solid var(--line);
  min-height: 210px;
  padding: 24px;
}

.feature-band article:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.feature-band article:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.feature-band span {
  color: var(--brand);
  font-weight: 900;
}

.feature-band p {
  color: var(--muted);
  line-height: 1.6;
}

.shop-layout {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 320px;
  padding: 24px 0 86px;
}

.shop-layout .toolbar {
  display: block;
  padding: 0 0 18px;
}

.shop-sidebar {
  background: rgba(17, 20, 24, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 92px;
}

.shop-sidebar .search-box {
  min-width: 0;
}

.sidebar-note {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.sidebar-note p {
  color: var(--muted);
  line-height: 1.6;
}

.product-card {
  background:
    linear-gradient(180deg, rgba(255, 106, 42, 0.08), transparent 42%),
    #101317;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.product-card:hover {
  border-color: rgba(255, 106, 42, 0.5);
  transform: translateY(-2px);
}

.product-image {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 106, 42, 0.18), transparent 38%),
    #0b0d0f;
}

.product-image img {
  transition: transform 0.22s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.035);
}

.product-body h3 {
  color: #fff2df;
}

@media (max-width: 860px) {
  .topbar,
  .toolbar,
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .toolbar {
    display: flex;
  }

  .nav {
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .rust-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 42px;
    padding-top: 56px;
  }

  .hero-stats,
  .server-grid,
  .feature-band,
  .shop-layout,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .hero-store-card {
    align-self: stretch;
  }

  .feature-band article,
  .feature-band article:first-child,
  .feature-band article:last-child {
    border-radius: var(--radius);
  }

  .shop-sidebar {
    order: -1;
    position: static;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  :root {
    --container: min(100% - 24px, 1180px);
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    bottom: 0;
    left: 0;
    max-width: none;
    right: 0;
    top: 0;
    width: auto;
  }

  .hero-actions,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
}
