:root {
  color-scheme: dark;
  --bg: #111315;
  --surface: #181c20;
  --surface-2: #20262c;
  --line: #33404a;
  --text: #edf3f6;
  --muted: #aebbc3;
  --quiet: #7f8d96;
  --accent: #70c1a5;
  --accent-2: #e5b85b;
  --danger: #df786d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, rgba(112, 193, 165, 0.09), transparent 420px), var(--bg);
  color: var(--text);
}

body.lightbox-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(17, 19, 21, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(112, 193, 165, 0.42);
  background: #1f302d;
  color: #d6fff1;
  font-weight: 800;
}
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand small { margin-top: 3px; color: var(--quiet); font-size: 12px; }

.main-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.main-nav a, .button, .icon-button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}
.main-nav a, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}
.button.primary { border-color: rgba(112, 193, 165, 0.56); background: #2d6658; }
.icon-button { width: 42px; padding: 0; cursor: pointer; }

main { overflow: hidden; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(36px, 6vw, 86px) clamp(18px, 4vw, 56px) 44px;
}

.hero-copy { max-width: 760px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 920px; margin-bottom: 20px; font-size: clamp(46px, 8vw, 98px); line-height: 0.94; }
h2 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 54px); line-height: 1; }
h3 { margin-bottom: 8px; font-size: 20px; }
.hero-copy p:not(.eyebrow), .section-heading p { max-width: 720px; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-panel {
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)), #15191d;
  box-shadow: var(--shadow);
}
.terminal-bar { display: flex; gap: 7px; align-items: center; height: 42px; padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.terminal-bar span:nth-child(2) { background: var(--accent-2); }
.terminal-bar span:nth-child(3) { background: var(--accent); }
.tier-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.tier-node { min-height: 90px; padding: 14px; border: 1px solid rgba(255,255,255,0.11); background: var(--surface); }
.tier-node strong { display: block; margin-bottom: 8px; color: var(--text); font-size: 18px; }
.tier-node span { color: var(--quiet); font-size: 13px; }

.section { padding: 68px clamp(18px, 4vw, 56px); }
.section-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: end;
  margin-bottom: 28px;
}
.section-heading.compact { display: block; }
.server-grid, .gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.server-card, .shot-card { overflow: hidden; border: 1px solid rgba(255,255,255,0.1); background: var(--surface); }
.server-card { display: grid; min-height: 360px; }

.server-visual, .shot-visual, .placeholder-visual {
  position: relative;
  min-height: 210px;
  background: linear-gradient(135deg, rgba(112,193,165,0.28), transparent 42%), linear-gradient(315deg, rgba(229,184,91,0.18), transparent 44%), #242b30;
}
.server-visual img, .shot-visual img { display: block; width: 100%; height: 100%; min-height: inherit; object-fit: cover; }
.server-visual::after, .placeholder-visual::after {
  content: "Screenshot paikka";
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  font-weight: 700;
}
.server-body, .shot-body { padding: 18px; }
.server-meta, .shot-meta, .stats-row { color: var(--quiet); font-size: 13px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 12px;
}

.filter-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 24px 0 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #15191d;
}
.filter-shell label { display: grid; gap: 6px; color: var(--quiet); font-size: 12px; font-weight: 800; text-transform: uppercase; }
select { width: 100%; min-height: 42px; border: 1px solid rgba(255,255,255,0.13); background: var(--surface-2); color: var(--text); padding: 0 10px; }
.stats-row { min-height: 22px; margin-bottom: 16px; }

.shot-card { cursor: pointer; text-align: left; }
.shot-card:hover { border-color: rgba(112, 193, 165, 0.48); }
.shot-card button { display: grid; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.shot-visual { aspect-ratio: 16 / 9; min-height: 0; }
.shot-body p { color: var(--muted); }

.split-section { display: grid; grid-template-columns: minmax(260px, 0.58fr) minmax(300px, 1fr); gap: 34px; }
.split-section .section-heading { display: block; margin-bottom: 0; }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 16px; border-left: 3px solid var(--accent); background: var(--surface); }
.timeline-item strong { color: var(--accent-2); }
.timeline-item p { margin: 0; color: var(--muted); }

.edit-guide { background: #15191d; }
.guide-list { display: grid; gap: 12px; max-width: 920px; margin: 0; padding-left: 22px; color: var(--muted); }
.guide-list code, .guide-list li { line-height: 1.55; }

.lightbox {
  width: min(1080px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid rgba(255,255,255,0.16);
  background: #0f1113;
  color: var(--text);
}
.lightbox::backdrop { background: rgba(0,0,0,0.78); }
.lightbox img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #08090a; }
.lightbox-copy { padding: 18px; }
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.74);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 980px) {
  .hero, .section-heading, .split-section { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .server-grid, .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-header { position: static; align-items: flex-start; flex-direction: column; }
  .main-nav { justify-content: flex-start; }
  h1 { font-size: 42px; }
  .hero-panel { min-height: 0; }
  .tier-map, .server-grid, .gallery-grid, .filter-shell { grid-template-columns: 1fr; }
  .icon-button { width: 100%; }
  .timeline-item { grid-template-columns: 1fr; }
}
