/* Landing page: hero, particle field, scroll hint, reveal-on-scroll sections.
 *
 * The palette is taken from the hero image rather than chosen separately, so the
 * page and the picture agree: three beams on three bearings, amber, cyan, magenta.
 * Those three are also the three axes of the label lattice, which is the whole
 * reason the image looks the way it does.
 */

:root {
  --pharos-amber: #f0a020;
  --pharos-cyan: #22c8c8;
  --pharos-magenta: #d4267f;
  --pharos-glow: 24px;
}

/* The light hero is pastel on white and its beams are much paler, so the same
 * accent values read as washed out against a light page. Deepen them there. */
[data-md-color-scheme="default"] {
  --pharos-amber: #d98200;
  --pharos-cyan: #0e9c9c;
  --pharos-magenta: #b81a68;
  --pharos-glow: 16px;
}

/* ------------------------------------------------- theme-reactive images ----- */

/* The theme does not ship these rules, so they are defined here. A hero rendered
 * for a dark page is unreadable on a light one and the reverse, which is why the
 * sisters keep two files rather than one. */
[data-md-color-scheme="default"] img[src$="#only-dark"],
[data-md-color-scheme="slate"] img[src$="#only-light"] {
  display: none;
}

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

.hero {
  position: relative;
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
  isolation: isolate;
}

/* Canvas sits behind everything in the hero and never intercepts a click. */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.hero p:has(img) {
  margin: 0;
}

.hero img {
  width: min(520px, 78vw);
  height: auto;
  border-radius: 1.25rem;
  box-shadow:
    0 0 var(--pharos-glow) color-mix(in srgb, var(--pharos-cyan) 22%, transparent),
    0 18px 48px rgb(0 0 0 / 38%);
}

[data-md-color-scheme="default"] .hero img {
  box-shadow:
    0 0 var(--pharos-glow) color-mix(in srgb, var(--pharos-cyan) 16%, transparent),
    0 14px 34px rgb(0 0 0 / 12%);
}

.md-typeset .hero h1 {
  margin: 1.5rem 0 0.4rem;
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: 0.05em;
}

.md-typeset .hero h1 .headerlink {
  display: none;
}

.hero-subtitle {
  max-width: 38rem;
  margin: 0 auto 1.9rem;
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* Markdown wraps both links in one paragraph, so the paragraph is the flex row: on
 * the container alone the buttons sat inline with no gap and stacked touching. */
.md-typeset .hero-buttons,
.md-typeset .hero-buttons > p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin: 0;
}

.md-typeset .hero-buttons .md-button {
  min-width: 12rem;
  margin: 0;
  padding: 0.75rem 1.7rem;
  border-radius: 3rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

/* The primary is the amber beam with dark ink on it, which reads at 6:1 or better
 * in both schemes; the secondary is an outline that takes the page's own text. */
.md-typeset .hero-buttons .md-button--primary {
  border: 1px solid var(--pharos-amber);
  background: var(--pharos-amber);
  color: #1a1206;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--pharos-amber) 32%, transparent);
}

.md-typeset .hero-buttons .md-button:not(.md-button--primary) {
  border: 1px solid color-mix(in srgb, var(--pharos-cyan) 45%, var(--md-default-fg-color--lightest));
  background: color-mix(in srgb, var(--pharos-cyan) 6%, var(--md-default-bg-color));
  color: var(--md-default-fg-color);
}

.md-typeset .hero-buttons .md-button:is(:hover, :focus-visible) {
  border-color: var(--pharos-cyan);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--pharos-cyan) 24%, transparent);
}

.md-typeset .hero-buttons .md-button--primary:is(:hover, :focus-visible) {
  border-color: var(--pharos-amber);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--pharos-amber) 45%, transparent);
}

@media (max-width: 44.9375em) {
  .md-typeset .hero-buttons > p {
    flex-direction: column;
    align-items: center;
  }

  .md-typeset .hero-buttons .md-button {
    width: min(18rem, 100%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .md-typeset .hero-buttons .md-button:hover {
    transform: translateY(-2px);
  }
}

/* The three beams, as a legend for what the picture is saying. */
.hero-beams {
  margin-top: 2.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------- scroll hint ----- */

.scroll-hint {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
}

.scroll-chevron {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-right: 2px solid var(--pharos-amber);
  border-bottom: 2px solid var(--pharos-amber);
  transform: rotate(45deg);
  opacity: 0.45;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-hint {
    animation: pharos-hint-bounce 2s ease-in-out infinite;
  }
  @keyframes pharos-hint-bounce {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(6px);
    }
  }
}

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

/* Visible by default. JS sets .js-ready on <html> to opt into the reveal, so a
 * reader with JavaScript off gets the whole page rather than a blank one. */
.landing-section {
  padding: 3.25rem 0 2.75rem;
  position: relative;
}

/* A hairline rule that fades at both ends, rather than a full-width border. */
.landing-section + .landing-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--md-default-fg-color--lightest),
    transparent
  );
}

.md-typeset .section-title {
  text-align: center;
  margin-bottom: 0.9rem;
}

/* A short accent bar under each section heading, cycling the three beam colours
 * so the page keeps referring back to the lattice. */
.md-typeset .section-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin: 0.7rem auto 0;
  border-radius: 2px;
  background: var(--pharos-amber);
}

