:root {
  color-scheme: light;
  --paper: #fbf7f1;
  --paper-2: #eef7f6;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-warm: #f7f1e8;
  --ink: #111827;
  --muted: #536171;
  --line: rgba(83, 97, 113, 0.18);
  --coral: #f97066;
  --coral-strong: #e6534b;
  --sun: #f3c969;
  --mint: #37c7b5;
  --sky: #66d8d1;
  --blue: #257f78;
  --lavender: #cfd7e3;
  --green: #1ea672;
  --shadow: 0 24px 70px rgba(17, 24, 39, 0.12);
  --small-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  --body-font: "Inter", "Segoe UI", system-ui, sans-serif;
  --display-font: "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, var(--paper), #f5faf9 58%, #fff);
  font-family: var(--body-font);
  font-weight: 500;
}

button,
select,
textarea,
input {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
.brand,
.primary-button,
.secondary-button,
.record-button,
.warning-button,
.stop-button,
.focus-button,
.ghost-button,
.glass-button,
.text-button {
  font-family: var(--display-font);
}

button,
select {
  min-height: 42px;
}

button {
  border: 0;
  cursor: pointer;
}

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

img {
  max-width: 100%;
  display: block;
}

[hidden],
.landing-view[hidden],
.signin-view[hidden],
.trial-view[hidden],
.profile-view[hidden],
.project-library-view[hidden],
.recorder-view[hidden] {
  display: none !important;
}

.landing-view,
.signin-view,
.trial-view,
.profile-view,
.project-library-view,
.app-shell {
  min-height: 100vh;
}

.brand,
.site-nav,
.site-nav-actions,
.top-actions,
.session-strip,
.session-actions,
.transport,
.meter-row,
.take-row,
.project-library-header,
.library-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

button.brand {
  min-height: 44px;
  background: transparent;
  padding: 0;
  text-align: left;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: url("./assets/medrak-mark.svg") center / cover no-repeat;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
}

.brand-mark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  background: transparent;
}

.brand-mark-button:hover .brand-mark,
button.brand:hover .brand-mark {
  transform: translateY(-1px);
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #257f78;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.record-button,
.warning-button,
.stop-button,
.icon-button,
.focus-button,
.mini-button,
.delete-take-button,
.ghost-button,
.glass-button,
.text-button,
.control-select,
.wide-select,
.project-name-input,
.signin-card input {
  border-radius: 8px;
}

.primary-button,
.secondary-button,
.record-button,
.warning-button,
.stop-button,
.icon-button,
.focus-button,
.mini-button,
.delete-take-button,
.ghost-button,
.glass-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--coral-strong), #f97066);
  color: #fff;
  box-shadow: 0 12px 28px rgba(249, 112, 102, 0.22);
}

.primary-button:hover:not(:disabled),
.record-button:hover:not(:disabled),
.hero-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(249, 112, 102, 0.28);
}

.secondary-button,
.ghost-button,
.icon-button,
.mini-button,
.delete-take-button,
.control-select,
.wide-select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.mini-button:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(55, 199, 181, 0.36);
  transform: translateY(-1px);
}

.glass-button {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.text-button {
  padding: 0 8px;
  background: transparent;
  color: var(--ink);
}

.record-button {
  background: linear-gradient(135deg, #e6534b, #f97066);
  color: #fff;
}

.warning-button {
  background: linear-gradient(135deg, var(--sun), #f2a94b);
  color: #503018;
}

.stop-button {
  background: #fff0ee;
  color: #a23a33;
}

.icon-button,
.delete-take-button {
  width: 42px;
  padding: 0;
}

.icon-button svg,
.delete-take-button svg,
.back-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  outline: none;
}

textarea:focus,
input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(55, 199, 181, 0.36);
  outline-offset: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.error {
  color: #a23a33;
  background: #fff0ee;
  border-color: rgba(249, 112, 102, 0.3);
}

.status-pill.pending {
  color: #755411;
  background: #fff6dc;
  border-color: rgba(243, 201, 105, 0.5);
}

.status-pill.saved {
  color: #147a68;
  background: #e8faf7;
  border-color: rgba(55, 199, 181, 0.42);
}

/* Landing */
.landing-view {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(251, 247, 241, 0) 0, var(--paper) 520px),
    linear-gradient(135deg, var(--paper), var(--paper-2) 52%, #ffffff);
}

.landing-view main {
  position: relative;
  z-index: 2;
  padding-bottom: 78px;
}

.site-nav {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 50;
  width: min(1180px, calc(100% - 28px));
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 225, 226, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--small-shadow);
  backdrop-filter: blur(22px);
  transform: translateX(-50%);
  transition: min-height 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

body.landing-scrolled .site-nav {
  min-height: 56px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.11);
}

.site-brand span:last-child {
  font-family: var(--display-font);
  font-weight: 850;
}

.site-nav-actions {
  gap: 8px;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  min-height: 88vh;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 116px 0 54px;
}

.hero-image {
  position: absolute;
  inset: -4% 0 auto;
  z-index: -3;
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: center;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(251, 247, 241, 0.98) 0%, rgba(251, 247, 241, 0.91) 34%, rgba(251, 247, 241, 0.36) 66%, rgba(251, 247, 241, 0.08) 100%),
    linear-gradient(0deg, rgba(251, 247, 241, 0.92), rgba(251, 247, 241, 0) 36%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.05), rgba(17, 24, 39, 0));
}

