/*
 * Howfolio website: the landing page, the comparison and the privacy policy. Same palette and type as
 * the extension (src/styles/tokens.css): ink for actions, orange only for brand marks, IBM Plex Sans
 * self-hosted (fonts.css). Nothing is loaded from elsewhere, like the product.
 */
:root {
  color-scheme: light dark;
  --paper: #f2f2ef;
  --paper-deep: #e8e7e2;
  --card: #ffffff;
  --ink: #111111;
  --muted: #57554f;
  --line: #dcdad3;
  --accent: #111111;
  --accent-hover: #2e2d2a;
  --accent-ink: #ffffff;
  --brand: #c8472d;
  --brand-text: #b23c24;
  --brand-tint: rgb(200 71 45 / 10%);
  --brand-ink: #ffffff;
  --red: #c42b1c;
  --display: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ui: var(--display);
  --measure: 34rem;
  --shadow: 0 1px 0 rgb(17 17 17 / 5%), 0 24px 48px -24px rgb(17 17 17 / 30%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0f0e;
    --paper-deep: #1a1a18;
    --card: #1a1a18;
    --ink: #f1f0ea;
    --muted: #a6a49c;
    --line: #2f2e2b;
    --accent: #f1f0ea;
    --accent-hover: #ffffff;
    --accent-ink: #111111;
    --brand: #ff7a45;
    --brand-text: #ff7a45;
    --brand-tint: rgb(255 122 69 / 12%);
    --brand-ink: #111111;
    --red: #ff6b5e;
    --shadow: 0 1px 0 rgb(0 0 0 / 30%), 0 24px 48px -24px rgb(0 0 0 / 70%);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.6 var(--ui);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Links carry the wordmark's underline bar. */
a {
  color: var(--ink);
  text-decoration: underline 2px var(--brand);
  text-underline-offset: 4px;
}

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

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--card);
}

/* ---- top bar ------------------------------------------------------------------------------- */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 118px;
  height: 35px;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 0.95rem;
}

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

.top nav a:hover {
  color: var(--ink);
}

/* ---- buttons ------------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 1rem/1 var(--ui);
  text-decoration: none;
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1), background-color 120ms;
}

.button:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

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

.button.quiet {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}

.button.quiet:hover {
  border-color: var(--muted);
  background: var(--card);
  color: var(--ink);
}

/* Stands where a button will be until the store listing and the checkout exist. */
.soon {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font: 500 1rem/1.3 var(--ui);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
  padding: 40px 0 72px;
}

.kicker {
  margin: 0 0 14px;
  color: var(--brand-text);
  font: 600 0.9rem/1 var(--ui);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 1.4rem + 3.4vw, 3.9rem);
  line-height: 1.05;
}

