/* torrere.com — the marketing site.
 *
 * The palette is lifted from the app's own tokens (web/src/styles/tokens.css)
 * rather than invented here, so the site and the thing it is selling do not
 * look like two products. Warm paper and ink, one accent — ember, because
 * "torrere" is Latin for to roast.
 *
 * NO JAVASCRIPT ANYWHERE ON THIS SITE. That is a security property, not a
 * preference: with no scripts the whole apex can carry `default-src 'none'`,
 * which is the isolation the share host was going to buy before /r/ moved to
 * the apex (security-spec C47). Adding one script means weakening the policy
 * for every path, share pages included. Do it in CSS or do without.
 */

:root {
  color-scheme: light dark;

  --paper: #fbf7f0;
  --paper-raised: #ffffff;
  --paper-sunk: #f2ebe0;
  --ink: #211a15;
  --ink-soft: #5d5049;
  --ink-faint: #8b7d73;
  --rule: #e5dbcd;
  --rule-strong: #cfc0ac;

  --ember: #b8451f;
  --ember-ink: #ffffff;
  --ember-wash: #f7e7dd;

  --added: #2f6b4a;
  --added-wash: #e2f0e7;
  --removed: #9a3121;
  --removed-wash: #f7e3df;
  --caution: #8a6216;
  --caution-wash: #f7eeda;

  --shadow-sm: 0 1px 2px rgb(33 26 21 / 0.06), 0 1px 1px rgb(33 26 21 / 0.04);
  --shadow-md: 0 4px 16px rgb(33 26 21 / 0.08), 0 1px 3px rgb(33 26 21 / 0.06);

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --measure: 34rem;
  --page: 64rem;
  --radius: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1512;
    --paper-raised: #241d18;
    --paper-sunk: #130f0d;
    --ink: #f2e9df;
    --ink-soft: #bcac9a;
    --ink-faint: #8a7b6c;
    --rule: #362c24;
    --rule-strong: #4d3f34;

    --ember: #ff8a54;
    --ember-ink: #2a1206;
    --ember-wash: #3a241a;

    --added: #74d19b;
    --added-wash: #1c2f25;
    --removed: #ff9b85;
    --removed-wash: #33201c;
    --caution: #e0b356;
    --caution-wash: #322715;

    --shadow-sm: none;
    --shadow-md: 0 4px 24px rgb(0 0 0 / 0.4);
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

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

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

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
  font-weight: 600;
}

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

/* --- skip link ----------------------------------------------------------- */

.skip {
  position: absolute;
  inset-inline-start: -9999px;
}

.skip:focus {
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}

/* --- shell --------------------------------------------------------------- */

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.site-header {
  border-block-end: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  margin-inline-end: auto;
}

.wordmark img {
  inline-size: 30px;
  block-size: 30px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.6rem);
  font-size: 0.95rem;
}

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

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

/* On a phone the four nav items have a min-content width wider than the
 * viewport, and a flex row that cannot shrink past it makes the whole DOCUMENT
 * scroll sideways — every section below inherits the overflow. The two in-page
 * jumps are the ones to drop: they only go to sections the reader is already
 * scrolling through, and both are still in the footer. */
@media (max-width: 46rem) {
  .nav-jump {
    display: none;
  }

  .site-nav {
    gap: 0.9rem;
  }

  .wordmark {
    font-size: 1.15rem;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  border-color: var(--ink-faint);
}

.btn-primary {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--ember-ink);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--ember) 88%, var(--ink));
  border-color: transparent;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

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

section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

section + section {
  border-block-start: 1px solid var(--rule);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
  margin-block-end: 0.9rem;
}

.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: var(--measure);
  line-height: 1.55;
}

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

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

/* The headline gets the larger share of the split. At an even 1fr 1fr it broke
 * over five lines while the demo column sat in a field of empty space. */
