/* Retensity — landing page
   Palette: deep green-cast ink, paper receipt as the single light element,
   diff red/green used only as code semantics. */

:root {
  --ink: #0d1411;
  --ink-2: #111a16;
  --line: #243029;
  --line-soft: #1a2420;
  --text: #c3cfc7;
  --text-dim: #7d8c83;
  --text-bright: #edf2ee;
  --paper: #f1ede1;
  --paper-ink: #1c1a14;
  --paper-dim: #6b6657;
  --paper-rule: #b9b2a0;
  --diff-green: #58b27e;
  --diff-green-ink: #0b120e;
  --diff-green-text: #9fd4b5;
  --diff-green-bg: rgba(88, 178, 126, 0.12);
  --diff-red-text: #d99c92;
  --diff-red-bg: rgba(201, 106, 91, 0.10);
  --amber: #d9b45c;
  --stamp: #c0453a;

  --font-display: "Archivo", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --gutter: 48px;
  --measure: 56ch;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--diff-green);
  color: var(--diff-green-ink);
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--diff-green);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  background: var(--diff-green);
  color: var(--diff-green-ink);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 16px;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

section { scroll-margin-top: 80px; }

h1, h2, h3 { color: var(--text-bright); letter-spacing: -0.015em; }

.mono, .fig, .facts, .hero-note, .receipt, .diff, .btn, .nav-links, .wordmark {
  font-family: var(--font-mono);
}

/* ---------- nav ---------- */

header { border-bottom: 1px solid var(--line); }

nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
  max-width: 1280px;
  margin: 0 auto;
}

.wordmark {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--text-bright);
  text-decoration: none;
}

.wordmark em { font-style: normal; color: var(--diff-green); }
.wordmark.small { font-size: 14px; }

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 13.5px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 120ms ease;
}

.nav-links a:hover { color: var(--text-bright); }

.nav-links a.nav-cta {
  color: var(--text-bright);
  border-bottom: 1px solid var(--diff-green);
  padding-bottom: 2px;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 64px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 88px var(--gutter) 104px;
}

h1 {
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(42px, 5.2vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 26px;
}

.lede {
  font-size: 18.5px;
  line-height: 1.65;
  max-width: var(--measure);
  margin-bottom: 36px;
}

.lede strong { color: var(--text-bright); font-weight: 600; }

.hero-ctas {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 22px;
  display: inline-block;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-primary {
  background: var(--diff-green);
  color: var(--diff-green-ink);
}

.btn-primary:hover { background: #6cc392; }

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover { border-color: var(--text-dim); color: var(--text-bright); }

.hero-note {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------- receipt ---------- */

.receipt-wrap { display: flex; justify-content: center; }

/* thermal printer the hero receipt feeds out of */
.printer {
  position: relative;
  overflow: hidden;
  padding: 16px 40px 70px;
}

.printer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 12px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  z-index: 2;
}

@keyframes print-feed {
  0%   { transform: translateY(-104%) rotate(0deg); }
  10%  { transform: translateY(-82%) rotate(0deg); }
  17%  { transform: translateY(-82%) rotate(0deg); }
  29%  { transform: translateY(-58%) rotate(0.2deg); }
  36%  { transform: translateY(-58%) rotate(0.2deg); }
  50%  { transform: translateY(-34%) rotate(0.4deg); }
  57%  { transform: translateY(-34%) rotate(0.4deg); }
  72%  { transform: translateY(-12%) rotate(0.7deg); }
  79%  { transform: translateY(-12%) rotate(0.7deg); }
  100% { transform: translateY(0) rotate(1.2deg); }
}

@keyframes stamp-in {
  0%   { opacity: 0; transform: rotate(-9deg) scale(1.5); }
  60%  { opacity: 0.95; transform: rotate(-9deg) scale(0.96); }
  100% { opacity: 0.85; transform: rotate(-9deg) scale(1); }
}

.receipt {
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 12.5px;
  line-height: 1.7;
  width: 330px;
  padding: 26px 24px 78px;
  transform: rotate(1.2deg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: transform 200ms ease;
  /* keyframes end on the static transform, so no fill mode is needed and
     the hover transition still wins afterwards */
  animation: print-feed 2.4s ease-in-out;
}

.receipt:hover { transform: rotate(0deg); }

/* perforated bottom edge */
.receipt::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 10px;
  background:
    linear-gradient(-45deg, transparent 7px, var(--paper) 0) 0 0 / 14px 100% repeat-x,
    linear-gradient(45deg, transparent 7px, var(--paper) 0) 7px 0 / 14px 100% repeat-x;
}

.receipt-brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  margin-bottom: 2px;
}

.receipt-sub {
  text-align: center;
  color: var(--paper-dim);
  margin-bottom: 14px;
}

.receipt hr {
  border: 0;
  border-top: 1px dashed var(--paper-rule);
  margin: 10px 0;
}

.receipt .row,
.facts .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.receipt .row span:last-child { text-align: right; white-space: nowrap; }
.receipt .dim { color: var(--paper-dim); }
.receipt .total { font-weight: 600; font-size: 13.5px; }

.stamp {
  position: absolute;
  right: 22px;
  bottom: 22px;
  transform: rotate(-9deg);
  border: 2.5px solid var(--stamp);
  color: var(--stamp);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  padding: 5px 10px;
  opacity: 0.85;
  /* worn-rubber-stamp texture */
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='40'><filter id='n'><feTurbulence baseFrequency='.6'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 .4'/></filter><rect width='120' height='40' filter='url(%23n)'/></svg>");
  mask-size: cover;
  animation: stamp-in 350ms ease-out 2.55s backwards;
}

/* ---------- shared section chrome ---------- */

.case, .how, .waste, .faq {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter) 110px;
}

.case-head, .section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 34px;
}

