:root {
  --ink: #151d1a;
  --text: #25312d;
  --muted: #65716b;
  --paper: #eef1e8;
  --paper-2: #f8f6ef;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(21, 29, 26, 0.14);
  --line-strong: rgba(21, 29, 26, 0.24);
  --shadow: 0 22px 60px rgba(21, 29, 26, 0.14);
  --body: Arial, Helvetica, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 29, 26, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 29, 26, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #eef1e8 0%, #f8f6ef 48%, #e5ece3 100%);
  background-size: 64px 64px, 64px 64px, auto;
}

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

:focus-visible {
  outline: 2px solid #244e73;
  outline-offset: 4px;
}

.hecs-skip {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 10;
  transform: translateY(-80px);
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
}

.hecs-skip:focus {
  transform: translateY(0);
}

.hecs-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding: 0 max(24px, 5vw);
  border-bottom: 1px solid var(--line);
  background: rgba(238, 241, 232, 0.88);
  backdrop-filter: blur(18px);
}

.hecs-brand,
.hecs-topnav {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.hecs-brand__mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
}

.hecs-topnav a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

.hecs-layout {
  min-height: calc(100vh - 72px);
}

.hecs-layout.is-index {
  overflow: hidden;
}

.hecs-topic {
  width: min(1120px, calc(100% - max(32px, 10vw)));
  margin: 0 auto;
  padding: 34px 0 30px;
}

.hecs-topic-card,
.hecs-start-guide {
  --hex-bg: #fff;
  --hex-fg: #16201b;
  padding: 28px 0 20px;
  color: var(--hex-fg);
}

.hecs-topic-card .hecs-eyebrow,
.hecs-start-guide .hecs-eyebrow {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--hex-bg);
  color: var(--hex-fg);
}

.hecs-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hecs-map-shell {
  min-width: 0;
}

.hecs-map {
  overflow: auto;
  min-height: 620px;
  padding: 48px 36px 78px;
  background:
    radial-gradient(circle at 24px 24px, rgba(21, 29, 26, 0.055) 2px, transparent 2px),
    rgba(255, 255, 255, 0.18);
  background-size: 48px 48px;
}

.is-index .hecs-map {
  min-height: calc(100vh - 72px);
  padding-top: 70px;
}

.hecs-row {
  display: flex;
  gap: 4px;
  height: 105px;
}

.hecs-row.is-offset {
  margin-left: 65px;
}

.hecs-hex {
  --hex-bg: #fff;
  --hex-fg: #16201b;
  --hex-edge: #edf0ea;
  flex: 0 0 125px;
  width: 125px;
  height: 130px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
  clip-path: polygon(50% 0, 100% 23%, 100% 77%, 50% 100%, 0 77%, 0 23%);
  background: var(--hex-bg);
  color: var(--hex-fg);
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.08;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.hecs-hex span {
  position: relative;
  z-index: 1;
  display: block;
  overflow-wrap: anywhere;
}

.hecs-hex:not(.hecs-hex--empty):hover,
.hecs-hex:not(.hecs-hex--empty):focus-visible,
.hecs-hex.is-active {
  background: #000 !important;
  color: #fff !important;
  transform: translateY(-4px);
  filter: none;
}

.hecs-hex.is-active {
  outline: 4px solid #fff;
  outline-offset: -4px;
}

.hecs-hex--empty {
  visibility: hidden;
  opacity: 0;
  background: transparent;
  pointer-events: none;
}

.hecs-resource-group {
  margin-top: 22px;
}

.hecs-resource-group h3 {
  margin: 0 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hecs-resource {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
  padding: 10px 14px;
  border: 2px solid var(--hex-bg);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.hecs-resource:hover,
.hecs-resource:focus-visible {
  background: #000;
  color: #fff;
  transform: translateX(4px);
}

.hecs-resource__target {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.hecs-start-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.hecs-start-levels section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.hecs-start-levels h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.hecs-start-levels div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hecs-start-levels a {
  --hex-bg: #fff;
  --hex-fg: #16201b;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--hex-bg) 34%, #fff);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.hecs-muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hecs-topic {
    width: calc(100% - 32px);
    padding-top: 28px;
  }

  .hecs-start-levels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hecs-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .hecs-layout {
    min-height: calc(100vh - 104px);
  }

  .hecs-map {
    padding: 34px 18px 52px;
  }

  .hecs-row {
    height: 92px;
  }

  .hecs-row.is-offset {
    margin-left: 54px;
  }

  .hecs-hex {
    flex-basis: 108px;
    width: 108px;
    height: 112px;
    padding: 14px;
    font-size: 12px;
  }

  .hecs-resource {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
