/**
 * Hakban public-site composition and market-lifecycle motion.
 *
 * Purpose
 *   Present the source, monitor, measure, and predict lifecycle while
 *   inheriting the product theme, typography, and chrome from /dashboard.css.
 *
 * Usage
 *   Loaded after /dashboard.css by marketing/index.html.
 */

html { min-height: 100%; background: var(--bg); }

body {
  --site-muted: #96938d;
  --site-line: rgba(240, 238, 232, 0.14);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--fg);
  font: var(--text)/var(--lead) var(--font);
}

.site-bar {
  position: sticky;
  flex: 0 0 auto;
  top: 0;
  z-index: 8;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
}

.site-bar .bar-nav { margin-left: auto; }
.bar-link--app { color: var(--fg); }

.site-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: 0;
}

[hidden] { display: none !important; }

body[data-launch-mode="loading"] [data-public-site] { visibility: hidden; }
body[data-launch-mode="loading"] [data-app-link],
body[data-launch-mode="early-access"] [data-app-link] { display: none; }

.early-access {
  flex: 1 1 auto;
  width: 100%;
  min-height: calc(100vh - 36px);
  padding: clamp(64px, 10vh, 108px) clamp(24px, 7vw, 96px) 48px;
}

.early-access__intro {
  width: min(100%, 900px);
}

.early-access__intro .eyebrow { color: var(--bronze); }
.early-access__intro h1 { max-width: 780px; }
.early-access__intro .lead { max-width: 620px; }

.early-access__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 1080px);
  margin-top: clamp(48px, 9vh, 92px);
  border: 1px solid var(--site-line);
}

.early-access-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  padding: 24px;
}

.early-access-card + .early-access-card { border-left: 1px solid var(--site-line); }
.early-access-card__number { color: var(--bronze); font: 500 0.625rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.early-access-card h2 { margin: 42px 0 0; font-size: 1rem; font-weight: 600; }
.early-access-card p { max-width: 30rem; margin: 7px 0 0; color: var(--site-muted); font-size: 0.75rem; line-height: 1.5; }
.early-access-card label { margin-top: auto; margin-bottom: 7px; color: var(--site-muted); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

.early-access-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.early-access-form-row input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--site-line);
  border-radius: 0;
  outline: 0;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

.early-access-form-row input:focus-visible {
  border-color: var(--bronze);
  box-shadow: inset 0 0 0 1px var(--bronze);
}

.early-access-form-row button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: var(--bronze);
  color: #0b0c0e;
  font: 650 0.75rem/1 var(--font);
}

.early-access-form-row button:disabled { opacity: 0.55; }
.early-access-form-row button:focus-visible {
  box-shadow: 0 0 0 2px var(--fg);
}
.early-access-status { min-height: 1.15rem; }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 36px);
  padding: clamp(52px, 7vh, 72px) clamp(24px, 6vw, 72px) 28px;
}

.hero__intro {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--site-muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

h1 {
  max-width: 68rem;
  margin: 0;
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.04;
}

.lead {
  max-width: 46rem;
  margin: 18px 0 0;
  color: var(--site-muted);
  font-size: 0.8125rem;
  line-height: 1.35rem;
}

.monitor-builder {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 1080px);
  margin-top: 30px;
  border: 1px solid var(--site-line);
  background: color-mix(in srgb, var(--fg) 1.5%, transparent);
}

.monitor-builder > label {
  grid-column: 1 / -1;
  padding: 9px 14px 7px;
  color: var(--site-muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.monitor-builder > input {
  grid-column: 1 / -1;
  min-width: 0;
  height: 42px;
  margin: 0 14px;
  padding: 0 13px;
  border: 1px solid var(--site-line);
  border-radius: 0;
  outline: 0;
  background: var(--bg);
  color: var(--fg);
  font: 500 1rem/1 var(--font);
}

.monitor-builder > input:focus { border-color: var(--bronze); }

.monitor-builder__return {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 8px 14px 10px;
  color: var(--site-muted);
  font-size: 0.6875rem;
}

.monitor-builder__return > span {
  color: var(--bronze);
  font-weight: 600;
  text-transform: uppercase;
}

.monitor-builder__return > strong {
  overflow: hidden;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-builder__return > a {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 16px;
  padding: 0 16px;
  background: var(--bronze);
  color: #0b0c0e;
  font-weight: 650;
  text-decoration: none;
}

.process-film {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin-top: 44px;
}

.process-film__toolbar {
  display: block;
  color: var(--site-muted);
  font-size: 0.6875rem;
}

.process-film__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 25px;
  color: var(--site-muted);
  font-size: 0.625rem;
}

.process-film__heading > span {
  color: var(--fg);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.process-film__controls {
  width: min(100%, 1200px);
  margin-top: 18px;
}

.example-switcher__prompt {
  display: block;
  margin-bottom: 8px;
  color: var(--site-muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.example-switcher {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--site-line);
}

.example-switcher button {
  min-width: 0;
  min-height: 24px;
  overflow: hidden;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--site-muted);
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-switcher button:hover,
.example-switcher button:focus-visible { color: var(--fg); }

.example-switcher button.is-active {
  background: color-mix(in srgb, var(--bronze) 12%, transparent);
  color: var(--bronze);
}

.process-film__mount {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 12px;
  aspect-ratio: 4 / 3;
  background: #0b0c0e;
  overflow: hidden;
}

.process-film__transport {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 4px;
  left: 18px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.process-film__playback {
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--site-muted);
  font: 500 0.625rem/1 var(--font);
  text-align: left;
}

.process-film__playback:hover,
.process-film__playback:focus-visible { color: var(--fg); }

.process-film__scrubber {
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.process-film__scrubber::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--bronze) 0 var(--film-progress),
    var(--site-line) var(--film-progress) 100%
  );
}

.process-film__scrubber::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  margin-top: -3px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--bronze);
  opacity: 0;
}

