:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #68625c;
  --paper: #f7f3ec;
  --panel: #fffaf3;
  --line: rgba(22, 22, 22, 0.12);
  --red: #c84636;
  --teal: #087f8c;
  --yellow: #f2b705;
  --green: #2d7d46;
  --blue: #315f9d;
  --shadow: 0 24px 70px rgba(39, 28, 18, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(8, 127, 140, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(200, 70, 54, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 236, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.topnav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
  color: var(--red);
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 8px solid var(--red);
  border-right-color: var(--teal);
  border-radius: 50%;
}

.topnav {
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
}

.icon-button,
.primary-button,
.ghost-button,
.journal-grid button,
.playlist-main,
.playlist-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.icon-button {
  width: 46px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-weight: 900;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(20px, 4vw, 54px);
  align-items: stretch;
  min-height: calc(100vh - 82px);
  padding: clamp(26px, 5vw, 64px);
}

.survey-panel {
  align-self: center;
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.9;
  letter-spacing: 0;
}

.platform-title {
  max-width: 18ch;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: clamp(27px, 3.4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 610px;
  margin: 22px 0 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.survey-form,
.module {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.86);
  box-shadow: var(--shadow);
}

.survey-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.field-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.field-grid {
  grid-template-columns: 0.65fr 1.35fr;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.chip-grid,
.mood-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-grid label,
.mood-scale label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
}

.chip-grid input,
.mood-scale input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--red);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button {
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  background: var(--red);
  color: white;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button {
  background: white;
  color: var(--ink);
}

.portrait-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: 8px;
  background: #171717;
  box-shadow: var(--shadow);
}

#waveCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portrait-overlay {
  position: absolute;
  inset: auto 24px 24px;
  max-width: 720px;
  color: white;
}

.portrait-overlay p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  text-transform: uppercase;
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.signal-row span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 800;
}

.insight-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: var(--ink);
  color: white;
}

.insight-band div {
  display: grid;
  gap: 6px;
  min-height: 140px;
  align-content: center;
  padding: 28px clamp(18px, 4vw, 56px);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.insight-band strong {
  font-size: clamp(26px, 4vw, 54px);
  line-height: 1;
}

.insight-band span {
  color: rgba(255, 255, 255, 0.72);
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: clamp(26px, 5vw, 64px);
}

.module {
  padding: clamp(20px, 3vw, 30px);
}

.full-width-module {
  grid-column: 1 / -1;
}

.module-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  font-weight: 700;
}

.timeline li::marker {
  color: var(--red);
  font-weight: 900;
}

.timeline .done {
  color: var(--green);
}

.playlist-list,
.rating-list,
.journal-grid {
  display: grid;
  gap: 10px;
}

.playlist-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.playlist-main {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: white;
  padding: 0;
  text-align: left;
}

.playlist-main:hover,
.journal-grid button:hover,
.playlist-main:focus-visible,
.journal-grid button:focus-visible {
  transform: translateY(-1px);
}

.playlist-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--red), transparent 58%),
    linear-gradient(45deg, var(--teal), var(--yellow));
}

.playlist-main strong,
.playlist-main small {
  display: block;
}

.playlist-main small {
  margin-top: 4px;
  color: var(--muted);
}

.playlist-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.playlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playlist-actions button {
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.playlist-actions button + button {
  background: white;
  color: var(--ink);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(8, 127, 140, 0.1);
  color: var(--teal);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

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

.journal-grid button {
  border-radius: 8px;
  background: white;
  min-height: 78px;
  padding: 14px;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.journal-grid button.is-active {
  background: var(--yellow);
  border-color: rgba(22, 22, 22, 0.36);
}

.rating-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.rating-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.09);
}

.rating-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--red));
}

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

  .topnav {
    display: none;
  }

  .workspace,
  .content-grid,
  .insight-band {
    grid-template-columns: 1fr;
  }

  .portrait-stage {
    min-height: 520px;
  }

  .insight-band div {
    min-height: 112px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }
}

@media (max-width: 620px) {
  .workspace,
  .content-grid {
    padding-inline: 16px;
  }

  .field-grid,
  .journal-grid,
  .module-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  h1 {
    max-width: 12ch;
    font-size: 48px;
  }

  .platform-title {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.08;
  }

  .portrait-stage {
    min-height: 460px;
  }

  .portrait-overlay {
    inset-inline: 16px;
    bottom: 16px;
  }
}
