/* Studio 7 homepage accents: waveforms, markers, emblems, mock-up frame and fee calculator.
   Uses the colour variables from styles.css. One accent colour only (blue). */

:root {
  --mono: var(--font); /* was a monospace font; now the site font everywhere */
  --blue-soft: rgba(0, 113, 227, 0.16);
}

/* ---------- Section eyebrows (track numbers) ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow-num {
  color: var(--blue-text);
  padding: 4px 7px; border-radius: 6px;
  background: var(--blue-soft);
  letter-spacing: 0.04em;
}

/* ---------- Waveforms (bars drawn by js/home.js) ---------- */

.wave { position: relative; display: block; width: 100%; height: 100%; }
.wave svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave .wave-base rect { fill: var(--surface-4); }
.wave .wave-played rect { fill: var(--blue); }
.wave .wave-played { clip-path: inset(0 100% 0 0); animation: wave-play 48s linear infinite; }
.wave .wave-head {
  position: absolute; top: 0; bottom: 0; left: 0; width: 1px;
  background: var(--blue-text); box-shadow: 0 0 12px var(--blue);
  animation: wave-head 48s linear infinite;
}
@keyframes wave-play { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wave-head { from { left: 0; } to { left: 100%; } }

.wave-mini { height: 22px; margin-top: 10px; }
.wave-mini .wave-played, .wave-mini .wave-head { animation-duration: 18s; }
.wave-mini .wave-base rect { fill: var(--surface-4); }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding-bottom: 150px; }
.hero .container { position: relative; z-index: 2; }

.hero-glow {
  position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: -260px; width: 1100px; height: 620px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 113, 227, 0.22), rgba(0, 113, 227, 0) 70%);
}

.hero-wave {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 28px; height: 110px;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.hero-markers { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.marker {
  position: absolute;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--pill);
  background: rgba(28, 28, 30, 0.72); border: 1px solid var(--line-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 500 12px/1 var(--mono); color: var(--text-3); letter-spacing: 0.02em;
  animation: float 7s ease-in-out infinite;
}
.marker:nth-child(2) { animation-delay: -2s; }
.marker:nth-child(3) { animation-delay: -4s; }
.marker:nth-child(4) { animation-delay: -5.5s; }
.marker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-text); }
.marker-file { color: var(--blue-text); }
@keyframes float { 50% { transform: translateY(-8px); } }

@media (max-width: 1100px) { .hero-markers { display: none; } }

/* ---------- Product mock-up frame ---------- */

.preview-stage { position: relative; perspective: 1800px; }
.preview-glow {
  position: absolute; inset: 8% 6% -4%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 113, 227, 0.28), transparent 75%);
  filter: blur(30px);
}
.preview-stage .preview-frame {
  position: relative; z-index: 1;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform-origin: 50% 0;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.js .preview-stage .preview-frame { transform: rotateX(14deg) scale(0.95); }
.js .preview-stage.is-in .preview-frame { transform: none; }

.preview-bar { display: flex; align-items: center; gap: 12px; padding: 2px 6px 14px; }
.preview-bar .preview-dots { padding: 0; }
.preview-url {
  flex: 0 1 320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 28px; border-radius: 8px; background: var(--surface);
  font-size: 12px; color: var(--muted);
}
.preview-bar-spacer { width: 49px; }

.mono-tag { font: 500 12px/1 var(--mono); color: var(--muted); }

.thumb {
  position: relative; flex: none; width: 72px; height: 44px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--surface-4), var(--surface-2));
  display: grid; place-items: center;
}
.thumb-chapters { position: absolute; left: 6px; right: 6px; bottom: 5px; display: flex; gap: 2px; }
.thumb-chapters span { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
.thumb-chapters span:first-child { background: var(--blue-text); }

.file-tag {
  font: 600 11px/1 var(--mono); color: var(--blue-text);
  padding: 6px 8px; border-radius: 6px; background: var(--blue-soft);
}
.pack-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-3); color: var(--text-2); display: grid; place-items: center;
}
.licence {
  flex: none; font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 5px 10px; border-radius: var(--pill); border: 1px solid var(--surface-4);
}

