/*
 * Fonts: the three families the Fireside dashboard uses, served from this
 * repo (assets/fonts, SIL Open Font License, see LICENSES.txt there).
 */
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/space-grotesk-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/space-grotesk-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/jetbrains-mono-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/*
 * Colours: the Ember theme of the Fireside dashboard, copied from
 * web/src/theme/themes.css in the server repo ([data-theme='ember']).
 * Keep the two in step if the theme changes.
 */
:root {
  color-scheme: dark;
  --page: #14110f;
  --card: #1d1916;
  --raised: #26211d;
  --hover: #2a2420;
  --border: #2e2823;
  --border-strong: #3a322b;
  --text: #f2ece4;
  --text-2: #c9bfb2;
  --text-3: #a39889;
  --accent: #f0803c;
  --accent-text: #f59a5c;
  --on-accent: #1a1009;
  --accent-wash: #2a211b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* --page of the other two dashboard themes, for the swatches in "Themes". */
  --theme-dark: #181927;
  --theme-light: #d8ccb4;

  --font: 'Inter', system-ui, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --radius: 8px;
  --gutter: 20px;
  --max: 1120px;
  /* Width of the heading column beside each section on a wide screen. */
  --aside: 300px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
pre {
  margin: 0;
}

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

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

strong {
  color: var(--text);
  font-weight: 600;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
  color: var(--on-accent);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.nav-list {
  display: none;
  gap: 4px;
  margin-right: -12px;
}

.nav-list a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 15px;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Hero */

.hero {
  padding-block: 48px 56px;
}

.hero-grid {
  display: grid;
}

/*
 * The dashboard's Home page in a phone: under the text on a narrow screen,
 * beside it on a wide one. The glow is firelight in the accent colour.
 */
.hero-phone {
  order: 2;
  width: min(78vw, 300px);
  margin: 48px auto 0;
  box-shadow:
    var(--shadow),
    0 0 140px rgba(240, 128, 60, 0.16);
}

h1 {
  margin-left: -0.04em;
  font-family: var(--display);
  font-size: clamp(64px, 21vw, 168px);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.lede {
  max-width: 31em;
  margin-top: 28px;
  color: var(--text-2);
  font-size: clamp(18px, 4.6vw, 22px);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-text);
  color: var(--on-accent);
}

.btn-secondary {
  border-color: var(--text-3);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--hover);
  border-color: var(--text);
}

/* The Plugin Hub button before approval: reads as not available yet. */
.btn-pending {
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
  font-weight: 500;
}

.btn-pending:hover {
  border-color: var(--text-3);
  color: var(--text-2);
}

.hero-note {
  margin-top: 20px;
  color: var(--text-3);
  font-size: 14px;
}

/* Sections */

.section {
  padding-block: 56px;
  border-top: 1px solid var(--border);
}

h2 {
  font-family: var(--display);
  font-size: clamp(28px, 6.4vw, 36px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.split > h2 {
  margin-bottom: 28px;
}

.section-intro {
  max-width: 34em;
  margin-top: 10px;
  color: var(--text-2);
}

/* Screenshot gallery: swipes sideways on a phone, sits in a row on a wide screen. */

.gallery {
  display: flex;
  gap: 24px;
  margin-top: 28px;
  /* Starts on the page's content edge and runs off the right side of the screen. */
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2));
  padding: 4px var(--edge) 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  -webkit-overflow-scrolling: touch;
}

.gallery > li {
  flex: 0 0 auto;
  /* Wide enough that the text in a 390 px screenshot stays readable. */
  width: min(78vw, 300px);
  scroll-snap-align: start;
}

.phone {
  padding: 8px;
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: 38px;
  box-shadow: var(--shadow);
}

.phone > img {
  display: block;
  /* The frame takes the picture's own shape, so the picture is never cropped or stretched. */
  width: 100%;
  height: auto;
  border-radius: 30px;
  background: var(--page);
}

.shot figcaption {
  margin-top: 14px;
  padding-inline: 4px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.45;
}

/* Features: a plain list under hairlines, not cards. */

.features {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 40px;
}

.feature {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 14px;
  row-gap: 2px;
  align-content: start;
  padding-block: 16px;
  border-top: 1px solid var(--border);
}

.feature-icon {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--accent);
}

.feature h3 {
  font-size: 16px;
  font-weight: 600;
}

.feature p {
  grid-column: 2;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
}

.swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 5px;
  border: 1px solid var(--text-3);
  border-radius: 50%;
}

.swatch-ember {
  background: var(--accent);
}

.swatch-dark {
  background: var(--theme-dark);
}

.swatch-light {
  background: var(--theme-light);
}

/*
 * How it works: three stops on one line, the way the data travels. The line
 * runs down the left on a phone and across the top on a wide screen.
 */

.flow {
  display: grid;
  grid-template-columns: 1fr;
}

.flow-step {
  position: relative;
  margin-left: 6px;
  padding: 0 0 32px 28px;
  border-left: 2px solid var(--border-strong);
}

.flow-step:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.flow-step::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--page);
}

.flow-icon {
  display: block;
  width: 26px;
  height: 26px;
  color: var(--text-3);
}

.flow-step h3 {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.flow-step p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
}

.facts {
  display: grid;
  gap: 10px;
  max-width: 40em;
  margin-top: 40px;
  color: var(--text-2);
}

.facts li {
  position: relative;
  padding-left: 20px;
}

.facts li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}

/* Getting started */

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.tabs[hidden] {
  display: none;
}

.tabs button {
  min-height: 44px;
  margin-bottom: -1px;
  padding: 8px 0;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-3);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button[aria-selected='true'] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.panel {
  max-width: 44em;
}

.panel + .panel {
  margin-top: 48px;
}

.has-tabs .panel {
  margin-top: 28px;
}

.panel[hidden] {
  display: none;
}

.panel-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

/* With tabs, the tab itself is the panel's heading. */
.has-tabs .panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.panel-intro {
  margin-top: 8px;
  color: var(--text-2);
}

.has-tabs .panel-intro {
  margin-top: 0;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 32px;
  margin-top: 32px;
}

.steps > li {
  counter-increment: step;
  position: relative;
  min-width: 0;
  padding-left: 40px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -3px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.steps h4 {
  font-size: 17px;
  font-weight: 600;
}

.steps p,
.steps .plain {
  margin-top: 6px;
  color: var(--text-2);
}

.plain {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  list-style: disc;
}

.plain li::marker {
  color: var(--text-3);
}

.pending-note {
  display: block;
  margin-top: 10px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent);
  font-size: 15px;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
}

:not(pre) > code {
  padding: 1px 5px;
  background: var(--raised);
  border-radius: 4px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.code {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}

.copy {
  min-width: 64px;
  min-height: 30px;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.code pre {
  padding: 14px;
  overflow-x: auto;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.panel-outro {
  margin-top: 36px;
  font-weight: 600;
}

/* Footer */

.site-footer {
  padding-block: 40px 56px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  gap: 24px;
}

.footer-brand {
  margin-bottom: 4px;
}

.footer-links {
  display: grid;
  gap: 10px;
}

.footer-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.license {
  color: var(--text-3);
  font-size: 14px;
}

.disclaimer {
  max-width: 44em;
  color: var(--text-3);
  font-size: 14px;
}

/* Wider screens */

@media (min-width: 560px) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }

  .nav-list {
    display: flex;
  }

  .hero {
    padding-block: 72px 80px;
  }

  .section {
    padding-block: 80px;
  }

  .flow {
    grid-template-columns: repeat(3, 1fr);
  }

  .flow-step {
    margin-left: 0;
    padding: 28px 28px 0 0;
    border-left: 0;
    border-top: 2px solid var(--border-strong);
  }

  .flow-step:last-child {
    border-top-color: var(--border-strong);
  }

  .flow-step::before {
    left: 0;
    top: -7px;
  }
}

/* Heading in a column of its own, content beside it. */
@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 64px;
  }

  .hero-phone {
    margin: 0;
  }

  .split {
    display: grid;
    grid-template-columns: var(--aside) minmax(0, 1fr);
  }

  .split > h2 {
    margin-bottom: 0;
  }

  .footer-grid {
    grid-template-columns: var(--aside) 1fr;
  }

  .disclaimer {
    grid-column: 2;
  }
}

/*
 * Wide enough for the four screenshots side by side at a readable size: the
 * row stops scrolling and sits centred, a little wider than the text column.
 */
@media (min-width: 1200px) {
  .gallery {
    justify-content: center;
    padding-inline: var(--gutter);
    overflow-x: visible;
  }

  .gallery > li {
    width: min(300px, calc((100vw - 2 * var(--gutter) - 72px) / 4));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
