:root {
  color-scheme: dark;
  --bg: #030405;
  --bg-soft: #090b0d;
  --panel: rgba(14, 16, 18, .86);
  --panel-solid: #101214;
  --steel-1: #f1eee7;
  --steel-2: #a2a2a0;
  --steel-3: #565a5c;
  --steel-4: #181a1c;
  --ember: #ff5a00;
  --ember-bright: #ff8a19;
  --ember-dark: #812000;
  --cyan: #09d8ff;
  --green: #23e178;
  --text: #f4f2ee;
  --muted: #b8b3ab;
  --line: rgba(255, 255, 255, .13);
  --line-hot: rgba(255, 90, 0, .55);
  --shadow: 0 18px 56px rgba(0, 0, 0, .58);
  --radius: 8px;
  --shell: min(1460px, calc(100vw - 36px));
  --display-font: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Arial", sans-serif;
  font-family: var(--display-font);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 90, 0, .24), transparent 36rem),
    radial-gradient(circle at 20% 0%, rgba(43, 76, 92, .18), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(#000, transparent 75%);
}

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

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 10px max(18px, calc((100vw - 1460px) / 2));
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(3,4,5,.78), rgba(3,4,5,.78)),
    url("../public/assets/ui/forge-card-background.png") repeat;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  width: auto;
  height: 58px;
  max-width: 78px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 90, 0, .34));
}

.brand__text {
  font-family: var(--display-font);
  font-size: clamp(1.28rem, 1.7vw, 1.9rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(255,255,255,.12);
}

.brand__text strong {
  color: var(--ember);
  font-weight: 900;
  text-shadow: 0 0 22px rgba(255, 90, 0, .5), 0 3px 0 #3b0d00;
}

.text-steel,
.text-ember {
  display: inline-block;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-title__line {
  display: block;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  padding: .035em 0 .055em;
  margin: -.035em 0;
}

.text-steel {
  background-image: linear-gradient(180deg, #ffffff 0%, #dedbd2 34%, #8e9090 62%, #f4efe4 100%);
  text-shadow: none;
  filter: drop-shadow(0 3px 0 #000) drop-shadow(0 0 12px rgba(255,255,255,.14));
}

.text-ember {
  background-image: linear-gradient(180deg, #ffb13a 0%, #ff6a00 34%, #b92b00 72%, #ff7a12 100%);
  text-shadow: none;
  filter: drop-shadow(0 3px 0 #270700) drop-shadow(0 0 14px rgba(255,90,0,.5));
}

.primary-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 46px);
  color: var(--steel-1);
  font-weight: 700;
}

.primary-nav a {
  color: rgba(244, 242, 238, .86);
}

.primary-nav a:hover {
  color: #fff;
}

.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--shadow);
}

.button--large {
  min-width: 180px;
  min-height: 48px;
}

.button--ember {
  border-color: #ff7a1d;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 36%),
    linear-gradient(135deg, #ff8b1f, #c93500 55%, #5d1300);
  color: #fff;
}

.button--steel,
.button--ghost {
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 40%),
    linear-gradient(135deg, rgba(35, 38, 40, .9), rgba(9, 10, 11, .95));
}

.button--ghost {
  min-width: 120px;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 11, 12, .9);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

.hero-forge-wrap {
  border: 48px solid transparent;
  border-image: url("../public/assets/ui/forge-card-border.webp") 82 round;
  padding: 0;
  margin-top: 12px;
  margin-bottom: 12px;
  background: var(--bg);
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
  padding: 20px clamp(20px, 2.5vw, 40px) 18px;
  background: #030405;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,4,5,.92) 0%, rgba(3,4,5,.72) 27%, rgba(3,4,5,.12) 47%, rgba(3,4,5,.04) 74%, rgba(3,4,5,.26) 100%),
    linear-gradient(0deg, rgba(3,4,5,.34), transparent 26%, transparent 80%, rgba(3,4,5,.16));
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 96px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.hero__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero__content,
.foundry-panel {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--ember-bright);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 690px;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2.45rem, 3.95vw, 4.55rem);
  font-stretch: condensed;
  font-weight: 600;
  line-height: .96;
  color: var(--steel-1);
  text-transform: none;
  text-shadow: none;
}

.hero__lede {
  max-width: 560px;
  margin: 16px 0;
  color: var(--muted);
  font-size: clamp(.96rem, 1.35vw, 1.16rem);
  line-height: 1.45;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 700px;
  margin: 22px 0 20px;
}

.proof-grid article {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  min-width: 0;
}

.proof-grid svg {
  width: 36px;
  height: 36px;
}

.proof-grid h2 {
  margin: 0 0 4px;
  font-size: .88rem;
}

.proof-grid p {
  font-size: .86rem;
}

.proof-grid p,
.service-card p,
.rust-card p,
.supported-card p,
.builder p,
.site-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.foundry-panel,
.rust-card,
.supported-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), transparent 30%),
    linear-gradient(180deg, rgba(255,90,0,.08), transparent 26%),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), var(--shadow);
}

