:root {
  --ink: #e8eef6;
  --muted: #93a0b3;
  --dim: #6d7b8e;
  --line: rgba(190, 220, 255, 0.16);
  --cyan: #9ae7ff;
  --amber: #ffc48a;
  --panel: rgba(7, 9, 14, 0.72);
  --danger: #ffb4a8;
  color-scheme: dark;
  font-family: "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #06070b;
  color: var(--ink);
}

button, input { font: inherit; color: inherit; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

canvas { display: block; cursor: grab; }
canvas:active { cursor: grabbing; }

.hud {
  position: fixed;
  z-index: 2;
  pointer-events: none;
}

.hud > * { pointer-events: auto; }

.top {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  pointer-events: none;
}

.brand strong {
  font-family: Syne, "Segoe UI", sans-serif;
  font-size: 22px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.brand span,
.kicker,
.meta,
.stack li,
.hint {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pill, .preset, .src {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  border-radius: 2px;
}

.pill {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.pill:hover, .preset:hover, .src:hover { border-color: rgba(154, 231, 255, 0.45); }

.live {
  pointer-events: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--cyan);
  min-width: 148px;
  text-align: right;
}

.left, .right {
  position: fixed;
  z-index: 2;
  top: 74px;
  bottom: 92px;
  width: min(320px, calc(100vw - 28px));
  overflow: auto;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  border-radius: 2px;
}

.left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left { left: 14px; }
.right { right: 14px; width: min(230px, calc(100vw - 28px)); }

.left h2, .right h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.sources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.src {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.src b { font-size: 13px; font-weight: 600; }
.src i { grid-column: 2; font-style: normal; color: var(--dim); font-size: 11.5px; line-height: 1.4; }
.src .idx {
  grid-row: span 2;
  align-self: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--cyan);
}

.src.active {
  border-color: rgba(154, 231, 255, 0.7);
  box-shadow: inset 2px 0 0 var(--cyan);
}

.borrowed {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.borrowed p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.links { margin: 8px 0 0; padding: 0; list-style: none; }
.links li { margin: 4px 0; font-size: 12px; }

.right dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; }
.right dt { color: var(--dim); font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.08em; }
.right dd { margin: 0; font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }

.slider { margin-top: 16px; }
.slider label {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.slider input { width: 100%; margin-top: 8px; accent-color: #79d7f2; }

.stack { margin: 14px 0 0; padding: 0; list-style: none; }
.stack li { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

.bottom {
  position: fixed;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.presets { display: flex; gap: 8px; flex-wrap: wrap; }

.preset {
  padding: 10px 12px 9px;
  min-width: 108px;
  text-align: left;
  cursor: pointer;
}

.preset b { display: block; font-size: 13px; font-weight: 600; }
.preset span {
  display: block;
  margin-top: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--dim);
}

.preset.active {
  border-color: rgba(154, 231, 255, 0.75);
  color: white;
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.hint { pointer-events: none; text-align: right; }

#boot {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  background: #06070b;
  transition: opacity 0.5s ease;
}

#boot strong {
  font-family: Syne, sans-serif;
  letter-spacing: 0.18em;
  font-size: 28px;
}

#boot span {
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  font-size: 12px;
}

#boot.hide { opacity: 0; pointer-events: none; }
#boot.error span { color: var(--danger); }

body.clean .left,
body.clean .right { display: none; }

body[data-scene="product"] .brand strong,
body[data-scene="plan"] .brand strong,
body[data-scene="product"] .brand span,
body[data-scene="plan"] .brand span,
body[data-scene="product"] .hint,
body[data-scene="plan"] .hint {
  color: #2c2a27;
}

body[data-scene="product"] .live,
body[data-scene="plan"] .live {
  color: #1d6478;
}

@media (max-width: 980px) {
  .brand strong { font-size: 18px; letter-spacing: 0.12em; }
  .live { min-width: 0; }
  .right { display: none; }
  .left {
    top: auto;
    bottom: 118px;
    max-height: 32vh;
    width: auto;
    right: 14px;
  }
  .hint { display: none; }
  .preset { min-width: 0; }
}