.hero-grid {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.72fr);
  gap: 48px;
  align-items: center;
}

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

.hero-copy h1 {
  max-width: 720px;
  color: var(--ink);
  font-size: 4.85rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 0.94;
  overflow-wrap: break-word;
}

.hero-copy p {
  width: min(600px, 100%);
  margin-top: 24px;
  color: #3e4b59;
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.47;
}

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

.hero-primary {
  min-height: 52px;
  padding: 0 24px;
  font-size: 1rem;
}

.hero-metrics {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 34px 0 0;
}

.hero-metrics div {
  padding: 12px 14px;
  border: 1px solid rgba(217, 225, 226, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.hero-metrics dt,
.hero-metrics dd {
  margin: 0;
}

.hero-metrics dt {
  font-weight: 850;
}

.hero-metrics dd {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.hero-product {
  position: relative;
  align-self: end;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(217, 225, 226, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 246, 0.86)),
    #ffffff;
  box-shadow: 0 34px 90px rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(18px);
}

.product-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.product-chrome span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lavender);
}

.product-chrome span:nth-child(2) {
  background: var(--sun);
}

.product-chrome span:nth-child(3) {
  background: var(--mint);
}

.product-chrome strong {
  margin-left: auto;
}

.product-window {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 16px;
  padding: 18px;
}

.product-script {
  display: grid;
  gap: 10px;
  min-height: 286px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 247, 241, 0.88), rgba(255, 255, 255, 0.9)),
    var(--surface-warm);
}

.product-script p {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  line-height: 1.34;
}

.product-script p:first-child {
  padding: 0;
  background: transparent;
  color: #257f78;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-script .is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 4px 0 0 var(--coral), 0 12px 28px rgba(249, 112, 102, 0.12);
}

.product-script .is-direction {
  color: #147a68;
  background: #e8faf7;
}

.product-script .is-muted {
  opacity: 0.72;
}

.product-rails {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 286px;
  padding: 12px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.product-rails span,
.preview-rails span,
.screen-meter i {
  display: block;
  width: 12px;
  min-height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--mint), #257f78);
}

.product-rails .is-coral,
.preview-rails .is-coral {
  background: linear-gradient(180deg, var(--coral), var(--coral-strong));
}

.product-transport {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 8px;
  padding: 0 18px 18px;
}

.product-transport span,
.product-transport strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
}

.product-transport span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.product-transport strong {
  background: var(--coral-strong);
  color: #fff;
}

.hero-console {
  position: absolute;
  right: max(28px, calc((100vw - 1180px) / 2));
  bottom: 34px;
  width: min(318px, calc(100% - 56px));
  padding: 16px;
  border: 1px solid rgba(217, 225, 226, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 22px 50px rgba(17, 24, 39, 0.14);
  backdrop-filter: blur(18px);
}

.hero-console span,
.panel-kicker {
  color: #257f78;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-console strong {
  display: block;
  margin: 8px 0 14px;
  font-size: 1.15rem;
}

.mini-wave {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 5px;
  height: 54px;
}

.mini-wave i {
  display: block;
  min-height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--mint), #257f78);
  animation: waveBounce 1.2s ease-in-out infinite alternate;
}

.mini-wave i:nth-child(2n) {
  animation-delay: 160ms;
}

.mini-wave i:nth-child(3n) {
  animation-delay: 280ms;
}

.mini-wave i:nth-child(1) { height: 22%; }
.mini-wave i:nth-child(2) { height: 58%; }
.mini-wave i:nth-child(3) { height: 38%; }
.mini-wave i:nth-child(4) { height: 86%; background: linear-gradient(180deg, var(--coral), var(--coral-strong)); }
.mini-wave i:nth-child(5) { height: 48%; }
.mini-wave i:nth-child(6) { height: 72%; }
.mini-wave i:nth-child(7) { height: 34%; }
.mini-wave i:nth-child(8) { height: 62%; }

@keyframes waveBounce {
  from { transform: scaleY(0.72); }
  to { transform: scaleY(1); }
}

