/* Omnisells landing page. One stylesheet, no build step.
   The visual world is the CNT shipping app: white and zinc surfaces, zinc-900
   ink, amber-700 as the one action colour, Geist and Geist Mono. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #18181b;
  --body: #52525b;
  --quiet: #63636b;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --surface: #ffffff;
  --band: #fafafa;
  --frame: #f4f4f5;
  --action: #b45309;
  --action-press: #92400e;
  --night: #09090b;
  --night-body: #d4d4d8;
  --night-line: #27272a;
  --night-action: #fbbf24;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  accent-color: var(--action);
  caret-color: var(--action);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keeps anchors and keyboard focus clear of the sticky header. */
  scroll-padding-top: 5rem;
}

/* Several components set their own display, which would otherwise beat the
   browser's rule for the hidden attribute. */
[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #fde68a;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
figure {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

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

img,
video {
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 30;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.3s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--action);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--action-press);
}

.btn--quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.btn--quiet:hover {
  border-color: #a1a1aa;
  background: var(--band);
}

.btn--small {
  min-height: 2.25rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 1.5rem;
  height: 1.5rem;
}

.top__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.top__link {
  display: none;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--body);
  text-decoration: none;
  transition: color 0.2s;
}

.top__link:hover {
  color: var(--ink);
}

.top__nav .btn {
  margin-left: 0.5rem;
}

@media (min-width: 46rem) {
  .top__link {
    display: inline-block;
  }
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
}

.hero__inner {
  padding-block: clamp(3.5rem, 9vw, 6rem) clamp(4rem, 9vw, 7rem);
}

.hero h1 {
  max-width: 17ch;
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero__lede {
  max-width: 48ch;
  margin-top: 1.5rem;
  color: var(--body);
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
  line-height: 1.7;
}

.hero .actions {
  margin-top: 2rem;
}

.hero__film {
  margin-top: clamp(3rem, 7vw, 5rem);
}

/* The contour field: thin, and gone before it reaches the film. The drawn
   SVG is the default; the canvas takes over only once it has a frame. */
.field {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  height: 44rem;
  overflow: hidden;
  opacity: 0.34;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 92%);
  mask-image: linear-gradient(to bottom, black 30%, transparent 92%);
}

.field svg,
.field canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 1.4s var(--ease);
}

.field canvas {
  opacity: 0;
}

/* Hairlines at any width, to match the shader's one-pixel lines. */
.field path {
  vector-effect: non-scaling-stroke;
}

.field[data-live] canvas {
  opacity: 1;
}

.field[data-live] svg {
  opacity: 0;
}

/* The one authored entrance: the hero rises out of a soft blur, in order. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(6px);
  }
}

.rise {
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

/* Player */

.player__stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--frame);
  box-shadow:
    0 40px 80px -48px rgba(24, 24, 27, 0.55),
    0 2px 6px -2px rgba(24, 24, 27, 0.12);
}

.player video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--frame);
}

.player__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  /* Low on the poster, clear of the quote it shows. */
  padding: 0 0 6%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.player__play:focus-visible {
  outline-offset: -6px;
  border-radius: 1rem;
}

.player__pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem 0.75rem 0.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 18px 40px -16px rgba(24, 24, 27, 0.7);
  transition: transform 0.3s var(--ease);
}

.player__play:hover .player__pill {
  transform: scale(1.04);
}

.player__play:active .player__pill {
  transform: scale(0.98);
}

.player__disc {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: #f59e0b;
  color: var(--ink);
}

.player__disc svg {
  width: 1rem;
  height: 1rem;
  margin-left: 2px;
}

.player__pill .time {
  color: #a1a1aa;
  font-size: 0.8125rem;
  font-weight: 400;
}

.player__error {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 0.625rem;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.player__error a {
  font-weight: 600;
}

.rail {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.25rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail li {
  flex: none;
}

.chapter {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--body);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

/* Inset, because the scrolling rail clips anything drawn outside it. */
.chapter:focus-visible {
  outline-offset: -2px;
}

.chapter:hover {
  background: var(--frame);
  color: var(--ink);
}

.chapter[aria-current] {
  color: var(--ink);
}

.chapter .time {
  color: var(--quiet);
  font-size: 0.75rem;
}

.chapter[aria-current] .time {
  color: var(--action);
}

.chapter__title {
  font-weight: 500;
}

.chapter__bar {
  position: absolute;
  inset: auto 0.75rem 0.25rem 0.75rem;
  height: 1px;
  background: var(--line);
}

.chapter__bar i {
  display: block;
  height: 1px;
  background: #d97706;
  transform: scaleX(var(--fill, 0));
  transform-origin: left;
}

@media (max-width: 63.99rem) {
  .rail {
    padding-right: 2rem;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 2rem), transparent);
  }
}

@media (min-width: 64rem) {
  .rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem 1.5rem;
    padding-bottom: 0;
    overflow: visible;
  }

  .chapter {
    white-space: normal;
  }
}

.sample {
  max-width: 62ch;
  margin-top: 1.25rem;
  color: var(--body);
  font-size: 0.9375rem;
}

/* Sections */

.section {
  border-top: 1px solid var(--line);
}

.section__inner {
  padding-block: clamp(4.5rem, 10vw, 7rem);
}

.section--band {
  background: var(--band);
}

.section h2,
.night h2 {
  font-size: clamp(1.875rem, 4.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.028em;
}

.section__lede {
  max-width: 56ch;
  margin-top: 1rem;
  color: var(--body);
  font-size: 1.125rem;
  line-height: 1.75;
}

.shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--frame);
  box-shadow:
    0 30px 60px -44px rgba(24, 24, 27, 0.5),
    0 2px 6px -2px rgba(24, 24, 27, 0.1);
}

