@font-face {
  font-family: Pretendard;
  src: url(/fonts/PretendardVariable.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --paper: #f4f6f5;
  --ink: #142d35;
  --muted: #455e63;
  --stage: #eaf1f1;
  --rule: #c7d2cf;
  --peach: #ffa477;
  --selected: #fff0e8;
  --rust: #903c23;
  font:
    100%/1.5 Pretendard,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
}
button,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #276489;
  outline-offset: 3px;
}
.shell {
  width: min(1280px, calc(100% - 96px));
  margin-inline: auto;
}
html {
  scroll-padding-top: 90px;
}
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.top,
.foot,
.actions,
.controls,
.languages,
.bench-head,
.countries,
.countries > div {
  display: flex;
  align-items: center;
}
.top {
  gap: 24px;
  min-height: 78px;
}
.top img,
.foot img {
  display: block;
}
.top nav {
  display: flex;
  gap: 26px;
  margin-left: 32px;
  font-weight: 650;
}
.top a,
.actions a,
.foot a {
  text-decoration: none;
}
.top nav a:hover,
.foot a:hover,
.store[href]:hover {
  text-decoration: underline;
}
.languages {
  margin-left: auto;
  gap: 2px;
  color: #586a6c;
  font-size: 14px;
}
.languages button {
  padding: 5px;
  border: 0;
  background: none;
  color: inherit;
}
.languages button[aria-pressed="true"] {
  font-weight: 850;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn,
.store {
  font-weight: 700;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 18px;
}
.ink,
footer {
  background: var(--ink);
  color: white;
}
.apricot,
.controls #run,
.controls #compile {
  background: var(--peach);
  color: #304952;
}
.apricot {
  box-shadow: 0 2px 0 #91624b;
}
.hero {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: clamp(26px, 4vw, 68px);
  align-items: center;
  padding-block: clamp(44px, 6vw, 90px);
}
.lead,
.bench {
  min-width: 0;
}
.lead .meta {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.055em;
}
.meta:before {
  content: "";
  width: 27px;
  height: 3px;
  background: #dc6a3d;
}
.lead h1 {
  font-size: clamp(38px, 4.45vw, 67px);
  line-height: 1.14;
  font-weight: 770;
  letter-spacing: -0.065em;
  margin: 22px 0;
  word-break: keep-all;
  text-wrap: balance;
}
.lead h1 span {
  display: block;
}
.lead h1 span:last-child {
  color: #924529;
}
.lead p {
  max-width: 36ch;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 21px);
  word-break: keep-all;
  margin: 0 0 27px;
}
.actions {
  flex-wrap: wrap;
  gap: 16px;
}
.store {
  font-size: 15px;
  border-bottom: 1px solid #899b99;
  padding-block: 5px;
}
.bench {
  background: white;
  border: 1px solid #aabab8;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 6px 0 #d5deda,
    0 17px 34px -24px #35505b;
}
.bench-head {
  background: #203c43;
  color: white;
  padding: 13px 19px;
  gap: 9px;
}
.hex {
  width: 14px;
  height: 14px;
  border: 3px solid #ffab80;
  transform: rotate(45deg);
  border-radius: 3px;
}
.bench-head small {
  margin-left: auto;
  font: 600 13px monospace;
  color: #d0e0dd;
}
.tabs {
  display: flex;
  padding: 8px;
  background: #fcfdfc;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
}
.tabs button,
.controls button,
.controls select,
.microboard button {
  border: 1px solid var(--rule);
  background: white;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 650;
  font-size: 14px;
}
.tabs button {
  flex: 1;
  border: 1px solid transparent;
}
.tabs button[aria-selected="true"] {
  color: var(--rust);
  background: var(--selected);
  border-color: #e4b8a1;
}
.stage,
.micro-stage {
  background-color: var(--stage);
  background-image: radial-gradient(#afc0bd 1px, transparent 1px);
  background-size: 14px 14px;
  border-block: 1px solid var(--rule);
}
.circuit {
  width: 100%;
  height: clamp(220px, 20.5vw, 318px);
  display: block;
}
.stage.off .lamp {
  fill: #b46c52;
}
.stage.off .led-glow {
  opacity: 0;
}
.controls {
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 16px;
}
.controls select {
  margin-left: auto;
}
.controls button:active {
  transform: translateY(1px);
}
.terminal {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #21383f;
  color: #e5f1ed;
  font: 13px/1.6 monospace;
  padding: 10px 16px;
}
.terminal b {
  color: #ffc39d;
  letter-spacing: 0.08em;
}
.terminal output {
  white-space: pre-line;
}
.micro-stage {
  display: grid;
  place-items: center;
  min-height: 236px;
  padding: 15px;
}
.microboard {
  width: min(270px, 100%);
  background: #26323a;
  border: 7px solid #3b4250;
  border-radius: 16px;
  padding: 9px 12px 0;
  color: #f1f5ee;
}
.microboard > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.microboard button {
  padding: 5px 10px;
  color: var(--ink);
}
#matrix {
  display: grid;
  grid-template-columns: repeat(5, 10px);
  gap: 4px;
  padding: 10px;
}
#matrix i {
  height: 10px;
  background: #524c4d;
}
#matrix i.on {
  background: #ff895e;
  box-shadow: 0 0 5px #fd9e57;
}
.contacts {
  margin-top: 6px;
  background: #dfba60;
  color: #352e1e;
  padding: 4px 10px;
  font: 700 13px monospace;
}
.status,
#previewText {
  margin: 0;
  padding: 7px 16px;
  display: block;
}
#previewText {
  background: var(--stage);
  white-space: pre-wrap;
}
.codebox {
  padding: 18px;
}
.codebox label {
  font-weight: 700;
}
.codebox textarea {
  display: block;
  width: 100%;
  height: 180px;
  margin-top: 10px;
  border: 0;
  border-radius: 6px;
  background: #21383f;
  color: #f0f6ee;
  padding: 12px;
  font: 14px/1.45 monospace;
  resize: vertical;
}
.codebox .controls {
  padding-inline: 0;
}
.codebox output {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 8em;
  overflow: auto;
}
.codebox p {
  color: var(--muted);
}
#pin {
  margin-left: auto;
}
.section {
  border-top: 1px solid var(--rule);
  padding-block: 52px;
}
.section h2,
#download h2 {
  font-size: clamp(29px, 3vw, 46px);
  letter-spacing: -0.055em;
  line-height: 1.18;
  margin: 0 0 28px;
  text-wrap: balance;
}
.section h3 {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 9px;
  letter-spacing: -0.04em;
}
.section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  word-break: keep-all;
}
.section > p {
  margin-top: 20px;
}
.flow,
.learning {
  display: grid;
  gap: 14px;
}
.flow {
  grid-template-columns: repeat(4, 1fr);
  counter-reset: steps;
}
.flow article,
.learning article {
  padding: 22px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.flow article:before {
  counter-increment: steps;
  content: counter(steps, decimal-leading-zero);
  display: block;
  font: 600 14px monospace;
  color: var(--rust);
  margin-bottom: 24px;
}
.board-mark {
  font: 700 24px monospace;
  width: fit-content;
  color: #e6f5ec;
  background: #275b61;
  border: 4px dotted #94b4ad;
  border-radius: 7px;
  padding: 4px 12px;
  margin-bottom: 18px;
}
.learning {
  grid-template-columns: 1fr 1fr;
}
.learning article {
  border-top: 3px solid #ef9b70;
}
.countries {
  gap: 14px 28px;
  flex-wrap: wrap;
}
.countries > div {
  gap: 8px;
}
.countries svg {
  width: 31px;
  height: 31px;
}
#download {
  padding: 56px 0;
  background: #dfebe7;
}
footer {
  padding: 30px 0;
}
.foot {
  flex-wrap: wrap;
  gap: 20px;
}
.foot > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-left: auto;
}
.foot small {
  color: #cfdbd9;
}
@media (max-width: 950px) {
  .shell {
    width: calc(100% - 48px);
  }
  .hero {
    grid-template-columns: 1fr 1.08fr;
    gap: 22px;
  }
  .top {
    gap: 15px;
  }
  .top nav {
    gap: 16px;
    margin-left: 0;
  }
  .flow {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: 35px;
  }
  .top {
    gap: 11px;
    flex-wrap: wrap;
    padding-block: 10px;
  }
  .top img {
    width: 72px;
    height: auto;
  }
  .top nav {
    order: 1;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--rule);
    padding-top: 8px;
    font-size: 14px;
  }
  .topdownload {
    font-size: 13px;
  }
  .topdownload {
    padding: 6px 9px;
    min-height: 34px;
  }
  .shell {
    width: calc(100% - 32px);
  }
  .lead h1 {
    font-size: clamp(37px, 7.7vw, 54px);
    margin: 14px 0;
  }
  .lead p {
    margin-bottom: 16px;
  }
  .actions {
    gap: 12px;
  }
  .circuit {
    height: auto;
  }
  .section {
    padding-block: 36px;
  }
  .section h2 {
    margin-bottom: 20px;
  }
  .flow article,
  .learning article {
    padding: 16px;
  }
  .learning {
    grid-template-columns: 1fr;
  }
  .foot > div {
    margin: 0;
  }
  .tabs button {
    font-size: 13px;
    padding: 7px 4px;
  }
  .controls {
    padding: 9px;
    gap: 5px;
  }
  .controls button,
  .controls select {
    padding: 6px;
    font-size: 13px;
  }
}

