/*
 * 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);
}

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

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

  .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;
  }
}
