/*
 * ApplyMog's public site (#138, rebuilt in #141).
 *
 * The same world as the application ("Quiet Desk", DESIGN.md and
 * src/styles/tokens.css): the graphite ladder the application opens in
 * (its default appearance is dark, whatever the system's), the operating
 * system's own interface face, and one accent, near-white, that means
 * "act". Depth is tone first, a hairline second, a small offset
 * shadow last. Status is never colour alone.
 *
 * The pages work without script: site.js only turns the header links into a
 * menu on a phone and the product tour into tabs.
 */

:root {
  color-scheme: dark;
  --window: #040405;
  --ground: #09090b;
  --paper: #0d0d10;
  --raised: #131317;
  --well: #0b0b0e;
  --line: #26262c;
  --line-strong: #3a3a42;
  --ink-strong: #ededf0;
  --ink: #d7d7dd;
  --ink-muted: #9a9aa4;
  --accent: #e4e4e8;
  --accent-hover: #f3f3f6;
  --on-accent: #0b0b0e;
  --link: #ededf0;
  --focus: #a9a9b4;
  --ok: #5fb27c;
  --ok-soft: rgb(95 178 124 / 12%);
  --warn: #d7a24a;
  --warn-soft: rgb(201 146 46 / 12%);
  --stop: #e3837f;
  --stop-soft: rgb(216 111 107 / 13%);
  --applied: #a993e6;
  --shadow: 0 1px 2px rgb(0 0 0 / 50%), 0 24px 48px -24px rgb(0 0 0 / 80%);
  --select: rgb(228 228 232 / 22%);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', system-ui,
    Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI',
    system-ui, Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono',
    monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Base ───────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--line-strong) var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
}

::selection {
  background: var(--select);
  color: var(--ink-strong);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  font-weight: 640;
  line-height: 1.12;
  letter-spacing: -0.028em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -0.014em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--raised);
  color: var(--ink-strong);
  font: 600 0.95rem/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--ink-muted);
  text-decoration: none;
}

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

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

.btn--small {
  min-height: 2.25rem;
  padding: 0 0.85rem;
  font-size: 0.875rem;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(16px);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-head {
    background: var(--ground);
  }
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: 4rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-strong);
  font: 650 1.05rem/1 var(--font-display);
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 7px;
  background: var(--ink-strong);
  color: var(--ground);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  font-size: 0.925rem;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--ink-strong);
}

/* A button in the nav keeps its own colours (the nav's links are muted). */
.site-nav a.btn {
  color: var(--ink-strong);
}

.site-nav a.btn--primary,
.site-nav a.btn--primary:hover {
  color: var(--on-accent);
}

.site-nav__account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle {
  display: none;
}

/* With script, a phone gets a menu button; without it, the links wrap. */
@media (max-width: 52rem) {
  .site-nav {
    order: 3;
    width: 100%;
    padding-bottom: 0.5rem;
  }

  .js .site-head .wrap {
    flex-wrap: nowrap;
  }

  .js .menu-toggle {
    display: inline-flex;
    min-height: 2.5rem;
    padding: 0 0.9rem;
  }

  .js .site-nav {
    display: none;
  }

  .js .site-nav.is-open {
    position: absolute;
    inset: 100% 0 auto 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .js .site-nav.is-open a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .js .site-nav.is-open .site-nav__account {
    padding-top: 1rem;
    gap: 0.75rem;
  }

  .js .site-nav.is-open .site-nav__account a {
    border: 1px solid var(--line-strong);
    padding: 0;
    flex: 1;
  }
}

/* ── Sections ───────────────────────────────────────────────────────── */

main {
  display: block;
}

.section {
  padding-block: clamp(4rem, 3rem + 4vw, 7rem);
  border-top: 1px solid var(--line);
}

.section--quiet {
  background: var(--window);
}

.section__head {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem);
}

.section__head p {
  margin-top: 1rem;
  color: var(--ink-muted);
  font-size: 1.075rem;
}

