:root {
  --paper: #f6f1e7;
  --paper-deep: #ece4d2;
  --ink: #1c1a16;
  --ink-soft: #5d574b;
  --green: #176442;
  --green-deep: #0f4d31;
  --red: #b3402e;
  --rule: #d8cfbc;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(28, 26, 22, 0.045) 31px,
      rgba(28, 26, 22, 0.045) 32px
    );
  color: var(--ink);
  font-family: "Public Sans", "Segoe UI", sans-serif;
  line-height: 1.65;
}

/* the red ledger margin rule */
.margin-rule {
  position: fixed;
  inset: 0 auto 0 clamp(1.25rem, 4vw, 4.5rem);
  width: 1px;
  background: rgba(179, 64, 46, 0.35);
  pointer-events: none;
  z-index: 0;
}

header.top,
main,
footer {
  position: relative;
  z-index: 1;
}

h1,
h2,
.wordmark,
.line-item strong,
.how-ref,
.entry-no {
  font-family: "Fraunces", Georgia, serif;
}

/* ---------- header ---------- */

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.2rem clamp(1.25rem, 5vw, 2rem) 1rem;
  border-bottom: 3px double var(--ink);
}

.wordmark {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
}

.wordmark-reg {
  font-size: 0.7rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--green);
}

/* ---------- buttons: print blocks ---------- */

.button {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  font-family: "Public Sans", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.button.small {
  padding: 0.45rem 0.95rem;
  font-size: 0.8rem;
}

.button.primary,
.button.small {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--green);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--rule);
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--green);
}

.button.secondary:hover {
  box-shadow: 6px 6px 0 var(--rule);
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--green);
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- layout ---------- */

main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem) 4rem;
}

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

.hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 7rem) 0 3rem;
}

.eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.eyebrow::before {
  content: "— ";
}

h1 {
  font-size: clamp(3rem, 9.5vw, 6rem);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

.full-stop {
  color: var(--green);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* the rubber stamp */
.stamp {
  position: absolute;
  top: clamp(3rem, 9vw, 6rem);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.7rem 1.1rem;
  border: 3px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  transform: rotate(7deg);
  opacity: 0.85;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='2'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23r)' opacity='0.92'/%3E%3C/svg%3E");
  mask-size: 80px 80px;
  animation: stamp-in 480ms cubic-bezier(0.2, 1.4, 0.4, 1) 700ms both;
}

.stamp em {
  font-style: italic;
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: none;
}

@keyframes stamp-in {
  from {
    transform: rotate(7deg) scale(1.7);
    opacity: 0;
  }
  to {
    transform: rotate(7deg) scale(1);
    opacity: 0.85;
  }
}

/* ---------- what we build ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin: 3.5rem 0;
  padding-top: 2.25rem;
  border-top: 1px solid var(--ink);
}

.grid article {
  position: relative;
}

.entry-no {
  display: block;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.grid h2 {
  font-size: 1.45rem;
  font-weight: 650;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ---------- how it works: invoice ---------- */

.how {
  border: 2px solid var(--ink);
  background: rgba(255, 252, 244, 0.6);
  box-shadow: 8px 8px 0 var(--paper-deep);
  padding: 0;
  margin: 3.5rem 0;
}

.how-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.6rem;
  border-bottom: 2px solid var(--ink);
}

.how-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.how-ref {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.how ol {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.6rem 1.4rem;
}

.how li {
  padding: 1.1rem 0;
}

.how li + li {
  border-top: 1px dashed var(--rule);
}

.line-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.line-item strong {
  font-size: 1.25rem;
  font-weight: 650;
}

.leader {
  flex: 1;
  border-bottom: 2px dotted var(--ink-soft);
  opacity: 0.55;
  transform: translateY(-0.3em);
}

.line-value {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  color: var(--green);
  font-size: 1.1rem;
}

.how li p {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  max-width: 38rem;
  font-size: 0.98rem;
}

/* ---------- founder ---------- */

.founder {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin: 3.5rem 0;
  padding-top: 2.25rem;
  border-top: 1px solid var(--ink);
}

.founder-photo {
  margin: 0;
}

.founder-photo img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--green);
  filter: saturate(0.9) contrast(1.02);
}

.founder-photo figcaption {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}

.founder-copy h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 650;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.founder-copy p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 36rem;
}

/* ---------- contact ---------- */

.contact {
  text-align: center;
  margin: 4rem 0 1rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--ink);
}

.contact h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 650;
  line-height: 1.1;
  margin: 0 auto 1rem;
  max-width: 28ch;
}

.contact p {
  color: var(--ink-soft);
  max-width: 40rem;
  margin: 0 auto;
}

.actions-center {
  justify-content: center;
}

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

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.4rem clamp(1.25rem, 5vw, 2rem) 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-top: 3px double var(--ink);
}

footer div {
  display: flex;
  gap: 1.5rem;
}

/* ---------- motion & a11y ---------- */

.reveal {
  animation: rise 640ms ease both;
}

.reveal:nth-of-type(2) {
  animation-delay: 90ms;
}

.hero .lede.reveal {
  animation-delay: 180ms;
}

.hero .actions.reveal {
  animation-delay: 280ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@media (max-width: 40rem) {
  .stamp {
    position: static;
    margin: 1.25rem 0 0;
    align-self: flex-start;
    display: inline-flex;
  }
  .hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .founder {
    grid-template-columns: 1fr;
  }
  .founder-photo {
    max-width: 14rem;
  }
}