.proof-strip {
  position: relative;
  z-index: 4;
  width: min(1180px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: -26px auto 0;
  padding: 12px;
  border: 1px solid rgba(217, 225, 226, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.proof-strip div,
.comparison-card,
.stage-panel,
.flow-step,
.feature-band > div,
.project-create-panel,
.project-list-section,
.project-card,
.script-panel,
.recording-panel,
.settings-panel,
.signin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

.proof-strip div {
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.proof-strip strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 850;
}

.proof-strip span {
  color: var(--muted);
  font-weight: 700;
}

.product-story,
.workflow-section,
.comparison-section,
.handoff-section,
.feature-band,
.final-cta {
  width: min(1180px, calc(100% - 32px));
  margin: 104px auto 0;
}

.product-story {
  display: grid;
  grid-template-columns: 0.76fr 1.24fr;
  gap: 34px;
  align-items: center;
}

.story-copy h2,
.workflow-copy h2,
.section-heading h2,
.handoff-copy h2,
.final-cta h2 {
  font-size: 4.25rem;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.02;
}

.story-copy p,
.workflow-copy p,
.section-heading p,
.handoff-copy p,
.final-cta p,
.comparison-card p,
.feature-band p,
.flow-step p,
.stage-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.story-copy p,
.workflow-copy p,
.handoff-copy p {
  margin-top: 18px;
  font-size: 1.05rem;
}

.story-stage {
  min-height: 620px;
  position: relative;
}

.stage-panel {
  position: absolute;
  padding: 20px;
}

.script-stage {
  left: 0;
  top: 30px;
  width: 72%;
  background: #ffffff;
}

.script-stage p {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7faf9;
  color: var(--muted);
}

.script-stage .active-line {
  background: var(--surface-warm);
  color: var(--ink);
  box-shadow: inset 4px 0 0 var(--coral);
}

.script-stage .direction-line {
  color: #147a68;
  background: #e8faf7;
}

.timeline-stage {
  right: 0;
  top: 118px;
  width: 34%;
  min-height: 380px;
  background: linear-gradient(180deg, #eef7f6, #fbf7f1);
}

.preview-rails {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  height: 260px;
  margin: 18px 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.preview-rails span {
  width: 24px;
}

.punch-stage {
  left: 12%;
  bottom: 18px;
  width: 54%;
  background: linear-gradient(135deg, #fff, #eef7f6);
}

.punch-stage strong,
.timeline-stage strong {
  display: block;
  margin-top: 10px;
  font-size: 1.45rem;
  line-height: 1.1;
}

.workflow-section {
  position: relative;
}

.workflow-copy {
  width: min(740px, 100%);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1fr);
  gap: 26px;
  align-items: start;
  margin-top: 34px;
}

.workflow-steps {
  display: grid;
  gap: 14px;
}

.flow-step {
  position: relative;
  min-height: 188px;
  padding: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.flow-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--mint);
  opacity: 0.78;
}

.flow-step span,
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-warm);
  color: #a23a33;
  font-weight: 900;
}

.flow-step h3 {
  margin-top: 22px;
  font-size: 1.48rem;
}

.flow-step p {
  margin-top: 10px;
}

.workflow-sticky {
  position: sticky;
  top: 94px;
  min-height: 520px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 32, 51, 0.96), rgba(17, 24, 39, 0.88)),
    var(--ink);
  box-shadow: 0 34px 90px rgba(17, 24, 39, 0.22);
}

.workflow-screen {
  position: absolute;
  inset: 28px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid rgba(247, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(247, 241, 232, 0.05);
}

.screen-sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-right: 1px solid rgba(247, 241, 232, 0.12);
}

.screen-sidebar span {
  display: block;
  height: 44px;
  border-radius: 8px;
  background: rgba(247, 241, 232, 0.1);
}

.screen-sidebar span:nth-child(2) {
  background: rgba(55, 199, 181, 0.3);
}

.screen-main {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 26px;
}

.screen-line {
  height: 72px;
  border-radius: 8px;
  background: rgba(247, 241, 232, 0.1);
}

.screen-line.is-soft {
  opacity: 0.52;
}

.screen-line.is-active {
  background: rgba(247, 241, 232, 0.92);
  box-shadow: inset 4px 0 0 var(--coral);
}

.screen-meter {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 96px;
  margin-top: 8px;
}

.screen-meter i {
  width: 18px;
  animation: waveBounce 1.3s ease-in-out infinite alternate;
}

.screen-meter i:nth-child(3) {
  background: linear-gradient(180deg, var(--coral), var(--coral-strong));
}

.section-heading {
  width: min(860px, 100%);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.comparison-card {
  min-height: 276px;
  padding: 22px;
}

.comparison-card span {
  color: #257f78;
  font-weight: 850;
}

.comparison-card h3 {
  margin-top: 34px;
  font-size: 1.55rem;
  line-height: 1.08;
}

.comparison-card p {
  margin-top: 14px;
}

.comparison-card.featured {
  background:
    linear-gradient(135deg, rgba(55, 199, 181, 0.17), rgba(249, 112, 102, 0.13)),
    #ffffff;
  transform: translateY(-14px);
}

.handoff-section {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 0.88fr;
  gap: 38px;
  align-items: center;
}

.handoff-image {
  width: 100%;
  height: 520px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.handoff-copy {
  max-width: 560px;
}

.handoff-copy .primary-button {
  margin-top: 26px;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-band > div {
  padding: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.feature-band h3 {
  margin-top: 22px;
  font-size: 1.35rem;
}

.feature-band p {
  margin-top: 8px;
}

.final-cta {
  margin-bottom: 0;
  padding: 52px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(55, 199, 181, 0.14), rgba(249, 112, 102, 0.11)),
    #ffffff;
  box-shadow: var(--shadow);
}

.final-cta h2 {
  max-width: 890px;
}

.final-cta .primary-button {
  margin-top: 26px;
}

body.landing-active .scroll-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.landing-active .scroll-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Sign in */
.signin-view {
  padding: 28px;
  background: linear-gradient(135deg, var(--paper), #eef7f6);
}

.trial-view,
.profile-view {
  padding: 28px;
  background: linear-gradient(135deg, var(--paper), #eef7f6);
}

.signin-brand {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 20;
  padding: 8px 10px;
  border: 1px solid rgba(217, 225, 226, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--small-shadow);
  backdrop-filter: blur(18px);
  font-weight: 850;
}

.signin-shell {
  width: min(1120px, 100%);
  min-height: calc(100vh - 110px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
}

.signin-art {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 620px;
  box-shadow: var(--shadow);
}

.signin-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signin-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(251, 247, 241, 0.9), transparent 56%);
}

.signin-art div {
  position: absolute;
  z-index: 2;
  left: 28px;
  right: 28px;
  bottom: 28px;
}

.signin-art h1 {
  max-width: 9ch;
  font-size: 6.5rem;
  line-height: 0.9;
  font-weight: 850;
}

.signin-art p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.08rem;
}

.signin-card {
  align-self: center;
  padding: 28px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 8px;
  background: #eef7f6;
}

.auth-tab {
  min-height: 40px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--display-font);
  font-weight: 800;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--small-shadow);
}

.signin-card h2 {
  margin-bottom: 24px;
  font-size: 2rem;
  line-height: 1.05;
}

.signin-card label,
.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.signin-card input,
.project-name-input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
}

