:root {
  --bg: #fafafa;
  --card: #ffffff;
  --fg: #0f0f0f;
  --muted: #6a6a6a;
  --line: #e8e8e8;
  --topbar-bg: rgba(250, 250, 250, 0.92);
  --topbar-shadow: 0 0 0 rgba(0, 0, 0, 0);
  --input-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-fg: #111;
  --focus-ring: rgba(0, 0, 0, 0.04);
  --focus-border: #cfcfcf;
  --kbd-bg: #ffffff;
  --hover-bg: #ffffff;
  --soft-fg: #3a3a3a;
  --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

html[data-theme='dark'] {
  --bg: #0d0f12;
  --card: #12151a;
  --fg: #f2f4f8;
  --muted: rgba(242, 244, 248, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --topbar-bg: rgba(13, 15, 18, 0.78);
  --topbar-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --input-bg: rgba(18, 21, 26, 0.9);
  --btn-bg: rgba(18, 21, 26, 0.9);
  --btn-fg: #f2f4f8;
  --focus-ring: rgba(255, 255, 255, 0.06);
  --focus-border: rgba(255, 255, 255, 0.22);
  --kbd-bg: rgba(18, 21, 26, 0.9);
  --hover-bg: rgba(18, 21, 26, 0.9);
  --soft-fg: rgba(242, 244, 248, 0.74);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--topbar-shadow);
}

.topbar__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.brand__mark {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: inline-block;
}

.brand__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__tag {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.nav {
  display: inline-flex;
  gap: 14px;
  justify-content: center;
}

.nav__link {
  font-size: 13px;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav__link:hover {
  border-color: var(--line);
  color: var(--fg);
  background: var(--hover-bg);
}

.search {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.search__input {
  width: min(420px, 100%);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  outline: none;
  font-size: 13px;
}

.search__input:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.search__btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
}

.search__btn:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.app {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 18px;
}

.left,
.right {
  position: sticky;
  top: 74px;
  height: calc(100vh - 86px);
  overflow: auto;
  padding-bottom: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
}

.card__title {
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 13px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.ca {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.ca__label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.ca__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ca__value {
  flex: 1;
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca__copy {
  white-space: nowrap;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--soft-fg);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list__item {
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft-fg);
}

.list__item:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.feed {
  height: calc(100vh - 86px);
  overflow: auto;
  scroll-snap-type: y mandatory;
  border-radius: var(--radius);
}

.feed::-webkit-scrollbar {
  width: 10px;
}

.feed::-webkit-scrollbar-thumb {
  background: #e3e3e3;
  border-radius: 999px;
}

.feed__hint {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--kbd-bg);
}

.clip {
  scroll-snap-align: start;
  padding: 0;
  margin: 0 0 18px 0;
}

.clip__stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  height: 72vh;
  min-height: 540px;
}

.stage {
  position: absolute;
  inset: 0;
}

.stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(0.95) contrast(1.02);
}

.stage__grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.65;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.06), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(0, 0, 0, 0.05), transparent 40%),
    radial-gradient(circle at 40% 80%, rgba(0, 0, 0, 0.04), transparent 45%),
    linear-gradient(180deg, #ffffff, #f7f7f7);
}

html[data-theme='dark'] .stage__grid {
  opacity: 0.55;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 38%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.06), transparent 44%),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.05), transparent 50%),
    linear-gradient(180deg, rgba(18, 21, 26, 0.96), rgba(13, 15, 18, 0.96));
}

.stage--alt .stage__grid {
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 0, 0, 0.06), transparent 40%),
    radial-gradient(circle at 75% 60%, rgba(0, 0, 0, 0.05), transparent 42%),
    linear-gradient(180deg, #ffffff, #f6f6ff);
}

html[data-theme='dark'] .stage--alt .stage__grid {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08), transparent 42%),
    radial-gradient(circle at 75% 60%, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(180deg, rgba(18, 21, 26, 0.96), rgba(13, 15, 18, 0.96));
}

