@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Kalam";
  src: url("/fonts/kalam-300-latin.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Kalam";
  src: url("/fonts/kalam-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ground: #e9e9e8;
  --paper: #f7f7f5;
  --ink: #121212;
  --ink-soft: #3b3b3b;
  --rule: #2a2a2a;
  --rule-faint: #b9b9b7;
  --carbon: #bdbdbb;
  --carbon-deep: #a9a9a7;
  --pen: #1f2c63;
  --number: #d22a1e;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hand: "Kalam", "Bradley Hand", cursive;
  color-scheme: light;
}

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

html { background: var(--ground); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }
a:focus-visible {
  outline: 3px solid var(--pen);
  outline-offset: 4px;
}

.page {
  flex: 1;
  width: min(100%, 1600px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
  align-items: center;
  column-gap: clamp(24px, 4vw, 72px);
  padding: clamp(40px, 7vh, 96px) clamp(24px, 3.8vw, 64px) clamp(32px, 5vh, 64px);
}

/* The pitch */

.pitch { align-self: start; padding-top: clamp(0px, 3.5vh, 40px); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
}
.brand-mark { width: clamp(72px, 7.2vw, 110px); height: auto; }
.brand-word {
  font-size: clamp(32px, 3.4vw, 52px);
  font-weight: 700;
  font-stretch: 92%;
  line-height: 0.93;
  letter-spacing: -0.035em;
}

.headline {
  margin: clamp(48px, 9.5vh, 100px) 0 0;
  font-size: clamp(54px, 6.5vw, 102px);
  font-weight: 870;
  font-stretch: 72%;
  line-height: 0.94;
  letter-spacing: -0.035em;
  word-spacing: 0.05em;
  text-wrap: balance;
}

.subhead {
  margin: clamp(24px, 3.8vh, 40px) 0 0;
  max-width: 16em;
  font-size: clamp(20px, 2.35vw, 36px);
  font-weight: 420;
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.actions {
  margin-top: clamp(32px, 5.5vh, 60px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}

.start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(60px, 7.4vh, 76px);
  padding: 0 clamp(36px, 3.9vw, 60px);
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(22px, 1.95vw, 30px);
  font-weight: 640;
  font-stretch: 94%;
  letter-spacing: -0.015em;
  text-decoration: none;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.start:hover { background: #2b2b2b; }
.start:active { transform: translateY(1px); }

.signin {
  font-size: clamp(18px, 1.45vw, 22px);
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.signin:hover { color: var(--ink); }

/* The order pad */

.pad {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 600px);
  margin-bottom: 6%;
}

.carbon {
  position: absolute;
  inset: 0;
  border-radius: 2px;
}

.carbon {
  background: var(--carbon);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.carbon-back {
  transform: translate(13%, 7.5%) rotate(-1.2deg);
  background: var(--carbon-deep);
}
.carbon-front {
  transform: translate(9%, 4.5%) rotate(-1.6deg);
}
.carbon-no {
  position: absolute;
  top: 7%;
  right: 4%;
  font-size: clamp(12px, 1.1vw, 17px);
  font-stretch: 80%;
  color: #6c6c6a;
}
.carbon-total {
  position: absolute;
  right: 4%;
  bottom: 1.4%;
  display: flex;
  gap: 1.2em;
  align-items: baseline;
  font-size: clamp(11px, 0.95vw, 14px);
  font-stretch: 80%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5e5e5c;
}
.carbon-total .hand {
  font-family: var(--hand);
  font-size: 1.35em;
  letter-spacing: 0;
  text-transform: none;
  color: #4d4f5c;
}

.sheet {
  position: relative;
  border-radius: 2px;
  transform: rotate(-2.6deg);
  transform-origin: 50% 50%;
  background: var(--paper);
  padding: 5.6% 5.8% 6%;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.06),
    0 14px 34px rgba(0, 0, 0, 0.14);
  font-size: clamp(11px, 1.05vw, 16px);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 3.5%;
  border-bottom: 1.5px solid var(--rule);
}
.sheet-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-size: 1.9em;
  font-weight: 700;
  font-stretch: 92%;
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.sheet-brand img { width: 1.85em; height: auto; }
.sheet-no {
  font-size: 2.05em;
  font-weight: 560;
  font-stretch: 78%;
  color: var(--number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.sheet-no small {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin-right: 0.3em;
}

.sheet-title {
  margin: 4% 0 0;
  font-size: 2em;
  font-weight: 640;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sheet-fields { margin: 2.5% 0 0; }
.sheet-fields div {
  display: grid;
  grid-template-columns: 6.6em 1fr;
  align-items: end;
  min-height: 2.45em;
}
.sheet-fields dt {
  font-size: 0.86em;
  font-weight: 640;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding-bottom: 0.35em;
}
.sheet-fields dd {
  margin: 0;
  border-bottom: 1px solid var(--rule-faint);
  padding: 0 0 0.05em 0.3em;
}

.hand {
  font-family: var(--hand);
  font-weight: 300;
  color: var(--pen);
  font-size: 1.62em;
  line-height: 1.15;
}

.lines {
  margin-top: 5%;
  width: 100%;
  flex: 1;
  border-collapse: collapse;
  border: 1.5px solid var(--rule);
  table-layout: fixed;
}
.lines th, .lines td {
  border-right: 1.5px solid var(--rule);
  border-bottom: 1px solid var(--rule-faint);
  padding: 0.35em 0.6em;
  vertical-align: middle;
}
.lines th:last-child, .lines td:last-child { border-right: 0; }
.lines thead th {
  font-size: 0.86em;
  font-weight: 640;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--rule);
  height: 2.6em;
}
.lines col, .lines th:nth-child(1), .lines td:nth-child(1) { width: 13%; text-align: center; }
.lines th:nth-child(3), .lines td:nth-child(3) { width: 19%; text-align: center; }
.lines td.hand { font-size: 1.5em; text-align: left; }
.lines td.hand:first-child { text-align: center; }
.lines tbody tr { height: 2.9em; }
.lines td.dash::after {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.5px;
  background: var(--pen);
  vertical-align: middle;
  transform: rotate(-4deg);
}
.lines tfoot td {
  border-top: 1.5px solid var(--rule);
  border-bottom: 0;
  height: 3.8em;
  padding: 0 1.2em 0 0.6em;
}
.lines tfoot .total-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2.2em;
}
.total-label {
  font-size: 0.95em;
  font-weight: 640;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.total-mark {
  position: relative;
  display: inline-block;
  padding: 0.45em 0.9em;
  transform: rotate(-3deg);
}
.total-mark .hand { font-size: 1.55em; white-space: nowrap; }
.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ring path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 520;
  stroke-dashoffset: 0;
}

/* The pen writes the order once, on arrival. */
.writes .sheet .hand {
  clip-path: inset(-20% 100% -20% 0);
  animation: write 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.writes .sheet-fields div:nth-child(1) .hand { animation-delay: 200ms; }
.writes .sheet-fields div:nth-child(2) .hand { animation-delay: 420ms; }
.writes .sheet-fields div:nth-child(3) .hand { animation-delay: 600ms; }
.writes .lines tbody tr:nth-child(1) .hand { animation-delay: 820ms; }
.writes .lines tbody tr:nth-child(2) .hand { animation-delay: 1120ms; }
.writes .lines tbody tr:nth-child(3) .hand { animation-delay: 1360ms; }
.writes .lines tfoot .hand { animation-delay: 1640ms; }
.writes .ring path {
  stroke-dashoffset: 520;
  animation: ring 700ms cubic-bezier(0.33, 1, 0.68, 1) 2050ms forwards;
}
@keyframes write { to { clip-path: inset(-20% -2% -20% 0); } }
@keyframes ring { to { stroke-dashoffset: 0; } }

.foot {
  padding: 22px clamp(24px, 3.8vw, 64px) 28px;
  font-size: 15px;
  color: #5d5d5b;
}
.foot a { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.foot a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
    row-gap: 56px;
    padding-top: 32px;
  }
  .headline { margin-top: 48px; }
  .pad { width: min(86%, 520px); margin-bottom: 48px; }
  .sheet { font-size: clamp(9px, 2.3vw, 14px); }
  .carbon-no, .carbon-total { font-size: clamp(9px, 2vw, 13px); }
}

@media (prefers-reduced-motion: reduce) {
  .writes .sheet .hand, .writes .ring path { animation: none; clip-path: none; stroke-dashoffset: 0; }
}