.google-button {
  width: 100%;
  min-height: 48px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: var(--display-font);
  font-weight: 850;
}

.google-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea4335, #fbbc05 42%, #34a853 68%, #4285f4);
  color: #fff;
  font-weight: 900;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-fine-print {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.auth-fine-print.error {
  color: #a23a33;
}

.auth-fine-print.saved {
  color: #147a68;
}

.signin-card .primary-button,
.signin-card .secondary-button,
.signin-card .text-button {
  width: 100%;
  margin-top: 12px;
}

.trial-shell,
.profile-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.trial-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: 24px;
  align-items: center;
}

.trial-summary-panel,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--small-shadow);
}

.trial-summary-panel {
  padding: 38px;
}

.trial-summary-panel h1 {
  max-width: 10ch;
  font-size: 6.6rem;
  line-height: 0.92;
}

.trial-summary-panel p {
  max-width: 560px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.trial-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.trial-stats div {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-warm);
}

.trial-stats strong,
.trial-stats span {
  display: block;
}

.trial-stats strong {
  font-size: 1.08rem;
}

.trial-stats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.billing-card {
  width: min(430px, 100%);
  justify-self: end;
}

.billing-grid {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
}

.profile-card {
  padding: 24px;
}

.profile-card h2 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.profile-card p {
  color: var(--muted);
  line-height: 1.45;
}

.billing-profile-card .warning-button {
  margin-top: 16px;
}

.usage-meter {
  height: 14px;
  margin: 20px 0 8px;
  border-radius: 999px;
  background: #eef7f5;
  overflow: hidden;
}

.usage-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sun), var(--coral));
  transition: width 180ms ease;
}

/* Project Library */
.project-library-view {
  padding: 30px;
}

.project-library-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.project-library-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.library-brand h1 {
  font-size: 2rem;
}

.library-brand p {
  margin-top: 4px;
  color: var(--muted);
}

.library-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.project-create-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(55, 199, 181, 0.14), rgba(249, 112, 102, 0.1)),
    rgba(255, 255, 255, 0.82);
}

.project-create-panel h2,
.project-list-heading h2 {
  margin-top: 3px;
  font-size: 1.2rem;
}

.project-create-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-library-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.84rem;
}

.project-library-status.pending {
  color: #8a650c;
}

.project-library-status.error {
  color: #a23a33;
}

.project-library-status.saved {
  color: #147a68;
}

.project-list-section {
  padding: 18px;
}

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

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.project-card {
  display: grid;
  gap: 16px;
  min-height: 190px;
  padding: 16px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    #ffffff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(55, 199, 181, 0.34);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-card h3 {
  font-size: 1rem;
}

.project-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.project-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-meta-item {
  display: grid;
  gap: 2px;
  padding: 9px;
  border-radius: 8px;
  background: var(--paper-2);
}

.project-meta-item strong {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.project-meta-item span {
  color: var(--muted);
  font-size: 0.72rem;
}

.project-open-button {
  justify-self: start;
}

.delete-project-button:hover:not(:disabled),
.delete-take-button:hover:not(:disabled) {
  color: #a23a33;
  border-color: rgba(249, 112, 102, 0.34);
  background: #fff0ee;
}

.delete-project-button.is-armed {
  color: #ffffff;
  border-color: rgba(249, 112, 102, 0.5);
  background: var(--coral-strong);
  box-shadow: 0 10px 24px rgba(249, 112, 102, 0.22);
}

.project-empty-state {
  padding: 38px 18px;
  border: 1px dashed rgba(55, 199, 181, 0.3);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.56);
}

.project-empty-state h2 {
  color: var(--ink);
}

/* Recorder */
.app-shell {
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(20px);
}

.brand h1 {
  font-size: 1.05rem;
  line-height: 1.1;
  font-weight: 700;
}

.brand p,
.panel-heading p,
#scriptSummary {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-format-select {
  min-width: 190px;
}