.shot img {
  width: 100%;
}

/* What the desk does: two picture-and-text pairs, then a plain list. */

.desk h2 {
  max-width: 18ch;
}

.pair {
  display: grid;
  gap: 1.5rem 4rem;
  align-items: center;
  margin-top: clamp(3rem, 7vw, 5rem);
}

.pair h3 {
  max-width: 20ch;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pair p {
  max-width: 46ch;
  margin-top: 0.875rem;
  color: var(--body);
}

@media (min-width: 60rem) {
  .pair {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  .pair--flip {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .pair--flip .shot {
    order: 2;
  }
}

.after {
  display: grid;
  gap: 2.5rem 4rem;
  margin-top: clamp(4rem, 9vw, 7rem);
}

.after h3 {
  max-width: 14ch;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.after dl {
  display: grid;
  gap: 2.25rem 3rem;
}

.after dt {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.after dd {
  max-width: 40ch;
  margin-top: 0.375rem;
  color: var(--body);
}

@media (min-width: 40rem) {
  .after dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .after {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
}

/* Tutorials: a list of questions. On a wide screen one still follows the row
   being pointed at; a phone gets the questions alone, because a 1200px screen
   recording is unreadable at that width. */

.tut__grid {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.tut__preview {
  display: none;
}

.tut__list {
  border-bottom: 1px solid var(--line);
}

.tut__row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.125rem 0.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.2s;
}

.tut__row .time {
  padding-top: 0.2rem;
  color: var(--quiet);
  font-size: 0.8125rem;
  transition: color 0.2s;
}

.tut__q {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.4;
}

.tut__a {
  grid-column: 2;
  color: var(--body);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.tut__row:hover .time,
.tut__row:focus-visible .time {
  color: var(--action);
}

.tut__row:hover .tut__q {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
}

@media (min-width: 64rem) {
  .tut__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 4rem;
    align-items: start;
  }

  .tut__preview {
    display: block;
    position: sticky;
    top: 6rem;
  }

  .tut__preview img {
    transition: opacity 0.35s var(--ease);
  }

  .tut__preview[data-swapping] img {
    opacity: 0;
  }

  .tut__preview figcaption {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-top: 1rem;
    color: var(--body);
    font-size: 0.9375rem;
  }

  .tut__preview figcaption .time {
    color: var(--action);
    font-size: 0.8125rem;
  }

  /* The list bleeds, not each row, so its closing rule is as wide as the rows. */
  .tut__list {
    margin-inline: -0.75rem;
  }

  .tut__row {
    padding: 1rem 0.75rem;
  }

  /* The row whose still is showing. Only meaningful next to the preview. */
  .tut__row[data-active] .time {
    color: var(--action);
  }

  .tut__row:hover,
  .tut__row[data-active] {
    background: #ffffff;
  }
}

/* Email and pallets */

.night {
  background: var(--night);
  color: #ffffff;
}

.night ::selection {
  background: var(--night-action);
  color: var(--night);
}

.night :focus-visible {
  outline-color: var(--night-action);
}

.night__grid {
  display: grid;
  gap: 3.5rem 4rem;
}

.night h2 {
  max-width: 14ch;
}

.night h3 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.night p {
  max-width: 52ch;
  margin-top: 1.25rem;
  color: var(--night-body);
  font-size: 1.125rem;
  line-height: 1.75;
}

.night h3 + p {
  margin-top: 1rem;
}

.night .night__note {
  max-width: 56ch;
  margin-top: 1rem;
  color: #a1a1aa;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.night code {
  color: var(--night-action);
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 600;
}

.night__link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--night-action);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration-color: rgba(251, 191, 36, 0.4);
  transition: text-decoration-color 0.2s;
}

.night__link:hover {
  text-decoration-color: var(--night-action);
}

@media (min-width: 64rem) {
  .night__grid {
    grid-template-columns: 1fr 1fr;
  }

  .night__grid > div + div {
    padding-left: 4rem;
    border-left: 1px solid var(--night-line);
  }
}

/* Omnisells: what it is, the two tools, and the Google account note. */

.about__grid {
  display: grid;
  gap: 3rem 4rem;
}

.about h2 {
  max-width: 16ch;
}

.about__lede {
  max-width: 44ch;
  margin-top: 1.25rem;
  color: var(--body);
  font-size: 1.125rem;
  line-height: 1.75;
}

.tools {
  border-bottom: 1px solid var(--line);
}

.tools > div {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.tools dt {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.tools dd {
  max-width: 62ch;
  margin-top: 0.375rem;
  color: var(--body);
}

.tools a {
  color: var(--ink);
  font-weight: 500;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.2s;
}

.tools a:hover {
  text-decoration-color: var(--action);
}

.tools dd + dd {
  font-size: 0.9375rem;
}

.google {
  margin-top: 2.5rem;
}

.google h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.google p {
  max-width: 62ch;
  margin-top: 0.75rem;
  color: var(--body);
}

@media (min-width: 64rem) {
  .about__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

/* Close */

.close h2 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.close .actions {
  margin-top: 2.5rem;
}

.foot {
  border-top: 1px solid var(--line);
  color: var(--body);
  font-size: 0.875rem;
}

.foot__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem;
}

.foot nav {
  display: flex;
  gap: 1.25rem;
}

.foot a {
  text-decoration: none;
  transition: color 0.2s;
}

.foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .rise {
    animation: none;
  }

  .btn,
  .player__pill,
  .field svg,
  .field canvas,
  .tut__preview img {
    transition: none;
  }
}