.lede {
  max-width: var(--measure);
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.fine {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* The product, framed as a window on the page. */
.window {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.window::before {
  content: '';
  display: block;
  height: 26px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 16px 13px, #e0614f 4.5px, transparent 5px),
    radial-gradient(circle at 32px 13px, #e7b545 4.5px, transparent 5px),
    radial-gradient(circle at 48px 13px, #5ab36b 4.5px, transparent 5px),
    var(--paper-deep);
}

/* ---- steps: the page tells its story as a guide would --------------------------------------- */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.section > h2,
.section-head h2 {
  margin: 0 0 12px;
  padding-bottom: 14px;
  background: linear-gradient(var(--brand), var(--brand)) left bottom / 32px 4px no-repeat;
  font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem);
  line-height: 1.1;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 40px;
}

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

.step {
  display: grid;
  grid-template-columns: 64px minmax(0, 4fr) minmax(0, 7fr);
  gap: 24px 32px;
  align-items: start;
  padding: 36px 0;
}

.step + .step {
  border-top: 1px dashed var(--line);
}

.step-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font: 600 1.2rem/1 var(--display);
  font-variant-numeric: tabular-nums;
}

.step h3 {
  margin: 4px 0 10px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.step p,
.step ul {
  margin: 0 0 12px;
  color: var(--muted);
}

.step ul {
  padding-left: 1.1em;
}

.step figure {
  margin: 0;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---- the ledger: everything Howfolio sends anywhere ---------------------------------------- */

.ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.receipt {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.receipt h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.receipt .sub {
  margin: 0 0 18px;
  color: var(--muted);
}

.receipt dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.receipt dt {
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-weight: 600;
}

.receipt dd {
  margin: 2px 0 14px;
  color: var(--muted);
}

.receipt .total {
  margin: 0;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-weight: 600;
}

/* ---- pricing ------------------------------------------------------------------------------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 880px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.plan.paid {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.plan h3 {
  margin: 0;
  font-size: 1.4rem;
}

.price {
  margin: 10px 0 4px;
  font: 600 2.6rem/1 var(--display);
}

.launch {
  align-self: flex-start;
  margin: 8px 0 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.price small {
  color: var(--muted);
  font: 500 1rem/1 var(--ui);
}

.plan ul {
  flex: 1;
  margin: 18px 0 24px;
  padding-left: 1.1em;
  color: var(--muted);
}

.plan li + li {
  margin-top: 6px;
}

/* ---- FAQ ----------------------------------------------------------------------------------- */

.faq {
  max-width: 46rem;
}

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

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

.faq summary {
  padding: 18px 0;
  font-weight: 600;
  cursor: pointer;
}

.faq summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.faq details p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* ---- comparison ---------------------------------------------------------------------------- */

.draft {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-left: 4px solid var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}

.table-wrap:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
  overflow-wrap: normal;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  font: 600 1.05rem/1.2 var(--display);
  letter-spacing: 0;
}

tbody th {
  width: 20%;
  color: var(--muted);
  font-weight: 600;
}

td.us {
  background: var(--brand-tint);
}

.verify {
  text-decoration: underline wavy color-mix(in srgb, var(--red) 70%, transparent);
  text-underline-offset: 4px;
}

.sources {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- prose (privacy) ----------------------------------------------------------------------- */

.prose {
  max-width: 44rem;
  /* Long addresses and keys must wrap rather than push the page sideways on a phone. */
  overflow-wrap: anywhere;
  padding: 24px 0 72px;
}

.prose h1 {
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem);
}

.prose h2 {
  margin: 44px 0 10px;
  font-size: 1.6rem;
}

.prose p,
.prose li {
  color: var(--ink);
}

/* The kicker keeps its brand colour inside prose pages too (the beta invitation). */
.prose .kicker {
  color: var(--brand-text);
}

/* The comparison needs room for five columns. */
.prose.wide {
  max-width: 64rem;
}

.prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  font-size: 0.9em;
}

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

footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

footer a {
  color: var(--muted);
}

/* ---- 404: a recording of the visit, where the highlight lands on nothing ---------------------- */

/* Backdrop: a dot grid like a design canvas, fading out from behind the recording, over a warm
   brand glow. The body lets the page's paper show through, so the layer sits between them. */
body.not-found {
  background: transparent;
}

body.not-found::before,
body.not-found::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* The glow, wider than the window so it shows round its edges. */
body.not-found::before {
  z-index: -2;
  background:
    radial-gradient(ellipse 48% 62% at 74% 46%, color-mix(in srgb, var(--brand) 32%, transparent), transparent 70%),
    radial-gradient(ellipse 36% 40% at 4% 100%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%);
}

/* The dot grid, fading out towards the edges. */
body.not-found::after {
  z-index: -1;
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--muted) 36%, transparent) 1.1px, transparent 1.6px) 0 0 / 22px 22px;
  mask-image: radial-gradient(ellipse 80% 75% at 62% 45%, #000000 35%, transparent 100%);
}


.lost {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
  padding: 32px 0 80px;
}

.lost h1 {
  font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.4rem);
}

.lost .lede {
  margin-bottom: 22px;
}

.way-back {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.way-back li {
  display: flex;
  gap: 12px;
  align-items: center;
}

.way-back .badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font: 600 0.85rem/1 var(--display);
}

.lost-shot {
  margin: 0;
}

.lost-page {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 12px;
  aspect-ratio: 4 / 3;
  padding: 18px 20px 20px;
  overflow: hidden;
  container-type: inline-size;
}

/* The extension's recording banner: ink, with a live red dot. */
.lost-rec {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: start;
  margin: 0;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 500 0.8rem/1.4 var(--ui);
}

.lost-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: lost-live 1.6s ease-in-out infinite;
}

