/* namu.market - Folk-art hexagonal timber market */
:root {
  --heartwood: #8B6840;
  --sapwood: #D8C4A0;
  --bark: #3A2818;
  --clay: #C07848;
  --lichen: #6A8058;
  --sawdust: #F0E8D8;
  --grain: #B8A078;
  --charcoal: #2A2418;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

body {
  background: var(--sawdust);
  color: var(--bark);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.75;
  overflow-x: hidden;
}

.wood-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background: repeating-linear-gradient(
    2deg,
    var(--grain) 0px,
    transparent 1px,
    transparent 8px
  );
}

/* Gate */
.gate {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8vh 2rem 4vh;
}
.gate-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--bark);
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.hex-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.hex-icon-small {
  width: 40px;
  height: 40px;
}

.gate-subtitle {
  font-size: 1rem;
  color: var(--heartwood);
  opacity: 0.7;
}

/* Honeycomb */
.stalls {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.honeycomb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hex-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.hex-row-offset {
  margin-left: calc(100px + 4px);
}

.hex-cell {
  --hex-width: min(200px, 40vw);
  width: var(--hex-width);
  height: calc(var(--hex-width) * 1.15);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--sapwood);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.hex-cell:hover {
  transform: scale(1.08);
  z-index: 2;
}

.hex-content {
  text-align: center;
  padding: 1.5rem 1rem;
}
.hex-illust {
  width: 50px;
  height: 50px;
  margin-bottom: 0.5rem;
}
.hex-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bark);
  margin-bottom: 0.25rem;
}
.hex-text {
  font-size: 0.8rem;
  color: var(--heartwood);
  line-height: 1.4;
}

/* Workshop */
.workshop {
  position: relative;
  z-index: 1;
  background: var(--bark);
  padding: 4rem 2rem;
  margin-top: 4rem;
}
.workshop-title {
  font-weight: 700;
  font-size: 2rem;
  color: var(--sapwood);
  text-align: center;
  margin-bottom: 2.5rem;
}
.workshop-grid {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}
.workshop-step {
  text-align: center;
}
.workshop-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 0.75rem;
}
.workshop-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--sapwood);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Close */
.market-close {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5rem 2rem 3rem;
}
.close-hex-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.close-char {
  font-weight: 700;
  font-size: 2rem;
  color: var(--bark);
  width: 60px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--sapwood);
}
.char-accent { color: var(--clay); }
.char-hanja { color: var(--lichen); }

.close-domain {
  font-size: 0.85rem;
  color: var(--heartwood);
  opacity: 0.4;
}

@media (max-width: 700px) {
  .hex-row { flex-wrap: wrap; }
  .hex-row-offset { margin-left: 0; }
  .hex-cell { --hex-width: min(150px, 45vw); }
}