.workspace {
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(440px, 1.7fr) minmax(260px, 0.72fr);
  gap: 16px;
  padding: 16px;
}

@media (min-width: 1181px) {
  .workspace.settings-panel-hidden {
    grid-template-columns: minmax(280px, 0.84fr) minmax(440px, 2fr);
  }

  .workspace.settings-panel-hidden .settings-panel {
    display: none;
  }
}

.script-panel,
.settings-panel {
  padding: 16px;
}

.recording-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.86);
}

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

#scriptInput {
  width: 100%;
  height: calc(100vh - 178px);
  min-height: 520px;
  resize: none;
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.session-strip {
  min-height: 72px;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(55, 199, 181, 0.12), rgba(249, 112, 102, 0.08)),
    rgba(255, 255, 255, 0.78);
}

#currentLineLabel {
  display: block;
  max-width: 44vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.session-actions {
  gap: 8px;
  justify-content: flex-end;
}

.record-state {
  gap: 8px;
  min-width: 118px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.9rem;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.is-recording .state-dot {
  background: var(--coral-strong);
  box-shadow: 0 0 0 5px rgba(249, 112, 102, 0.14);
}

.teleprompter {
  flex: 1;
  min-height: 440px;
  max-height: calc(100vh - 310px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scroll-padding: 30vh 0;
  scroll-snap-type: y proximity;
  padding: 30vh 28px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.94), transparent 18% 82%, rgba(255, 255, 255, 0.94)),
    var(--paper-2);
  cursor: ns-resize;
  scrollbar-width: none;
  touch-action: none;
  user-select: none;
}

.teleprompter::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.focus-timeline {
  display: none;
}

.prompt-row {
  position: relative;
  width: min(920px, 100%);
  min-height: 78px;
  margin: 0 auto 14px;
  padding: 18px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #657283;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.34rem;
  line-height: 1.36;
  opacity: 0.68;
  transform-origin: center center;
  will-change: color, opacity, transform;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 220ms ease,
    color 220ms ease,
    border-color 220ms ease;
}

.prompt-row:not(.blank) {
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.line-wheel-active .prompt-row {
  transition-duration: 120ms;
}

.prompt-row.active {
  width: min(980px, 100%);
  background: var(--surface-warm);
  border-color: rgba(249, 112, 102, 0.32);
  color: var(--ink);
  font-weight: 720;
  opacity: 1;
  transform: scale(1.018);
  box-shadow: 0 16px 34px rgba(249, 112, 102, 0.16);
}

.prompt-row.recording-line::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--coral-strong);
  box-shadow: 0 0 0 6px rgba(249, 112, 102, 0.14);
  transform: translateY(-50%);
}

.prompt-row.direction {
  color: #147a68;
  font-style: italic;
}

.prompt-row.blank {
  min-height: 42px;
  opacity: 0.65;
}

.prompt-row.blank::after {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--line);
}

.line-number {
  position: absolute;
  left: 10px;
  top: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.prompt-text {
  display: block;
  max-width: 100%;
}

.inline-direction {
  color: #168566;
  font-style: italic;
}

.punch-marker::before {
  content: "record starts here";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--coral-strong);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.transport {
  gap: 8px;
  padding: 14px 16px 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.82);
}

.recording-mode-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.mode-toggle-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.mode-toggle-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--small-shadow);
}

.meter-row {
  gap: 12px;
  padding: 0 16px 12px;
  background: rgba(255, 255, 255, 0.82);
}

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

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sky), var(--coral));
  transition: width 70ms linear;
}

#meterLabel {
  min-width: 72px;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.takes-panel {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
  background: rgba(255, 255, 255, 0.82);
}

.take-row {
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.take-row.has-audio {
  border-color: rgba(43, 182, 115, 0.34);
  background: #eafff5;
}

.take-row.active-target {
  border-color: var(--coral);
}

.take-name {
  min-width: 64px;
  font-weight: 900;
}

.take-kind {
  color: var(--muted);
  font-size: 0.82rem;
}

.take-duration {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.delete-take-button {
  width: 34px;
  min-height: 34px;
}

.control-select {
  padding: 0 10px;
}

.wide-select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
}

.compact {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.toggle-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.toggle-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 750;
}

.toggle-list input {
  accent-color: var(--coral-strong);
}

/* Timeline */
.timeline-rail {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.timeline-shell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.52) 8%, rgba(255, 255, 255, 0.52) 92%, rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(55, 199, 181, 0.13);
  overflow: hidden;
}

.timeline-shell::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(55, 199, 181, 0.24), transparent);
  transform: translateX(-50%);
}

.timeline-lanes {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 5px;
  padding: 5px;
}

.timeline-shell-main .timeline-lanes {
  grid-template-columns: 1fr;
}

.timeline-shell-alt .timeline-lanes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timeline-shell-continuous .timeline-lanes {
  grid-template-columns: 1fr;
}

.timeline-lane {
  position: relative;
  min-width: 0;
  height: 100%;
  border-radius: 999px;
}