.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.meter span { width: 3px; border-radius: 1px; background: var(--blue-text); animation: meter 1.2s ease-in-out infinite; }
.meter span:nth-child(1) { height: 40%; animation-delay: -0.2s; }
.meter span:nth-child(2) { height: 80%; animation-delay: -0.5s; }
.meter span:nth-child(3) { height: 55%; animation-delay: -0.9s; }
.meter span:nth-child(4) { height: 100%; animation-delay: -0.3s; }
.meter span:nth-child(5) { height: 65%; animation-delay: -0.7s; }
@keyframes meter { 50% { transform: scaleY(0.45); } }
.meter span { transform-origin: bottom; }

.stems .lanes { position: relative; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.lane { display: flex; align-items: center; gap: 10px; }
.lane-name { width: 48px; font-size: 11px; color: var(--muted); }
.lane-track { position: relative; flex: 1; height: 12px; }
.lane-track i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--surface-4); }
.lane.is-accent .lane-track i { background: var(--blue); }
.stems .playhead {
  position: absolute; top: -4px; bottom: -4px; left: 58px; width: 1px;
  background: var(--text); opacity: 0.8;
  animation: lane-head 8s linear infinite;
}
@keyframes lane-head { from { left: 58px; } to { left: 100%; } }

/* ---------- Emblems ---------- */

.emblem {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue-text);
  margin-bottom: 6px;
}
.emblem-sm { width: 38px; height: 38px; border-radius: 10px; margin-bottom: 4px; }

/* ---------- Format strip ---------- */

.format-strip { padding: 40px 0 0; text-align: center; }
.format-label { margin-bottom: 18px; }
.ticker {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: ticker 50s linear infinite; }
.ticker-track span {
  display: inline-flex; align-items: center; white-space: nowrap;
  font: 500 15px/1 var(--font); color: var(--text-3); padding: 0 24px; letter-spacing: -0.01em;
}
.ticker-track span + span { border-left: 1px solid var(--line-2); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- File cards ---------- */

.file-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.file-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.file-type {
  flex: none; width: 46px; height: 52px; border-radius: 8px;
  display: grid; place-items: end center; padding-bottom: 8px;
  background: var(--surface-3); font: 600 11px/1 var(--mono); color: var(--blue-text);
  position: relative;
}
.file-type::before {
  content: ""; position: absolute; top: 0; right: 0; width: 12px; height: 12px;
  background: linear-gradient(225deg, var(--bg) 50%, var(--surface-4) 50%);
  border-bottom-left-radius: 3px;
}
.file-meta { flex: 1; min-width: 0; }
.file-name { font: 500 13px/1.3 var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Fee calculator ---------- */

.calc {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start;
}
.calc-controls, .calc-result {
  background: var(--surface); border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column; gap: 28px;
}
.calc-result { gap: 10px; border: 1px solid var(--line-2); }

.seg { display: inline-flex; padding: 4px; border-radius: var(--pill); background: var(--bg); align-self: flex-start; }
.seg-btn {
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font: 500 14px var(--font); padding: 9px 16px; border-radius: var(--pill);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--surface-3); color: var(--text); }

.control { display: flex; flex-direction: column; gap: 12px; }
.control label { font-size: 15px; font-weight: 500; }
.control-value { font: 600 20px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }

.control input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
  --fill: 20%;
}
.control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--blue) var(--fill), var(--surface-4) var(--fill));
}
.control input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--surface-4); }
.control input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--blue); }
.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; margin-top: -8px;
  background: var(--text); border: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.control input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--text); border: none; }
.ruler { display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); color: var(--muted); }

