/*
 * The showcase site's stylesheet.
 *
 * The tokens are the product's, copied from apps/dashboard/src/styles.css, which took them from
 * design/generique/dashboard-generique.html (D-014, read-only). A visitor who signs up should
 * land on something that looks like the page that convinced him — so this file follows the
 * dashboard rather than inventing a second visual language.
 *
 * No framework and no dependency. The only script is `carousel.js`, and the page is complete
 * without it: the examples are a scroll-snap track that swipes and snaps with CSS alone, so the
 * script adds the automatic advance and nothing the reader would otherwise miss.
 *
 * Mobile first, like the rest: a restaurateur reads this on the phone he had in his hand.
 */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #21262d;
  --border-2: #30363d;
  --ink: #e6edf3;
  --muted: #8b949e;
  --dim: #6e7681;
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.14);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;

  --measure: 34rem;
  --gutter: 1.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  /* Sober rather than crisp-white: the product is dark, and long text on pure #fff over #0d1117
     is fatiguing. */
  -webkit-font-smoothing: antialiased;
}

/* The keyboard user's way past the header, visible only when focused. */
.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: var(--gutter);
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 0.5rem;
  color: var(--ink);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

/* ---------------------------------------------------------------------------------------
   The wordmark, the header and the two ways in
   --------------------------------------------------------------------------------------- */

/* Sticky, and opaque rather than translucent.
 *
 * It follows the reader for one reason: it carries the only two actions on the page. That is
 * also why the hero no longer repeats them — a call to action that is permanently on screen does
 * not need a copy three lines below it.
 *
 * Opaque because a blurred bar over a dark page is a cost (a compositing layer, on a phone) for
 * an effect nobody asked for. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark span {
  color: var(--green);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  font-size: 0.95rem;
}

.link:hover {
  color: var(--ink);
  border-bottom-color: var(--border-2);
}

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--green);
  border-radius: 0.5rem;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: rgba(63, 185, 80, 0.22);
}

.button-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.0625rem;
}

/* ---------------------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------------------- */

main {
  padding: 0 var(--gutter);
}

section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-child {
  border-bottom: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h1 {
  /* Large enough to carry the one sentence that has to land, small enough to stay a sentence
     and not a slogan. */
  font-size: clamp(2rem, 7vw, 2.75rem);
}

h2 {
  font-size: clamp(1.5rem, 5vw, 1.875rem);
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.375rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  color: var(--muted);
  font-size: 1.125rem;
}

.hero {
  padding-top: 4.5rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.note {
  margin-top: 1.25rem;
  color: var(--dim);
  font-size: 0.9375rem;
}

/* ---------------------------------------------------------------------------------------
   The example review
   ---------------------------------------------------------------------------------------
   Showing one is worth more than a paragraph describing one, and it is the only place on this
   page that looks like the product. Labelled as an example in the caption rather than dressed
   as a testimonial: an invented customer quote passed off as real would be a lie, and this
   product sells honesty. */

/* Three examples, one at a time.
 *
 * A scroll-snap track rather than a stack of transformed slides: the browser does the snapping,
 * the swipe works on a phone without a line of script, and the arrow keys work because it is a
 * real scroll container. carousel.js only adds the automatic advance and the dots on top. */
.carousel {
  margin-top: 2rem;
}

.track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Room for the cards' focus ring, which a hidden overflow would clip. */
  padding: 0.25rem;
  margin: -0.25rem;
  scrollbar-width: none;
}

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

.card {
  flex: 0 0 100%;
  /* `start`, not `center`: the last card cannot be centred — there is no scroll range left past
     it — so it settled half off the edge. Aligning left edges works for all three. */
  scroll-snap-align: start;
  padding: 1.25rem 1.375rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 0.75rem;
  /* Equal heights so the page does not jump as the reviews advance — they carry one, two or
     three rated things and would otherwise each set their own. */
  display: flex;
  flex-direction: column;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.dots button {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--border-2);
  cursor: pointer;
}

.dots button[aria-current] {
  background: var(--green);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.875rem;
}

.stars {
  color: var(--green);
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}

.stars .off {
  color: var(--border-2);
}

.date {
  color: var(--dim);
  font-size: 0.875rem;
}

/* Whether this person can be answered is the first thing the reader wonders, so it is on the
   header rather than inside — same reasoning as the dashboard it is copied from. */
.anon {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--dim);
  font-size: 0.75rem;
}

/* One rated thing: what it was, and what was said about it.
 *
 * The chips are the product's own, values copied from apps/dashboard/src/styles.css: green for
 * what was praised, red for what was reproached, each with the icon the journey shows. This is
 * the page's whole argument in one object — a score says something is wrong, these say what. */
.rev-item {
  padding: 0.875rem 0;
  border-top: 1px solid var(--border);
}

/* The path to the rated thing, with the leaf in bold — the same trail the dashboard draws, and
   the reason a review is worth more than a score: it names what was judged. */
.crumb {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.crumb b {
  color: var(--ink);
  font-weight: 600;
}

.crumb .sep {
  color: var(--dim);
  padding: 0 0.125rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.1875rem 0.625rem;
  border: 1px solid transparent;
}

.chip.pos {
  background: rgba(63, 185, 80, 0.12);
  color: #7ee787;
  border-color: rgba(63, 185, 80, 0.24);
}

.chip.neg {
  background: rgba(248, 81, 73, 0.11);
  color: #ff8a80;
  border-color: rgba(248, 81, 73, 0.24);
}

/* The column above sets equal heights across the three examples, so the page does not jump as
   they advance. The leftover space falls below this quote rather than above it: pushed to the
   bottom with an `auto` margin, a two-line quote floated alone under a gap. */
.card blockquote {
  margin: 0.875rem 0 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

/* An address means the client can answer. Shown rather than hidden, because that possibility is
   worth as much as the review itself. */
.anon.signed {
  border-color: rgba(63, 185, 80, 0.3);
  color: #7ee787;
  font-style: normal;
}

/* The line that says what the card is for. After it rather than before, so the reader sees the
   thing and then reads what it means — the other way round is a caption nobody needs. */
.after {
  margin: 1.5rem 0 0;
  color: var(--muted);
}

/* The three reasons.
 *
 * Stacked in the same column as everything else, and not in three columns: side by side they
 * needed a wider container, which made the page's left edge jump at that one section — the
 * reader notices the jolt before the argument. They are three or four lines each; stacked costs
 * a scroll and keeps the page a single column of prose. */
.grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.grid p {
  color: var(--muted);
  margin: 0;
}

.grid .link {
  white-space: nowrap;
}

/* What it costs the reader to try, in three lines. A list, because three short facts do not
   need a section each. */
.how ul {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.875rem;
  color: var(--muted);
}

.how li {
  padding-left: 1.25rem;
  position: relative;
}

.how li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--green);
}

.how strong {
  color: var(--ink);
  font-weight: 600;
}

.closing p:not(.actions) {
  color: var(--muted);
}

/* ---------------------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--gutter) 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--measure);
  margin: 0 auto;
}

.wordmark-small {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
  color: var(--muted);
}

.wordmark-small span {
  color: var(--green);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer a {
  color: var(--dim);
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--border-2);
}

/* ---------------------------------------------------------------------------------------
   Wider screens: the measure stays, the rhythm opens up
   --------------------------------------------------------------------------------------- */

@media (min-width: 48rem) {
  :root {
    --gutter: 2.5rem;
  }

  section {
    padding: 5rem 0;
  }

  .hero {
    padding-top: 6rem;
  }
}

/* Somebody who asked for less motion gets no transition to begin with — there is none here,
   and this makes that a promise rather than an accident. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
