:root {
  --ink: #11161a;
  --muted: #5c6870;
  --paper: #f7f9f8;
  --white: #ffffff;
  --teal: #0f7d7a;
  --teal-dark: #095c5a;
  --amber: #d1912f;
  --line: #d8e0dd;
  --shadow: 0 22px 70px rgba(7, 21, 25, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 64px);
  color: var(--white);
  background: linear-gradient(to bottom, rgba(12, 19, 22, 0.84), rgba(12, 19, 22, 0));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 0.95rem;
  font-weight: 650;
}

.nav a {
  opacity: 0.86;
}

.nav a:hover,
.nav a:focus-visible {
  opacity: 1;
}

.hero {
  position: relative;
  min-height: min(760px, 92vh);
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  isolation: isolate;
}

.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media {
  object-fit: cover;
  z-index: -2;
}

.hero-shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 13, 16, 0.9) 0%, rgba(7, 13, 16, 0.72) 38%, rgba(7, 13, 16, 0.22) 78%),
    linear-gradient(180deg, rgba(7, 13, 16, 0.15) 60%, var(--paper) 100%);
}

.hero-content {
  width: min(720px, calc(100% - 40px));
  margin-left: clamp(20px, 7vw, 96px);
  padding-top: 74px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.5rem, 12vw, 8.25rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 640px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  color: var(--white);
  background: var(--teal);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--teal-dark);
}

.button.secondary {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.metrics div {
  min-height: 118px;
  padding: 28px clamp(20px, 4vw, 56px);
  background: var(--white);
}

.metrics strong,
.operation-list strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.metrics span,
.operation-list span,
.service-card p,
.operation-copy p,
.contact p {
  color: var(--muted);
}

.section {
  padding: clamp(64px, 10vw, 116px) clamp(20px, 5vw, 64px);
}

.section-intro {
  display: grid;
  max-width: 1180px;
  margin: 0 auto 34px;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 30px;
}

h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.service-grid {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.service-card {
  min-height: 260px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.icon {
  display: inline-flex;
  margin-bottom: 44px;
  color: var(--teal);
  font-weight: 900;
}

.service-card h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.service-card p {
  margin: 0;
}

.operations {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: clamp(30px, 6vw, 80px);
  align-items: start;
  background: #eaf0ee;
}

.operation-copy {
  max-width: 760px;
}

.operation-copy p:last-child {
  max-width: 620px;
  margin-top: 24px;
  font-size: 1.08rem;
}

.operation-list {
  display: grid;
  gap: 12px;
}

.operation-list div {
  padding: 22px;
  border-left: 4px solid var(--teal);
  background: var(--white);
}

.contact {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.contact p {
  max-width: 660px;
  margin: 20px auto 28px;
  font-size: 1.1rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 64px);
  color: var(--white);
  background: var(--ink);
}

@media (max-width: 760px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
  }

  .nav {
    gap: 12px;
    font-size: 0.86rem;
  }

  .hero {
    min-height: 700px;
  }

  .hero-content {
    margin: 0 auto;
    padding-top: 96px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(7, 13, 16, 0.9) 0%, rgba(7, 13, 16, 0.72) 70%, rgba(7, 13, 16, 0.35) 100%),
      linear-gradient(180deg, rgba(7, 13, 16, 0.1) 60%, var(--paper) 100%);
  }

  .metrics,
  .section-intro,
  .service-grid,
  .operations {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 220px;
  }
}

@media (max-width: 520px) {
  .site-header {
    flex-direction: column;
    gap: 14px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }
}

.factorio-page {
  background: #f4f1e8;
}

.factorio-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 5vw, 64px);
  color: #f8f5eb;
  background: #1e2525;
}

.factorio-brand,
.factorio-nav {
  display: flex;
  align-items: center;
}

.factorio-brand {
  gap: 10px;
  font-weight: 850;
}

.factorio-nav {
  gap: clamp(14px, 3vw, 32px);
  color: rgba(248, 245, 235, 0.82);
  font-weight: 750;
}

.factorio-nav a:hover,
.factorio-nav a:focus-visible {
  color: #ffffff;
}

.factorio-hero {
  min-height: 430px;
  display: grid;
  align-items: end;
  padding: 96px clamp(20px, 5vw, 64px) 58px;
  color: #f8f5eb;
  background:
    linear-gradient(120deg, rgba(18, 22, 22, 0.94), rgba(39, 45, 41, 0.84)),
    repeating-linear-gradient(90deg, rgba(213, 143, 50, 0.18) 0 1px, transparent 1px 72px),
    #2a302f;
}