.timeline-segment {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 0;
  border: 1px solid rgba(55, 199, 181, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  opacity: 0.94;
  overflow: hidden;
  transform: translateZ(0);
  transition: top 180ms cubic-bezier(0.2, 0.8, 0.2, 1), height 180ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.timeline-segment::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  bottom: 2px;
  width: calc(18% + (var(--level) * 68%));
  border-radius: 999px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.12)),
    rgba(55, 199, 181, 0.48);
  transform: translateX(-50%);
}

.timeline-segment.selected,
.timeline-segment.is-playing {
  border-color: rgba(249, 112, 102, 0.8);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(249, 112, 102, 0.18), 0 0 18px rgba(249, 112, 102, 0.16);
}

.timeline-segment.is-recording::before {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.12)),
    rgba(249, 112, 102, 0.62);
}

.timeline-segment.punch-start {
  border-color: rgba(249, 112, 102, 0.9);
  box-shadow: 0 0 0 1px rgba(249, 112, 102, 0.24), 0 0 18px rgba(249, 112, 102, 0.18);
}

.continuous-segment {
  min-height: 12px;
}

.timeline-label {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 92%;
  color: currentColor;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.82;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
}

.timeline-ruler {
  position: absolute;
  inset: 5px;
  pointer-events: none;
}

.timeline-tick {
  position: absolute;
  left: 50%;
  width: 52%;
  height: 1px;
  background: rgba(55, 199, 181, 0.14);
  transform: translate(-50%, -50%);
}

.timeline-tick.selected {
  background: rgba(249, 112, 102, 0.5);
}

.timeline-tick.active {
  background: rgba(43, 182, 115, 0.6);
}

.timeline-cursor,
.timeline-punch-marker {
  position: absolute;
  left: 5px;
  right: 5px;
  height: 2px;
  border-radius: 999px;
  pointer-events: none;
  transform: translateY(-50%);
}

.timeline-cursor {
  background: var(--blue);
  box-shadow: 0 0 14px rgba(55, 199, 181, 0.38);
  transition: top 70ms linear;
}

.timeline-punch-marker {
  height: 3px;
  background: var(--coral-strong);
  box-shadow: 0 0 18px rgba(249, 112, 102, 0.38);
}

/* Focus mode */
body.immersive-mode {
  overflow: hidden;
  background: #080807;
}

body.immersive-mode .topbar,
body.immersive-mode .script-panel,
body.immersive-mode .settings-panel {
  display: none;
}

body.immersive-mode .workspace {
  height: 100vh;
  padding: 0;
  display: block;
}

body.immersive-mode .recording-panel {
  height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #080807;
}

body.immersive-mode .session-strip {
  min-height: 70px;
  padding: 14px 22px;
  border-bottom-color: rgba(247, 240, 228, 0.12);
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(18px);
}

body.immersive-mode .eyebrow,
body.immersive-mode .record-state,
body.immersive-mode #meterLabel,
body.immersive-mode .take-kind,
body.immersive-mode .take-duration {
  color: rgba(247, 240, 228, 0.58);
}

body.immersive-mode #currentLineLabel {
  max-width: 62vw;
  color: #fff9ec;
}

body.immersive-mode .session-recorded-time-status {
  display: inline-flex;
  background: rgba(247, 240, 228, 0.1);
  color: rgba(247, 240, 228, 0.78);
  border-color: rgba(247, 240, 228, 0.14);
}

body.immersive-mode .focus-button {
  background: #f7f0e4;
  color: #080807;
}

body.immersive-mode .teleprompter {
  min-height: 0;
  max-height: none;
  scroll-padding: 26vh 0 42vh;
  padding: 30vh 150px 40vh;
  background:
    linear-gradient(to bottom, #080807 0%, rgba(8, 8, 7, 0) 17%, rgba(8, 8, 7, 0) 83%, #080807 100%),
    #0d0d0b;
}

body.immersive-mode .focus-timeline {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 92px;
  bottom: 340px;
  z-index: 5;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 20px;
  pointer-events: none;
}

body.immersive-mode .timeline-rail-main {
  grid-column: 1;
}

body.immersive-mode .timeline-rail-alt {
  grid-column: 3;
}

body.immersive-mode .timeline-shell {
  background:
    linear-gradient(to bottom, rgba(247, 240, 228, 0), rgba(247, 240, 228, 0.06) 8%, rgba(247, 240, 228, 0.06) 92%, rgba(247, 240, 228, 0)),
    rgba(247, 240, 228, 0.025);
  box-shadow: inset 0 0 0 1px rgba(247, 240, 228, 0.07);
}

body.immersive-mode .timeline-shell::before {
  background: linear-gradient(to bottom, transparent, rgba(247, 240, 228, 0.2), transparent);
}

body.immersive-mode .timeline-segment {
  border-color: rgba(247, 240, 228, 0.14);
  background: rgba(247, 240, 228, 0.055);
  color: rgba(247, 240, 228, 0.46);
}

body.immersive-mode .timeline-segment::before {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03)),
    rgba(97, 206, 198, 0.36);
}

body.immersive-mode .timeline-segment.selected,
body.immersive-mode .timeline-segment.is-playing {
  border-color: rgba(247, 240, 228, 0.82);
  color: #fffaf0;
  box-shadow: 0 0 0 1px rgba(247, 240, 228, 0.13), 0 0 20px rgba(247, 240, 228, 0.14);
}

