:root {
  --bg: #0f1524;
  --bg2: #172033;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.065);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #e7eaff;
  --text-dim: rgba(231, 234, 255, 0.74);
  --text-soft: rgba(231, 234, 255, 0.58);
  --accent: #d89a40;
  --accent-soft: rgba(216, 154, 64, 0.14);
  --accent-ink: #f4d9ad;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.14);
  --success: #33c27f;
  --warning: #ffb668;
  --danger: #ef6a6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --radius: 20px;
  --topbar-bg: linear-gradient(180deg, rgba(16, 22, 35, 0.9), rgba(10, 15, 24, 0.96));
  --topbar-line: rgba(255, 255, 255, 0.07);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --chip-line: rgba(255, 255, 255, 0.09);
  --chip-line-soft: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(255, 255, 255, 0.025);
  --input-placeholder: rgba(231, 234, 255, 0.32);
}

html[data-theme="light"],
body[data-theme="light"] {
  --bg: #e8ecf3;
  --bg2: #f1f3f7;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(15, 23, 42, 0.13);
  --line-strong: rgba(15, 23, 42, 0.18);
  --text: #0f1a2d;
  --text-dim: rgba(15, 26, 45, 0.7);
  --text-soft: rgba(15, 26, 45, 0.58);
  --accent: #ca8c34;
  --accent-soft: rgba(202, 140, 52, 0.14);
  --accent-ink: #8a5a18;
  --cyan: #0ea5c5;
  --cyan-soft: rgba(14, 165, 197, 0.14);
  --success: #198754;
  --warning: #b46918;
  --danger: #b83c3c;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
  --topbar-bg: linear-gradient(180deg, rgba(241, 243, 247, 0.92), rgba(232, 236, 243, 0.98));
  --topbar-line: rgba(15, 23, 42, 0.08);
  --chip-bg: rgba(15, 23, 42, 0.03);
  --chip-line: rgba(15, 23, 42, 0.12);
  --chip-line-soft: rgba(15, 23, 42, 0.08);
  --input-bg: rgba(255, 255, 255, 0.85);
  --input-placeholder: rgba(15, 26, 45, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at top right, rgba(216, 154, 64, 0.14), transparent 24%),
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.05), transparent 18%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
}

a,
button,
input {
  font: inherit;
}

.container {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

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

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 34px;
  height: 34px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-title {
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 800;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.topbar-nav a {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  background: var(--chip-bg);
  border: 1px solid var(--chip-line-soft);
  font-size: 0.94rem;
  display: inline-flex;
  align-items: center;
  position: relative;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.topbar-nav a.is-active {
  color: var(--text);
  background: rgba(216, 154, 64, 0.12);
  border-color: rgba(216, 154, 64, 0.24);
}

.topbar-nav a:hover {
  color: var(--text);
  border-color: var(--chip-line);
  background: var(--chip-bg);
  transform: translateY(-1px);
}

.page {
  padding-bottom: 54px;
}

.hero {
  padding: 34px 0 14px;
}

.hero-grid,
.workspace-grid {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
}

.hero-side {
  display: grid;
  gap: 18px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.045), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%);
  pointer-events: none;
}

.hero-copy,
.builder-panel,
.live-panel,
.collection-panel,
.stat-stack,
.side-note {
  padding: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-ink);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.04;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.5rem, 4.8vw, 4rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.12rem;
}

.hero-text,
.muted,
.event-item p,
.watch-card-sub,
.watch-foot,
.preview-meta,
.form-helper {
  color: var(--text-dim);
}

.hero-text {
  max-width: 60ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions.compact {
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #14211d;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, #d89a40, #f0b558);
  box-shadow: 0 12px 24px rgba(216, 154, 64, 0.22);
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(216, 154, 64, 0.26);
}

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

.btn.ghost {
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--chip-line);
  box-shadow: none;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.preset-chip {
  color: var(--text);
  border: 1px solid var(--chip-line);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 11px 15px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.preset-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 154, 64, 0.28);
  background: rgba(216, 154, 64, 0.08);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  align-content: end;
  padding: 18px;
  border-radius: 16px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-line-soft);
}

