@font-face {
  font-family: "WildGag";
  src: url("./wildgag.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PretendardLocal";
  src: url("./Pretendard-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: only light;
  forced-color-adjust: none;
  --ink: #151611;
  --stone: #77766a;
  --stone-dark: #32362f;
  --paper: #fff8dd;
  --paper-strong: #fff1a7;
  --grass: #79b32f;
  --grass-dark: #315b23;
  --earth: #8c5a2d;
  --earth-dark: #46301d;
  --gold: #ffc73a;
  --red: #e24731;
  --teal: #16858a;
  --muted: #62665b;
  --line: rgba(21, 22, 17, 0.16);
  --shadow: 0 18px 0 rgba(21, 22, 17, 0.1), 0 30px 60px rgba(21, 22, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: only light;
  forced-color-adjust: none;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color-scheme: only light;
  forced-color-adjust: none;
  color: var(--ink);
  background-color: var(--paper);
  background:
    linear-gradient(90deg, rgba(21, 22, 17, 0.055) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(21, 22, 17, 0.055) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 18% 12%, rgba(255, 199, 58, 0.28), transparent 28rem),
    var(--paper);
  background-size: 32px 32px, 32px 32px, auto, auto;
  font-family: "PretendardLocal", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 30px;
}

.site-header,
.site-footer,
.panel-heading,
.section-heading,
.release-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: min(236px, 48vw);
  text-decoration: none;
}

.brand img,
.guide-art,
.hero-moai-image {
  display: block;
}

.brand img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 7px 0 rgba(21, 22, 17, 0.16));
}

.dev-gate {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 20;
  display: none;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  width: min(calc(100% - 32px), 330px);
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf1;
  box-shadow: var(--shadow);
}

.dev-gate:not(.is-open) {
  display: none;
}

.dev-gate.is-open {
  display: grid;
}

.dev-gate label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.dev-gate input {
  min-height: 42px;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fffdf1;
  padding: 0 12px;
  font-weight: 850;
}

.dev-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--stone-dark);
  color: #fffdf1;
  box-shadow: 0 5px 0 var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.dev-fab[aria-expanded="true"] {
  background: var(--gold);
  color: var(--ink);
}

.ghost-button,
.icon-button,
.primary-button,
.channel-tab,
.release-button,
.release-link {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 950;
}

.ghost-button,
.icon-button {
  border: 2px solid var(--ink);
  background: #fffdf1;
  color: var(--ink);
  cursor: pointer;
}

.ghost-button {
  padding: 0 14px;
}

.ghost-button:hover,
.icon-button:hover:not(:disabled),
.channel-tab:hover {
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(380px, 0.78fr) minmax(520px, 1.22fr);
  align-items: end;
  gap: 26px;
  padding: 18px 0 16px;
}

.hero-copy {
  min-width: 0;
  padding-bottom: 42px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "WildGag", "PretendardLocal", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
}

h1 {
  max-width: 660px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 4.8vw, 4.72rem);
  line-height: 0.92;
  letter-spacing: 0;
  -webkit-text-stroke: 1.5px #fffdf1;
  paint-order: stroke fill;
  text-shadow:
    2px 0 0 #fffdf1,
    -2px 0 0 #fffdf1,
    0 2px 0 #fffdf1,
    0 -2px 0 #fffdf1,
    3px 5px 0 rgba(21, 22, 17, 0.12);
}

h1 span {
  display: block;
  white-space: nowrap;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  max-width: 600px;
  margin-bottom: 22px;
  color: #3c4138;
  font-size: clamp(1.04rem, 1.55vw, 1.24rem);
  font-weight: 800;
  line-height: 1.55;
}

.channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.channel-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border: 2px solid var(--ink);
  background: #fffdf1;
  box-shadow: 0 5px 0 var(--ink);
  text-decoration: none;
}

.channel-tab.active {
  background: var(--gold);
}

.channel-tab.locked {
  color: var(--muted);
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: end;
  min-width: 0;
  min-height: 320px;
}

.moai-stage {
  position: relative;
  width: min(100%, 620px);
  height: 330px;
  overflow: hidden;
}

.platform {
  position: absolute;
  left: 34px;
  right: 28px;
  bottom: 30px;
  height: 54px;
  border: 5px solid var(--ink);
  border-top-color: var(--grass);
  background: #855022;
  box-shadow: 10px 10px 0 rgba(21, 22, 17, 0.14);
}

.dust-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.moai {
  position: absolute;
  z-index: 2;
  width: 72px;
  height: 72px;
  left: 0;
  top: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}

.hero-moai-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dust {
  position: absolute;
  width: var(--s);
  height: var(--s);
  border: 2px solid rgba(20, 20, 18, var(--a));
  background: rgba(175, 160, 120, var(--a));
  clip-path: polygon(50% 0%, 90% 22%, 100% 60%, 68% 100%, 24% 86%, 0% 42%);
  transform: translate(-50%, -50%) rotate(var(--r));
}

.build-board {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr) minmax(270px, 330px);
  gap: 18px;
  align-items: start;
  margin-top: -4px;
}

