/* Tembr product site. Brand: amber #F3A530 on #131110, ember gradient
   #F3A530 -> #D1622B reserved for live and played sound. */

@font-face {
  font-family: "Archivo";
  src: url("/tembr/fonts/archivo-800-latin.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/tembr/fonts/archivo-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/tembr/fonts/instrumentsans-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/tembr/fonts/instrumentsans-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/tembr/fonts/instrumentsans-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/tembr/fonts/ibmplexmono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/tembr/fonts/ibmplexmono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #131110;
  --surface: #1c1916;
  --raised: #262019;
  --inset: #0c0b0a;
  --line: #2e2a25;
  --line-soft: #242019;
  --text: #f2ead9;
  --muted: #a89e8c;
  --faint: #6b6357;
  --amber: #f3a530;
  --amber-hover: #f7b95c;
  --amber-dim: #8a6423;
  --ember-deep: #d1622b;
  --radius: 8px;
  --f-display: "Archivo", sans-serif;
  --f-body: "Instrument Sans", -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --wrap: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--amber-dim); color: var(--text); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
img, svg, video { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

h1, h2 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
h1 { font-size: clamp(42px, 7.4vw, 88px); }
h2 { font-size: clamp(28px, 4vw, 46px); margin-bottom: 14px; }
h3 { font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }

/* ---------- top bar ---------- */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  pointer-events: none;
}
.top a, .top button { pointer-events: auto; }
.top-brand img { display: block; width: 118px; height: auto; }

.amb {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(19, 17, 16, 0.72);
  backdrop-filter: blur(8px);
  transition: color 0.15s ease, border-color 0.15s ease, transform 160ms var(--ease-out);
}
.amb:hover { color: var(--text); border-color: var(--amber-dim); }
.amb:active { transform: scale(0.96); }
.amb-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.amb-bars i {
  width: 3px; height: 4px;
  background: var(--faint);
  border-radius: 1px;
  transition: height 0.3s var(--ease-out), background 0.3s ease;
}
.amb[aria-pressed="true"] .amb-bars i { background: var(--amber); }
.amb[aria-pressed="true"] .amb-bars i:nth-child(1) { animation: amb-b 1.1s ease-in-out infinite; }
.amb[aria-pressed="true"] .amb-bars i:nth-child(2) { animation: amb-b 0.9s 0.15s ease-in-out infinite; }
.amb[aria-pressed="true"] .amb-bars i:nth-child(3) { animation: amb-b 1.3s 0.3s ease-in-out infinite; }
@keyframes amb-b { 50% { height: 12px; } }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 110px 24px 170px;
  width: 100%;
}
.hero-inner h1 { max-width: 12ch; text-wrap: balance; }
.hero-sub {
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 52ch;
  margin-top: 22px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
  align-items: center;
}
/* Sits beside the CTAs as the third flex item, and drops to its own line on
   narrow screens because .hero-actions already wraps. */
.mic-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  flex: 1 1 260px;
  max-width: 34ch;
}
.mic-note.listening { color: var(--amber); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 99px;
  background: var(--amber);
  color: #17130c;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--amber);
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 160ms var(--ease-out);
}
.cta:hover { background: var(--amber-hover); border-color: var(--amber-hover); }
.cta:active { transform: scale(0.97); }
.cta.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.cta.ghost:hover { border-color: var(--amber-dim); color: var(--amber); }
.cta.listening {
  background: var(--ember-deep);
  border-color: var(--ember-deep);
  color: var(--text);
}
.mic-ico { flex-shrink: 0; }

/* ---------- bands ---------- */

.band { padding: clamp(84px, 12vw, 150px) 0; border-top: 1px solid var(--line-soft); }
.band-sub { color: var(--muted); max-width: 58ch; margin-bottom: 30px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 14.5px; }

/* ---------- demo ---------- */

.demo-band { background: var(--inset); }
.demo-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 40px;
  align-items: center;
  margin-top: 36px;
}
.demo-tabs { display: flex; flex-direction: column; gap: 10px; }
.demo-tab {
  text-align: left;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 160ms var(--ease-out);
}
.demo-tab:hover { border-color: var(--amber-dim); }
.demo-tab:active { transform: scale(0.99); }
.demo-tab.active { border-color: var(--amber); background: var(--raised); }
.demo-tab b { font-family: var(--f-display); font-weight: 700; font-size: 16px; }
.demo-tab span { color: var(--muted); font-size: 13px; }
.demo-note { font-size: 13px; color: var(--faint); margin-top: 12px; max-width: 40ch; }

.phone {
  position: relative;
  width: min(360px, 86vw);
  /* Fallback only. JS measures the page inside and shrinks the frame to it, so
     a short lead page leaves no dead space; 19.5:9 is the tallest it may get. */
  aspect-ratio: 390 / 844;
  border: 1px solid var(--line);
  border-radius: 38px;
  background: #000;
  padding: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  justify-self: center;
}
.phone-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 22px;
  border-radius: 12px;
  background: #000;
  z-index: 2;
}
.phone iframe {
  /* Rendered at the player page's native 390px width, then scaled to fit
     the phone's inner screen so nothing overflows. JS sets the scale. */
  width: 390px;
  height: 780px;
  border: 0;
  border-radius: 30px;
  background: #0d1114;
  transform-origin: top left;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 36px;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
}
.step-k {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.step-k::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 14px;
}
.step p { color: var(--muted); font-size: 14.5px; }