.stat-value {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  color: var(--text-soft);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.feature-list li,
.side-note li {
  position: relative;
  padding-left: 18px;
  line-height: 1.5;
}

.feature-list li::before,
.side-note li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.workspace {
  padding-top: 18px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.section {
  padding-top: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-copy {
  max-width: 26ch;
  text-align: left;
  line-height: 1.55;
}

.watch-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.builder-intro {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.builder-tip,
.empty-state {
  border-radius: 16px;
  border: 1px solid var(--chip-line-soft);
  background: var(--chip-bg);
  padding: 16px 18px;
}

.builder-tip strong,
.empty-state h3 {
  color: var(--text);
}

.builder-tip.is-soft {
  background: rgba(216, 154, 64, 0.07);
  border-color: rgba(216, 154, 64, 0.16);
}

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

.field span {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-soft);
}

.field input {
  width: 100%;
  min-height: 52px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--chip-line);
  border-radius: 14px;
  padding: 0 14px;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.field input::placeholder {
  color: var(--input-placeholder);
}

.field input:focus {
  outline: none;
  border-color: rgba(216, 154, 64, 0.44);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 4px rgba(216, 154, 64, 0.12);
}

.form-helper,
.watch-form-actions,
.watch-form-status {
  grid-column: 1 / -1;
}

.watch-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.watch-form-status {
  min-height: 22px;
  line-height: 1.5;
}

.watch-form-status[data-variant="success"] {
  color: var(--success);
}

.watch-form-status[data-variant="error"] {
  color: var(--danger);
}

.event-feed,
.watch-collection {
  display: grid;
  gap: 12px;
}

.empty-state {
  gap: 10px;
  display: grid;
}

.empty-state p {
  margin: 0;
}

.empty-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.event-item,
.watch-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 16px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-line-soft);
}

.event-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.event-item.is-positive::before {
  background: var(--success);
}

.event-item.is-warning::before {
  background: var(--warning);
}

.event-top,
.watch-card-head,
.watch-foot,
.watch-actions,
.watch-market {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.watch-card-head > div,
.panel-head > div:first-child {
  display: grid;
  gap: 6px;
}

.event-badge,
.watch-state,
.watch-meta span,
.watch-market span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.event-badge {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.event-time,
.watch-foot {
  font-size: 0.86rem;
  color: var(--text-soft);
}

.watch-state {
  color: var(--success);
  background: rgba(51, 194, 127, 0.12);
}

.watch-state.is-paused {
  color: var(--warning);
  background: rgba(255, 182, 104, 0.12);
}

.watch-meta,
.watch-market {
  gap: 8px;
}

.watch-meta span {
  color: var(--text-dim);
  background: var(--chip-bg);
}

.watch-market span {
  color: #9fe7f3;
  background: rgba(34, 211, 238, 0.12);
}

.watch-actions .btn {
  min-width: 132px;
}

.text-link {
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
}

.side-note li {
  max-width: 58ch;
}

.watch-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border-radius: 14px;
  color: #fff;
  background: #243147;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.watch-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.watch-toast[data-variant="success"] {
  background: #1f6f43;
}

.watch-toast[data-variant="error"] {
  background: #8b3b3b;
}

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

@media (max-width: 760px) {
  .container {
    width: min(100vw - 20px, 1180px);
  }

  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }

  .topbar-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    gap: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .topbar-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .hero-copy,
  .builder-panel,
  .live-panel,
  .collection-panel,
  .stat-stack,
  .side-note {
    padding: 20px;
  }

  .hero {
    padding-top: 22px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.05rem, 11vw, 2.85rem);
    line-height: 0.98;
  }

  h2 {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
    line-height: 1.08;
  }

  .hero-text {
    margin-top: 14px;
    font-size: 0.96rem;
    line-height: 1.58;
  }

  .hero-actions,
  .preset-row,
  .empty-actions {
    gap: 10px;
  }

  .preset-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
  }

  .preset-chip {
    width: 100%;
    min-height: 44px;
    text-align: center;
    padding: 10px 12px;
  }

  .watch-form {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel-head {
    gap: 12px;
    margin-bottom: 16px;
  }

  .builder-intro {
    margin-bottom: 16px;
  }

  .panel-head,
  .watch-card-head,
  .watch-foot,
  .watch-actions,
  .watch-market {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-copy {
    text-align: left;
  }

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

  .stat-card {
    min-height: 84px;
    padding: 16px;
  }

  .event-item,
  .watch-card,
  .builder-tip,
  .empty-state {
    padding: 16px;
  }

  .event-item::before {
    top: 14px;
    bottom: 14px;
  }

  .watch-market,
  .watch-meta {
    display: flex;
    flex-wrap: wrap;
  }

  .watch-foot {
    gap: 6px;
  }

  .watch-form-actions {
    gap: 10px;
  }

  .btn,
  .btn.ghost {
    width: 100%;
    min-height: 46px;
  }

  .watch-actions .btn {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .page {
    padding-bottom: 42px;
  }

  .container {
    width: min(100vw - 16px, 1180px);
  }

  .topbar-nav a {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.87rem;
  }

  .hero-copy,
  .builder-panel,
  .live-panel,
  .collection-panel,
  .stat-stack,
  .side-note {
    padding: 18px;
    border-radius: 18px;
  }

  .hero {
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(1.9rem, 10.6vw, 2.35rem);
  }

  h2 {
    font-size: clamp(1.3rem, 7vw, 1.65rem);
  }

  .hero-actions {
    margin-top: 18px;
  }

  .builder-tip,
  .empty-state,
  .event-item,
  .watch-card {
    padding: 14px;
  }

  .field input {
    min-height: 48px;
  }

  .preset-row {
    grid-template-columns: 1fr;
  }

  .watch-state,
  .watch-meta span,
  .watch-market span,
  .event-badge {
    min-height: 30px;
  }

  .watch-toast {
    right: 10px;
    left: 10px;
    bottom: 10px;
    max-width: none;
  }
}