/* Grey bars stand in for the page around the missing step. */
.lost-bars {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bar {
  display: block;
  height: 10px;
  border-radius: 5px;
  /* Mixed from the text colour, so the bars show on the window in both themes. */
  background: color-mix(in srgb, var(--muted) 16%, transparent);
}

.bar-logo {
  width: 64px;
  height: 14px;
  margin-right: auto;
  background: color-mix(in srgb, var(--muted) 28%, transparent);
}

.bar-nav {
  width: 42px;
}

.bar-title {
  width: 58%;
  height: 18px;
  margin-top: 6px;
  background: color-mix(in srgb, var(--muted) 28%, transparent);
}

.bar-line {
  width: 82%;
}

/* Where the page should be: dashed until the click, then Howfolio's highlight, around nothing. */
.lost-target {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  border: 2px dashed var(--line);
  border-radius: 10px;
  animation: lost-highlight 6s ease-in-out infinite;
}

.lost-empty {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font: 500 0.9rem/1 var(--ui);
}

/* The big number, ghosted until the highlight lands on it. Drawn as generated content: it is decoration
   (the heading says it), so it is not read out or held to text contrast. */
.lost-ghost::before {
  content: '404';
}

.lost-ghost {
  color: color-mix(in srgb, var(--muted) 22%, transparent);
  font: 600 19cqi/0.9 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  animation: lost-ghost 6s ease-in-out infinite;
}

.lost-badge {
  position: absolute;
  top: -13px;
  left: -13px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font: 600 0.8rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  animation: lost-badge 6s ease-in-out infinite;
}

.lost-cursor {
  position: absolute;
  top: 70%;
  left: 76%;
  fill: var(--ink);
  stroke: var(--card);
  stroke-width: 1.4;
  stroke-linejoin: round;
  transform-origin: 4px 3px;
  animation: lost-cursor 6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.lost-ripple {
  position: absolute;
  top: calc(70% - 16px);
  left: calc(76% - 14px);
  width: 36px;
  height: 36px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  opacity: 0;
  animation: lost-ripple 6s ease-out infinite;
}

/* The screenshot being taken. */
.lost-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  animation: lost-flash 6s ease-out infinite;
}

.lost-shot figcaption {
  margin-top: 14px;
}

.lost-shot figcaption strong {
  color: var(--ink);
}

@keyframes lost-live {
  50% { opacity: 0.35; }
}

@keyframes lost-cursor {
  0% { opacity: 0; transform: translate(150px, 120px); }
  8% { opacity: 1; transform: translate(150px, 120px); }
  38% { transform: translate(0, 0) scale(1); }
  42% { transform: translate(0, 0) scale(0.82); }
  46% { transform: translate(0, 0) scale(1); }
  88% { opacity: 1; transform: translate(0, 0); }
  96%, 100% { opacity: 0; transform: translate(0, 0); }
}

@keyframes lost-ripple {
  0%, 41% { opacity: 0; transform: scale(0.3); }
  43% { opacity: 0.7; }
  58%, 100% { opacity: 0; transform: scale(2.4); }
}

@keyframes lost-flash {
  0%, 46% { opacity: 0; }
  48% { opacity: 0.55; }
  56%, 100% { opacity: 0; }
}

@keyframes lost-highlight {
  0%, 47% { border-style: dashed; border-color: var(--line); background: transparent; }
  50%, 92% { border-style: solid; border-color: var(--brand); background: var(--brand-tint); }
  98%, 100% { border-style: dashed; border-color: var(--line); background: transparent; }
}

@keyframes lost-ghost {
  0%, 47% { color: color-mix(in srgb, var(--muted) 22%, transparent); }
  50%, 92% { color: color-mix(in srgb, var(--brand) 55%, transparent); }
  98%, 100% { color: color-mix(in srgb, var(--muted) 22%, transparent); }
}

@keyframes lost-badge {
  0%, 48% { opacity: 0; transform: scale(0.6); }
  53%, 92% { opacity: 1; transform: scale(1); }
  98%, 100% { opacity: 0; transform: scale(0.6); }
}

/* Without motion: the finished step, cursor resting on the empty highlight. */
@media (prefers-reduced-motion: reduce) {
  .lost-dot,
  .lost-cursor,
  .lost-ripple,
  .lost-flash,
  .lost-target,
  .lost-badge,
  .lost-ghost {
    animation: none;
  }

  .lost-ghost {
    color: color-mix(in srgb, var(--brand) 55%, transparent);
  }

  .lost-target {
    border-style: solid;
    border-color: var(--brand);
    background: var(--brand-tint);
  }
}

/* ---- small screens ------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .hero,
  .ledger,
  .plans,
  .lost {
    grid-template-columns: minmax(0, 1fr);
  }

  .lost {
    gap: 40px;
    padding-top: 8px;
  }

  .lost-page {
    aspect-ratio: auto;
  }

  .lost-target {
    min-height: 200px;
  }

  body.not-found::before {
    background: radial-gradient(ellipse 90% 45% at 50% 78%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%);
  }

  body.not-found::after {
    mask-image: radial-gradient(ellipse 120% 70% at 50% 70%, #000000 30%, transparent 100%);
  }

  .hero {
    gap: 36px;
    padding-top: 16px;
  }

  .step {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .step figure {
    grid-column: 1 / -1;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