.stage--dark .stage__grid {
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.12), transparent 38%),
    radial-gradient(circle at 75% 60%, rgba(255, 255, 255, 0.10), transparent 42%),
    linear-gradient(180deg, #141414, #0f0f0f);
}

.stage--dark .stage__content,
.stage--dark .stage__subtitle,
.stage--dark .stage__title,
.stage--dark .stage__badge {
  color: #fff;
}

.stage__content {
  position: relative;
  z-index: 2;
  max-width: 540px;
  padding: 22px;
}

.stage__title {
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.stage--dark .stage__title {
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.stage__badge {
  font-family: var(--mono);
  font-size: 11px;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: #111;
}

html[data-theme='dark'] .stage__badge {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(18, 21, 26, 0.72);
  color: var(--fg);
}

.stage--dark .stage__badge {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.stage__title {
  margin: 14px 0 8px 0;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stage__subtitle {
  margin: 0 0 16px 0;
  color: var(--soft-fg);
  font-size: 14px;
  line-height: 1.5;
}

.stage--dark .stage__subtitle {
  color: rgba(255, 255, 255, 0.76);
}

.stage__run {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.btn:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

.btn--ghost {
  background: var(--btn-bg);
  border: 1px solid var(--line);
  font-weight: 600;
}

.runbar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.6);
}

.runbar__fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #111, #444);
  border-radius: 999px;
  transition: width 180ms linear;
}

.stage--dark .runbar {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
}

.stage--dark .runbar__fill {
  background: linear-gradient(90deg, #fff, #bbb);
}

.stage__steps {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(10, 10, 10, 0.62);
  padding: 12px;
  max-width: 100%;
  overflow: auto;
  max-height: 220px;
  width: fit-content;
  max-width: calc(100% - 92px);
}

.stage--dark .stage__steps {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
}

.step {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(210, 255, 220, 0.92);
  padding: 6px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stage--dark .step {
  color: rgba(210, 255, 220, 0.92);
  border-top-color: rgba(255, 255, 255, 0.14);
}

.step:first-child {
  border-top: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px;
  gap: 16px;
  pointer-events: none;
}

.overlay__left {
  pointer-events: auto;
  max-width: 66%;
}

.handle {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.tags {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: #3b3b3b;
}

.overlay__right {
  pointer-events: auto;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.action {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: color-mix(in srgb, var(--btn-bg) 82%, transparent);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 6px;
}

.action:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
}

.action--liked {
  border-color: color-mix(in srgb, #ff2d55 45%, rgba(0, 0, 0, 0.12));
}

.action--liked .action__icon {
  color: #ff2d55;
}

.action__icon {
  font-size: 16px;
  line-height: 1;
}

.action__count {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft-fg);
}

.burst-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -55%) scale(0.6);
  font-size: 86px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  animation: burst-heart 780ms ease-out forwards;
}

@keyframes burst-heart {
  0% {
    opacity: 0;
    transform: translate(-50%, -55%) scale(0.55);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(1.25);
  }
}

.mini {
  display: grid;
  gap: 8px;
}

.mini__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--btn-bg);
  font-family: var(--mono);
  font-size: 12px;
}

.footer {
  padding: 6px 2px;
}

.footer__sep {
  margin: 0 8px;
}

.footer__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__link:hover {
  opacity: 0.8;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
}

.modal__panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(520px, calc(100% - 36px));
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
}

.modal__title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.iconbtn {
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.modal__body {
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow: auto;
}

.comment {
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  background: var(--btn-bg);
}

.modal__foot {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.modal__input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  outline: none;
  font-size: 13px;
  background: var(--input-bg);
  color: var(--fg);
}

.modal__input:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

@media (max-width: 1020px) {
  .app {
    grid-template-columns: 1fr;
  }

  .left,
  .right {
    display: none;
  }

  .clip__stage {
    min-height: 520px;
  }

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

  .nav {
    justify-content: flex-start;
  }

  .search {
    justify-content: flex-start;
  }
}