.foundry-panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.quick-actions h3 {
  margin: 0;
  font-size: .86rem;
  text-transform: uppercase;
}

.panel-head span {
  color: var(--green);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

.panel-head span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.metric-list {
  display: grid;
  gap: 5px;
  margin: 12px 0;
}

.metric-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 27px;
}

.metric-list dt {
  color: var(--muted);
}

.metric-list dd {
  margin: 0;
  color: var(--cyan);
  font-weight: 900;
}

.sparkline {
  display: inline-block;
  width: 78px;
  height: 18px;
  margin-left: 8px;
  background: linear-gradient(135deg, transparent 8%, var(--cyan) 9% 12%, transparent 13% 26%, var(--cyan) 27% 30%, transparent 31% 48%, var(--cyan) 49% 52%, transparent 53% 70%, var(--cyan) 71% 74%, transparent 75%);
  opacity: .95;
}

.sparkline--slow {
  opacity: .65;
}

.quick-actions {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.quick-actions a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
}

/* ── Reusable forge border system ─────────────────────────────────────────
   Drop .forge-border onto any card/panel to get the riveted steel frame.
   Slice value 82 = corner zone in the 512×512 forge-card-border.webp asset.
   ──────────────────────────────────────────────────────────────────────── */
.forge-border {
  border: 48px solid transparent;
  border-image: url("../public/assets/ui/forge-card-border.webp") 82 fill stretch;
  border-radius: 0; /* border-image overrides radius — corners are in the PNG */
}

/* ── Hammered steel tile — use as background on any section or card ──── */
.steel-bg {
  background-image: url("../public/assets/textures/steel-tile.webp");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
  position: relative;
  z-index: 3;
}

.service-card {
  position: relative;
  display: flex;
  min-height: 240px;
  padding: 20px 18px 18px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(0,0,0,.04) 0%, rgba(0,0,0,.22) 78%, rgba(0,0,0,.88) 94%, rgba(0,0,0,1) 100%),
    url("../public/assets/services/card-bg.png");
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 16px 46px rgba(0, 0, 0, .48);
}

.service-card__icon {
  display: block;
  width: 130px;
  height: 130px;
  margin: 0 auto 14px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.62)) drop-shadow(0 0 12px rgba(255,90,0,.42));
}

.service-card h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.14rem;
  font-weight: 900;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(255,255,255,.12);
}

.service-card p {
  max-width: 220px;
  font-size: .86rem;
}

.service-card a {
  display: inline-block;
  margin-top: auto;
  color: var(--ember-bright);
  font-size: 1.35rem;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255,90,0,.45);
}

/* ── Game server carousel ────────────────────────────────────────────── */
.server-carousel-wrap {
  margin-top: 10px;
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.carousel-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-title-group h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--steel-1);
}

.carousel-dash {
  color: var(--ember);
  font-weight: 900;
  font-size: 1.2rem;
}

.carousel-view-all {
  color: var(--ember-bright);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.carousel-view-all:hover {
  color: #fff;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.game-card {
  position: relative;
  flex: 0 0 calc(25% - 9px);
  min-height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
}

.game-card__art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  transition: transform .5s ease;
}

.game-card:hover .game-card__art {
  transform: scale(1.04);
}

.game-card__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.38) 46%, rgba(0,0,0,.12) 100%);
}

.game-card__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 16px 44px;
  z-index: 2;
}

.game-card__title {
  margin: 0 0 4px;
  font-family: var(--display-font);
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(0,0,0,.8);
  line-height: 1;
}

.game-card__tag {
  margin: 0;
  color: var(--ember-bright);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.game-card__footer {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.game-card__footer svg {
  width: 8px;
  height: 8px;
  color: var(--green);
  vertical-align: middle;
  margin-right: 4px;
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.carousel-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.carousel-btn:hover {
  background: rgba(255,90,0,.18);
  border-color: var(--ember);
  color: #fff;
}

.carousel-btn:disabled {
  opacity: .3;
  cursor: default;
}

.builder {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 40px;
  align-items: center;
  margin-top: 52px;
  border-top: 1px solid var(--line-hot);
  border-bottom: 1px solid var(--line);
}

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

.builder__list span {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  margin-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.site-footer img {
  width: 48px;
}

.site-footer p:last-child {
  max-width: 780px;
  font-size: .92rem;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .primary-nav,
  .header-actions {
    display: none;
  }

  .site-header.is-open .primary-nav,
  .site-header.is-open .header-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .site-header.is-open .primary-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header.is-open .primary-nav a,
  .site-header.is-open .header-actions a {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.04);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 54px;
  }

  .foundry-panel {
    max-width: 520px;
  }

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

  .launch-strip,
  .builder {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .brand__mark {
    width: auto;
    height: 48px;
    max-width: 66px;
  }

  .brand__text {
    font-size: 1.35rem;
  }

  .hero {
    min-height: auto;
  }

  .proof-grid,
  .game-types,
  .builder__list {
    grid-template-columns: 1fr;
  }

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

  .hero-actions,
  .site-header.is-open .header-actions,
  .site-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .rust-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}
