/* Bloom — First Crack Coffee Roasters. Shared design tokens and components. */

/* ---------- Fonts (self-hosted, no CDN) ---------- */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("./assets/fonts/cormorant-garamond-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --roast: #181715;
  --roast-elevated: #252320;
  --roast-soft: #1f1e1b;
  --ember: #cc785c;
  --ember-active: #a9583e;
  --ink: #141413;
  --body-strong: #252523;
  --body: #3d3d3a;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --teal: #5db8a6;
  --amber: #e8a55a;

  --font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

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

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  --content-max: 1200px;
}

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

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

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

body {
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--ink);
}
.display-l {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--ink);
}
.display-m {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.display-s {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--body-strong);
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

/* Numbers in running text use mono per the design language. */
.num {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

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

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

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

.band-soft {
  background: var(--surface-soft);
}
.band-strong {
  background: var(--surface-cream-strong);
}
.band-dark {
  background: var(--roast);
  color: var(--on-dark);
}
.band-dark h1,
.band-dark h2,
.band-dark h3,
.band-dark .display-xl,
.band-dark .display-l,
.band-dark .display-m,
.band-dark .display-s {
  color: var(--on-dark);
}
.band-dark .eyebrow {
  color: var(--on-dark-soft);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
.split--hero {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
}
.split--stretch {
  align-items: stretch;
}
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: stretch;
}
@media (max-width: 768px) {
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}

.stack {
  display: grid;
  gap: var(--space-6);
}
.stack-4 {
  display: grid;
  gap: var(--space-4);
}

.divider {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--body);
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color 100ms ease-out, border-color 100ms ease-out;
}
.nav__link:hover {
  color: var(--ink);
}
.nav__link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ember);
}
.nav__cta {
  margin-left: var(--space-2);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 100ms ease-out, border-color 100ms ease-out,
    color 100ms ease-out;
}
.btn-primary {
  background: var(--ember);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:active {
  background: var(--ember-active);
}
.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-secondary:hover {
  border-color: var(--muted-soft);
}
.btn-on-dark {
  background: var(--roast-elevated);
  color: var(--on-dark);
}
.btn-on-dark:hover {
  background: #302d29;
}
.btn-cream {
  background: var(--canvas);
  color: var(--ink);
}
.btn-cream:hover {
  background: var(--surface-card);
}

.text-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  color: var(--ember);
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  transition: border-color 100ms ease-out;
}
.text-link:hover {
  border-bottom-color: var(--ember);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ---------- Bloom mark ---------- */

.bloom-mark {
  display: inline-block;
  color: var(--ink);
  flex: none;
}
.band-dark .bloom-mark,
.footer .bloom-mark {
  color: var(--on-dark);
}
.bloom-mark svg {
  display: block;
}
.bloom-ornament {
  color: var(--ember);
  margin-bottom: var(--space-6);
}

/* Load animation: rings settle in once. */
.bloom-mark--hero .ring {
  transform-origin: center;
  animation: bloom-in 1.2s ease-out both;
}
.bloom-mark--hero .ring-2 {
  animation-delay: 0.12s;
}
.bloom-mark--hero .ring-3 {
  animation-delay: 0.24s;
}
@keyframes bloom-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface-card);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}
.band-dark .badge,
.origin-card--featured .badge {
  background: var(--roast-elevated);
  color: var(--on-dark);
}

/* ---------- Origin comparison cards ---------- */

.origin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.origin-card {
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.origin-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-card);
}
.origin-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.origin-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-8);
}
.origin-card__region {
  font-size: 14px;
  color: var(--muted);
}
.origin-card__notes {
  font-size: 16px;
  color: var(--body);
}
.origin-card--featured {
  background: var(--roast);
  border-color: var(--roast);
  color: var(--on-dark);
}
.origin-card--featured .origin-card__name {
  color: var(--on-dark);
}
.origin-card--featured .origin-card__region {
  color: var(--on-dark-soft);
}
.origin-card--featured .origin-card__notes {
  color: var(--on-dark);
}
.origin-card--featured .text-link {
  color: var(--ember);
}

/* Mono spec rows (origin detail, inline specs) */
.spec {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--body);
}
.spec li {
  display: flex;
  gap: var(--space-4);
}
.spec .spec__k {
  color: var(--muted);
  min-width: 96px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  padding-top: 2px;
}
.origin-card--featured .spec {
  color: var(--on-dark);
}
.origin-card--featured .spec .spec__k {
  color: var(--on-dark-soft);
}

/* ---------- Feature / info cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.info-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.info-card__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
}
.info-card__body {
  font-size: 16px;
  color: var(--body);
}

/* ---------- Recipe window (the signature) ---------- */

