:root {
  color-scheme: dark;
  --bg: #12140f;
  --panel: rgba(19, 20, 16, 0.92);
  --panel-solid: #1a1b15;
  --panel-2: #242419;
  --text: #f6efd8;
  --muted: #c9c1a7;
  --line: rgba(237, 214, 140, 0.24);
  --gold: #d3a735;
  --gold-dark: #856b1d;
  --leaf: #8ccc27;
  --leaf-deep: #44681d;
  --wood: #9b6630;
  --water: #2e6d87;
  --stone: #9b9b8d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(10, 12, 8, 0.36), rgba(10, 12, 8, 0.96)),
    repeating-linear-gradient(135deg, rgba(128, 167, 42, 0.16) 0 34px, rgba(64, 93, 30, 0.12) 34px 68px),
    var(--bg);
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 0 6vw;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 20, 15, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  width: 20px;
  height: 30px;
  background: var(--leaf);
  clip-path: polygon(50% 0, 100% 42%, 75% 42%, 100% 72%, 63% 72%, 63% 100%, 37% 100%, 37% 72%, 0 72%, 25% 42%, 0 42%);
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.28));
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  margin-top: 0.24rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  min-height: 40px;
  padding: 0.68rem 0.9rem;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(190, 150, 45, 0.34), rgba(82, 70, 28, 0.24));
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 8rem 6vw 9rem;
}

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

.hero-image {
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(12, 14, 10, 0.92), rgba(12, 14, 10, 0.52) 48%, rgba(12, 14, 10, 0.28)),
    linear-gradient(0deg, var(--bg), rgba(18, 20, 15, 0.16) 46%, transparent);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
}

.kicker {
  margin: 0 0 0.9rem;
  color: var(--leaf);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.94;
}

.hero-content p:not(.kicker),
.page-title p,
.copy p,
.gallery p,
.detail-panel p {
  max-width: 66ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(19, 20, 16, 0.82);
  font-weight: 900;
}

.button.primary {
  border-color: #e0bb4e;
  background: linear-gradient(180deg, #cba33b, #77601f);
  color: #fff7dc;
}

.button.ghost {
  background: rgba(16, 17, 13, 0.72);
}

.section,
.page {
  padding-inline: 6vw;
}

.resource-bar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: -4.5rem 6vw 0;
  border: 1px solid var(--line);
  background: rgba(237, 214, 140, 0.16);
  box-shadow: var(--shadow);
}

.resource-bar article {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 1.15rem;
  background: var(--panel);
}

.resource-bar strong,
.resource-bar small {
  display: block;
}

.resource-bar small {
  grid-column: 2;
  color: var(--leaf);
}

.resource-icon,
.mini-icon {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 38px;
}

.resource-icon.tree::before,
.mini-icon.house::before,
.mini-icon.pick::before,
.mini-icon.wheat::before,
.mini-icon.scroll::before {
  content: "";
  position: absolute;
  inset: 4px;
}

.resource-icon.tree::before {
  background: var(--leaf);
  clip-path: polygon(50% 0, 100% 50%, 74% 50%, 100% 80%, 58% 80%, 58% 100%, 42% 100%, 42% 80%, 0 80%, 26% 50%, 0 50%);
}

.resource-icon.stone::before,
.resource-icon.stone::after {
  content: "";
  position: absolute;
  background: var(--stone);
  transform: skewY(-20deg);
}

.resource-icon.stone::before {
  left: 5px;
  top: 15px;
  width: 20px;
  height: 15px;
}

.resource-icon.stone::after {
  right: 3px;
  top: 8px;
  width: 22px;
  height: 18px;
  background: #6c6e67;
}

.resource-icon.grain::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 4px;
  width: 4px;
  height: 30px;
  background: var(--gold);
}

.resource-icon.grain::after {
  content: "";
  position: absolute;
  inset: 6px 8px;
  background: var(--gold);
  clip-path: polygon(50% 0, 72% 18%, 56% 22%, 82% 40%, 57% 41%, 86% 64%, 50% 54%, 14% 64%, 43% 41%, 18% 40%, 44% 22%, 28% 18%);
}

.resource-icon.people::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ebd394;
}

.resource-icon.people::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 5px;
  width: 24px;
  height: 18px;
  border-radius: 50% 50% 4px 4px;
  background: #ebd394;
}

.split-section,
.detail-panel,
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 2rem;
  align-items: start;
  padding-top: 7rem;
  padding-bottom: 6rem;
}

.split-section h2,
.page-title h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.4rem, 5.7vw, 5.2rem);
  line-height: 0.98;
}

.feature-grid,
.build-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 7rem;
}

