:root {
  --bg: #0c0d11;
  --bg-2: #111318;
  --surface: #171a22;
  --surface-2: #1c1f28;
  --border: #2a2e3a;
  --accent: #c8973a;
  --accent-bright: #ecd08a;
  --text: #e8e4dc;
  --muted: #868c9c;
  --radius: 10px;
  --maxw: 1080px;
  --cdn: https://assets.markdidenkowork.workers.dev;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-bright); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 13, 17, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
}

.brand {
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-nav {
  display: flex;
  gap: 18px;
  margin-left: 20px;
  font-size: 15px;
}

.topbar-nav a {
  color: var(--muted);
  text-decoration: none;
}

.topbar-nav a:hover { color: var(--text); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 11px;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--accent-bright);
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, #cf9f45, #9c6f22);
  color: #1a1206;
  font-family: inherit;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.08); }

.btn--ghost {
  background: transparent;
  color: var(--accent-bright);
}

.btn--lg { padding: 14px 28px; font-size: 19px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  background-image:
    linear-gradient(180deg, rgba(10,10,14,0.35) 0%, rgba(10,10,14,0.72) 55%, var(--bg) 100%),
    var(--hero-img);
  background-size: cover;
  background-position: center 30%;
}

.hero-inner { padding: 70px 20px 60px; }

.hero h1 {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  font-weight: normal;
}

.hero-tagline {
  margin-top: 14px;
  font-size: clamp(18px, 2.4vw, 23px);
  color: var(--accent-bright);
  max-width: 34ch;
}

.hero-sub {
  margin-top: 16px;
  color: var(--muted);
  max-width: 56ch;
}

.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-meta {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
section { padding: 64px 0; }

.section-label {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

h2 {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: normal;
  line-height: 1.2;
}

h3 {
  font-size: 21px;
  font-weight: normal;
}

.lede {
  margin-top: 16px;
  max-width: 68ch;
  color: #cdc8be;
}

.lede + .lede { margin-top: 12px; }

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── Factions ─────────────────────────────────────────────────────────────── */
.factions {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.faction {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.faction::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,14,0.78) 0%, rgba(10,10,14,0.22) 32%, rgba(10,10,14,0.78) 72%, rgba(10,10,14,0.97) 100%);
}

.faction-head,
.faction-body {
  position: relative;
  z-index: 1;
  padding: 18px;
}

.faction-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.faction-crest {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--accent);
  object-fit: cover;
}

.faction-name {
  font-size: 26px;
  color: var(--accent-bright);
}

.faction-desc {
  font-size: 15px;
  color: #c0bbb2;
}

/* ── The loop ─────────────────────────────────────────────────────────────── */
.loop {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  counter-reset: step;
}

.loop-step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.loop-step::before {
  counter-increment: step;
  content: counter(step);
  display: block;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 6px;
}

.loop-step h3 { font-size: 18px; }

.loop-step p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

/* ── Demos ────────────────────────────────────────────────────────────────── */
.demo-section + .demo-section { border-top: 1px solid var(--border); }

.demo-layout {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 36px;
  align-items: start;
}

.demo-section:nth-of-type(even) .demo-layout {
  grid-template-columns: 400px minmax(0, 1fr);
}

.demo-section:nth-of-type(even) .demo-copy { order: 2; }

.demo-copy p { color: #c4bfb6; }

.demo-copy p + p { margin-top: 12px; }

.demo-points {
  margin-top: 16px;
  list-style: none;
  font-size: 15px;
  color: var(--muted);
}

.demo-points li {
  padding-left: 18px;
  position: relative;
  margin-top: 6px;
}

.demo-points li::before {
  content: '\2756';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
  top: 4px;
}

.phone {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px;
  background: #06070a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.phone iframe {
  display: block;
  width: 100%;
  height: 680px;
  border: 0;
  border-radius: 14px;
  background: var(--bg-2);
}

.phone-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Join ─────────────────────────────────────────────────────────────────── */
.join {
  text-align: center;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(200, 151, 58, 0.11), transparent 70%);
}

.join h2 { margin-bottom: 14px; }

.join .lede { margin: 0 auto 26px; text-align: center; }

.bot-handle {
  display: inline-block;
  margin-top: 18px;
  font-size: 15px;
  color: var(--muted);
}

.bot-handle code {
  font-family: inherit;
  color: var(--accent-bright);
}

footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 920px) {
  .demo-layout,
  .demo-section:nth-of-type(even) .demo-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .demo-section:nth-of-type(even) .demo-copy { order: 0; }
  .phone { max-width: 420px; margin: 0 auto; }
  .topbar-nav { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  section { padding: 48px 0; }
  .phone iframe { height: 620px; }
}
