:root {
  --ink: #0a1020;
  --muted: #5c6270;
  --line: #eaded7;
  --paper: #fffaf3;
  --surface: #fffefd;
  --coral: #ff5b4a;
  --blue: #2388f6;
  --yellow: #f9c900;
  --lime: #c9ef4b;
  --aqua: #13c5bd;
  --lavender: #d7b8ff;
  --shadow: 0 28px 70px rgba(26, 20, 10, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 18%, rgba(35, 136, 246, 0.16), transparent 22rem),
    radial-gradient(circle at 92% 14%, rgba(255, 91, 74, 0.14), transparent 20rem),
    linear-gradient(135deg, #fff9ee 0%, #fffefd 48%, #f5fbff 100%);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.studio-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 30px clamp(20px, 4vw, 58px) 42px;
}

.topbar {
  display: grid;
  grid-template-columns: 180px 1fr 56px;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: flex-start;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 92px;
  height: 92px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(10, 16, 32, 0.12);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.nav-button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  padding: 10px 16px 12px;
  font-weight: 800;
}

.nav-button.active {
  color: var(--coral);
  border-color: var(--coral);
}

.nav-button.has-stories {
  color: var(--ink);
}

.nav-button.has-stories:hover {
  color: var(--coral);
}

.nav-button.has-stories::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(201, 239, 75, 0.8);
  animation: storyPulse 1.4s ease-out 3;
}

@keyframes storyPulse {
  70% {
    box-shadow: 0 0 0 9px rgba(201, 239, 75, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 239, 75, 0);
  }
}

.profile-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(10, 16, 32, 0.08);
  background: var(--lime);
  color: var(--ink);
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) minmax(330px, 410px);
  gap: clamp(24px, 3vw, 52px);
  align-items: center;
  padding-top: clamp(46px, 8vh, 94px);
}

.story-start {
  max-width: 860px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(19, 197, 189, 0.16);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(56px, 5.15vw, 74px);
  line-height: 1.04;
  letter-spacing: 0;
}

h1 .headline-line {
  display: block;
  white-space: nowrap;
}

h1 em,
.draft-panel h2 {
  display: inline-block;
  color: var(--coral);
  font-family: Kalam, "Comic Sans MS", cursive;
  font-weight: 700;
  line-height: 0.95;
  font-style: normal;
}

.intro {
  max-width: 560px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.composer {
  padding: 22px;
  background: rgba(255, 254, 253, 0.88);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.voice-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.voice-status span {
  display: inline-flex;
  width: fit-content;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--coral);
  background: #fff4ec;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.voice-status strong {
  font-size: 34px;
  font-weight: 900;
}

.record-button {
  display: flex;
  width: 100%;
  min-height: 132px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 24px 42px rgba(10, 16, 32, 0.22);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
}

.record-button span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 12px rgba(255, 91, 74, 0.22);
}

.record-button.recording {
  background: var(--coral);
}

.record-button.recording span {
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.22);
}