body.immersive-mode .timeline-segment.is-recording::before {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.03)),
    rgba(255, 95, 82, 0.62);
}

body.immersive-mode .timeline-segment.punch-start {
  border-color: rgba(255, 95, 82, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 95, 82, 0.24), 0 0 18px rgba(255, 95, 82, 0.16);
}

body.immersive-mode .timeline-tick {
  background: rgba(247, 240, 228, 0.12);
}

body.immersive-mode .timeline-tick.selected {
  background: rgba(247, 240, 228, 0.42);
}

body.immersive-mode .timeline-tick.active {
  background: rgba(97, 206, 198, 0.56);
}

body.immersive-mode .timeline-cursor {
  background: #fffaf0;
  box-shadow: 0 0 14px rgba(255, 250, 240, 0.52), 0 0 1px rgba(255, 250, 240, 0.9);
}

body.immersive-mode .timeline-punch-marker {
  background: #ff5f52;
  box-shadow: 0 0 18px rgba(255, 95, 82, 0.42);
}

body.immersive-mode .prompt-row {
  width: min(1120px, calc(100% - 72px));
  min-height: 116px;
  margin-bottom: 22px;
  padding: 20px 34px;
  border: 0;
  background: transparent;
  color: rgba(247, 240, 228, 0.34);
  font-size: 2.7rem;
  line-height: 1.18;
  opacity: 1;
  transform: scale(0.96);
}

body.immersive-mode .prompt-row.active {
  width: min(1320px, 100%);
  background: transparent;
  color: #fff9ec;
  transform: translateY(-20px) scale(1.08);
  text-shadow: 0 0 24px rgba(247, 240, 228, 0.12);
  box-shadow: none;
}

body.immersive-mode .prompt-row.recording-line::before {
  left: 14px;
  width: 9px;
  height: 9px;
  background: #ff5f52;
  box-shadow: 0 0 0 7px rgba(255, 95, 82, 0.14), 0 0 22px rgba(255, 95, 82, 0.44);
}

body.immersive-mode .prompt-row.direction {
  color: rgba(97, 206, 198, 0.66);
}

body.immersive-mode .prompt-row.blank::after {
  background: rgba(247, 240, 228, 0.18);
}

body.immersive-mode .line-number {
  color: rgba(247, 240, 228, 0.34);
  top: 18px;
}

body.immersive-mode .inline-direction {
  color: #61cec6;
}

body.immersive-mode .punch-marker::before {
  background: #e45b49;
  color: #fffaf0;
}

body.immersive-mode .transport,
body.immersive-mode .meter-row,
body.immersive-mode .takes-panel {
  background: #080807;
}

body.immersive-mode .transport {
  border-top: 1px solid rgba(247, 240, 228, 0.12);
  padding: 14px 22px 10px;
}

body.immersive-mode .secondary-button,
body.immersive-mode .icon-button,
body.immersive-mode .mini-button,
body.immersive-mode .delete-take-button,
body.immersive-mode .control-select,
body.immersive-mode .recording-mode-toggle {
  background: #151513;
  color: #f7f0e4;
  border-color: rgba(247, 240, 228, 0.12);
}

body.immersive-mode .mode-toggle-button {
  color: rgba(247, 240, 228, 0.58);
}

body.immersive-mode .mode-toggle-button.active {
  background: #f7f0e4;
  color: #080807;
}

body.immersive-mode .delete-take-button {
  color: rgba(247, 240, 228, 0.58);
}

body.immersive-mode .delete-take-button:hover:not(:disabled) {
  color: #ff8277;
  border-color: rgba(255, 130, 119, 0.34);
  background: #1c1412;
}

body.immersive-mode .record-button {
  background: #e04b3c;
  color: #fffaf0;
}

body.immersive-mode .warning-button {
  background: #c9963d;
  color: #120d04;
}

body.immersive-mode .stop-button {
  background: #f7f0e4;
  color: #080807;
}

body.immersive-mode .meter {
  background: rgba(247, 240, 228, 0.14);
}

body.immersive-mode .take-row {
  border-color: rgba(247, 240, 228, 0.14);
  background: #10100e;
}

body.immersive-mode .take-row.has-audio {
  border-color: rgba(83, 188, 132, 0.46);
  background: #101711;
}

body.immersive-mode .take-name {
  color: #f7f0e4;
}

.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(251, 247, 241, 0.72);
  backdrop-filter: blur(12px);
}

.countdown-overlay[hidden] {
  display: none !important;
}