.landing-section:nth-of-type(2) .section-title::after {
  background: var(--pharos-cyan);
}
.landing-section:nth-of-type(3) .section-title::after {
  background: var(--pharos-magenta);
}

/* The lead is set apart by size and weight, not by centring.
 *
 * It was centred, and the body under it was not, so every section stepped from a
 * ragged left edge to a hard one at the first body line. Centring earns its place
 * in the hero, where the block is short and symmetrical and there is no column to
 * break; three lines above a paragraph is long enough that the eye starts using
 * the left edge to find the next line, and a lead that moves that edge costs more
 * than the emphasis it buys. Hierarchy comes from the larger size and the lighter
 * body colour instead. */
.section-lead {
  max-width: 44rem;
  margin-inline: auto;
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--md-default-fg-color);
}

/* One measure for the whole section, so the column has a single pair of edges.
 *
 * Everything on this page is centred already, but the lead was capped at 44rem
 * while the body prose under it ran the full 1188px content width. Each section
 * therefore stepped 154px wider on both sides and switched from centred to
 * ragged-right at the same moment, which reads as a break in the layout rather
 * than as the deliberate narrowing it was meant to be. It also put body lines at
 * roughly 150 characters, well past the point where the eye reliably finds the
 * next line.
 *
 * Body text stays left-aligned. Centring is for the title and the lead, where the
 * line count is short enough that a ragged left edge costs nothing. */
.landing-section > :is(p, ul, ol) {
  max-width: 44rem;
  margin-inline: auto;
}

/* ------------------------------------------------------------- pipeline ----- */

/* Six stages as a row of beacons. Each step takes one of the three beam colours,
 * cycling, and the connectors between them are a hairline so the row reads left
 * to right without arrows competing with the icons. */
.pipeline-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 52rem;
  margin: 1.6rem auto 1.2rem;
}

.md-typeset .pipeline-step {
  position: relative;
  display: flex;
  flex: 1 1 0;
  justify-content: center;
  min-width: 6.5rem;
  padding: 1rem 0.5rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--step-accent) 35%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--step-accent) 7%, var(--md-default-bg-color));
}

/* Markdown wraps the icon and label in one paragraph; stack them inside it. */
.md-typeset .pipeline-step p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
}

.md-typeset .pipeline-step .step-icon svg {
  width: 1.7rem;
  height: 1.7rem;
  max-height: none;
  fill: var(--step-accent);
}

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--md-default-fg-color);
}

.md-typeset .pipeline-caption {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
  color: var(--md-default-fg-color--light);
}

/* Centring is for short lines; on a phone the caption runs six. */
@media (max-width: 44.9375em) {
  .md-typeset .pipeline-caption {
    text-align: left;
  }
}

/* ----------------------------------------------------------- what is it ----- */

/* The case in three beats, one per beam colour: the problem, the gap, the answer. */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 56rem;
  margin: 1.6rem auto 0;
}

.md-typeset .why-card {
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-top: 3px solid var(--card-accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--md-default-fg-color) 3%, var(--md-default-bg-color));
}

.md-typeset .why-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.why-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--card-accent) 72%, var(--md-default-fg-color));
}

/* On white the amber beam needs more ink to clear AA at label size. */
[data-md-color-scheme="default"] .why-label {
  color: color-mix(in srgb, var(--card-accent) 55%, #000);
}

@media (max-width: 44.9375em) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

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

/* The landing ends on one quiet line, like the sisters, rather than the theme's
 * prev/next links and grey bar. `:has()` needs no script, so it holds even before
 * the page's JavaScript runs. */
body:has(.hero) .md-footer {
  display: none;
}

.md-typeset .landing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 3rem 0 0;
  padding: 1.6rem 0 0.4rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

/* Markdown wraps the line in a paragraph; that paragraph is the row. */
.md-typeset .landing-footer p {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
}

.md-typeset .landing-footer a {
  color: var(--md-default-fg-color--light);
}

.md-typeset .landing-footer a:is(:hover, :focus-visible) {
  color: var(--pharos-cyan);
}

.md-typeset .landing-footer .twemoji svg {
  width: 1.15rem;
  height: 1.15rem;
}

@media (max-width: 44.9375em) {
  .pipeline-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }

  .md-typeset .pipeline-step {
    min-width: 0;
    padding-inline: 0.25rem;
  }

  .step-label {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }
}

/* --------------------------------------------------------------- explore ----- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  max-width: 56rem;
  margin: 1.6rem auto 0;
}

/* Links styled as cards need the theme's link colour and underline taken off,
 * with focus given the same affordance as hover. */
.md-typeset a.feature-card {
  display: block;
  padding: 1.2rem 1.25rem 1.1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-top: 3px solid var(--card-accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--md-default-fg-color) 3%, var(--md-default-bg-color));
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.md-typeset a.feature-card:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--card-accent) 55%, transparent);
  border-top-color: var(--card-accent);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--card-accent) 18%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .md-typeset a.feature-card:is(:hover, :focus-visible) {
    transform: translateY(-3px);
  }
}

.feature-icon {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  margin-bottom: 0.7rem;
  background: var(--card-accent);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.feature-name {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--md-default-fg-color);
}

.md-typeset .feature-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
}

@media (prefers-reduced-motion: no-preference) {
  html.js-ready .landing-section {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 0.7s ease,
      transform 0.7s ease;
  }
  html.js-ready .landing-section.visible {
    opacity: 1;
    transform: translateY(0);
  }
}