.lede {
  font-size: clamp(1.075rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 38rem;
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.more {
  margin-top: 2rem;
  font-weight: 600;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(3.5rem, 2.5rem + 5vw, 7rem) clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.hero .wrap {
  display: grid;
  gap: 3rem 4rem;
  align-items: center;
}

@media (min-width: 64rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.4rem);
}

.hero .lede {
  margin-top: 1.5rem;
}

.beta-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* One flex item for the sentence, so the link flows with it and never
   shrinks to a column of its own on a phone. */
.beta-note a {
  white-space: nowrap;
}

.beta-note::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

/* ── Product frames: real screens, synthetic data ───────────────────── */

.frame {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2rem;
  padding-inline: 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.frame__bar::before {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0.9rem 0 0 var(--line-strong), 1.8rem 0 0 var(--line-strong);
  margin-right: 2.2rem;
}

.frame img {
  width: 100%;
}

.caption {
  margin-top: 0.85rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.pair {
  position: relative;
}

.pair__inset {
  position: absolute;
  right: clamp(-0.5rem, -1vw, 0rem);
  bottom: -1.5rem;
  width: min(38%, 19rem);
  border-radius: var(--r-md);
}

@media (max-width: 40rem) {
  .pair__inset {
    position: static;
    width: 78%;
    margin: -2.5rem 0 0 auto;
  }
}

/* ── The tour (tabs with script; stacked steps without) ─────────────── */

.tour {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.tour__tabs {
  display: none;
}

.tour__step + .tour__step {
  margin-top: 4rem;
}

.tour__step {
  display: grid;
  gap: 1.75rem 3rem;
  align-items: start;
}

.tour__step-title {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.tour__n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.tour__text p {
  margin-top: 0.85rem;
  color: var(--ink);
}

.tour__text ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  font-size: 0.95rem;
}

.tour__text li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.5rem;
  color: var(--ink-muted);
}

.tour__text li::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  margin: 0.6rem 0 0 0.2rem;
  border-radius: 50%;
  background: var(--ink-muted);
}

@media (min-width: 60rem) {
  .tour__step {
    grid-template-columns: minmax(16rem, 0.8fr) 1.7fr;
  }
}

.js .tour__tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--well);
}

.tour__tab {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-muted);
  font: 600 0.925rem/1.2 var(--font);
  text-align: left;
  cursor: pointer;
}

.tour__tab:hover {
  color: var(--ink-strong);
}

.tour__tab[aria-selected='true'] {
  background: var(--raised);
  border-color: var(--line-strong);
  color: var(--ink-strong);
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
}

.tour__tab[aria-selected='true'] .tour__n {
  border-color: var(--ink-strong);
  color: var(--ink-strong);
}

.js .tour__step + .tour__step {
  margin-top: 0;
}

.js .tour__step[hidden] {
  display: none;
}

.js .tour__step .tour__step-title {
  display: none;
}

@media (max-width: 40rem) {
  .js .tour__tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .js .tour__step:not([hidden]) .frame {
    animation: settle 520ms var(--ease) both;
  }

  @keyframes settle {
    from {
      opacity: 0.4;
      filter: blur(6px);
      transform: translateY(10px);
    }
  }
}

/* ── The field report ───────────────────────────────────────────────── */

