:root {
  --paper: #f6efdf;
  --paper-strong: rgba(255, 251, 244, 0.82);
  --paper-soft: rgba(255, 248, 238, 0.68);
  --ink: #231d18;
  --muted: #665a4f;
  --accent: #b95d16;
  --accent-strong: #8f4310;
  --accent-soft: rgba(239, 179, 120, 0.28);
  --blue-soft: rgba(103, 138, 209, 0.16);
  --line: rgba(71, 56, 39, 0.12);
  --shadow: 0 24px 70px rgba(76, 54, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(246, 171, 92, 0.36), transparent 26%),
    radial-gradient(circle at 92% 18%, rgba(118, 149, 222, 0.24), transparent 28%),
    linear-gradient(160deg, #efe4cf 0%, #f8f5ee 48%, #e6edf8 100%);
}

.halo {
  position: fixed;
  width: 34vw;
  height: 34vw;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(72px);
  opacity: 0.58;
}

.halo-left {
  top: -8vw;
  left: -10vw;
  background: rgba(230, 137, 53, 0.26);
}

.halo-right {
  right: -12vw;
  bottom: -14vw;
  background: rgba(88, 126, 214, 0.2);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 42px 20px 56px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.7fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 22px;
}

.eyebrow,
.panel-kicker,
.card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead-copy h1 {
  margin: 6px 0 0;
}

.title-main {
  display: block;
  font-family: "Iowan Old Style", "AppleMyungjo", serif;
  font-size: clamp(3.5rem, 8vw, 5.6rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
}

.title-sub {
  display: block;
  max-width: 760px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 500;
}

.lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.meta-pill,
.demo-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 244, 0.82);
  box-shadow: 0 12px 32px rgba(82, 57, 35, 0.08);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.demo-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.masthead-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.masthead-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 244, 0.78);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(82, 57, 35, 0.08);
}

.masthead-link:hover {
  border-color: rgba(185, 93, 22, 0.38);
  transform: translateY(-1px);
}

.masthead-link-primary {
  background: linear-gradient(135deg, #fff0d9, #ffdcb8);
  border-color: rgba(185, 93, 22, 0.38);
}

.demo-chip {
  cursor: pointer;
  padding: 11px 16px;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.demo-chip.is-active {
  border-color: rgba(185, 93, 22, 0.38);
  background: linear-gradient(135deg, #fff0d9, #ffdcb8);
}

.masthead-side {
  display: grid;
  gap: 14px;
}

.side-card {
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: var(--paper-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.side-card-accent {
  background:
    linear-gradient(135deg, rgba(255, 241, 219, 0.96), rgba(255, 249, 241, 0.9)),
    var(--paper-strong);
}

.side-card h2 {
  margin: 8px 0 10px;
  font-family: "Iowan Old Style", "AppleMyungjo", serif;
  font-size: 1.7rem;
  line-height: 1.08;
}

.side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.syntax-showcase {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.syntax-example,
.lede code {
  display: block;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px 12px;
  color: var(--accent-strong);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: keep-all;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
  gap: 20px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 28px;
  background: var(--paper-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.panel-editor {
  grid-column: 1;
}

.panel-output,
.panel-canvas {
  grid-column: 2;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  margin: 6px 0 0;
  font-family: "Iowan Old Style", "AppleMyungjo", serif;
  font-size: 1.78rem;
  line-height: 1.05;
}

.panel-summary,
.status-text {
  color: var(--muted);
}

.panel-summary {
  margin: 10px 0 16px;
  line-height: 1.72;
}

.status-text {
  margin: 0;
  max-width: 220px;
  text-align: right;
  line-height: 1.5;
}

.run-button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #d97b1d);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 12px 24px;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(185, 93, 22, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.run-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(185, 93, 22, 0.28);
}

#editor,
#output,
.canvas-info {
  width: 100%;
  border: 1px solid rgba(77, 58, 38, 0.12);
  border-radius: 20px;
  background: rgba(255, 254, 251, 0.92);
  color: #2a231d;
  font-size: 0.97rem;
  line-height: 1.72;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

#editor {
  min-height: 540px;
  resize: vertical;
  padding: 18px;
  font-size: 0.92rem;
  line-height: 1.58;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

#output,
.canvas-info {
  margin: 14px 0 0;
  padding: 18px;
  white-space: pre-wrap;
  overflow: auto;
}

#output {
  min-height: 540px;
}

.panel-canvas {
  display: flex;
  flex-direction: column;
}

.canvas-wrap {
  margin-top: 14px;
  padding: 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, #eef3ff, #f2f5ff);
  border: 1px solid rgba(70, 89, 139, 0.14);
}

#hanoiCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #f8f1dc;
}

.canvas-info {
  min-height: 104px;
  background: rgba(250, 247, 241, 0.95);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .masthead,
  .workspace {
    grid-template-columns: 1fr;
  }

  .panel-output,
  .panel-canvas {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 26px 14px 38px;
  }

  .panel,
  .side-card {
    padding: 18px;
    border-radius: 22px;
  }

  .panel-head {
    flex-direction: column;
  }

  .status-text {
    max-width: none;
    text-align: left;
  }

  #editor,
  #output {
    min-height: 360px;
  }

  .canvas-info {
    min-height: 96px;
  }
}