.fig {
  font-size: 12.5px;
  color: var(--diff-green);
  white-space: nowrap;
}

.case-head h2, .section-head h2 {
  font-weight: 700;
  font-size: 21px;
}

.section-lede {
  max-width: var(--measure);
  margin: -14px 0 34px;
  color: var(--text-dim);
}

/* ---------- case study ---------- */

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

.case-copy p {
  margin-bottom: 18px;
  max-width: var(--measure);
  font-size: 16px;
}

.case-copy .k { color: var(--text-bright); font-weight: 600; }

.facts {
  font-size: 13px;
  border: 1px solid var(--line);
  margin-top: 8px;
}

.facts .row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.facts .row:last-child { border-bottom: 0; }
.facts .row span:first-child { color: var(--text-dim); }

.facts a {
  color: var(--diff-green);
  text-decoration: none;
}

.facts a:hover { text-decoration: underline; }

.status-open { color: var(--amber); }

.diff {
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  overflow: hidden;
}

.diff-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
}

.diff pre { padding: 16px 0; overflow-x: auto; }

.diff .l { display: block; padding: 0 16px; white-space: pre; }
.diff .add { background: var(--diff-green-bg); color: var(--diff-green-text); }
.diff .del { background: var(--diff-red-bg); color: var(--diff-red-text); }
.diff .ctx { color: var(--text-dim); }

.diff-note {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.diff-note b { color: var(--text); font-weight: 500; }

/* ---------- cache meter ---------- */

.meter {
  margin-top: 48px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
}

.dots-wrap { height: 250px; }

.dots-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--diff-green);
  display: block;
  margin-bottom: 12px;
}

.steps h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.steps p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
}

/* ---------- what we find ---------- */

.waste-list {
  border: 1px solid var(--line);
  border-bottom: 0;
}

.waste-item {
  display: grid;
  grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.waste-item dt {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 15.5px;
}

.waste-item dd {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  max-width: var(--measure);
}

/* ---------- faq ---------- */

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

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

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-bright);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

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

.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 400;
}

.faq details[open] summary::after { content: "−"; }

.faq details p {
  padding: 0 0 20px;
  max-width: var(--measure);
  font-size: 15.5px;
  line-height: 1.65;
}

/* ---------- closing ---------- */

.closing {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter) 110px;
  text-align: center;
}

.closing h2 {
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.closing p {
  max-width: 52ch;
  margin: 0 auto 32px;
  color: var(--text);
}

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

footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px var(--gutter) 40px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  :root { --gutter: 20px; }

  nav { padding: 18px var(--gutter); }

  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding: 56px var(--gutter) 72px;
  }

  .case-grid { grid-template-columns: 1fr; }

  .dots-wrap { height: 200px; }

  .steps { grid-template-columns: 1fr; gap: 28px; }

  .waste-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .case, .how, .waste, .faq, .closing { padding-bottom: 72px; }
}

@media (max-width: 560px) {
  /* keep the nav one line tall: the section links repeat in the page itself */
  .nav-links a:not(.nav-cta) { display: none; }
  .receipt { width: min(330px, 100%); }
  .hero-ctas .btn { width: 100%; text-align: center; }
}
