:root {
  --bg: #09090f;
  --bg-soft: #12131c;
  --panel: rgba(15, 18, 29, 0.88);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f6f7fb;
  --muted: #a6adc8;
  --accent: #ff8a1d;
  --accent-2: #ff4d6d;
  --accent-3: #66e2ff;
  --success: #9cff57;
  --danger: #ff7b7b;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
  font-family: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 58%, rgba(102, 226, 255, 0.08), transparent 22%),
    radial-gradient(circle at top left, rgba(255, 77, 109, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(102, 226, 255, 0.18), transparent 28%),
    linear-gradient(160deg, #07070b 0%, #0f1020 45%, #16111a 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: -10% -6% auto -6%;
  height: 72vh;
  background:
    linear-gradient(112deg, transparent 8%, rgba(102, 226, 255, 0.2) 20%, transparent 34%),
    linear-gradient(98deg, transparent 18%, rgba(183, 102, 255, 0.18) 34%, transparent 48%),
    linear-gradient(126deg, transparent 48%, rgba(255, 77, 109, 0.16) 63%, transparent 76%);
  filter: blur(8px);
  opacity: 0.85;
  transform: perspective(1200px) rotateX(66deg) translateY(34vh);
  transform-origin: center;
  pointer-events: none;
}

a,
button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar,
.panel,
.hero-panel,
.modal-dialog {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  border-radius: 24px;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #190c11;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.hero-copy h1,
.panel-head h2,
.ab-test-card h3,
.history-item h3,
.hook-card h3,
.modal-head h2 {
  font-family: "Sora", sans-serif;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.ghost-link,
.tiny-link {
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
}

.ghost-link:hover,
.tiny-link:hover {
  color: var(--text);
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  padding: 12px 18px;
  border: 0;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  color: #140f12;
  background: linear-gradient(135deg, var(--accent), #ffb627);
  box-shadow: 0 10px 30px rgba(255, 138, 29, 0.34);
  font-weight: 800;
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-button:hover,
.secondary-button:hover,
.tone-chip:hover,
.copy-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.layout {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 28px;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 26%, rgba(102, 226, 255, 0.16), transparent 18%),
    radial-gradient(circle at 84% 70%, rgba(183, 102, 255, 0.12), transparent 20%),
    linear-gradient(90deg, transparent 20%, rgba(102, 226, 255, 0.08) 20.5%, transparent 21%),
    linear-gradient(90deg, transparent 54%, rgba(102, 226, 255, 0.06) 54.4%, transparent 54.8%);
  pointer-events: none;
}

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

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

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.3rem);
  line-height: 0.95;
}

.hero-text,
.ab-test-card p,
.step-description,
.empty-state p,
.profile-summary dd,
.history-card-item,
.feedback-text {
  color: var(--muted);
  line-height: 1.65;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.hero-grid article,
.ab-test-card,
.social-card,
.hook-card,
.history-item,
.notice-banner {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 24px;
}

.hero-grid article {
  padding: 16px;
}

.hero-grid span,
.social-label,
.history-item time {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.hero-grid strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.1rem;
}

.hero-stage {
  position: relative;
  min-height: 100%;
}

.social-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orbit-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 54px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 11, 24, 0.46);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  color: #c7f6ff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.orbit-ig {
  top: 3%;
  left: 16%;
  color: #ffc0f1;
}

.orbit-yt {
  top: 21%;
  right: 12%;
  color: #ff9ea8;
}

.orbit-tt {
  right: 0;
  bottom: 20%;
  color: #97fbff;
}

.orbit-in {
  left: 8%;
  bottom: 14%;
  color: #8fe2ff;
}

.orbit-fb {
  top: 42%;
  right: 28%;
  color: #95b8ff;
}

.orbit-x {
  top: 12%;
  left: 44%;
  color: #d5f8ff;
}

.social-wall {
  height: 100%;
  display: grid;
  gap: 16px;
  align-content: center;
  position: relative;
}

.social-wall::before {
  content: "";
  position: absolute;
  inset: 8% 0 8% -18%;
  background:
    linear-gradient(90deg, transparent 0%, rgba(102, 226, 255, 0.2) 12%, transparent 24%),
    linear-gradient(90deg, transparent 18%, rgba(255, 77, 109, 0.14) 32%, transparent 44%),
    linear-gradient(90deg, transparent 48%, rgba(183, 102, 255, 0.16) 62%, transparent 74%);
  opacity: 0.7;
  filter: blur(14px);
  pointer-events: none;
}

.social-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.social-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 55%);
  pointer-events: none;
}

.social-card strong {
  position: relative;
  display: block;
  font-size: 1.2rem;
  line-height: 1.3;
}