.countdown-overlay span {
  display: block;
  color: var(--coral-strong);
  font-family: var(--display-font);
  font-size: 14rem;
  font-weight: 700;
  line-height: 0.78;
  text-shadow: 0 20px 50px rgba(249, 112, 102, 0.16);
  animation: countdownPulse 820ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.countdown-overlay p {
  margin-top: 26px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

body.immersive-mode .countdown-overlay {
  background: rgba(8, 8, 7, 0.88);
}

body.immersive-mode .countdown-overlay span {
  color: #fff9ec;
  text-shadow: 0 0 40px rgba(247, 240, 228, 0.25);
}

body.immersive-mode .countdown-overlay p {
  color: rgba(247, 240, 228, 0.72);
}

@keyframes countdownPulse {
  0% {
    opacity: 0;
    transform: scale(0.84);
  }
  22% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 0.88;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 1180px) {
  .hero-grid {
    gap: 28px;
  }

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

  .story-copy h2,
  .workflow-copy h2,
  .section-heading h2,
  .handoff-copy h2,
  .final-cta h2 {
    font-size: 3.55rem;
  }

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

  #scriptInput {
    height: 300px;
    min-height: 300px;
  }

  .settings-panel {
    display: none;
  }

  .settings-panel.open {
    display: block;
  }

  body.immersive-mode .settings-panel.open {
    display: none;
  }

  #currentLineLabel {
    max-width: 68vw;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .product-story,
  .workflow-grid,
  .handoff-section,
  .signin-shell,
  .trial-shell,
  .profile-grid,
  .comparison-grid,
  .feature-band {
    grid-template-columns: 1fr;
  }

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

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

  .hero-copy h1 {
    max-width: 640px;
    font-size: 3.7rem;
  }

  .hero-product {
    align-self: auto;
    min-height: 360px;
  }

  .hero-console {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(420px, calc(100% - 56px));
    margin: 22px auto 0;
  }

  .story-stage {
    min-height: auto;
    display: grid;
    gap: 14px;
  }

  .stage-panel {
    position: static;
    width: 100%;
  }

  .timeline-stage {
    min-height: 320px;
  }

  .workflow-sticky {
    position: relative;
    top: auto;
    min-height: 420px;
  }

  .comparison-card.featured {
    transform: none;
  }

  .handoff-image {
    height: 360px;
  }

  .proof-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .signin-art {
    min-height: 380px;
  }

  .signin-art h1,
  .trial-summary-panel h1 {
    font-size: 4.8rem;
  }

  .billing-card {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-nav {
    top: 8px;
    width: calc(100% - 16px);
    min-height: 58px;
    align-items: center;
  }

  .site-nav-actions {
    display: flex;
    width: auto;
    margin-left: auto;
  }

  .site-nav-actions .text-button,
  .site-nav-actions .ghost-button {
    display: none;
  }

  .site-nav-actions .primary-button {
    grid-column: auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .site-brand span:last-child {
    display: none;
  }

  .top-actions,
  .session-actions,
  .project-create-panel,
  .project-library-header,
  .topbar,
  .session-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-hero {
    min-height: auto;
    padding: 96px 0 28px;
  }

  .hero-copy h1 {
    max-width: 100%;
    font-size: 2.7rem;
    line-height: 0.96;
  }

  .hero-copy p {
    margin-top: 16px;
    font-size: 1rem;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .hero-metrics {
    display: none;
  }

  .hero-product,
  .hero-console {
    display: none;
  }

  .proof-strip,
  .product-story,
  .workflow-section,
  .comparison-section,
  .handoff-section,
  .feature-band,
  .final-cta {
    width: calc(100% - 20px);
  }

  .proof-strip {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .product-story,
  .workflow-section,
  .comparison-section,
  .handoff-section,
  .feature-band,
  .final-cta {
    margin-top: 64px;
  }

  .story-copy h2,
  .workflow-copy h2,
  .section-heading h2,
  .handoff-copy h2,
  .final-cta h2 {
    font-size: 2.25rem;
  }

  .workflow-screen {
    inset: 16px;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .screen-main {
    padding: 16px;
  }

  .screen-line {
    height: 54px;
  }

  .final-cta {
    padding: 28px;
  }

  .project-library-view,
  .signin-view,
  .trial-view,
  .profile-view {
    padding: 16px;
  }

  .trial-summary-panel {
    padding: 24px;
  }

  .signin-art h1,
  .trial-summary-panel h1 {
    font-size: 3.1rem;
  }

  .countdown-overlay span {
    font-size: 8rem;
  }

  .trial-stats {
    grid-template-columns: 1fr;
  }

  .project-create-controls,
  .project-name-input,
  .project-create-controls .primary-button {
    width: 100%;
  }

  .workspace {
    padding: 10px;
  }

  .teleprompter {
    min-height: 380px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .prompt-row {
    font-size: 1.08rem;
  }

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

  .transport .record-button,
  .transport .stop-button,
  .transport .warning-button,
  .transport .control-select,
  .transport .secondary-button {
    width: 100%;
  }

  .take-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .take-kind,
  .take-duration {
    margin-left: 0;
  }

  body.immersive-mode .session-strip {
    min-height: 82px;
    padding: 12px 14px;
  }

  body.immersive-mode #currentLineLabel {
    max-width: 100%;
  }

  body.immersive-mode .teleprompter {
    padding: 25vh 74px 40vh;
  }

  body.immersive-mode .prompt-row {
    width: min(100%, calc(100% - 18px));
    min-height: 92px;
    padding: 18px 16px;
    font-size: 1.56rem;
  }

  body.immersive-mode .prompt-row.active {
    width: 100%;
  }

  body.immersive-mode .focus-timeline {
    left: 10px;
    right: 10px;
    top: 116px;
    bottom: 390px;
    grid-template-columns: 48px 1fr 48px;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  body.landing-active .scroll-reveal,
  body.landing-active .scroll-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