/* ---------- videos ---------- */

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.video-slot video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--inset);
  display: block;
}
.video-slot figcaption {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}
.tutorials h3 { margin: 40px 0 6px; }
.tutorials-sub { color: var(--faint); font-size: 13px; margin-bottom: 14px; }

/* The film leads; the pair supports; the tutorials line up like chapters. */
.video-featured { max-width: 760px; margin-top: 10px; }
.videos-pair { grid-template-columns: 1fr 1fr; margin-top: 24px; }
.videos-tutorials { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.video-len { color: var(--faint); margin-left: 8px; letter-spacing: 0.08em; }

@media (max-width: 640px) {
  .videos-pair { grid-template-columns: 1fr; }
}

/* ---------- the walkthrough tour ---------- */

.tour {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 12px;
}
.tour-rail {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 90px;
}
.tour-tab {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease, transform 160ms var(--ease-out);
}
.tour-tab i {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--faint);
  transition: color 0.15s ease;
}
.tour-tab:hover { color: var(--text); border-color: var(--line); }
.tour-tab:active { transform: scale(0.98); }
.tour-tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
.tour-tab.active i, .tour-tab.done i { color: var(--amber); }

.tour-stage { min-height: 300px; }
.tour-step { display: none; }
.tour-step.active {
  display: block;
  animation: tour-in 220ms var(--ease-out);
}
@keyframes tour-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.tour-step h3 { font-size: 22px; margin-bottom: 10px; }
.tour-copy { color: var(--muted); font-size: 14.5px; max-width: 48ch; margin-bottom: 18px; }
.tour-fine { font-size: 13px; color: var(--faint); margin: 16px 0 0; }

.tour-act {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 160ms var(--ease-out);
}
.tour-act:hover { border-color: var(--amber-dim); }
.tour-act:active { transform: scale(0.97); }
.tour-act.playing { border-color: var(--ember-deep); background: var(--raised); }
.tour-rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ember-deep);
  flex-shrink: 0;
}
.tour-act.playing .tour-rec-dot { animation: tour-pulse 1.1s ease-in-out infinite; }
@keyframes tour-pulse { 50% { opacity: 0.35; } }

.tour-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 46px;
  margin-top: 20px;
}
.tour-bars i {
  flex: 1 1 0;
  max-width: 9px;
  height: 100%;
  border-radius: 2px;
  background: #2a241d;
  transform: scaleY(0.16);
  transform-origin: bottom;
}
.tour-bars.live i {
  background: linear-gradient(180deg, var(--ember-deep), var(--amber));
}

.tour-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tour-chip {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.tour-chip.in { opacity: 1; transform: none; }

.tour-voice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.tour-voice-meta { display: flex; flex-direction: column; gap: 2px; }
.tour-voice-meta b { font-family: var(--f-display); font-weight: 700; font-size: 16px; }
.tour-voice-meta span { color: var(--muted); font-size: 13px; }
.tour-star {
  font-size: 22px;
  line-height: 1;
  color: var(--faint);
  padding: 8px;
  border-radius: 50%;
  transition: color 0.15s ease, transform 160ms var(--ease-out);
}
.tour-star:hover { color: var(--muted); }
.tour-star:active { transform: scale(0.9); }
.tour-star[aria-pressed="true"] { color: var(--amber); }

.tour-type {
  font-family: var(--f-mono);
  font-size: 16px;
  color: var(--text);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-height: 56px;
  max-width: 560px;
  margin-bottom: 18px;
}
.tour-typed::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--amber);
  animation: tour-caret 1.05s steps(1) infinite;
}
@keyframes tour-caret { 50% { opacity: 0; } }
.tour-step.typed-done .tour-typed::after { display: none; }

.tour-leads { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.tour-lead {
  text-align: left;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 160ms var(--ease-out);
}
.tour-lead:hover { border-color: var(--amber-dim); }
.tour-lead:active { transform: scale(0.98); }
.tour-lead.playing { border-color: var(--ember-deep); background: var(--raised); }
.tour-lead b { font-family: var(--f-display); font-weight: 700; font-size: 15px; }
.tour-lead span { color: var(--muted); font-size: 12.5px; }

/* Static and reduced-motion: the tour becomes a plain readable sequence. */
.tour.static { display: block; }
.tour.static .tour-rail { display: none; }
.tour.static .tour-step { display: block; margin-bottom: 40px; animation: none; }
.tour.static .tour-typed::after { display: none; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 64px 0 48px;
  background: var(--inset);
}
.foot .wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.foot-logo { width: 104px; height: auto; opacity: 0.9; }
.foot-built { color: var(--muted); font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease;
}
.foot-links a:hover { color: var(--amber); }
.foot-copy { color: var(--faint); font-size: 12.5px; margin-top: 12px; }

/* ---------- reveals & motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .demo-grid { grid-template-columns: 1fr; }
  .phone { justify-self: start; }
  .tour { display: block; }
  .tour-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
  }
  .tour-tab { white-space: nowrap; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .amb[aria-pressed="true"] .amb-bars i { animation: none; height: 9px; }
  .tour-step.active { animation: none; }
  .tour-typed::after { animation: none; }
  .tour-act.playing .tour-rec-dot { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
