/* CarUtil: the site wears the converter's own palette.
 *
 *   accent  #6a9bcc  dusty blue   steps, rules, links
 *   warn    #d97757  clay         warnings
 *   ok      #788c5d  sage         success
 *   muted   #b0aea5  cloud        secondary text
 *   surface #141413  slate        the page
 *   text    #faf9f5  ivory        the type
 *
 * The terminal windows are Contour's: its warm near-black, its rounded
 * frame, and the vertical chiclet rail down the left edge.
 */

:root {
  --accent: #6a9bcc;
  --warn: #d97757;
  --ok: #788c5d;
  --muted: #b0aea5;
  --surface: #141413;
  --text: #faf9f5;

  /* Contour */
  --c-bg: #1a1716;
  --c-bar: #211d1c;
  --c-line: #2e2a29;
  --c-fg: #d0d0d0;
  --c-dim: #807b78;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
          "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* The scrollbar, which the browser paints white by default and which then
 * sits on the page like a bright scar. This one is a thin, dark thumb that
 * only shows itself against the surface, and the page gets a little more
 * room to breathe because the gutter is narrow.
 *
 * `scrollbar-color` covers Firefox and the standards-based Chromium builds;
 * the ::-webkit-scrollbar rules cover the rest. */
html {
  scrollbar-color: #3a3532 transparent;
  scrollbar-width: thin;
}
body::-webkit-scrollbar { width: 9px; height: 9px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb {
  background: #2e2a28;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
body::-webkit-scrollbar-thumb:hover { background: #46413e; background-clip: content-box; }
body::-webkit-scrollbar-corner { background: transparent; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Contour's own colour scheme, as the player wants it: the theme option is a
 * name, and the name is a CSS class. Contour ships a built-in scheme called
 * "contour" -- the default one, warm near-black on warm grey -- so the
 * recordings are played with the terminal's real colours rather than one of
 * the player's stock themes.
 *
 * The sixteen are Contour's own, from its "contour" built-in palette.
 */
.asciinema-player-theme-contour {
  --term-color-foreground: #d0d0d0;
  --term-color-background: #1a1716;
  --term-color-0: #000000;
  --term-color-1: #c63939;
  --term-color-2: #00a000;
  --term-color-3: #a0a000;
  --term-color-4: #4d79ff;
  --term-color-5: #ff66ff;
  --term-color-6: #00a0a0;
  --term-color-7: #c0c0c0;
  --term-color-8: #707070;
  --term-color-9: #ff0000;
  --term-color-10: #00ff00;
  --term-color-11: #ffff00;
  --term-color-12: #0000ff;
  --term-color-13: #ff00ff;
  --term-color-14: #00ffff;
  --term-color-15: #ffffff;
}

code {
  font-family: inherit;
  color: var(--muted);
}

/* ---------------------------------------------------------------- header */

.top {
  border-bottom: 1px solid #232120;
  background: #121110;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: .02em;
}
.wordmark:hover { text-decoration: none; }
.wordmark__name { font-size: 16px; }

.nav { display: flex; gap: 24px; }
.nav a {
  color: var(--muted);
  font-size: 13.5px;
}
.nav a:hover { color: var(--text); text-decoration: none; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding-top: 76px;
  padding-bottom: 76px;
}

.hero__text { max-width: 60ch; }

h1 {
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 22px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.lede {
  font-size: 15px;
  color: #dedcd5;
  margin: 0 0 14px;
  max-width: 60ch;
}
.lede b { color: var(--text); font-weight: 600; }
.lede--quiet { color: var(--muted); }

.cta { margin: 30px 0 0; display: flex; gap: 12px; }

.button {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 13.5px;
}
.button:hover { background: rgba(106, 155, 204, .12); text-decoration: none; }
.button--quiet { border-color: #34302e; color: var(--muted); }
.button--quiet:hover { background: rgba(250, 249, 245, .05); color: var(--text); }

.hero__demo { margin: 0; }

/* -------------------------------------------------- the Contour windows */

.window {
  position: relative;
  margin: 0;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .5);
  transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease,
              border-color .22s ease;
}

/* Hovering a terminal window brings it forward, the way the window you are
 * working in sits above the others: it lifts, its edge brightens, and the
 * rest of the page's windows fade back. */
.window:hover {
  z-index: 5;
  transform: translateY(-2px);
  border-color: #3d3836;
  box-shadow: 0 26px 56px rgba(0, 0, 0, .66);
}
main:has(.window:hover) .window:not(:hover) {
  opacity: .5;
}

.window__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  background: var(--c-bar);
  border-bottom: 1px solid var(--c-line);
}
.window__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  opacity: .45;
  transition: opacity .22s ease;
}
.window__dot--r { background: #d05a52; }
.window__dot--y { background: #c8a44a; }
.window__dot--g { background: #5f9e5f; }

/* The traffic lights come on when the window has focus, the way macOS
 * brightens them on the window you are working in. Plain colours, no glow. */
.window:hover .window__dot { opacity: 1; }
.window__title {
  margin-left: 8px;
  color: var(--c-dim);
  font-size: 12px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .22s ease;
}
/* A focused window says so: the title goes white, and the walkthrough swaps
 * to the command a person would actually type. */
.window:hover .window__title { color: #fff; }
.window__title::before { content: attr(data-title); }
.window__title::after { content: attr(data-alt); display: none; }
.window:hover .window__title::before { display: none; }
.window:hover .window__title::after { display: inline; }

.window__body {
  display: flex;
  align-items: stretch;
}

/* The terminal body. */
.terminal {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--c-bg);
  transition: filter .22s ease;
}
/* The text takes the project's ivory when the window is focused. The coloured
 * accents are 24-bit and set inline by the player, so the terminal is
 * brightened as well to bring them up with the rest. */
.window:hover .terminal {
  --term-color-foreground: #faf9f5;
  filter: brightness(1.12);
}
.terminal asciinema-player { display: block; }
.terminal .asciinema-player,
.terminal asciinema-player { width: 100%; }

.window--flat { border-radius: 10px; }
.window--small .window__body { padding: 0; }

/* ------------------------------------------------------------- the numbers */

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: #232120;
  border: 1px solid #232120;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
}
.total {
  background: #161514;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.total__n {
  font-size: 30px;
  line-height: 1.15;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -.02em;
}
.total__k {
  color: var(--muted);
  font-size: 12.5px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 14px 16px 10px;
}
.chart img { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------- sections */

/* `section.wrap`, not `section`: the .wrap rule sets a padding shorthand, and
 * a class beats a type selector however late it comes. Written as a bare
 * `section` it was silently dead, and every section had no vertical padding
 * at all. */
section.wrap {
  padding-top: 74px;
  padding-bottom: 74px;
  scroll-margin-top: 58px;
}
#usage, #docs, #install { border-top: 1px solid #232120; }
#stats { padding-top: 48px; }

.section-title {
  font-size: 28px;
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.section-lede {
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 34px;
  font-size: 14.5px;
}
.sub-title {
  font-size: 16px;
  margin: 52px 0 18px;
  font-weight: 600;
  color: var(--text);
}
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ------------------------------------------------------------- contents */

.facts { margin: 0; }
.facts dt {
  color: var(--text);
  font-size: 13.5px;
  margin-top: 16px;
}
.facts dt:first-child { margin-top: 0; }
.facts dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 40px;
}
.split--wide { margin-top: 46px; }
.split__col h3 { margin-top: 0; }

/* The seven questions, as a list: the numbers line up in a column, the
 * questions line up in a column, and nothing wraps into a ragged shape. */
.steps {
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
  border: 1px solid #232120;
  border-radius: 10px;
  overflow: hidden;
  background: #161514;
}
.step {
  display: grid;
  grid-template-columns: 26px 128px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 11px 20px;
  border-bottom: 1px solid #232120;
}
.step:last-child { border-bottom: none; }
.step__n {
  color: var(--accent);
  font-size: 12px;
  text-align: right;
}
.step b {
  font-size: 13.5px;
  font-weight: 600;
}
.step span:last-child { color: var(--muted); font-size: 13px; }
.step code { color: #cfcbc4; }

.shell {
  margin: 0;
  padding-left: 2px;
  font-size: 13px;
  line-height: 1.75;
  color: #cfcbc4;
  white-space: pre;
  overflow-x: auto;
}
.c-prompt { color: var(--ok); }
.c-comment { color: #6a6663; font-style: italic; }

.opts {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 8px;
}
.opts td, .opts th {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid #232120;
}
.opts th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: .1em;
  padding-bottom: 8px;
}
.opts td:first-child { white-space: nowrap; width: 1%; }
.opts td:last-child { color: var(--muted); }
.opts code { color: var(--accent); }
.opts--wide td:first-child { width: 20%; }
.opts--tight td:first-child { width: 40%; }
.opts--tight td:last-child { text-align: right; color: var(--muted); }

.plain { color: var(--muted); font-size: 14px; padding-left: 20px; }
.plain li { margin-bottom: 12px; }
.plain b { color: var(--text); font-weight: 600; }

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

.foot {
  border-top: 1px solid #232120;
  padding: 40px 0 52px;
  color: var(--muted);
  font-size: 13px;
}
.foot p { margin: 0 0 6px; }
.foot b { color: var(--text); }
.foot__quiet { font-size: 12.5px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 52px; }
  h1 { font-size: 31px; }
  .nav { gap: 16px; }
  .nav a { font-size: 12.5px; }
  .wrap { padding: 0 20px; }
}

@media (max-width: 560px) {
  .top .wrap {
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nav { gap: 18px; }
  h1 { font-size: 27px; }
  .terminal { padding: 10px; }
  .opts td:first-child { white-space: normal; }
  /* The three columns of the step list do not fit a phone, so the question
   * and its answer stack instead. */
  .step {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 2px 12px;
    padding: 10px 16px;
  }
  .step span:last-child { grid-column: 2; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .total__n { font-size: 26px; }
  /* Two charts side by side are unreadable on a phone, so they stack. */
  .chart { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