.latest-panel,
.release-section,
.guide-section,
.notepad-section {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 253, 241, 0.94);
  box-shadow: var(--shadow);
}

.latest-panel,
.release-section,
.guide-section,
.notepad-section {
  padding: 22px;
}

.notepad-section {
  margin: 0 0 18px;
}

.notepad-section[hidden] {
  display: none;
}

.status-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 950;
  white-space: nowrap;
}

.tag-pill {
  background: #e5efc5;
}

.notepad-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #d7efe8;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.notepad-status.saving {
  background: var(--paper-strong);
}

.notepad-status.error {
  background: #ffd8d0;
  color: #8b251f;
}

.shared-notepad {
  display: block;
  width: 100%;
  min-height: 250px;
  max-height: 62vh;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  background: #fffdf1;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  box-shadow: inset 0 5px 0 rgba(21, 22, 17, 0.06);
}

.shared-notepad:focus {
  box-shadow:
    inset 0 5px 0 rgba(21, 22, 17, 0.06),
    0 0 0 3px rgba(22, 133, 138, 0.18);
}

.notepad-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.ghost-button.compact {
  min-height: 38px;
  padding: 0 12px;
}

.tag-pill.dev {
  background: #d8eff1;
}

.muted,
.microcopy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.version-name {
  font-family: "PretendardLocal", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  margin-bottom: 18px;
  color: var(--earth-dark);
  font-size: clamp(1.8rem, 3.4vw, 2.55rem);
  font-weight: 950;
  line-height: 1;
  overflow-wrap: anywhere;
}

.build-meta {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}

.build-meta div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.build-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.build-meta dd {
  min-width: 0;
  margin: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.button-row,
.release-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex: 1 1 180px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 18px;
  border: 2px solid var(--ink);
  background: linear-gradient(90deg, #ff6148 0%, var(--red) 24%, #d43b2c 76%, #b9271f 100%);
  color: #fff;
  box-shadow:
    0 6px 0 var(--ink),
    0 0 0 0 rgba(255, 199, 58, 0),
    0 13px 26px rgba(226, 71, 49, 0.22);
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(21, 22, 17, 0.45);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
  animation: download-breathe 2.8s ease-in-out infinite;
}

.primary-button::before,
.primary-button::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.primary-button::before {
  inset: 0;
  background: transparent;
  box-shadow:
    inset 18px 0 24px rgba(255, 239, 158, 0.32),
    inset -18px 0 24px rgba(255, 199, 58, 0.24);
  mix-blend-mode: screen;
  opacity: 0.7;
  animation: download-edge-glow 2.9s ease-in-out infinite;
}

.primary-button::after {
  inset: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow:
    inset 0 8px 10px rgba(255, 241, 167, 0.1),
    inset 0 -8px 10px rgba(77, 14, 10, 0.12);
  opacity: 0.58;
}

.primary-button:hover {
  filter: saturate(1.08) brightness(1.04);
  transform: translateY(-3px);
  box-shadow:
    0 9px 0 var(--ink),
    0 0 0 5px rgba(255, 199, 58, 0.2),
    0 17px 34px rgba(226, 71, 49, 0.3);
}

.primary-button:active {
  transform: translateY(2px) scale(0.985);
  box-shadow:
    0 2px 0 var(--ink),
    0 0 0 8px rgba(255, 199, 58, 0.18),
    0 8px 18px rgba(226, 71, 49, 0.24);
}

.primary-button.disabled,
.primary-button[aria-disabled="true"] {
  pointer-events: none;
  background: #9b9b91;
  animation: none;
  box-shadow: none;
}

.primary-button.disabled::before,
.primary-button.disabled::after,
.primary-button[aria-disabled="true"]::before,
.primary-button[aria-disabled="true"]::after {
  display: none;
}

.download-spark {
  position: fixed;
  left: var(--x);
  top: var(--y);
  z-index: 1000;
  width: var(--s);
  height: var(--s);
  border: 2px solid rgba(21, 22, 17, 0.72);
  border-radius: 2px;
  background: var(--c);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--r));
  animation: download-spark 520ms cubic-bezier(0.18, 0.78, 0.22, 1) forwards;
}

@keyframes download-breathe {
  0%,
  100% {
    box-shadow:
      0 6px 0 var(--ink),
      0 0 0 0 rgba(255, 199, 58, 0),
      0 13px 26px rgba(226, 71, 49, 0.22);
  }

  50% {
    box-shadow:
      0 6px 0 var(--ink),
      0 0 0 5px rgba(255, 199, 58, 0.16),
      0 16px 32px rgba(226, 71, 49, 0.28);
  }
}

@keyframes download-edge-glow {
  0%,
  100% {
    opacity: 0.58;
    transform: scaleX(1);
  }

  50% {
    opacity: 0.92;
    transform: scaleX(1.035);
  }
}

@keyframes download-spark {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.9) rotate(var(--r));
  }

  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(0.22)
      rotate(calc(var(--r) + 150deg));
  }
}

.icon-button {
  min-width: 72px;
  padding: 0 14px;
}

