/* Roast Log — shared design tokens and components */

/* ---------- Fonts (self-hosted) ---------- */

@font-face {
  font-family: "Archivo";
  src: url("./assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo Black";
  src: url("./assets/fonts/archivo-black-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./assets/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --paper: #ecefe3;
  --paper-deep: #dfe3ce;
  --ink: #211a13;
  --green-bean: #737e4b;
  --drum: #2b2e21;
  --crack: #b14e12;

  --ink-15: rgba(33, 26, 19, 0.15);
  --ink-20: rgba(33, 26, 19, 0.2);
  --ink-40: rgba(33, 26, 19, 0.4);
  --paper-20: rgba(236, 239, 227, 0.2);

  --font-display: "Archivo Black", "Archivo", sans-serif;
  --font-body: "Archivo", -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;

  --radius: 2px;
  --content-max: 1140px;
}

/* ---------- Reset ---------- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

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

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

.display {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(20px, 2vw, 22px);
  line-height: 1.3;
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-bean);
}

.data {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

.lede {
  max-width: 560px;
}

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

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  padding: var(--space-12) 0;
}

.section-head {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.divider {
  position: relative;
  border-top: 1px solid var(--ink-15);
  height: 0;
}

.divider-note {
  position: absolute;
  top: -8px;
  left: 0;
  padding-right: var(--space-1);
  background: var(--paper);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-bean);
}

/* ---------- Nav ---------- */

.nav {
  border-bottom: 1px solid var(--ink-20);
  background: var(--paper);
}

.nav-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  max-width: var(--content-max);
  margin: 0 auto;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: var(--space-3);
}

.nav-links a {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--crack);
  transition: color 100ms ease-out;
}

.nav-links a[aria-current="page"] {
  border-bottom-color: var(--crack);
}

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

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  transition: background-color 100ms ease-out, color 100ms ease-out,
    border-color 100ms ease-out;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn-primary:hover {
  background: var(--crack);
  border-color: var(--crack);
}

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

.btn-secondary:hover {
  color: var(--crack);
  border-color: var(--crack);
}

.band-dark .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.band-dark .btn-primary:hover {
  background: var(--crack);
  color: var(--paper);
  border-color: var(--crack);
}

/* ---------- Batch tag ---------- */

.batch-tag {
  position: relative;
  background: var(--paper-deep);
  border: 1px solid var(--ink-20);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.batch-tag::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.batch-tag img {
  border: 1px solid var(--ink-20);
}

.spec-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.spec-k {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-bean);
  flex-shrink: 0;
}

.spec-dots {
  flex: 1;
  border-bottom: 1px dotted var(--ink-40);
  transform: translateY(-4px);
  min-width: 16px;
}

.spec-v {
  text-align: right;
}

/* ---------- Roast curve (signature) ---------- */

/* padding-top only — a `padding` shorthand would wipe out .container's
   horizontal gutter on the same element. */
.curve-band {
  padding-top: var(--space-4);
}

.curve {
  width: 100%;
  height: auto;
  display: block;
}

/* No vector-effect here: non-scaling-stroke makes stroke-dasharray screen-space,
   which breaks the pathLength-normalized draw animation. */
.curve-path {
  fill: none;
  stroke: var(--crack);
  stroke-width: 2.5;
}

.curve-tick {
  fill: var(--crack);
}

/* SVG text scales with the viewBox, so sizes are in SVG user units. */
.curve-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.08em;
  fill: var(--ink);
}

.hero-curve .curve-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: curve-draw 1.2s ease-out forwards;
}

.hero-curve .curve-tick,
.hero-curve .curve-label {
  opacity: 0;
  animation: curve-fade 0.6s ease-out forwards;
  animation-delay: 1.2s;
}

@keyframes curve-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes curve-fade {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-curve .curve-path {
    animation: none;
    stroke-dashoffset: 0;
  }

  .hero-curve .curve-tick,
  .hero-curve .curve-label {
    animation: none;
    opacity: 1;
  }
}

/* ---------- Dark bands ---------- */

.band-dark {
  background: var(--drum);
  color: var(--paper);
}

.band-dark .eyebrow {
  color: var(--paper);
  opacity: 0.7;
}

.band-dark a {
  color: var(--paper);
}

.cta-band {
  padding: var(--space-12) 0;
  text-align: center;
}

.cta-band .cta-inner {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
}

/* ---------- Footer ---------- */

.footer {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--paper-20);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

.footer .wordmark {
  color: var(--paper);
}

.footer-col {
  display: grid;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.footer-col a {
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--crack);
  transition: color 100ms ease-out;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .section {
    padding: 56px 0;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .data {
    font-size: 13px;
  }

  .curve-label {
    font-size: 26px;
  }

  .curve-tick {
    r: 9px;
  }
}