.card-reel {
  transform: rotate(-4deg);
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.22), rgba(255, 138, 29, 0.12));
}

.card-proof {
  transform: translateX(28px) rotate(5deg);
  background: linear-gradient(135deg, rgba(102, 226, 255, 0.2), rgba(25, 20, 62, 0.2));
}

.card-curiosity {
  transform: rotate(-2deg);
  background: linear-gradient(135deg, rgba(255, 182, 39, 0.18), rgba(255, 255, 255, 0.06));
}

.app-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
}

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

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

.panel-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.side-head {
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-pill.ready {
  color: #0d1307;
  background: linear-gradient(135deg, #b2ff59, var(--success));
}

.status-pill.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.notice-banner {
  padding: 16px;
  margin-bottom: 16px;
  color: #ffe6ae;
  background: linear-gradient(135deg, rgba(255, 138, 29, 0.16), rgba(255, 77, 109, 0.12));
}

.quick-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.guide-card,
.step-help-box {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 22px;
}

.guide-card {
  padding: 15px 16px;
}

.guide-card strong,
.step-help-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.guide-card p,
.field-helper,
.step-help-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.field-helper {
  margin-top: -4px;
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.field-helper-soft {
  opacity: 0.9;
}

.generator-form,
.onboarding-form {
  display: grid;
  gap: 12px;
}

.input-focus-box {
  border: 1px solid rgba(102, 226, 255, 0.35);
  border-radius: 20px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(102, 226, 255, 0.08), rgba(255, 77, 109, 0.05));
}

.input-focus-title {
  margin: 0 0 10px;
  color: #d9faff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.generator-form label,
.step-shell label {
  font-size: 0.95rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 6, 12, 0.62);
  color: var(--text);
  padding: 16px 18px;
  outline: none;
}

textarea::placeholder {
  color: rgba(166, 173, 200, 0.72);
}

textarea:focus {
  border-color: rgba(102, 226, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(102, 226, 255, 0.1);
}

textarea.is-invalid {
  border-color: rgba(255, 123, 123, 0.86);
  box-shadow: 0 0 0 4px rgba(255, 123, 123, 0.12);
}

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

.tema-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.step-help-box {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(102, 226, 255, 0.09), rgba(255, 77, 109, 0.06));
}

.form-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.feedback-text {
  min-height: 24px;
  margin: 6px 0 2px;
}

.feedback-text.error {
  color: var(--danger);
}

.feedback-text.success {
  color: var(--success);
}

.empty-state {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state.compact {
  padding: 18px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.hook-card {
  padding: 18px;
}

.hook-card h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.hook-type {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-3);
}

.copy-button {
  margin-top: 16px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.profile-summary {
  display: grid;
  gap: 14px;
  margin: 0;
}

.profile-summary div {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-summary dt {
  margin-bottom: 6px;
  color: var(--accent-3);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-summary dd {
  margin: 0;
}

.ab-test-card {
  margin-top: 22px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(102, 226, 255, 0.11), rgba(255, 138, 29, 0.1));
}

.ab-test-card h3 {
  margin: 0 0 10px;
}

.history-panel {
  padding-bottom: 8px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-item {
  padding: 18px;
}

.history-item h3 {
  margin: 8px 0 10px;
  font-size: 1.05rem;
}

.history-card-list {
  display: grid;
  gap: 10px;
}

.history-card-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 24px));
  border-radius: 28px;
  padding: 24px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.modal-head h2 {
  margin: 0;
}

.step-progress {
  margin: 18px 0;
}

.step-progress span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#progress-bar-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.tone-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tone-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tone-chip.is-selected {
  color: #120b0f;
  background: linear-gradient(135deg, var(--accent), #ffc140);
  border-color: transparent;
}

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

  .results-grid,
  .hero-grid,
  .quick-guide {
    grid-template-columns: 1fr;
  }

  .card-proof {
    transform: none;
  }

  body::after {
    opacity: 0.5;
    transform: perspective(900px) rotateX(72deg) translateY(38vh);
  }

  .social-orbit {
    opacity: 0.65;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .topbar,
  .panel,
  .hero-panel,
  .modal-dialog {
    border-radius: 22px;
  }

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

  .topbar-actions,
  .form-actions,
  .modal-actions {
    flex-direction: column;
  }

  .topbar-actions > * ,
  .form-actions > * ,
  .modal-actions > * {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: 2.4rem;
  }

  .quick-guide {
    gap: 10px;
  }

  .guide-card {
    padding: 12px;
  }

  .guide-card p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .input-focus-box {
    padding: 12px;
  }

  textarea {
    min-height: 108px;
  }

  .orbit-chip {
    min-width: 46px;
    height: 46px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 0.72rem;
  }

  .modal-dialog {
    padding: 20px;
  }
}
