/* Replacr Studio, replacrstudio.com
   Palette pulled from the app's Theme.swift and the Replacr logo. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* App chrome */
  --bg: #1C1C1E;
  --panel: #252527;
  --section: #2F2F32;
  --lane: #38383B;
  --lane-alt: #333336;
  --ruler: #29292B;
  --well: #18181A;
  --divider: #0E0E0F;
  --hairline: rgba(255, 255, 255, 0.07);

  --text: #E8E8EA;
  --dim: #A6A6AB;
  --faint: #76767B;

  /* Brand (logo) */
  --brand: #662D91;
  --brand-hover: #7637A6;
  --brand-ring: #A47BD0;
  --brand-gray: #A7A9AC;

  /* Clips and markers (app) */
  --source: #95A2DE;
  --source-bar: #6170C0;
  --output: #93CFA1;
  --output-bar: #4F9A63;
  --ink: #0F1013;
  --marker: #E06A00;
  --threshold: #D02B2B;
  --playhead: #F2F2F4;
  --hits: #F0963C;
  --lcd-bg: #0A0E0B;
  --lcd: #4BE08A;

  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--divider);
  background: linear-gradient(#2B2B2D, #232325);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand img {
  height: 30px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
}

.site-nav a {
  color: var(--dim);
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }

@media (max-width: 640px) {
  .site-nav .nav-optional { display: none; }
  .site-nav { gap: 18px; }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: #4E2170;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover { background: var(--brand-hover); }

.btn-small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.btn svg { width: 18px; height: 18px; flex: none; }

/* Hero */

.hero {
  padding: clamp(56px, 9vw, 104px) 0 0;
}

.hero h1 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(40px, 6.6vw, 80px);
  line-height: 0.98;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}

.hero .lede {
  margin: 28px 0 0;
  max-width: 34em;
  font-size: clamp(18px, 2vw, 20px);
  color: var(--dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 36px;
}

.requirement {
  margin: 0;
  font-size: 14px;
  color: var(--faint);
}

/* Session panel (hero visual) */

.session {
  margin: clamp(48px, 7vw, 80px) 0 0;
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: linear-gradient(#2B2B2D, #232325);
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
  color: var(--dim);
}

.lights { display: flex; gap: 7px; }
.lights span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #48484C;
}

.lcd {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 10px;
  background: var(--lcd-bg);
  border: 1px solid #000;
  border-radius: var(--radius-sm);
  color: var(--lcd);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
}
.lcd small { color: #2F8A55; font-size: 12px; font-weight: 500; }

.session-grid {
  display: grid;
  grid-template-columns: 168px 1fr;
}

.session-grid > * { border-bottom: 1px solid var(--divider); }
.session-grid > :nth-last-child(-n + 2) { border-bottom: 0; }

.ruler-head, .ruler {
  height: 30px;
  background: var(--ruler);
}

.ruler {
  position: relative;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.ruler .tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #3C3C3F;
  padding: 2px 0 0 5px;
}
.ruler .hit {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--marker);
}

.track-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 14px;
  background: linear-gradient(#353538, #2E2E31);
  border-right: 1px solid var(--divider);
  position: relative;
}
.track-head::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.track-head.is-source::before { background: var(--source-bar); }
.track-head.is-output::before { background: var(--output-bar); }

.track-name {
  font-size: 13px;
  font-weight: 600;
  background: #1A1A1C;
  color: #E6E6E8;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-role {
  font-size: 12px;
  color: var(--faint);
  padding-left: 2px;
}

.lane {
  position: relative;
  height: 128px;
  padding: 10px 0;
  background: var(--lane);
}
.lane.alt { background: var(--lane-alt); }

.clip {
  position: relative;
  height: 100%;
  border-radius: 3px;
  overflow: hidden;
}
.clip.is-source { background: var(--source); }
.clip.is-output { background: var(--output); }

.clip-name {
  height: 18px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 18px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.clip.is-source .clip-name { background: var(--source-bar); }
.clip.is-output .clip-name { background: var(--output-bar); }

.clip svg {
  width: 100%;
  height: calc(100% - 18px);
}
.wave { fill: var(--ink); }
.thr {
  stroke: var(--threshold);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.mk {
  stroke: var(--marker);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 168px;
  width: 0;
  border-left: 1px solid var(--playhead);
  pointer-events: none;
  opacity: 0;
}

.session-body { position: relative; }

/* Load sequence: playhead sweeps once, replaced clip is written behind it */
.session.is-playing .playhead {
  opacity: 1;
  animation: sweep 4.2s linear forwards;
}
.session.is-playing .clip.is-output {
  animation: write 4.2s linear forwards;
}
.session.is-done .playhead { opacity: 0; transition: opacity 0.4s; }

@keyframes sweep {
  from { left: 168px; }
  to { left: 100%; }
}
@keyframes write {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.session-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 10px 14px;
  background: var(--panel);
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--faint);
}
.key-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 3px; border-radius: 2px; }
.swatch.thr-s { background: repeating-linear-gradient(90deg, var(--threshold) 0 4px, transparent 4px 7px); }
.swatch.mk-s { background: var(--marker); width: 3px; height: 12px; }

@media (max-width: 720px) {
  .session-grid { grid-template-columns: 96px 1fr; }
  .playhead { left: 96px; }
  @keyframes sweep { from { left: 96px; } to { left: 100%; } }
  .lane { height: 104px; }
  .track-head { padding: 0 8px 0 12px; }
  .track-name { font-size: 12px; padding: 3px 6px; }
  .track-role { font-size: 11px; }
  .ruler .tick:nth-child(even) { display: none; }
}

/* Sections */

.section {
  padding: clamp(80px, 11vw, 136px) 0 0;
}

.section-head {
  max-width: 40em;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.06;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 18px;
}

/* Steps: a real sequence, so they get numbers */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  counter-reset: step;
}

