:root {
  --ink: #10251e;
  --ink-soft: #173229;
  --paper: #f7f3e9;
  --paper-muted: #d9d5ca;
  --line-dark: rgba(16, 37, 30, 0.22);
  --line-light: rgba(255, 255, 255, 0.28);
  --accent: #d8ff43;
  --contest-blue: #2855d9;
  --contest-coral: #ff735f;
  --contest-white: #fffdf7;
  --danger: #ff735f;
  --topbar-height: 78px;
}

html {
  color-scheme: light;
}

body {
  background: var(--ink);
  color: var(--contest-white);
}

body.lab-menu-open {
  overflow: hidden;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline-color: var(--contest-coral);
}

.skip-link {
  border: 2px solid var(--ink);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
}

.topbar {
  height: var(--topbar-height);
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.brand {
  width: clamp(190px, 17vw, 235px);
  flex: none;
}

.lab-wordmark {
  display: block;
  width: 100%;
  height: auto;
}

.lab-main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.lab-main-nav a {
  color: inherit;
  text-decoration: none;
}

.lab-main-nav a:not(.lab-nav-cta) {
  position: relative;
  padding: 28px 0;
}

.lab-main-nav a:not(.lab-nav-cta)::after {
  position: absolute;
  right: 0;
  bottom: 20px;
  left: 0;
  height: 2px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.lab-main-nav a:hover::after,
.lab-main-nav a.is-active::after {
  transform: scaleX(1);
}

.nav-beta,
.composer-beta {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--contest-coral);
  color: var(--contest-white);
  font-weight: 900;
  line-height: 1;
}

.nav-beta {
  margin-left: 4px;
  padding: 3px 6px 2px;
  font-size: 8px;
  letter-spacing: .1em;
  vertical-align: 2px;
}

.composer-beta {
  margin-left: 6px;
  padding: 4px 7px 3px;
  font-size: 8px;
  letter-spacing: .08em;
  vertical-align: 1px;
}

.lab-nav-cta {
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--contest-coral);
  color: var(--contest-white) !important;
}

.lab-nav-cta:hover {
  background: var(--ink);
}

.lab-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.lab-menu-button span {
  display: block;
  width: 25px;
  height: 2px;
  margin: 7px auto;
  background: currentColor;
  transition: transform 180ms ease;
}

.studio-shell {
  min-height: calc(100svh - var(--topbar-height));
  grid-template-columns: minmax(390px, 0.88fr) minmax(540px, 1.12fr);
}

.composer,
.output-stage {
  padding: clamp(30px, 3.6vw, 58px);
}

.composer {
  position: relative;
  overflow: hidden;
  border-right: 2px solid var(--ink);
  background: var(--paper);
}

.composer::before {
  position: absolute;
  top: 18%;
  left: -22%;
  width: 60%;
  aspect-ratio: 1;
  border: 1px solid rgba(40, 85, 217, 0.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.output-stage {
  position: relative;
  background: var(--contest-blue);
  color: var(--contest-white);
}

.output-stage::before {
  position: absolute;
  top: -16%;
  right: -12%;
  width: 54%;
  aspect-ratio: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: rotate(18deg);
}

.section-index,
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.section-index {
  color: var(--contest-blue);
}

.composer-heading {
  position: relative;
  z-index: 1;
  margin: clamp(26px, 4.4vh, 52px) 0 clamp(24px, 3.8vh, 44px);
}

.composer-heading .eyebrow {
  color: var(--contest-blue);
}

.composer-heading h1 {
  max-width: 650px;
  margin: 12px 0 16px;
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: clamp(52px, 5.4vw, 82px);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.96;
}

.composer-heading h1 span {
  color: var(--contest-coral);
}

.composer-heading > p:last-child {
  max-width: 470px;
  color: #4f6259;
  font-size: 13px;
  line-height: 1.7;
}

#generate-form {
  position: relative;
  z-index: 1;
}

#generate-form > label {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.prompt-field {
  border: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.7);
  box-shadow: 6px 6px 0 rgba(40, 85, 217, 0.16);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  min-height: 154px;
  padding: 17px 18px 34px;
  color: var(--ink);
  font-size: clamp(15px, 1.25vw, 18px);
}

textarea::placeholder {
  color: #8a978f;
}

.prompt-field:focus-within {
  border-color: var(--contest-blue);
  box-shadow: 7px 7px 0 var(--accent);
  transform: translate(-1px, -1px);
}

.char-count {
  right: 15px;
  color: #64756c;
}

.field-help {
  color: #64756c;
}

.field-error {
  color: #c93e2c;
}

.prompt-examples {
  gap: 8px;
  margin: 20px 0 28px;
}

.prompt-example-guide {
  width: 100%;
  margin: 0 0 2px;
  color: #64756c;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  letter-spacing: -0.015em;
  text-transform: none;
}

.prompt-example-guide strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.prompt-example-guide span {
  font-size: 12px;
  font-weight: 550;
}