.calc-keep { font-size: clamp(44px, 6vw, 64px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.calc-per { font-size: 20px; font-weight: 500; color: var(--text-3); letter-spacing: -0.01em; }

.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 14px 0 6px; background: var(--bg); }
.split span { display: block; height: 100%; transition: flex-basis .3s ease; flex: 0 0 0; }
.split-keep { background: var(--blue); }
.split-stripe { background: var(--surface-4); }
.split-melos { background: var(--text-3); }

.calc-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.calc-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 15px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.calc-rows li span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.calc-rows li.is-total { color: var(--text); font-weight: 600; }
.key { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.key-keep { background: var(--blue); }
.key-stripe { background: var(--surface-4); }
.key-melos { background: var(--text-3); }

.calc-tip { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--text-2); font-size: 14px; }

@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
  .calc-controls, .calc-result { padding: 24px; }
}

/* ---------- Join ---------- */

.join { position: relative; overflow: hidden; }
.join .container { position: relative; z-index: 1; }
.join-wave {
  position: absolute; left: 0; right: 0; top: 50%; height: 160px; transform: translateY(-50%);
  opacity: 0.18;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .wave .wave-played { clip-path: inset(0 62% 0 0); }
  .wave .wave-head { left: 38%; }
  .js .preview-stage .preview-frame { transform: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .preview-stage .preview-frame { padding: 8px; }
  .preview-body { padding: 14px; gap: 12px; }
  .preview-body .item { padding: 14px; gap: 12px; }
  .preview-body .item > .mono-tag,
  .preview-body .item > .file-tag,
  .preview-body .item > .licence { display: none; }
  .preview-bar-spacer, .preview-bar .preview-dots { display: none; }
  .hero { padding-bottom: 120px; }
  .hero-wave { height: 80px; opacity: 0.4; }
}

/* ---------- Patreon comparison ---------- */
.calc-compare { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 15px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.compare { border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.compare-row { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 24px; padding: 18px 28px; border-top: 1px solid var(--line-2); font-size: 15px; color: var(--text-3); }
.compare-row:first-child { border-top: 0; }
.compare-row > span:first-child { color: var(--text); font-weight: 600; }
.compare-row > span:nth-child(2) { color: var(--text-2); }
.compare-head { padding-top: 22px; padding-bottom: 14px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.compare-head > span:nth-child(2) { color: var(--blue-text); font-weight: 600; }
.compare-head > span:nth-child(3) { color: var(--text-3); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 720px) {
  .compare-row { grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 16px 20px; }
  .compare-row > span:first-child { grid-column: 1 / -1; }
  .compare-head > span:first-child { display: none; }
}

.tag-soon { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); font-size: 12px; font-weight: 500; letter-spacing: 0; }

/* ---------- Hero entrance (plays once on load) ---------- */

@keyframes hero-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes hero-logo-in { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes wave-sweep { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes head-sweep {
  0% { left: 0; opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes wave-sweep-mini { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 62% 0 0); } }
@keyframes head-sweep-mini { from { left: 0; } to { left: 38%; } }

.hero .container > * { animation: hero-in 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.hero .container > :nth-child(2) { animation-delay: 0.08s; }
.hero .container > :nth-child(3) { animation-delay: 0.16s; }
.hero .container > :nth-child(4) { animation-delay: 0.24s; }
.hero .container > :nth-child(5) { animation-delay: 0.32s; }
.hero .container > :nth-child(6) { animation-delay: 0.40s; }
.hero-glow { animation: fade-in 1.4s ease-out both; }
.hero-markers { animation: fade-in 1s ease-out 0.6s both; }

/* Hero waveform: one quick sweep across, then it stays filled */
.hero-wave .wave .wave-played { animation: wave-sweep 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.45s both; }
.hero-wave .wave .wave-head { animation: head-sweep 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.45s both; }

/* Waveform behind the sign-up section: static, no looping */
.join-wave .wave .wave-played { animation: none; clip-path: inset(0 0 0 0); }
.join-wave .wave .wave-head { display: none; }

/* Mini player in the preview: sweeps to its playback point once, then holds */
.wave-mini .wave-played { animation: wave-sweep-mini 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.9s both; }
.wave-mini .wave-head { animation: head-sweep-mini 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.9s both; }