.icon-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.microcopy {
  min-height: 40px;
  margin: 16px 0 0;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2,
.guide-section h2 {
  margin-bottom: 0;
}

.release-list {
  display: grid;
  gap: 12px;
}

.release-item {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--line);
  border-left: 8px solid var(--grass-dark);
  border-radius: 8px;
  background: #fffdf1;
}

.release-item.latest {
  border-left-color: var(--red);
}

.release-title {
  min-width: 0;
}

.release-title h3 {
  font-family: "PretendardLocal", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  margin: 0 0 6px;
  font-size: 1.1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.release-title p {
  margin: 0;
}

.release-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.data-box {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff7cf;
}

.data-box span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.data-box strong {
  display: block;
  min-width: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.release-button,
.release-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.release-button {
  padding: 0 14px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.release-link {
  color: var(--teal);
}

.release-link:hover {
  text-decoration: underline;
}

.guide-art {
  width: min(154px, 56%);
  height: auto;
  margin: 4px auto 16px;
  filter: drop-shadow(0 10px 0 rgba(21, 22, 17, 0.1));
}

.guide-copy {
  margin: 0 0 18px;
  color: #3c4138;
  font-weight: 820;
  line-height: 1.5;
}

.empty-state,
.error-state {
  padding: 20px;
  border: 2px dashed rgba(21, 22, 17, 0.25);
  border-radius: 8px;
  background: rgba(255, 253, 241, 0.74);
  color: var(--muted);
  font-weight: 850;
}

.error-state {
  color: #8f271d;
}

.site-footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  padding: 14px 16px;
  border: 2px solid var(--red);
  border-radius: 8px;
  background: #fffdf1;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 850;
}

@media (max-width: 1080px) {
  .build-board {
    grid-template-columns: 1fr;
  }

  .site-header {
    min-height: 98px;
  }

  .brand {
    width: min(170px, 38vw);
  }

  .hero {
    position: relative;
    display: block;
    min-height: 246px;
    padding: 8px 0 10px;
  }

  .hero-copy {
    max-width: 390px;
    padding-bottom: 0;
  }

  h1 {
    max-width: 430px;
    margin-bottom: 12px;
    font-size: clamp(3rem, 6.5vw, 4rem);
  }

  .lead {
    margin-bottom: 16px;
  }

  .hero-art {
    position: absolute;
    top: -6px;
    right: 0;
    display: block;
    width: min(47vw, 440px);
    min-height: 236px;
    height: 236px;
    overflow: hidden;
  }

  .moai-stage {
    position: absolute;
    top: 0;
    right: 0;
    width: 620px;
    height: 330px;
    transform: scale(0.68);
    transform-origin: top right;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 16px, 700px);
    padding-top: 8px;
  }

  .site-footer,
  .panel-heading,
  .section-heading,
  .release-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    min-height: 0;
    margin-bottom: 4px;
  }

  .brand {
    width: min(142px, 42vw);
  }

  .dev-gate {
    right: 10px;
    bottom: 66px;
    width: min(calc(100% - 20px), 320px);
  }

  .dev-gate > * {
    min-width: 0;
  }

  .dev-gate label {
    grid-column: auto;
  }

  .dev-gate input {
    width: 100%;
    max-width: 100%;
  }

  .dev-gate .ghost-button {
    width: 100%;
  }

  .dev-fab {
    right: 12px;
    bottom: 12px;
    width: 52px;
    height: 52px;
  }

  .hero {
    min-height: auto;
    padding: 4px 0 10px;
  }

  .hero-copy .eyebrow {
    margin-bottom: 6px;
    font-size: 0.68rem;
  }

  h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 9.4vw, 2.5rem);
    line-height: 0.95;
    -webkit-text-stroke-width: 1px;
    text-shadow:
      1.5px 0 0 #fffdf1,
      -1.5px 0 0 #fffdf1,
      0 1.5px 0 #fffdf1,
      0 -1.5px 0 #fffdf1,
      2px 3px 0 rgba(21, 22, 17, 0.12);
  }

  .lead {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .channel-tabs {
    gap: 8px;
  }

  .channel-tab {
    min-width: 92px;
    min-height: 38px;
  }

  .hero-art {
    position: absolute;
    top: -124px;
    right: -8px;
    left: auto;
    display: block;
    width: min(246px, calc(100vw - 154px));
    min-height: 160px;
    height: 160px;
    overflow: hidden;
  }

  .moai-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 560px;
    height: 330px;
    transform: scale(0.4);
    transform-origin: top left;
  }

  .moai-stage .platform {
    left: 18px;
    right: 18px;
  }

  .latest-panel,
  .notepad-section,
  .release-section,
  .guide-section {
    padding: 18px;
  }

  .version-name {
    font-size: clamp(1.45rem, 8.2vw, 2rem);
    line-height: 1.08;
  }

  #latest-sha {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .release-grid {
    grid-template-columns: 1fr;
  }

  .build-meta div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .button-row,
  .primary-button,
  .icon-button,
  .notepad-footer,
  .release-button,
  .release-link {
    width: 100%;
  }

  .notepad-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .release-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