.prompt-examples button {
  border: 1.5px solid var(--ink);
  padding: 8px 12px;
  background: var(--contest-white);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
}

.prompt-examples button:nth-of-type(1) {
  background: var(--accent);
}

.prompt-examples button:nth-of-type(2) {
  background: #efffb2;
}

.prompt-examples button:nth-of-type(3) {
  background: #dfe6ff;
}

.prompt-examples button:nth-of-type(4) {
  background: #ffd9d1;
}

.prompt-examples button:hover {
  background: var(--contest-coral);
  color: var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.submit-row {
  gap: 20px;
}

.fixed-options {
  color: var(--contest-blue);
  font-weight: 800;
}

.generate-button {
  min-width: 224px;
  border: 2px solid var(--ink);
  padding: 16px 18px 16px 20px;
  background: var(--accent);
  box-shadow: 6px 6px 0 var(--ink);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.generate-button:hover:not(:disabled) {
  background: var(--contest-coral);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  transform: translate(4px, 4px);
}

.generate-button:disabled {
  background: var(--paper-muted);
  opacity: 0.75;
}

.stage-topline {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.stage-topline h2 {
  margin-top: 8px;
  color: var(--contest-white);
  font-size: 22px;
  font-weight: 900;
}

.output-stage .section-index,
.elapsed-time {
  color: rgba(255, 255, 255, 0.72);
}

.stage-canvas {
  min-height: 400px;
  border: 3px solid var(--ink);
  background: var(--accent);
  box-shadow: 10px 10px 0 var(--ink);
  isolation: isolate;
  transition: background 360ms ease;
}

.stage-canvas::after {
  display: none;
}

.stage-canvas[data-state="submitting"] {
  background: var(--contest-white);
}

.stage-canvas[data-state="queued"] {
  background: var(--accent);
}

.stage-canvas[data-state="running"] {
  background: var(--contest-coral);
}

.idle-art {
  overflow: hidden;
}

.idle-art p {
  position: relative;
  display: flex;
  width: min(45%, 340px);
  min-width: 210px;
  aspect-ratio: 0.82;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--contest-white);
  box-shadow: 12px 14px 0 rgba(16, 37, 30, 0.72);
  color: var(--contest-blue);
  font-family: Pretendard, "Noto Sans KR", sans-serif;
  font-style: normal;
  transform: rotate(-2deg);
}

.idle-art p > span {
  font-size: clamp(90px, 10vw, 150px);
  font-weight: 950;
  letter-spacing: -0.08em;
  line-height: 1;
}

.idle-art p small {
  position: absolute;
  right: 4%;
  bottom: 8%;
  border: 2px solid var(--ink);
  padding: 5px 8px;
  background: var(--contest-blue);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--contest-white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: rotate(-6deg);
}

.target-ring-large {
  width: min(72%, 560px);
  height: 82%;
  border: 2px dashed rgba(40, 85, 217, 0.34);
  border-radius: 48%;
  transform: rotate(8deg);
}

.target-ring-small {
  top: auto;
  bottom: 10%;
  width: min(34%, 280px);
  height: 7%;
  border: 0;
  background: rgba(16, 37, 30, 0.4);
  filter: blur(9px);
  transform: rotate(-2deg);
}

.crosshair {
  display: none;
}

.idea-sticker {
  position: absolute;
  z-index: 3;
  border: 2px solid var(--ink);
  padding: 7px 10px;
  background: var(--contest-white);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  animation: sticker-float 4.6s ease-in-out infinite;
}

.idea-sticker-left {
  top: 18%;
  left: 8%;
  transform: rotate(-7deg);
}

.idea-sticker-right {
  right: 7%;
  bottom: 19%;
  background: var(--contest-coral);
  transform: rotate(7deg);
  animation-delay: -2.2s;
}

.working-view {
  color: var(--ink);
}

.queue-figure > span {
  color: var(--contest-blue);
  font-family: Pretendard, "Noto Sans KR", sans-serif;
  font-size: clamp(90px, 13vw, 190px);
  font-style: normal;
  font-weight: 950;
}

.queue-figure small {
  color: rgba(16, 37, 30, 0.62);
  font-weight: 800;
}

.working-copy .eyebrow {
  color: var(--contest-blue);
}

.working-copy h3,
.error-view h3 {
  color: var(--ink);
  font-weight: 950;
}

.working-copy > p:last-child,
.error-view > p:not(.eyebrow) {
  color: rgba(16, 37, 30, 0.72);
}

.scan-line {
  height: 4px;
  background: var(--contest-blue);
  box-shadow: 0 0 20px rgba(40, 85, 217, 0.5);
}

.result-view {
  inset: 14px;
  border: 3px solid var(--ink);
  background: var(--contest-white);
  box-shadow: 7px 7px 0 rgba(16, 37, 30, 0.72);
}

.result-view img {
  background: var(--contest-white);
}

.error-view {
  background: var(--contest-coral);
  color: var(--ink);
}

.error-view > span,
.error-view .eyebrow {
  color: var(--ink);
}

.error-view button {
  border: 2px solid var(--ink);
  padding: 9px 12px;
  background: var(--contest-white);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-weight: 800;
}

.queue-progress {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.progress-track span {
  background: var(--accent);
}

.queue-progress li {
  color: rgba(255, 255, 255, 0.48);
  font-weight: 650;
}

.queue-progress li.is-active,
.queue-progress li.is-done {
  color: var(--contest-white);
}

.queue-progress li.is-active {
  color: var(--accent);
}

.result-actions {
  position: relative;
  z-index: 1;
}

.result-actions p {
  color: rgba(255, 255, 255, 0.68);
}

.result-actions button,
.result-actions a {
  color: var(--contest-white);
  font-weight: 750;
}

.lab-main-nav {
  font-size: 15px;
}

.section-index,
.eyebrow {
  font-size: 12px;
}

.composer-heading > p:last-child {
  font-size: 15px;
}

#generate-form > label {
  font-size: 14px;
}

textarea {
  font-size: clamp(17px, 1.35vw, 20px);
}

.char-count,
.field-help,
.field-error {
  font-size: 13px;
}

.prompt-examples button {
  font-size: 12px;
}

.fixed-options {
  font-size: 11px;
}

.generate-button {
  font-size: 15px;
}

.stage-topline h2 {
  font-size: 26px;
}

.working-copy > p:last-child,
.error-view > p:not(.eyebrow) {
  font-size: 15px;
}

.error-view button,
.result-actions button,
.result-actions a {
  font-size: 13px;
}

.queue-progress li {
  font-size: 12px;
}

.queue-progress li span {
  font-size: 10px;
}

.result-actions p {
  font-size: 12px;
}

.result-actions .ai-warning {
  color: rgba(255, 255, 255, 0.84);
}

.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--ink);
  color: rgba(255, 253, 247, 0.62);
}