.process-film__scrubber:hover::-webkit-slider-thumb,
.process-film__scrubber:focus-visible::-webkit-slider-thumb { opacity: 1; }

.process-film__scrubber::-moz-range-track {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--bronze) 0 var(--film-progress),
    var(--site-line) var(--film-progress) 100%
  );
}

.process-film__scrubber::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--bronze);
  opacity: 0;
}

.process-film__scrubber:hover::-moz-range-thumb,
.process-film__scrubber:focus-visible::-moz-range-thumb { opacity: 1; }

.process-film__stage-targets {
  position: absolute;
  z-index: 2;
  top: 25px;
  right: 0;
  bottom: 20px;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  pointer-events: none;
}

.process-film__stage-targets > button {
  min-width: 0;
  border: 0;
  border-radius: 0;
  outline-offset: -2px;
  background: transparent;
  pointer-events: auto;
}

.process-film__stage-targets > button:hover,
.process-film__stage-targets > button:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--bronze) 60%, transparent);
}

.film-director-note { display: none; }

.is-dev .process-film__mount:hover ~ .film-director-note {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 20px;
  display: block;
  max-width: 24rem;
  padding: 8px 10px;
  border: 1px solid var(--bronze);
  background: var(--bg);
  color: var(--fg);
  font-size: 0.6875rem;
  line-height: 1.45;
  pointer-events: none;
}

.market-examples {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: min(100%, 720px);
  margin-top: 10px;
  color: var(--site-muted);
  font-size: 0.6875rem;
}

.market-examples > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--site-line);
}

.market-examples button {
  min-width: 0;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--site-line);
  border-radius: 0;
  background: transparent;
  color: var(--site-muted);
  font: inherit;
}

.market-examples button:last-child { border-right: 0; }
.market-examples button:hover,
.market-examples button:focus-visible { color: var(--fg); }

.market-examples button.is-active {
  background: color-mix(in srgb, var(--bronze) 10%, transparent);
  color: var(--bronze);
}

.process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 1200px);
  margin-top: 12px;
  border: 1px solid var(--site-line);
}

.process-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 82px;
  padding: 13px 18px;
  border: 0;
  border-right: 1px solid var(--site-line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
}

.process-stage:last-child { border-right: 0; }
.process-stage > span { color: var(--site-muted); font: 500 0.625rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.process-stage > strong { margin-top: 7px; font-size: 0.75rem; text-transform: uppercase; }
.process-stage > small { margin-top: 5px; color: var(--site-muted); font-size: 0.6875rem; line-height: 1.35; }
.process-stage:hover,
.process-stage:focus-visible { background: color-mix(in srgb, var(--fg) 3%, transparent); }
.process-stage.is-active { background: color-mix(in srgb, var(--bronze) 7%, transparent); }
.process-stage.is-active > span,
.process-stage.is-active > strong { color: var(--bronze); }

@media (max-width: 920px) {
  body {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .site-main {
    display: block;
    height: auto;
    min-height: calc(100vh - 36px);
  }

  .hero { height: auto; padding: 40px 32px 28px; }
  .process-film { flex: 0 0 auto; }
}

@media (max-width: 640px) {
  .site-bar .bar-nav { gap: 12px; }
  .site-bar .bar-nav > a:first-child { display: none; }
  .hero { padding: 40px 16px 24px; }
  h1 { font-size: clamp(2rem, 10vw, 2.75rem); }
  .lead { font-size: 0.75rem; }
  .monitor-builder { margin-top: 20px; }
  .monitor-builder__return { grid-template-columns: auto minmax(0, 1fr); }
  .monitor-builder__return > a { grid-column: 1 / -1; justify-content: space-between; min-height: 34px; }
  .example-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-stage:nth-child(2) { border-right: 0; }
  .process-stage:nth-child(-n + 2) { border-bottom: 1px solid var(--site-line); }
  .market-examples > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-examples button { border-bottom: 1px solid var(--site-line); }
  .market-examples button:nth-child(2n) { border-right: 0; }
  .market-examples button:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .early-access { padding: 48px 16px 32px; }
  .early-access__actions { grid-template-columns: 1fr; margin-top: 40px; }
  .early-access-card { min-height: 260px; padding: 20px; }
  .early-access-card + .early-access-card { border-top: 1px solid var(--site-line); border-left: 0; }
  .early-access-form-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-examples button { transition: none; }
}
