:root {
  --bg: #050714;
  --panel: rgba(10, 15, 34, 0.78);
  --border: rgba(129, 140, 248, 0.18);
  --text: #f4f7ff;
  --muted: rgba(221, 231, 255, 0.66);
  --violet: #818cf8;
  --violet-soft: rgba(129, 140, 248, 0.12);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.12);
  --shadow: 0 30px 80px rgba(1, 6, 18, 0.56);
  --mono: "Orbitron", sans-serif;
  --body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.12), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(251, 191, 36, 0.1), transparent 28%),
    linear-gradient(180deg, #050714 0%, #02040d 100%);
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
}

.page-noise,
.page-grid,
.page-orb {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.page-noise {
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.28) 0 0.7px, transparent 0.9px),
    radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.18) 0 0.8px, transparent 1px);
  background-size: 16px 16px, 24px 24px;
  mix-blend-mode: soft-light;
}

.page-grid {
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 85%);
}

.page-orb {
  filter: blur(96px);
  opacity: 0.52;
}

.page-orb--violet {
  inset: auto auto 10% -6%;
  width: 34rem;
  height: 34rem;
  background: rgba(129, 140, 248, 0.24);
}

.page-orb--gold {
  inset: 4% -6% auto auto;
  width: 24rem;
  height: 24rem;
  background: rgba(251, 191, 36, 0.18);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.app-header,
.hero-panel,
.panel,
.footer-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12, 18, 42, 0.88) 0%, rgba(7, 12, 28, 0.8) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 24px;
  margin-bottom: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(129, 140, 248, 0.18), rgba(251, 191, 36, 0.12)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(129, 140, 248, 0.24);
  color: var(--violet);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(129, 140, 248, 0.12);
}

.brand-icon svg {
  width: 28px;
  height: 28px;
}

.brand-kicker,
.panel-eyebrow,
.hero-eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--violet);
}

.brand-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.32);
  background: rgba(129, 140, 248, 0.08);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.hero-panel {
  border-radius: 32px;
  padding: 36px;
  margin-bottom: 22px;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.55), transparent);
}

.hero-copy {
  max-width: 760px;
}

.hero-title {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-title span {
  display: block;
}

.accent-word {
  color: var(--gold);
  text-shadow: 0 0 28px rgba(251, 191, 36, 0.24);
}

.hero-description {
  margin: 18px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e9e7ff;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(420px, 1.06fr);
  gap: 22px;
}

.panel {
  border-radius: 28px;
  padding: 28px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.panel-header h2,
.footer-panel h2 {
  margin: 0;
  font-size: 1.5rem;
}

.control-block + .control-block,
.signal-meta,
.action-row {
  margin-top: 24px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.label-row label,
.label-row span:first-child {
  color: var(--text);
  font-weight: 700;
}

textarea {
  width: 100%;
}

#number-input {
  resize: vertical;
  min-height: 196px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 7, 18, 0.7);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#number-input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.34);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

#number-input::placeholder {
  color: rgba(218, 232, 255, 0.38);
}

.panel-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.example-grid,
.signal-meta,
.action-row,
.preview-meta,
.result-grid {
  display: grid;
  gap: 12px;
}

.example-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.example-chip,
.action-btn,
.copy-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.example-chip,
.copy-chip,
.action-btn {
  cursor: pointer;
}

.example-chip {
  border-radius: 18px;
  padding: 12px 14px;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.example-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.28);
  background: rgba(129, 140, 248, 0.08);
}

.signal-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-item,
.meta-card {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.meta-item span,
.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.meta-item strong,
.meta-card strong {
  display: block;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.action-row--double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-btn {
  min-height: 56px;
  border-radius: 18px;
  padding: 0 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.action-btn:hover:not(:disabled),
.copy-chip:hover {
  transform: translateY(-1px);
}

.action-btn--primary {
  border-color: rgba(129, 140, 248, 0.34);
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.28), rgba(251, 191, 36, 0.16));
  box-shadow: 0 20px 36px rgba(44, 58, 120, 0.18);
}

.preview-empty {
  text-align: center;
  padding: 40px 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(6, 10, 23, 0.92), rgba(8, 13, 28, 0.94));
}

.empty-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--violet);
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.16);
}

.empty-icon svg {
  width: 40px;
  height: 40px;
}

.preview-empty h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.preview-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-shell {
  display: grid;
  gap: 18px;
}

.preview-meta--top {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-card--wide {
  grid-column: 1 / -1;
}

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

.result-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(7, 11, 25, 0.95), rgba(10, 15, 31, 0.94));
  overflow: hidden;
}

.result-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.result-card__header h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.result-card__header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.copy-chip {
  min-width: 72px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.copy-chip:hover {
  border-color: rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.1);
}

.result-card__body {
  padding: 18px;
}

.result-output {
  margin: 0;
  min-height: 60px;
  color: #f5f5ff;
  font-size: 1rem;
  line-height: 1.8;
  word-break: break-word;
}

.error-message {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  color: #ffd8e2;
  background: rgba(255, 124, 161, 0.08);
  border: 1px solid rgba(255, 124, 161, 0.16);
  line-height: 1.6;
}

.footer-panel {
  border-radius: 28px;
  padding: 30px 32px;
  margin-top: 22px;
}

.footer-copy {
  max-width: 760px;
}

.footer-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

@media (max-width: 720px) {
  .app-shell {
    padding: 20px 16px 56px;
  }

  .app-header,
  .hero-panel,
  .panel,
  .footer-panel {
    border-radius: 24px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .example-grid,
  .signal-meta,
  .action-row--double,
  .preview-meta--top {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    padding: 28px 24px;
  }

  .panel,
  .footer-panel {
    padding: 24px;
  }

  .result-card__header {
    flex-direction: column;
  }

  .copy-chip {
    width: 100%;
  }
}