@keyframes sticker-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

@media (min-width: 981px) and (min-height: 760px) {
  .site-footer {
    display: none;
  }
}

@media (max-width: 1180px) {
  .studio-shell {
    grid-template-columns: minmax(360px, 0.92fr) minmax(500px, 1.08fr);
  }

  .composer,
  .output-stage {
    padding: 34px;
  }

  .composer-heading h1 {
    font-size: clamp(50px, 5.8vw, 72px);
  }
}

@media (max-width: 980px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .composer {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .composer-heading h1 {
    max-width: none;
    font-size: clamp(56px, 11vw, 84px);
  }

  .stage-canvas {
    min-height: min(74vw, 680px);
  }
}

@media (max-width: 820px) {
  .topbar {
    position: sticky;
    top: 0;
    padding-inline: 20px;
  }

  .brand {
    width: 184px;
  }

  .lab-menu-button {
    display: block;
  }

  .lab-main-nav {
    position: fixed;
    z-index: 9;
    inset: var(--topbar-height) 0 auto;
    display: flex;
    height: calc(100svh - var(--topbar-height));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 30px 22px;
    background: var(--paper);
    color: var(--ink);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .lab-menu-open .lab-main-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .lab-main-nav a:not(.lab-nav-cta) {
    border-bottom: 1px solid var(--line-dark);
    padding: 22px 4px;
    font-size: 22px;
  }

  .lab-main-nav a:not(.lab-nav-cta)::after {
    display: none;
  }

  .lab-nav-cta {
    margin-top: 25px;
    border-radius: 5px;
    padding: 18px;
    text-align: center;
  }

  .lab-menu-open .lab-menu-button span:first-child {
    transform: translateY(4.5px) rotate(45deg);
  }

  .lab-menu-open .lab-menu-button span:last-child {
    transform: translateY(-4.5px) rotate(-45deg);
  }
}

@media (max-width: 620px) {
  :root {
    --topbar-height: 68px;
  }

  .topbar {
    padding-inline: 16px;
  }

  .brand {
    width: 178px;
  }

  .composer,
  .output-stage {
    padding: 28px 18px 36px;
  }

  .composer-heading {
    margin: 38px 0 34px;
  }

  .composer-heading h1 {
    font-size: clamp(50px, 15vw, 66px);
  }

  .composer-heading > p:last-child {
    font-size: 14px;
  }

  textarea {
    min-height: 180px;
    padding-inline: 14px;
  }

  .prompt-examples button {
    padding: 9px 10px;
  }

  .generate-button {
    width: calc(100% - 6px);
  }

  .stage-canvas {
    min-height: 118vw;
    box-shadow: 7px 7px 0 var(--ink);
  }

  .idle-art p {
    width: 57%;
    min-width: 0;
  }

  .target-ring-large {
    width: 82%;
  }

  .idea-sticker-left {
    top: 13%;
    left: 4%;
  }

  .idea-sticker-right {
    right: 3%;
    bottom: 15%;
  }

  .result-view {
    inset: 8px;
    box-shadow: 4px 4px 0 rgba(16, 37, 30, 0.72);
  }

  .queue-figure > span {
    font-size: 29vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .idea-sticker {
    animation: none;
  }
}