.feature-grid article,
.build-menu article,
.building-card,
.stat-list,
.timeline,
.palette {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.feature-grid article,
.build-menu article,
.building-card,
.stat-list,
.palette {
  padding: 1.35rem;
}

.feature-grid h2,
.build-menu strong,
.building-card h2,
.stat-list h2,
.timeline h2,
.palette h2 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
}

.feature-grid p,
.build-menu p,
.timeline p,
.palette p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.page {
  padding-top: 5rem;
  padding-bottom: 6rem;
}

.page-title {
  margin-bottom: 3rem;
}

.build-menu {
  padding-bottom: 0;
}

.build-menu article {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 0.8rem;
  align-items: start;
}

.build-menu article p {
  grid-column: 2;
}

.build-menu .active {
  background: linear-gradient(180deg, rgba(166, 130, 31, 0.92), rgba(65, 56, 25, 0.92));
}

.mini-icon.house::before {
  background: var(--gold);
  clip-path: polygon(50% 0, 100% 38%, 88% 38%, 88% 100%, 12% 100%, 12% 38%, 0 38%);
}

.mini-icon.pick::before {
  border-top: 5px solid var(--stone);
  border-left: 22px solid transparent;
  transform: rotate(-35deg);
}

.mini-icon.pick::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 10px;
  width: 5px;
  height: 26px;
  background: var(--wood);
  transform: rotate(42deg);
}

.mini-icon.wheat::before {
  background: var(--gold);
  clip-path: polygon(46% 0, 60% 0, 55% 100%, 43% 100%);
}

.mini-icon.wheat::after {
  content: "";
  position: absolute;
  inset: 6px 7px;
  background: var(--gold);
  clip-path: polygon(50% 0, 70% 16%, 54% 23%, 82% 40%, 57% 42%, 86% 63%, 50% 55%, 14% 63%, 43% 42%, 18% 40%, 46% 23%, 30% 16%);
}

.mini-icon.scroll::before {
  border: 3px solid #e8cf85;
  border-radius: 2px;
}

.mini-icon.scroll::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 9px;
  top: 15px;
  height: 3px;
  background: #e8cf85;
  box-shadow: 0 7px 0 #e8cf85;
}

.building-card {
  min-height: 25rem;
}

.building-art {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 1.2;
  margin: 0 auto 1rem;
  background:
    linear-gradient(145deg, transparent 0 34%, #b88630 35% 54%, transparent 55%),
    linear-gradient(35deg, transparent 0 30%, #d7ae47 31% 52%, transparent 53%),
    linear-gradient(#7b552b, #7b552b) 50% 66% / 44% 32% no-repeat,
    linear-gradient(#4b3420, #4b3420) 50% 80% / 14% 18% no-repeat,
    radial-gradient(circle at 24% 78%, #9a9b8c 0 6%, transparent 7%),
    radial-gradient(circle at 72% 82%, #b7b6a5 0 7%, transparent 8%);
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.32));
}

.stat-list dl {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 0;
}

.stat-list div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.stat-list dt {
  color: var(--gold);
  font-weight: 900;
}

.stat-list dd {
  margin: 0;
  color: var(--muted);
}

.timeline {
  padding: 1.4rem;
}

.timeline ol {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(237, 214, 140, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.timeline time {
  color: var(--leaf);
  font-weight: 900;
}

.gallery {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
}

.gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.gallery figcaption {
  padding: 1rem;
  color: var(--muted);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.swatches span {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--swatch);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 6vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(13, 14, 10, 0.76);
}

@media (max-width: 900px) {
  .site-header {
    min-height: 68px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 68px;
    right: 6vw;
    left: 6vw;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
    border: 1px solid var(--line);
    background: var(--panel-solid);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
  }

  .hero {
    min-height: 720px;
    padding-top: 5.5rem;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(12, 14, 10, 0.86), rgba(12, 14, 10, 0.54) 50%, var(--bg)),
      linear-gradient(0deg, var(--bg), transparent 34%);
  }

  h1,
  .split-section h2,
  .page-title h1 {
    max-width: 100%;
  }

  .resource-bar,
  .feature-grid,
  .build-menu,
  .split-section,
  .detail-panel,
  .gallery {
    grid-template-columns: 1fr;
  }

  .resource-bar {
    margin-top: 0;
  }

  .split-section,
  .detail-panel,
  .gallery {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .hero {
    min-height: 650px;
    padding-bottom: 4.5rem;
  }

  .hero-actions,
  .site-footer,
  .timeline li,
  .stat-list div {
    display: flex;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .page {
    padding-top: 3.5rem;
  }
}
