:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #5d6875;
  --line: #d9e0e8;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --accent: #176b87;
  --accent-dark: #0f5369;
  --coral: #d45d4c;
  --gold: #b98616;
  --mint: #dff4ea;
  --soft-blue: #e7f4f8;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 3vw, 36px);
  background: rgba(251, 252, 253, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

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

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link,
.quiet-action,
.icon-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 11px;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.quiet-action:hover,
.quiet-action:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line);
  background: #fff;
  color: var(--accent-dark);
  outline: none;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
  min-height: calc(100vh - 142px);
  padding: clamp(24px, 5vw, 58px) 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.lead,
.section-heading p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.04rem;
}

.home-actions,
.form-actions,
.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  font-weight: 700;
}

.primary-action {
  background: var(--accent);
  color: #fff;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--accent-dark);
  outline: 3px solid rgba(23, 107, 135, 0.22);
}

.secondary-action {
  background: #fff;
  color: var(--accent-dark);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  background: var(--soft-blue);
  outline: 3px solid rgba(23, 107, 135, 0.16);
}

.workshop-visual {
  position: relative;
  min-height: 380px;
}

.stage-card,
.prompt-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stage-card {
  position: absolute;
  inset: 34px 22px 60px 0;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12), rgba(212, 93, 76, 0.1)),
    #fff;
}

.timer-chip {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.speaker-dot {
  width: 118px;
  height: 118px;
  margin: 38px auto 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #fff 0 13%, transparent 14%),
    radial-gradient(circle at 50% 75%, #fff 0 28%, transparent 29%),
    var(--accent);
  box-shadow: 0 0 0 14px rgba(23, 107, 135, 0.12);
}

.story-lines {
  display: grid;
  gap: 12px;
  width: min(270px, 90%);
  margin: 0 auto;
}

.story-lines span {
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 41, 51, 0.18);
}

.story-lines span:nth-child(2) {
  width: 78%;
}

.story-lines span:nth-child(3) {
  width: 52%;
}

.prompt-card {
  position: absolute;
  right: 0;
  bottom: 24px;
  width: min(245px, 78%);
  padding: 18px;
  background: var(--mint);
}

.prompt-card strong,
.prompt-card span {
  display: block;
}

.prompt-card span {
  color: var(--muted);
}

.section-heading {
  margin: 10px 0 26px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.two-column {
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
}

.form-panel,
.output-panel,
.timer-panel,
.record-panel,
.feedback-panel,
.tips-panel,
.rubric-grid article,
.examples-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(31, 41, 51, 0.06);
}

.form-panel,
.output-panel,
.timer-panel,
.record-panel,
.feedback-panel,
.tips-panel {
  padding: clamp(16px, 2.3vw, 24px);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 700;
}

.form-note {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(23, 107, 135, 0.18);
  border-color: var(--accent);
}

.output-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.stats-row span {
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  padding: 8px 10px;
  font-size: 0.92rem;
}

.pitch-output {
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  white-space: pre-wrap;
}

.pitch-output.empty {
  color: var(--muted);
}

.hook-options {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.hook-options button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.hook-options button:hover,
.hook-options button:focus-visible {
  background: var(--soft-blue);
  outline: 3px solid rgba(23, 107, 135, 0.14);
}

.hook-options strong {
  display: block;
  color: var(--accent-dark);
  margin-bottom: 3px;
}

.revision-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.revision-bar.stacked {
  align-items: stretch;
}

.revision-bar button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  padding: 8px 11px;
  font-weight: 700;
}

.revision-bar button:hover,
.revision-bar button:focus-visible {
  background: var(--soft-blue);
  outline: 3px solid rgba(23, 107, 135, 0.14);
}

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

.timer-panel {
  text-align: center;
}

.timer-ring {
  display: grid;
  place-items: center;
  width: min(270px, 78vw);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 59%, transparent 60%),
    conic-gradient(var(--accent) var(--progress, 100%), #e8edf2 0);
}

#timer-display {
  font-size: clamp(2.8rem, 10vw, 4.8rem);
  font-weight: 800;
  letter-spacing: 0;
}

.timer-message {
  color: var(--muted);
}

.record-status {
  align-self: start;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 10px;
}

.record-status.recording {
  background: #fde9e5;
  color: #a33c2e;
}

.helper-text {
  color: var(--muted);
  margin: 0 0 14px;
}

.record-actions {
  margin: 0 0 14px;
}

.record-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

#practice-audio,
.recording-video {
  width: 100%;
  margin: 4px 0 12px;
}

.recording-video {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  object-fit: cover;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 14px;
  border-radius: 8px;
  color: var(--accent-dark);
  font-weight: 800;
}

.reflection-label {
  margin: 0;
}

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

.feedback-metrics span {
  display: grid;
  gap: 2px;
  min-height: 64px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
}

.feedback-metrics strong {
  color: var(--accent-dark);
  font-size: 1rem;
}

.feedback-metrics small {
  color: var(--muted);
  font-weight: 700;
}

.transcript-box {
  min-height: 92px;
  max-height: 170px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  padding: 12px;
}

.feedback-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.feedback-list li {
  margin: 8px 0;
}

.tips-panel ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.tips-panel li {
  margin: 10px 0;
}

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

.rubric-grid article,
.examples-list article {
  padding: 18px;
}

.rubric-grid p,
.examples-list p {
  color: var(--muted);
}

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

.examples-list article {
  border-left: 6px solid var(--gold);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 36px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 880px) {
  .app-header,
  .app-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .hero-band,
  .workspace-grid,
  .two-column,
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: auto;
  }

  .workshop-visual {
    min-height: 300px;
  }

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

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .brand {
    min-width: 0;
  }

  .nav-link {
    flex: 1 1 96px;
  }

  .home-actions button,
  .form-actions button,
  .timer-actions button,
  .revision-bar button {
    width: 100%;
  }

  .feedback-metrics {
    grid-template-columns: 1fr;
  }

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

  .stage-card {
    inset: 18px 0 56px;
  }
}
