/* ============================================================
   MELODIC FOUNDRY — FRONT OFFICE PAGE LAYOUT
   Screen-specific layout over tokens.css + motifs.css. Landing
   is board 1b in design/HANDOFF.md; measurements come from its
   spec. Responsive: designed at 1440/390, collapse points at
   ~1180 and ~700 per the handoff's suggested treatment.
   ============================================================ */

/* ---------- header (64px bar) ---------- */
.fo-header {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
  padding: 0 40px;
  border-bottom: 1px solid var(--sem-border-subtle);
}

.fo-header-label {
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sem-link);
}

.fo-header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.fo-header-nav a:not(.fo-btn) {
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
  color: var(--sem-text-muted);
  transition: color var(--mf-dur-base) var(--mf-ease-out);
}

.fo-header-nav a:not(.fo-btn):hover {
  color: var(--sem-accent-hover);
}

/* ---------- hero ---------- */
.fo-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 60px;
  padding: 84px 80px 72px;
  align-items: center;
}

.fo-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px;
  border: 1px solid var(--sem-border-subtle);
  border-radius: var(--mf-radius-full);
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
  color: var(--sem-text-muted);
  margin-bottom: 26px;
}

.fo-hero h1 {
  margin: 0 0 24px;
  font-size: 58px;
  line-height: 1.06;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fo-hero h1 .accent {
  color: var(--sem-link);
}

.fo-hero-body {
  max-width: 520px;
  margin: 0 0 30px;
  font-size: 17.5px;
  color: var(--sem-text-secondary);
}

.fo-hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.fo-hero-reassure {
  font-size: 11px;
}

/* Hero artifact: two stacked manifest cards + a stamp overlapping the
   top-right corner. */
.fo-hero-art {
  position: relative;
  justify-self: center;
}

.fo-hero-art .back {
  position: absolute;
  inset: 0;
  transform: rotate(3deg) translate(14px, 10px);
  background: var(--sem-surface-1);
  border: 1px solid var(--sem-border-subtle);
  border-radius: var(--mf-radius-md);
}

.fo-hero-art .front {
  position: relative;
  width: 400px;
  transform: rotate(-1.5deg);
  box-shadow: var(--sem-elev-3);
}

.fo-hero-art .fo-stamp {
  position: absolute;
  top: -24px;
  right: -30px;
  --stamp-rotate: 8deg;
  color: var(--fo-state-quoted-text);
  z-index: 1;
}

.fo-manifest-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  border-top: var(--manifest-rule);
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: var(--mf-track-label);
  color: var(--sem-text-secondary);
}

.fo-manifest-foot .fo-badge {
  color: var(--fo-state-quoted-text);
}

/* ---------- journey strip ---------- */
.fo-journey {
  position: relative;
  padding: 34px 80px;
  background: var(--fo-band-bg);
  border-top: 1px solid var(--sem-border-subtle);
  border-bottom: 1px solid var(--sem-border-subtle);
}

.fo-journey-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fo-journey-line {
  position: relative;
}

/* The conveyor runs through the dot row — dots sit ON the line. */
.fo-journey-line > .fo-conveyor {
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
}

.fo-journey-stations {
  position: relative;
  display: flex;
  justify-content: space-between;
}

.fo-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.fo-station-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--fo-stage, var(--sem-accent));
  box-shadow: 0 0 10px var(--fo-stage, var(--sem-accent));
}

/* The optional station (design add-on): dashed plaque, dot at half glow. */
.fo-station.optional .fo-plaque {
  border-style: dashed;
}

.fo-station.optional .fo-station-dot {
  opacity: 0.7;
}

.fo-station.dock .fo-plaque {
  border-color: var(--fo-stage-dock-text);
}

.fo-station.dock .fo-plaque-name {
  color: var(--fo-stage-dock-text);
}

.fo-station.dock .fo-crate {
  width: 22px;
  height: 15px;
  border-width: 2px;
}

/* ---------- section scaffolding ---------- */
.fo-section {
  padding: 80px;
}

.fo-section-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 0 0 34px;
}

.fo-section-title h2 {
  margin: 0;
  font-size: 30px;
  text-transform: uppercase;
}

/* ---------- how it works ---------- */
.fo-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.fo-step {
  background: var(--sem-surface-1);
  border: 1px solid var(--sem-border-subtle);
  border-radius: var(--mf-radius-md);
  padding: 22px;
}

.fo-step-no {
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: var(--mf-track-label);
  color: var(--sem-link);
}

.fo-step h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  text-transform: uppercase;
}

.fo-step p {
  margin: 0;
  font-size: var(--mf-text-sm);
  color: var(--sem-text-secondary);
}

/* ---------- off the line lately ---------- */
.fo-examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.fo-example {
  position: relative;
  background: var(--sem-surface-1);
  border: 1px solid var(--sem-border-subtle);
  border-top: 4px solid var(--fo-identity, var(--sem-accent));
  border-radius: var(--mf-radius-md);
  padding: 20px 22px 22px;
}

.fo-example-id {
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: var(--mf-track-label);
  color: var(--fo-identity, var(--sem-accent));
}

.fo-example h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.fo-example p {
  margin: 0 0 16px;
  font-size: var(--mf-text-sm);
  color: var(--sem-text-secondary);
}

.fo-example-tags {
  display: flex;
  gap: 8px;
}

.fo-example-tags span {
  padding: 3px 9px;
  border: 1px solid var(--sem-border-strong);
  border-radius: var(--mf-radius-full);
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sem-text-muted);
}

.fo-example .fo-stamp {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 12px;
  padding: 3px 9px;
  --stamp-rotate: -5deg;
  color: var(--sem-link);
}

