/*
 * The start page (src/page.ts): the docs' calm column on the theme's tokens (@openfolia/theme,
 * served as /_demo/theme.css), light by default and `.dark` on <html> for dark. No colour is
 * written here but the films' black and the play button's white, which sit on the films' own
 * dark frames in both themes.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}
html.dark {
  color-scheme: dark;
}
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.icon {
  width: 1em;
  height: 1em;
  flex: none;
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* The bar: the docs' header. */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  border-bottom: 1px solid var(--border);
}
.home {
  display: block;
  border-radius: 4px;
}
.logo {
  height: 24px;
  width: auto;
  display: block;
}
.logo-dark,
.dark .logo-light {
  display: none;
}
.dark .logo-dark {
  display: block;
}
.tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tools .docs {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 13.5px;
  padding: 6px 8px;
}
.tools .docs:hover {
  color: var(--foreground);
}
.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.seg > a,
.seg label span {
  display: block;
  padding: 3px 9px;
  border-radius: calc(var(--radius) - 4px);
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.seg > a:hover,
.seg label span:hover {
  color: var(--foreground);
}
.seg > a[aria-current],
.seg input:checked + span {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.08);
}
.seg label {
  position: relative;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg input:focus-visible + span {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted-foreground);
  font-size: 16px;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}
.icon-btn .sun,
.dark .icon-btn .moon {
  display: none;
}
.dark .icon-btn .sun {
  display: block;
}

