/* The Coffee Shop Ledger — printed paper, black ink, lots of space. */

/* ---------- Fonts (self-hosted variable woff2, latin subset) ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-v20.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/lora-latin-v37.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lora-italic-latin-v37.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  --paper: #FAF9F6;
  --paper-2: #F3F1EA;
  --paper-3: #EDEAE2;
  --ink: #161616;
  --ink-2: #3A3A36;
  --muted: #5E5D58;
  --rule: #D9D6CF;
  --on-ink: #FAF9F6;
  --on-ink-2: #E3E1DA;
  --on-ink-muted: #B4B2A9;
  --accent: #161616;
  --accent-hover: #000;

  --serif: "Lora", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;

  --max: 1120px;
  --gutter: 24px;
  --radius: 2px;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--muted);
}

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

.band-ink :focus-visible {
  outline-color: var(--on-ink);
}

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

/* ---------- Layout ---------- */

/* Max widths are content widths; the gutters sit outside them. */
.wrap {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.wrap-narrow {
  max-width: calc(760px + 2 * var(--gutter));
}

.wrap-buy {
  max-width: calc(880px + 2 * var(--gutter));
}

.split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* Grids collapse to one column on phones without overflowing. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--col), 100%), 1fr));
}

.band-paper {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.band-ink {
  background: var(--ink);
  color: var(--on-ink);
}

.rule-top {
  border-top: 1px solid var(--rule);
}

/* ---------- Type ---------- */

.kicker {
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.band-ink .kicker {
  color: var(--on-ink-muted);
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.15;
}

h3 {
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
}

.lead {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 540px;
}

.prose {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
}

.prose + .prose {
  margin-top: 16px;
}

.band-ink .prose {
  color: var(--on-ink-2);
}

.meta {
  font-size: 14px;
  color: var(--muted);
}

.caption {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-2);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 15px 26px;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 14px 24px;
}

.btn-secondary:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.btn-sm {
  padding: 11px 18px;
  font-size: 14px;
}

.btn-lg {
  padding: 16px 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-ink);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
  color: var(--on-ink);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

/* 44px touch target without making the header taller. */
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -7px 0;
  font-family: var(--serif);
  font-size: 19px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}

.nav-links a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 96px;
  padding-bottom: 104px;
  gap: 64px;
}

.hero-text {
  flex: 1 1 480px;
  min-width: 0;
}

.hero .kicker {
  margin-bottom: 20px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero .lead {
  margin-bottom: 36px;
}

.hero .meta {
  margin-top: 24px;
}

.hero-cover {
  flex: 0 1 340px;
  min-width: 260px;
  display: flex;
  justify-content: center;
}

/* Flat book mockup: a front sheet over an offset back sheet. */
.cover {
  position: relative;
  width: min(300px, calc(100% - 14px));
  aspect-ratio: 2 / 3;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--ink);
  background: var(--paper-3);
}