@media (min-width: 56rem) {
  .hero .split {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* No max-width in ch here: inside the two-column split the column is already
 * the constraint, and a 18ch cap on top of it broke the headline over five
 * lines. The upper clamp bound is sized for half the page, not all of it. */
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-block-end: 1.5rem;
}

.hero .lede {
  margin-block-end: 2rem;
}

.hero-note {
  margin-block-start: 1rem;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

/* --- the diff demo -------------------------------------------------------
 * Static markup, styled to match the real diff card in the app. It is the one
 * idea the whole product rests on, so it gets shown rather than described. */

.demo {
  display: grid;
  gap: 1rem;
  max-width: 30rem;
  margin-block-start: 2.5rem;
}

.bubble {
  align-self: start;
  justify-self: end;
  max-width: 22rem;
  padding: 0.7rem 1.05rem;
  border-radius: 1.1rem 1.1rem 0.3rem 1.1rem;
  background: var(--ember-wash);
  color: var(--ink);
  font-size: 1rem;
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.1rem 1.25rem;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-block-end: 0.75rem;
}

.diff {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  display: grid;
  gap: 0.3rem;
}

.diff li {
  padding: 0.2rem 0.55rem;
  border-radius: 0.4rem;
  display: flex;
  gap: 0.6rem;
}

.diff li::before {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  inline-size: 1ch;
  opacity: 0.8;
}

.diff .out {
  background: var(--removed-wash);
  color: var(--removed);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.diff .out::before {
  content: "−";
}

.diff .in {
  background: var(--added-wash);
  color: var(--added);
}

.diff .in::before {
  content: "+";
}

.card-foot {
  margin-block-start: 0.9rem;
  padding-block-start: 0.75rem;
  border-block-start: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.pill {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* --- feature grid -------------------------------------------------------- */

.grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-block-start: 2.5rem;
}

.grid h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-block-end: 0.6rem;
}

.grid p {
  color: var(--ink-soft);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
  margin-block-end: 1rem;
  max-width: 20ch;
}

/* --- split --------------------------------------------------------------- */

.split {
  display: grid;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}

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

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

/* --- cook mode sample ---------------------------------------------------- */

.cook-sample {
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  font-family: var(--font-display);
}

.cook-sample .step-no {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
}

.cook-sample .step-body {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  line-height: 1.35;
  margin-block: 0.8rem 1.2rem;
}

.cook-sample .step-meta {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink-faint);
}

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

.plans {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-block-start: 2.5rem;
  max-width: 42rem;
}

.plan {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.plan.featured {
  border-color: var(--ember);
}

.plan h3 {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.price {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.1;
  margin-block: 0.6rem 0.2rem;
}

.price small {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink-faint);
}

.plan p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* --- lists --------------------------------------------------------------- */

.ticks {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  max-width: var(--measure);
}

/* A hanging dash, not a flex row. As a flex container the <strong> that opens
 * several of these items became its own flex item, so "Importing." sat in one
 * column and its sentence wrapped inside a narrower second one. */
.ticks li {
  position: relative;
  padding-inline-start: 1.6rem;
  color: var(--ink-soft);
}

.ticks li::before {
  content: "—";
  position: absolute;
  inset-inline-start: 0;
  color: var(--ember);
}

/* --- notice -------------------------------------------------------------- */

.notice {
  background: var(--caution-wash);
  border: 1px solid color-mix(in srgb, var(--caution) 35%, transparent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--ink);
  max-width: var(--measure);
}

.notice strong {
  color: var(--caution);
}

/* Two one-off adjustments that would be `style=` attributes anywhere else.
 * They are classes because the site's CSP has no 'unsafe-inline' in style-src,
 * and an inline style attribute is silently dropped under it. */
.notice-spaced {
  margin-block-start: 2rem;
}

.lede-center {
  text-align: center;
}

/* --- prose (legal, support, delete) -------------------------------------- */

.prose {
  max-width: 42rem;
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.01em;
  margin-block-end: 1.5rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin-block: 2.5rem 0.8rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--rule);
}

.prose h3 {
  font-size: 1.1rem;
  margin-block: 1.75rem 0.5rem;
}

.prose p,
.prose ul,
.prose ol,
.prose table {
  margin-block: 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.4rem;
}

.prose li {
  margin-block-end: 0.5rem;
}

.prose table {
  border-collapse: collapse;
  inline-size: 100%;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: start;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--rule);
  vertical-align: top;
}

.prose th {
  background: var(--paper-sunk);
  font-weight: 600;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--paper-sunk);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

.prose hr {
  border: 0;
  border-block-start: 1px solid var(--rule);
  margin-block: 2.5rem;
}

.prose blockquote {
  margin: 0 0 1.1rem;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--ember);
  color: var(--ink-soft);
}

/* An unfilled [[PLACEHOLDER]] from legal/entity.json. Loud on purpose — a legal
 * page with a hole in it should look like one, not like a typo. */
.gap {
  background: var(--caution-wash);
  border-block-end: 2px dotted var(--caution);
  color: var(--caution);
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 0.3em 0.3em 0 0;
}

.doc-meta {
  color: var(--ink-faint);
  font-size: 0.95rem;
  margin-block-end: 2rem;
}

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

.site-footer {
  border-block-start: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding-block: 3rem 4rem;
  font-size: 0.95rem;
}

.foot-cols {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin-block-end: 2.5rem;
}

.foot-cols h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-block-end: 0.8rem;
}

.foot-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

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

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

.disclaimer {
  max-width: 40rem;
  color: var(--ink-soft);
  border-block-start: 1px solid var(--rule);
  padding-block-start: 1.5rem;
}

.copyright {
  margin-block-start: 1.5rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* --- 404 ----------------------------------------------------------------- */

.center {
  min-height: 50vh;
  display: grid;
  align-content: center;
  gap: 1.25rem;
  text-align: center;
  justify-items: center;
  padding-block: 4rem;
}

.center h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