/* The column. */
main {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 72px 24px 56px;
  outline: none;
}
.col {
  width: 100%;
  max-width: 680px;
}
.state,
.films-block {
  display: none;
}
[data-state='ready'] .s-ready,
[data-state='starting'] .s-starting,
[data-state='full'] .s-full,
[data-state='error'] .s-error,
[data-state='full'] .films-block,
[data-state='films'] .films-block {
  display: block;
  animation: enter 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 18px;
  min-height: 20px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-muted);
}
.dot.warn {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-muted);
}
.dot.off {
  background: var(--muted-foreground);
  box-shadow: 0 0 0 3px var(--muted);
}
h1 {
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 .soft {
  color: var(--muted-foreground);
}
.lede {
  margin-top: 16px;
  font-size: 17px;
  color: var(--muted-foreground);
  max-width: 62ch;
  text-wrap: pretty;
}
.notice-line {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: calc(var(--radius) - 2px);
  background: var(--info-muted);
  color: var(--foreground);
}
.notice-line .icon {
  color: var(--info);
  margin-top: 3px;
}
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* The people. */
.people {
  list-style: none;
  padding: 0;
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.person {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  background: var(--card);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-content: start;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--foreground);
  color: var(--background);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.who {
  display: grid;
  align-content: center;
  min-width: 0;
}
.name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}
.role {
  font-size: 12.5px;
  color: var(--muted-foreground);
  line-height: 1.3;
}
.does {
  grid-column: 1 / -1;
  font-size: 13.5px;
  color: var(--muted-foreground);
  line-height: 1.45;
}
.people-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Private: the green box, with the three facts under a hairline. */
.private {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
}
.private .badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--background);
  color: var(--primary);
  font-size: 17px;
}
.private-body {
  min-width: 0;
  flex: 1;
}
.private-title {
  font-weight: 600;
}
.private-body > p:not(.private-title) {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.facts {
  list-style: none;
  padding: 12px 0 0;
  margin-top: 14px;
  border-top: 1px solid oklch(from var(--foreground) l c h / 0.1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.fact {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.4;
}
.fact .icon {
  color: var(--foreground);
  margin-top: 2px;
  font-size: 14px;
}
.fact b {
  display: block;
  color: var(--foreground);
  font-weight: 500;
}

/* Actions. */
.actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 16px;
  box-shadow:
    0 1px 2px oklch(0 0 0 / 0.12),
    inset 0 1px 0 oklch(1 0 0 / 0.12);
  transition:
    transform 0.12s ease,
    filter 0.15s ease,
    opacity 0.15s ease;
}
.btn:hover {
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
  filter: none;
  transform: none;
}
.btn .icon {
  font-size: 15px;
}
.btn.secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  box-shadow: none;
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn.ghost {
  background: transparent;
  color: var(--foreground);
  box-shadow: none;
  font-weight: 500;
  padding: 0 12px;
}
.btn.ghost:hover {
  background: var(--accent);
  filter: none;
}
.lang {
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}
.lang legend {
  float: left;
  padding: 0;
}
.fine {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Starting. */
.progress-card {
  margin-top: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.bar-track {
  height: 3px;
  background: var(--muted);
}
.bar-track i {
  display: block;
  height: 100%;
  width: 4%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.steps {
  list-style: none;
  padding: 8px 0;
}
.steps li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
}
.steps .mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  border: 1.5px solid var(--border);
  color: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.steps .done .mark {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.steps .now .mark {
  border-color: var(--primary);
  border-right-color: transparent;
  animation: spin 0.9s linear infinite;
}
.steps .label {
  font-weight: 500;
}
.steps .sub {
  display: block;
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 400;
}
.steps li:not(.done, .now) .label {
  color: var(--muted-foreground);
}
.steps time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.tip {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted-foreground);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Full: the retry notice and the films. */
.notice {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 16px;
  background: var(--card);
}
.notice .grow {
  flex: 1;
  font-size: 14px;
  min-width: 0;
}
.notice .grow small {
  display: block;
  color: var(--muted-foreground);
  font-size: 13px;
  min-height: 1.4em;
  font-variant-numeric: tabular-nums;
}
.notice .btn {
  height: 38px;
  font-size: 14px;
  padding: 0 14px;
}
.meter {
  display: flex;
  gap: 3px;
}
.meter i {
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: var(--warning);
}
.films-block {
  margin-top: 28px;
}
.films {
  list-style: none;
  padding: 0;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.film {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  min-width: 0;
}
.film.wide {
  grid-column: span 2;
}
.poster {
  appearance: none;
  border: 0;
  padding: 0;
  display: block;
  width: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  cursor: pointer;
  border-radius: 0;
}
.poster img,
.film video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  background: #111;
}
.poster .play {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: oklch(1 0 0 / 0.92);
  color: oklch(0.2 0 0);
  font-size: 15px;
  box-shadow: 0 4px 14px oklch(0 0 0 / 0.3);
  transition: transform 0.15s ease;
}
.poster:hover .play {
  transform: scale(1.06);
}
.film-title {
  display: block;
  padding: 10px 14px 12px;
  font-weight: 600;
  font-size: 14px;
}

/* Error. */
.err-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--destructive-muted);
  color: var(--destructive);
  font-size: 22px;
  margin-bottom: 20px;
}
.ref {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: calc(var(--radius) - 2px);
  padding: 10px 12px;
  display: inline-block;
}
.ref[hidden] {
  display: none;
}

/* What this demo stores. */
.s-data {
  animation: enter 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.stores {
  list-style: none;
  padding: 0;
  margin-top: 32px;
  display: grid;
  gap: 12px;
}
.store {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px 18px 18px;
}
.store .badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--muted);
  color: var(--primary);
  font-size: 17px;
}
.store h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.store p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted-foreground);
  max-width: 64ch;
  text-wrap: pretty;
}
.back {
  margin-top: 28px;
  font-size: 14px;
  font-weight: 500;
}
.back a {
  color: var(--primary);
  text-underline-offset: 3px;
}

.foot {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  font-size: 13px;
  color: var(--muted-foreground);
  display: flex;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.foot-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.foot a {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .bar {
    padding: 0 16px;
  }
  .logo {
    height: 22px;
  }
  .tools .docs {
    display: none;
  }
  main {
    padding: 36px 16px 32px;
  }
  h1 {
    font-size: 30px;
  }
  .lede {
    font-size: 16px;
  }
  .people {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 28px;
  }
  .person {
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    padding: 12px 14px;
  }
  .person .avatar {
    grid-row: span 2;
    align-self: start;
  }
  .does {
    grid-column: 2;
  }
  .private {
    padding: 14px 14px 16px;
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    width: 100%;
  }
  .lang {
    justify-content: center;
  }
  .notice {
    flex-wrap: wrap;
  }
  .notice .btn {
    width: 100%;
  }
  .films {
    gap: 10px;
  }
  .film-title {
    font-size: 13px;
    padding: 8px 10px 10px;
  }
  .poster .play {
    left: 10px;
    bottom: 10px;
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .steps li {
    padding: 12px 14px;
  }
  .foot {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .steps .now .mark {
    border-right-color: var(--primary);
  }
}