/* ---------- closing CTA band ---------- */
.fo-cta {
  padding: 76px 80px;
  background: var(--fo-band-bg);
  border-top: 1px solid var(--sem-border-subtle);
  text-align: center;
}

.fo-cta .fo-stamp {
  --stamp-rotate: -4deg;
  color: var(--sem-link);
  margin-bottom: 30px;
}

.fo-cta h2 {
  margin: 0 0 20px;
  font-size: 40px;
  text-transform: uppercase;
}

.fo-cta p {
  max-width: 560px;
  margin: 0 auto 30px;
  font-size: 15px;
  color: var(--sem-text-secondary);
}

/* ---------- footer ---------- */
.fo-footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 40px;
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
  color: var(--sem-text-faint);
}

.fo-footer a {
  color: var(--sem-text-muted);
}

.fo-footer a:hover {
  color: var(--sem-accent-hover);
}

.fo-footer nav {
  display: flex;
  gap: 22px;
}

/* ---------- responsive (1440 and 390 specified; middle suggested) ---------- */
@media (max-width: 1180px) {
  .fo-hero {
    grid-template-columns: 1fr;
    padding: 56px 40px 48px;
  }

  .fo-hero-art {
    justify-self: start;
  }

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

  .fo-examples {
    grid-template-columns: 1fr;
  }

  .fo-section {
    padding: 56px 40px;
  }

  .fo-journey {
    padding: 34px 40px;
    overflow-x: auto;
  }

  .fo-journey-stations {
    gap: 26px;
  }
}

@media (max-width: 700px) {
  .fo-header {
    height: 54px;
    padding: 0 18px;
    gap: 12px;
  }

  .fo-logo {
    font-size: 18px;
  }

  /* Phone header (54px bar): the lockup + SIGN IN. The label and the
     primary CTA go — the hero repeats "Start a work order" one screen
     height down. */
  .fo-header > .fo-logo-divider,
  .fo-header-label,
  .fo-header-nav .fo-btn-primary,
  .fo-header-nav a:not(.fo-btn) {
    display: none;
  }

  .fo-hero {
    padding: 40px 18px 36px;
  }

  .fo-hero h1 {
    font-size: 38px;
    white-space: normal;
  }

  .fo-hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Stretch the art to the track and let the card take it — with
     justify-self: start the card's percentage width resolves against a
     shrink-to-fit parent and lays out at max-content, which is what forces
     the whole page wider than the phone viewport. */
  .fo-hero-art {
    justify-self: stretch;
    width: 100%;
  }

  .fo-hero-art .front {
    width: auto;
  }

  .fo-hero-art .back {
    transform: rotate(3deg) translate(6px, 10px);
  }

  .fo-hero-art .fo-stamp {
    top: -18px;
    right: -4px;
  }

  .fo-section {
    padding: 40px 18px;
  }

  .fo-steps {
    grid-template-columns: 1fr;
  }

  .fo-cta {
    padding: 56px 18px;
  }

  .fo-footer {
    flex-direction: column;
    gap: 10px;
  }
}

/* ---------- page frame (all pages) ---------- */
/* Short pages (sign-in, footer pages) must not leave the footer stranded
   mid-viewport: the body is a column and main takes the slack. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1;
}

/* ---------- footer pages (pricing / contact / terms) ---------- */
.fo-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.fo-page-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.fo-page-head h1 {
  font-size: 34px;
  font-weight: 400;
  margin: 0;
  line-height: 1.15;
}

.fo-page-lede {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--sem-text-secondary);
  max-width: 560px;
}

/* A one-line pointer between cards (the operators page's "already on the
   crew?" — the back-office door for people who are past applying). */
.fo-page-aside {
  margin: 28px 0;
  padding-left: 24px;
  font-size: 14px;
  color: var(--sem-text-secondary);
}

.fo-page-card {
  background: var(--sem-surface-1);
  border: 1px solid var(--sem-border-subtle);
  border-radius: var(--mf-radius-md);
  padding: 8px 24px;
}

/* Stacked cards (the operators page) breathe instead of touching. */
.fo-page-card + .fo-page-card {
  margin-top: 28px;
}

.fo-fact {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-top: var(--manifest-rule);
}

.fo-fact:first-child {
  border-top: none;
}

.fo-fact-label {
  flex: 0 0 110px;
  font-family: var(--mf-font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
  color: var(--sem-text-faint);
  padding-top: 3px;
}

.fo-fact p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--fo-body-bright);
}

.fo-page-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  text-align: center;
}

.fo-page-note {
  display: block;
  margin-top: 24px;
  text-align: center;
}

@media (max-width: 700px) {
  .fo-page {
    padding: 40px 16px 56px;
  }

  .fo-fact {
    flex-direction: column;
    gap: 6px;
  }
}

/* The operator application (docs/OPERATOR-PROGRAM.md) — the one form on
   this origin. Field chrome matches the customer app's auth inputs. */
.fo-apply {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 0;
  border-top: var(--manifest-rule);
}
.fo-apply label {
  font-size: 10px;
  letter-spacing: var(--mf-track-label);
  color: var(--sem-text-faint);
  margin-top: 20px;
}
.fo-apply label:first-child {
  margin-top: 4px;
}
.fo-apply input,
.fo-apply textarea {
  background: var(--sem-surface-0);
  border: 1px solid var(--sem-border-subtle);
  border-radius: var(--mf-radius-sm);
  color: var(--sem-text-primary);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}
.fo-apply input:focus,
.fo-apply textarea:focus {
  outline: none;
  border-color: var(--sem-accent);
}
.fo-apply [data-apply-error] {
  color: var(--sem-danger, #ff2e7e);
  font-size: 11px;
}