.cover-front {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.cover-kicker {
  margin-bottom: 10px;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover-title {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
}

.cover-front svg {
  width: 100%;
  margin-top: 48px;
}

.cover-tagline {
  margin-top: auto;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------- How the book teaches ---------- */

.teach {
  padding-top: 88px;
  padding-bottom: 88px;
  gap: 56px;
}

.teach-text {
  flex: 1 1 360px;
  min-width: 0;
}

.teach h2 {
  margin-bottom: 20px;
}

.teach-figure {
  flex: 1 1 480px;
  min-width: 0;
}

.teach-figure svg {
  width: 100%;
}

.teach-figure .caption {
  margin-top: 8px;
}

/* ---------- Why it's different ---------- */

.why {
  padding-top: 104px;
  padding-bottom: 32px;
}

.section-title {
  margin-bottom: 48px;
  max-width: 760px;
}

.features {
  --col: 260px;
  gap: 40px;
}

.feature {
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}

.feature h3 {
  margin-bottom: 8px;
}

.feature p {
  color: var(--ink-2);
}

/* ---------- What's inside ---------- */

.inside {
  padding-top: 88px;
  padding-bottom: 104px;
}

.chapters {
  --col: 300px;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.chapter {
  padding: 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.chapter-num {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.chapter h3 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
}

.chapter p {
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- Sample ---------- */

.sample {
  padding-top: 104px;
  padding-bottom: 104px;
  gap: 64px;
}

.sample-text {
  flex: 1 1 380px;
  min-width: 0;
}

.sample h2 {
  margin-bottom: 24px;
}

.sample-figure {
  flex: 1 1 440px;
  min-width: 0;
  padding: 32px 28px 24px;
  background: var(--paper);
}

.sample-figure svg {
  width: 100%;
}

.sample-figure .caption {
  margin-top: 12px;
  font-size: 15px;
}

/* ---------- The whole shop ---------- */

.shop {
  padding-top: 104px;
  padding-bottom: 104px;
}

.stats {
  --col: 180px;
  gap: 32px;
}

.stat {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

.stat-value {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1.1;
}

.stat-label {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Written for ---------- */

.audience {
  padding-top: 96px;
  padding-bottom: 96px;
}

.audience h2 {
  margin-bottom: 40px;
}

.audiences {
  --col: 240px;
  gap: 40px;
}

.audiences h3 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.audiences p {
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- Buy ---------- */

.buy {
  padding-top: 104px;
  padding-bottom: 104px;
  gap: 56px;
}

.buy-cover {
  flex: 0 1 220px;
  min-width: 200px;
  display: flex;
  justify-content: center;
}

.cover-small {
  width: 200px;
  height: 300px;
  display: flex;
  flex-direction: column;
  padding: 26px 22px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.cover-small .cover-title {
  font-size: 20px;
}

.cover-small svg {
  width: 100%;
  margin-top: 36px;
}

.buy-text {
  flex: 1 1 360px;
  min-width: 0;
}

.buy h2 {
  margin-bottom: 8px;
}

.price {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.6;
}

.price-note {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--muted);
}

.included {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 15px;
}

.included li {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.included li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 1px;
  background: var(--ink);
  transform: translateY(-4px);
}

.small-print {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- FAQ ---------- */

.faq {
  padding-top: 104px;
  padding-bottom: 104px;
}

.faq h2 {
  margin-bottom: 32px;
}

.faq-list {
  border-top: 1px solid var(--ink);
}

.faq-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.faq-item h3 {
  margin-bottom: 6px;
}

.faq-item p {
  color: var(--ink-2);
}

/* ---------- Footer and signup ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-top: 64px;
  padding-bottom: 48px;
}

.signup {
  flex: 1 1 360px;
  min-width: 0;
}

.signup-title {
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.6;
}

.signup-desc {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--ink-2);
}

.signup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.signup-form label {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.signup-form input,
.signup-form button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 16px;
  line-height: normal;
  color: var(--ink);
}

.signup-form input {
  padding: 12px 14px;
  background: var(--paper);
}

.signup-form button {
  padding: 12px 22px;
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.signup-form button:hover {
  background: var(--paper-2);
}

.signup-status {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-2);
}

.signup-status:empty {
  display: none;
}

.copyright {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Thank-you and 404 pages ---------- */

.page {
  padding-top: 96px;
  padding-bottom: 104px;
}

.page h1 {
  margin-bottom: 24px;
}

.page .lead {
  max-width: none;
  margin-bottom: 16px;
}

.page .note {
  font-size: 15px;
  color: var(--muted);
}

.page-block {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}

.page-block h2 {
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.page-block p {
  color: var(--ink-2);
}

.page .actions {
  margin-top: 40px;
}

/* ---------- Phones ---------- */

@media (max-width: 640px) {
  .hero,
  .teach,
  .inside,
  .sample,
  .shop,
  .audience,
  .buy,
  .faq,
  .page {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .why {
    padding-top: 64px;
    padding-bottom: 16px;
  }

  .inside {
    padding-top: 48px;
  }

  .section-title {
    margin-bottom: 36px;
  }

  .footer {
    padding-top: 48px;
    padding-bottom: 40px;
  }
}