.recipe {
  background: var(--roast);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--roast-elevated);
}
.recipe__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--roast-elevated);
}
.recipe__name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--on-dark-soft);
  letter-spacing: 0.02em;
}
.recipe__dots {
  display: inline-flex;
  gap: 6px;
}
.recipe__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #46433d;
}
.recipe__dots i:first-child {
  background: var(--ember);
}
.recipe__body {
  background: var(--roast-soft);
  padding: var(--space-6) var(--space-6) var(--space-6) 0;
}
.recipe__code {
  list-style: none;
  counter-reset: line;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  color: var(--on-dark);
}
.recipe__code li {
  counter-increment: line;
  display: block;
  white-space: pre;
  padding-left: 56px;
  position: relative;
}
.recipe__code li::before {
  content: counter(line, decimal-leading-zero);
  position: absolute;
  left: 0;
  width: 40px;
  text-align: right;
  color: var(--muted-soft);
  opacity: 0.7;
}
.recipe__code .k {
  display: inline-block;
  color: var(--on-dark);
}
.recipe__code .v {
  color: var(--ember);
}
.recipe__code .u {
  color: var(--teal);
}
.recipe__code .c {
  color: var(--teal);
  opacity: 0.85;
}
.recipe__code .t {
  color: var(--on-dark);
}
/* width helpers for aligning the "=" in monospace */
.recipe__code .w6 {
  width: 6ch;
}
.recipe__code .w12 {
  width: 12ch;
}
.recipe__code .w13 {
  width: 13ch;
}
.recipe__code .w11 {
  width: 11ch;
}

.recipe__caption {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- Ember callout band ---------- */

.callout {
  background: var(--ember);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-16) var(--space-12);
  text-align: center;
  display: grid;
  gap: var(--space-6);
  justify-items: center;
}
.callout h2 {
  color: #fff;
  max-width: 18ch;
}
.callout p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 46ch;
}

/* ---------- Pull statement ---------- */

.statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.18;
  letter-spacing: -0.5px;
  color: var(--ink);
}

/* ---------- Media frames ---------- */

.frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card);
}
.frame--xl {
  border-radius: var(--radius-xl);
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame--square {
  aspect-ratio: 1 / 1;
}
.frame--wide {
  aspect-ratio: 16 / 9;
}
.frame--photo {
  aspect-ratio: 4 / 3;
}

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

.page-head {
  padding: var(--space-16) 0 var(--space-12);
}
.page-head .stack {
  max-width: 62ch;
}

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

.footer {
  background: var(--roast);
  color: var(--on-dark-soft);
  padding: var(--space-16) 0 var(--space-12);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(250, 249, 245, 0.12);
}
.footer .wordmark {
  color: var(--on-dark);
}
.footer__tag {
  margin-top: var(--space-4);
  max-width: 34ch;
  color: var(--on-dark-soft);
  font-size: 15px;
}
.footer__col h4 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-dark);
  margin-bottom: var(--space-4);
}
.footer__col ul {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}
.footer__col a,
.footer__col li {
  font-size: 15px;
  color: var(--on-dark-soft);
}
.footer__col a:hover {
  color: var(--on-dark);
}
.footer__base {
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--on-dark-soft);
}

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

@media (max-width: 900px) {
  .origin-grid,
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  .display-xl {
    font-size: 40px;
    letter-spacing: -1px;
    line-height: 1.08;
  }
  .display-l {
    font-size: 34px;
    letter-spacing: -0.6px;
    line-height: 1.12;
  }
  .display-m {
    font-size: 27px;
    letter-spacing: -0.3px;
  }
  .display-s {
    font-size: 24px;
  }
  .statement {
    font-size: 29px;
  }
  .section {
    padding: var(--space-12) 0;
  }
  .page-head {
    padding: var(--space-12) 0 var(--space-8);
  }
  .split,
  .split--hero {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .origin-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }
  .nav__inner {
    gap: var(--space-3);
  }
  .wordmark {
    font-size: 18px;
  }
  .nav__links {
    gap: var(--space-3);
  }
  .nav__link {
    font-size: 13px;
  }
  /* Logo already links home; drop the redundant text link on narrow screens. */
  .nav__links > .nav__link:first-child {
    display: none;
  }
  .nav__cta {
    padding: 0 14px;
    font-size: 13px;
  }
  .callout {
    padding: var(--space-12) var(--space-6);
  }
  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .recipe__code li {
    padding-left: 44px;
  }
  .recipe__code li::before {
    width: 30px;
  }
  .recipe__body {
    font-size: 13px;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bloom-mark--hero .ring {
    animation: none;
  }
  * {
    scroll-behavior: auto;
  }
}