.voice-prompt {
  min-height: 56px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.utility,
.submit-button,
.more-button {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.utility {
  padding: 11px 16px;
  color: var(--ink);
  background: #fff4ec;
}

.submit-button {
  margin-left: auto;
  padding: 13px 20px;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 14px 26px rgba(255, 91, 74, 0.28);
}

.quick-starts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.start-card {
  min-height: 164px;
  padding: 24px;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  text-align: left;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.start-card:hover,
.start-card.active {
  transform: translateY(-4px);
  box-shadow: 0 22px 38px rgba(10, 16, 32, 0.14);
}

.start-card span {
  display: block;
  max-width: 190px;
  margin-bottom: 14px;
  font-size: 23px;
  line-height: 1.1;
  font-weight: 900;
}

.start-card small {
  display: block;
  max-width: 220px;
  color: rgba(10, 16, 32, 0.76);
  font-size: 15px;
  line-height: 1.35;
}

.coral {
  background: var(--coral);
}

.blue {
  background: var(--blue);
}

.yellow {
  background: var(--yellow);
}

.blue,
.blue small {
  color: #fff;
}

.draft-panel {
  position: relative;
  padding: 38px 30px 30px;
  overflow: hidden;
  background: rgba(255, 254, 253, 0.78);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.draft-panel::before,
.draft-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.draft-panel::before {
  width: 150px;
  height: 150px;
  top: -70px;
  right: -46px;
  background: rgba(255, 91, 74, 0.13);
}

.draft-panel::after {
  width: 130px;
  height: 130px;
  bottom: -60px;
  left: -40px;
  background: rgba(35, 136, 246, 0.13);
}

.panel-topline {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.draft-panel h2 {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 52px;
  text-align: center;
}

.draft-panel p {
  position: relative;
  z-index: 1;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.hook-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.hook-button {
  display: grid;
  width: 100%;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: center;
  padding: 19px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.hook-button span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 900;
}

.hook-button strong {
  font-size: 16px;
  line-height: 1.35;
}

.hook-button.active span {
  color: #fff;
  background: var(--coral);
}

.hook-button:hover strong {
  color: var(--blue);
}

.result-card {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: 20px;
  background: #fff5d6;
}

.transcript-card {
  position: relative;
  z-index: 1;
  margin: 22px 0 8px;
  padding: 18px;
  border-radius: 20px;
  background: #eefcfa;
}

.transcript-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--aqua);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.transcript-card p {
  margin: 0;
  color: var(--ink);
  text-align: left;
}

.diagnosis-card {
  position: relative;
  z-index: 1;
  margin: 14px 0 8px;
  padding: 18px;
  border: 1px solid rgba(10, 16, 32, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.diagnosis-card.awaiting {
  opacity: 0.68;
}

.diagnosis-card.ready {
  border-color: rgba(19, 197, 189, 0.48);
  box-shadow: 0 14px 28px rgba(19, 197, 189, 0.14);
  transform: translateY(-2px);
}

.diagnosis-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.diagnosis-heading span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.diagnosis-heading strong {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--lime);
  font-size: 12px;
  font-weight: 900;
}

.meter-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.meter-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e9e3;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--blue));
  transition: width 220ms ease;
}

.diagnosis-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.result-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.result-card p {
  margin: 0;
  color: var(--ink);
  text-align: left;
}

.more-button {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.more-button:hover {
  color: #fff;
  background: var(--ink);
}

.more-button.locked {
  cursor: not-allowed;
  color: var(--muted);
  background: #f5eee8;
}

.more-button.locked:hover {
  color: var(--muted);
  background: #f5eee8;
}

.stories-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 16, 32, 0.28);
  backdrop-filter: blur(3px);
}

.stories-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 31;
  display: flex;
  width: min(440px, calc(100vw - 28px));
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 254, 253, 0.96);
  box-shadow: 0 30px 80px rgba(10, 16, 32, 0.24);
  transform: translateX(calc(100% + 28px));
  transition: transform 220ms ease;
}

.stories-panel.open {
  transform: translateX(0);
}

.stories-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.stories-panel-header span,
.saved-story-card span,
.mini-diagnosis span,
.panel-hooks span,
.could-become span,
.session-cta span {
  display: block;
  margin-bottom: 8px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stories-panel-header h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.close-panel-button {
  border: 0;
  border-radius: 999px;
  background: #fff4ec;
  color: var(--ink);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 900;
}

.saved-story-card,
.mini-diagnosis,
.panel-hooks,
.could-become,
.session-cta {
  border-radius: 20px;
  padding: 18px;
}

.saved-story-card {
  background: #eefcfa;
}

.saved-story-card h4,
.session-cta h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.saved-story-card p,
.mini-diagnosis p,
.session-cta p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.saved-story-card blockquote {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-left: 5px solid var(--coral);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-family: Kalam, "Comic Sans MS", cursive;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.mini-diagnosis {
  background: #fff5d6;
}

.mini-diagnosis span {
  color: var(--coral);
}

.panel-hooks {
  background: #fff;
  border: 1px solid var(--line);
}

.panel-hooks ol,
.could-become ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.panel-hooks li,
.could-become li {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.could-become {
  background: #f6f3ff;
}

.could-become span {
  color: #7b52db;
}

.session-cta {
  margin-top: auto;
  background: var(--ink);
  color: #fff;
}

.session-cta span,
.session-cta p {
  color: rgba(255, 255, 255, 0.76);
}

.session-cta a {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  padding: 14px 16px;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
}

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

  .nav-links {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .story-start {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .studio-shell {
    padding: 22px 16px 28px;
  }

  .brand img {
    width: 76px;
    height: 76px;
  }

  .hero-grid {
    padding-top: 38px;
  }

  .intro {
    font-size: 17px;
  }

  .composer-actions,
  .quick-starts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .submit-button {
    margin-left: 0;
  }

  .start-card {
    min-height: 132px;
  }

  .draft-panel {
    padding: 30px 20px 22px;
  }
  h1 .headline-line {
    white-space: normal;
  }
}