[hidden] {
  display: none !important;
}
.is-soon {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: #fff;
  font-size: 0.9rem;
}
.qr-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
.qr-card img {
  display: block;
  border-radius: 5px;
  background: white;
}
.lead .qr-card {
  margin-top: 18px;
}
.lead .qr-card img {
  border: 1px solid var(--rule);
}
.play {
  text-decoration: none;
  gap: 9px;
}
.play:before {
  content: "";
  width: 13px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.store-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  background: white;
  border: 1px solid var(--rule);
  padding: 20px;
  border-radius: 14px;
}
.store-card .qr-card {
  flex-direction: column;
  font-size: 0.8rem;
}
.store-card .is-soon {
  border: 0;
  padding: 0;
  font-size: 1rem;
}
.download-grid,
.activities-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.preset-bar,
.view-row,
.light-control,
.puzzle-select,
.choices,
.board-tabs {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.preset-bar,
.view-row,
.light-control {
  padding: 10px 16px;
}
.preset-bar {
  background: #f4f7f6;
  border-bottom: 1px solid var(--rule);
}
.preset-bar b {
  font: 700 13px monospace;
  color: var(--rust);
}
.preset-bar button,
.view-row button,
.shake,
.puzzle-select button,
.choices button,
#puzzleNext,
.board-tabs button {
  border: 1px solid #b4c3bd;
  background: white;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 7px 10px;
}
button[aria-pressed="true"]:is(
    [data-preset],
    [data-example],
    [data-puzzle],
    [data-board],
    #unoView
  ),
.choices button[aria-pressed="true"],
.board-tabs [aria-selected="true"] {
  color: var(--rust);
  background: var(--selected);
  border-color: #ad7455;
}
.view-row {
  justify-content: space-between;
  font-size: 0.92rem;
}
.view-row button {
  color: var(--rust);
}
.light-control {
  justify-content: space-between;
  font-size: 0.92rem;
}
.light-control input {
  flex: 1;
  accent-color: #97532e;
  min-width: 64px;
}
.sketch-preview {
  background: var(--stage);
  padding: 12px 16px;
}
.sketch-preview p {
  font-weight: 700;
  margin: 0 0 8px;
}
.sketch-preview pre,
#previewText {
  overflow: auto;
  max-width: 100%;
  font-size: 0.86rem;
}
.terminal {
  flex-wrap: wrap;
}
.upload-result:has(#uploadStatus:not(:empty)) {
  padding: 12px 16px;
}
.inline-download {
  color: #863c25;
  font-weight: 700;
  text-underline-offset: 3px;
  display: block;
  margin: 10px 0 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
#microDownload {
  margin: 0;
  padding: 0 16px 12px;
}
.shake {
  margin: 0 16px 10px;
}
.codebox .preset-bar {
  padding: 0 0 10px;
  margin-bottom: 12px;
  background: transparent;
}
#pin {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font: 600 0.8rem monospace;
}
.pin-lamp {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #778781;
  border: 1px solid #334d45;
}
.pin-lamp.on {
  background: #ffaa4c;
  box-shadow: 0 0 8px #e68a2c;
}
.activity-card,
#boardPreview {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: clamp(18px, 2.3vw, 32px);
}
.activity-card {
  min-width: 0;
}
.activity-card h3 {
  margin-bottom: 14px;
}
.puzzle-diagram,
.signal-stage {
  width: 100%;
  background-color: var(--stage);
  background-image: radial-gradient(#aec2bb 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: 9px;
  margin: 14px 0;
}
.puzzle-diagram {
  height: 105px;
  display: block;
}
.puzzle-diagram .wire {
  fill: none;
  stroke: #345e57;
  stroke-width: 3;
}
.puzzle-diagram text {
  fill: white;
  font: 700 13px monospace;
}
.puzzle-diagram .bulb {
  fill: #9eaaa4;
  stroke: #65756e;
  stroke-width: 2;
}
.puzzle-diagram .gap {
  fill: #fff0e8;
  stroke: var(--rust);
}
.puzzle-diagram .gap-text {
  text-anchor: middle;
  fill: var(--rust);
}
.puzzle-diagram .missing,
.solved :is(.gap, .gap-text) {
  visibility: hidden;
}
.solved .bulb {
  fill: #f79b42;
  animation: ignite 0.5s ease-out;
}
@keyframes ignite {
  from {
    fill: #fff2bd;
  }
}
.choices,
.mission-inputs {
  margin: 12px 0;
}
.choices button {
  text-align: left;
}
.activity-card #puzzleQuestion {
  color: var(--ink);
  font-weight: 650;
}
.activity-card :is(#puzzleResult, #missionResult):not(:empty) {
  margin-top: 12px;
  font-weight: 700;
  color: #225d44;
}
.activity-card :is(#puzzleResult, #missionResult).warning {
  color: #913b25;
}
#puzzleNext {
  margin-top: 8px;
}
.signal-stage {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.signal-case {
  display: flex;
  gap: 7px;
  background: #213b3e;
  border-radius: 12px;
  padding: 10px;
}
.signal-case i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #576969;
}
.signal-case i.on {
  background: #8be69b;
  box-shadow: 0 0 7px #83e496;
}
.mission-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mission-inputs label {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 80px;
  font-size: 0.86rem;
  font-weight: 650;
}
.mission-inputs select {
  padding: 6px;
  background: white;
  border: 1px solid #8b9d96;
  border-radius: 5px;
}
#judgeRun {
  border: 1px solid #c67d58;
}
#checks {
  padding: 0;
  list-style: none;
}
#checks:empty {
  margin: 0;
}
#checks li {
  font-size: 0.9rem;
}
.board-tabs {
  margin: 0 0 14px;
}
#boardPreview {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
#boardPreview .board-mark {
  flex: none;
  margin: 0;
}
#boardPreview ul {
  padding-left: 1.2em;
  margin: 8px 0;
}
@media (max-width: 760px) {
  html {
    scroll-padding-top: 108px;
  }
  .qr-card {
    display: none;
  }
  .activities-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }
  .store-card {
    padding: 16px;
  }
  #boardPreview {
    display: block;
  }
  #boardPreview .board-mark {
    display: inline-block;
    margin-bottom: 14px;
  }
  .preset-bar,
  .light-control,
  .view-row {
    padding: 8px 10px;
  }
  .preset-bar button {
    font-size: 0.81rem;
    padding: 6px;
  }
  .hero {
    gap: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .solved .bulb {
    animation: none;
  }
}

:lang(ko):is(h2, h3, button) {
  word-break: keep-all;
}
@media (min-width: 1000px) and (max-height: 650px) {
  .hero {
    padding-block: 22px;
  }
  .hero h1 {
    font-size: 48px;
  }
  .hero .circuit {
    height: 180px;
  }
  .lead .qr-card {
    margin-top: 10px;
  }
}