.factorio-hero-inner {
  width: min(860px, 100%);
}

.factorio-hero h1 {
  max-width: 900px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.96;
}

.factorio-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 22px 0 0;
  color: rgba(248, 245, 235, 0.82);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.factorio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.factorio-secondary {
  border-color: rgba(248, 245, 235, 0.42);
}

.factorio-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #d9d2c1;
  border-bottom: 1px solid #d9d2c1;
  background: #fffaf0;
}

.factorio-status div {
  min-height: 104px;
  padding: 24px clamp(20px, 4vw, 54px);
  border-right: 1px solid #d9d2c1;
}

.factorio-status div:last-child {
  border-right: 0;
}

.factorio-status span,
.profile-meta,
.sync-section p {
  color: #66706b;
}

.factorio-status span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.factorio-status strong {
  display: block;
  font-size: 1.12rem;
}

.server-section,
.factorio-profiles,
.sync-section {
  padding: clamp(44px, 7vw, 82px) clamp(20px, 5vw, 64px);
}

.server-section {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(420px, 1.3fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  background: #ebe4d5;
}

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

.server-grid article {
  min-height: 142px;
  padding: 22px;
  border: 1px solid #d9d2c1;
  border-radius: 8px;
  background: #fffdf7;
}

.server-grid span {
  display: block;
  margin-bottom: 10px;
  color: #66706b;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.server-grid strong {
  display: block;
  color: #1c2a29;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.server-grid p {
  margin: 12px 0 0;
  color: #66706b;
}

.factorio-profiles {
  display: grid;
  gap: 22px;
}

.compare-panel {
  grid-column: 1 / -1;
}

.profile-panel {
  border: 1px solid #d9d2c1;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 18px 46px rgba(40, 34, 21, 0.1);
  overflow: hidden;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-bottom: 1px solid #e5ddcc;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.profile-head h2,
.sync-section h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.profile-meta {
  margin: 12px 0 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.factorio-profiles table {
  min-width: 980px;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 20%;
}

.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
  width: 150px;
}

.comparison-table th:nth-child(3),
.comparison-table th:nth-child(4),
.comparison-table td:nth-child(3),
.comparison-table td:nth-child(4) {
  width: 24%;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid #eee5d5;
  text-align: left;
  vertical-align: top;
}

th {
  color: #59625e;
  background: #faf2e4;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td code,
.sync-grid code {
  color: #1c2a29;
  overflow-wrap: anywhere;
}

.mod-link {
  color: #1c2a29;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.version-link {
  display: inline-flex;
  align-items: center;
  color: #0f6b68;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.missing-cell {
  color: #8b342f;
  font-weight: 800;
}

.compare-status {
  display: inline-flex;
  min-width: 118px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.compare-status.match {
  color: #1f5136;
  background: #dff0e6;
}

.compare-status.different {
  color: #6a4700;
  background: #ffe8ad;
}

.compare-status.trackSpecific {
  color: #3f4a45;
  background: #e8ece6;
}

.compare-status.vanilla {
  color: #294e6b;
  background: #d9ecff;
}

.compare-status.missingStable,
.compare-status.missingExperimental {
  color: #7d2724;
  background: #ffd8d4;
}

.compare-row.different td {
  background: #fff9ec;
}

.compare-row.trackSpecific td {
  background: #fffdf7;
}

.compare-row.vanilla td {
  background: #f0f8ff;
}

.compare-row.missingStable td,
.compare-row.missingExperimental td {
  background: #fff1ef;
}

.sync-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  background: #e8ece6;
}

.sync-grid {
  display: grid;
  gap: 12px;
}

.sync-grid div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-left: 4px solid var(--teal);
  background: #fffdf7;
}

.sync-grid strong {
  color: #1c2a29;
}

.factorio-footer {
  background: #1e2525;
}

@media (max-width: 760px) {
  .factorio-header,
  .profile-head {
    flex-direction: column;
  }

  .factorio-status,
  .server-section,
  .server-grid,
  .factorio-profiles,
  .sync-section {
    grid-template-columns: 1fr;
  }

  .factorio-status div {
    border-right: 0;
    border-bottom: 1px solid #d9d2c1;
  }

  .factorio-status div:last-child {
    border-bottom: 0;
  }
}