.steps li {
  padding: 28px 28px 0 0;
  counter-increment: step;
}
.steps li + li {
  padding-left: 28px;
  border-left: 1px solid var(--hairline);
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-ring);
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 650;
  font-stretch: 108%;
}
.steps p {
  margin: 0;
  color: var(--dim);
  font-size: 16px;
}

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; row-gap: 0; }
  .steps li, .steps li + li { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--hairline); }
}

/* Inspector: mirrors the app's right-hand panel */

.inspector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel {
  background: var(--panel);
  padding: 0 0 8px;
}

.panel h3 {
  margin: 0;
  padding: 12px 20px;
  background: var(--section);
  border-bottom: 1px solid var(--divider);
  font-size: 15px;
  font-weight: 650;
  font-stretch: 108%;
}

.panel dl { margin: 0; padding: 6px 20px 8px; }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.row:last-child { border-bottom: 0; }

.row dt { font-weight: 600; font-size: 16px; }
.row dd.val {
  margin: 0;
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  color: var(--lcd);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row dd.desc {
  margin: 0;
  grid-column: 1 / -1;
  font-size: 15px;
  color: var(--dim);
}

@media (max-width: 820px) {
  .inspector { grid-template-columns: 1fr; }
}

/* Batch + keys */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

.split h2 { font-size: clamp(28px, 3.4vw, 38px); }
.split p { color: var(--dim); margin: 18px 0 0; max-width: 32em; }

.tracklist {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.tracklist li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #222224;
}
.tracklist li:nth-child(even) { background: #262628; }
.tracklist li.off { color: #8A8A8F; }

.check {
  width: 16px; height: 16px;
  border-radius: 3px;
  background: var(--brand);
  position: relative;
}
.check::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.off .check { background: #161618; border: 1px solid #3A3A3D; }
.off .check::after { display: none; }

.count {
  color: var(--hits);
  font-variant-numeric: tabular-nums;
}
.off .count { color: #5A5A5E; }

.keys {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 18px;
  align-items: center;
  font-size: 15px;
}
.keys dt { display: flex; gap: 6px; }
.keys dd { margin: 0; color: var(--dim); }

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #DDDDE0;
  background: linear-gradient(#48484C, #3C3C40);
  border: 1px solid #111113;
  border-radius: 5px;
  box-shadow: 0 2px 0 #111113;
}

/* Privacy callout */

.private {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: clamp(28px, 4vw, 44px);
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
}
.private img { width: 88px; height: 88px; }
.private h2 { font-size: clamp(26px, 3vw, 34px); }
.private p { margin: 12px 0 0; color: var(--dim); max-width: 46em; }
.private a { color: var(--text); text-underline-offset: 3px; }

@media (max-width: 600px) {
  .private { grid-template-columns: 1fr; }
  .private img { width: 64px; height: 64px; }
}

/* Maker note */

.maker {
  max-width: 44em;
  margin: 0;
}
.maker blockquote {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.5;
  font-weight: 420;
  color: var(--text);
}
.maker blockquote p { margin: 0 0 1em; }
.maker figcaption {
  font-size: 15px;
  color: var(--faint);
}
.maker figcaption a { color: var(--dim); text-underline-offset: 3px; }

/* Final CTA */

.closer {
  padding: clamp(80px, 11vw, 136px) 0;
  text-align: center;
}
.closer img { width: 96px; height: 96px; margin: 0 auto 26px; }
.closer h2 { margin: 0 0 28px; }
.closer .requirement { margin-top: 16px; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--divider);
  background: #18181A;
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }
.legal { flex-basis: 100%; font-size: 13px; color: #5E5E63; }

/* Document pages (privacy, support) */

.doc {
  padding: clamp(48px, 8vw, 88px) 0 clamp(72px, 10vw, 120px);
}
.doc .wrap { max-width: calc(760px + var(--gutter) * 2); }

.doc h1 {
  margin: 0;
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.02;
  font-weight: 700;
  font-stretch: 116%;
  letter-spacing: -0.02em;
}
.doc .updated { margin: 14px 0 0; color: var(--faint); font-size: 15px; }

.doc .summary {
  margin: 36px 0 8px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  font-size: 18px;
}
.doc .summary p { margin: 0; }

.doc h2 {
  margin: 48px 0 12px;
  font-size: 23px;
  font-weight: 650;
  font-stretch: 108%;
}
.doc p, .doc li { color: #CFCFD3; }
.doc p { margin: 0 0 16px; }
.doc ul { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--text); text-underline-offset: 3px; }
.doc strong { color: var(--text); font-weight: 600; }

.faq dt {
  margin-top: 28px;
  font-weight: 600;
  font-size: 18px;
}
.faq dd { margin: 8px 0 0; color: #CFCFD3; }

.contact-card {
  margin: 32px 0 8px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
}
.contact-card p { margin: 0 0 6px; }
.contact-card .email {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 650;
  font-stretch: 108%;
  text-decoration: none;
  word-break: break-word;
}
.contact-card .email:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .session.is-playing .playhead,
  .session.is-playing .clip.is-output { animation: none; }
  .playhead { display: none; }
}

.closer h2 {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.06;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.015em;
}
.kto { align-self: center; font-size: 13px; color: var(--faint); }
.contact-note { margin-top: 12px !important; color: var(--dim) !important; font-size: 15px; }