.ledger {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

@media (min-width: 56rem) {
  .ledger {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ledger__col {
  background: var(--paper);
  padding: 1.5rem 1.5rem 1.75rem;
}

.ledger__col h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ledger__col > p {
  margin-top: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.925rem;
}

.ledger ul {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  font-size: 0.9rem;
}

.ledger li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.ledger li span:last-child {
  color: var(--ink-muted);
  text-align: right;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pill::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentcolor;
}

.pill--ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.pill--warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.pill--stop {
  color: var(--stop);
  background: var(--stop-soft);
}

/* ── Split feature rows ─────────────────────────────────────────────── */

.split {
  display: grid;
  gap: 2rem 4rem;
  align-items: center;
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: 1fr 1.25fr;
  }

  .split--flip > :first-child {
    order: 2;
  }
}

.split p + p {
  margin-top: 1rem;
}

.split h2 + p {
  margin-top: 1.25rem;
}

.checks {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.checks li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.6rem;
}

.checks li::before {
  content: '';
  width: 0.9rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  border: solid var(--ok);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px);
}

.checks--never li::before {
  width: 0.85rem;
  height: 2px;
  margin-top: 0.75rem;
  border: 0;
  background: var(--stop);
  transform: none;
}

/* ── Boundaries ─────────────────────────────────────────────────────── */

.boundaries {
  display: grid;
  gap: 1rem 3rem;
}

@media (min-width: 56rem) {
  .boundaries {
    grid-template-columns: 1fr 1fr;
  }
}

.boundaries > div {
  padding-top: 1.25rem;
  border-top: 2px solid var(--line-strong);
}

.boundaries h3 {
  margin-bottom: 0.25rem;
}

/* ── Steps (how it works, install) ──────────────────────────────────── */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3.5rem;
}

.steps > li {
  counter-increment: step;
  display: grid;
  gap: 1.5rem 3rem;
  align-items: start;
}

@media (min-width: 60rem) {
  .steps > li {
    grid-template-columns: minmax(16rem, 0.85fr) 1.5fr;
  }
}

.steps > li > div > h3::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-muted);
  font-size: 0.8rem;
  vertical-align: 0.1em;
}

.steps p {
  margin-top: 0.75rem;
}

.steps .checks {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.numbered {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.numbered li::marker {
  color: var(--ink-muted);
  font-weight: 600;
}

/* ── FAQ ─────────────────────────────────────────────────────────────── */

.faq {
  border-top: 1px solid var(--line);
  max-width: 50rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  color: var(--ink-strong);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0.45rem 0.25rem 0 0;
  border: solid var(--ink-muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 0.7rem;
}

.faq details > div {
  padding: 0 0 1.35rem;
  color: var(--ink);
  max-width: 44rem;
}

.faq details > div p + p {
  margin-top: 0.75rem;
}

.faq h2 {
  font-size: 1.35rem;
  margin: 3rem 0 0.75rem;
}

/* ── Closing band ───────────────────────────────────────────────────── */

.access {
  display: grid;
  gap: 2rem 4rem;
  align-items: start;
}

@media (min-width: 56rem) {
  .access {
    grid-template-columns: 1.3fr 1fr;
  }
}

.access__paths {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.access__paths > div {
  background: var(--paper);
  padding: 1.25rem 1.5rem;
}

.access__paths p {
  margin: 0.35rem 0 0.9rem;
  color: var(--ink-muted);
  font-size: 0.925rem;
}

/* ── Documents (support, privacy, terms, source) ────────────────────── */

.doc {
  max-width: 46rem;
  padding-block: clamp(3rem, 2rem + 3vw, 5rem);
}

.doc h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.85rem);
  margin-bottom: 1.5rem;
}

.doc h2 {
  font-size: 1.4rem;
  margin: 2.75rem 0 0.75rem;
}

.doc h3 {
  margin: 1.75rem 0 0.5rem;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 1rem;
}

.doc ul,
.doc ol {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.4rem;
}

.note {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--warn-soft);
  color: var(--ink-strong);
}

.doc .lede {
  color: var(--ink-muted);
}

.page-head {
  padding-block: clamp(3rem, 2rem + 4vw, 6rem) clamp(2rem, 1.5rem + 2vw, 3rem);
}

.page-head h1 {
  max-width: 18ch;
}

.page-head .lede {
  margin-top: 1.25rem;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--window);
  padding-block: 3rem 2.5rem;
  font-size: 0.9rem;
}

.site-foot .wrap {
  display: grid;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .site-foot .wrap {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

.site-foot nav {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.site-foot h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.site-foot a {
  color: var(--ink);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--ink-strong);
  text-decoration: underline;
}

.site-foot__about p {
  margin-top: 0.75rem;
  color: var(--ink-muted);
  max-width: 22rem;
}
