/* BaristaTools site styles. Dark palette is the default, light under prefers-color-scheme. */
:root {
  --ground: #15171A;
  --band: #1B1E21;
  --surface: #1F2226;
  --chip: rgba(240, 122, 58, 0.14);
  --line: #33373C;
  --text: #ECEAE6;
  --text2: #C9C6C1;
  --accent: #F07A3A;
  --on-accent: #1F0A00;
  --accent-text: #F2884E;
  --accent-hover: #FFA574;
  --method: #7FD6F2;
  --grinder: #BFE664;
  --ingredient: #D7B4F5;
  --icon-bg: rgba(255, 255, 255, 0.06);
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-strong: rgba(0, 0, 0, 0.45);
  --frame: #2B2F35;
  --frame-bg: #232529;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #EFF1F3;
    --band: #FFFFFF;
    --surface: #FFFFFF;
    --chip: #F5E6DD;
    --line: #DCE1E6;
    --text: #1A1D21;
    --text2: #444A52;
    --accent-text: #9A4012;
    --accent-hover: #6F2D0A;
    --method: #0E7490;
    --grinder: #48740E;
    --ingredient: #7E3FB8;
    --icon-bg: #F1F3F5;
    --shadow: rgba(26, 29, 33, 0.12);
    --shadow-strong: rgba(26, 29, 33, 0.22);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
svg { flex: none; }
.num { font-variant-numeric: lining-nums tabular-nums; }

.wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Header */
.site-header { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 40px; display: block; }
.brand-name { font-size: 20px; font-weight: 800; }
.brand-name span { font-weight: 500; }
.nav { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: center; font-size: 15px; font-weight: 600; }
.nav a { color: var(--text2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
.nav a:hover { color: var(--text); }
.nav a.btn-download { margin-left: 8px; height: 44px; padding: 0 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.nav a.btn-download:hover { color: var(--on-accent); filter: brightness(1.08); }

/* Buttons */
.btn { min-height: 56px; padding: 0 26px; border-radius: 16px; display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn-ghost { padding: 0 22px; border: 1px solid var(--line); color: var(--text); font-size: 16px; font-weight: 600; }
.btn-ghost:hover { color: var(--text); border-color: var(--text2); }

/* Hero */
.hero { padding-top: 40px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.chip { align-self: flex-start; min-height: 30px; padding: 0 12px; border-radius: 15px; background: var(--chip); color: var(--accent-text); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.hero h1 { font-size: clamp(36px, 8vw, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: break-word; }
.hero-lead { font-size: 19px; line-height: 1.55; color: var(--text2); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero illustration: desktop composition (600 x 680 canvas) */
.hb { margin: 0; flex: 0 0 600px; height: 680px; position: relative; }
.hb-blob { position: absolute; left: 70px; top: 60px; width: 460px; height: 560px; border-radius: 230px; background: var(--band); }
.hb-phone { position: absolute; left: 160px; top: 40px; width: 280px; border-radius: 44px; border: 9px solid var(--frame); background: var(--frame-bg); box-shadow: 0 30px 60px var(--shadow-strong); overflow: hidden; padding-top: 14px; }
.hb-phone img { display: block; width: 100%; height: 560px; object-fit: cover; }
.hb-card { position: absolute; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 32px var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.hb-card-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.hb-card-big { font-size: 30px; font-weight: 800; line-height: 1; }
.hb-card-big small { font-size: 16px; font-weight: 600; color: var(--text2); }
.hb-card-sub { font-size: 12px; color: var(--text2); }
.hb-scale { left: 0; top: 110px; width: 190px; }
.hb-ratio { left: 430px; top: 70px; width: 170px; gap: 4px; }
.hb-grind { left: 20px; top: 430px; width: 200px; gap: 8px; }
.hb-app { left: 400px; top: 400px; width: 180px; gap: 10px; }
.hb-grind-rows { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.hb-grind-rows b { font-weight: 700; }
.hb-grind-rows .alt { color: var(--text2); }
.hb-grind-rows .alt b { color: var(--text); }
/* The QR fills the card width. The background matches the light fill of
   qr-play.svg, so the quiet zone is one even colour. */
.hb-qr { display: block; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 1; padding: 6px; border-radius: 12px; background: #ECEAE6; }
.c-method { color: var(--method); }
.c-accent { color: var(--accent-text); }
.c-grinder { color: var(--grinder); }
.c-ingredient { color: var(--ingredient); }

/* Hero stacked below 1040 px: phone, then the cards in a simple row */
@media (max-width: 1119px) {
  .hero { gap: 40px; }
  /* Stacked hero: the phone on its own row, the cards in a row under it
     at their natural height. */
  .hb { flex: 1 1 100%; height: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 210px)); justify-content: center; align-items: start; gap: 12px; }
  .hb-blob { display: none; }
  .hb-phone { position: relative; left: auto; top: auto; grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 260px; margin: 0 0 12px; }
  .hb-phone img { height: auto; aspect-ratio: 262 / 560; }
  .hb-card { position: static; width: auto; min-width: 0; }
  .hb-app { display: none; }
}
@media (max-width: 480px) {
  .hb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb-grind { grid-column: 1 / -1; }
  .hb-card { padding: 12px; }
  .hb-card-big { font-size: 26px; }
}

/* Features */
.features { background: var(--band); padding: 72px 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; max-width: 40rem; margin-bottom: 32px; }
.section-head h2, .share-text h2 { font-size: clamp(28px, 6vw, 36px); font-weight: 800; line-height: 1.15; }
.section-head p, .share-text p { font-size: 17px; line-height: 1.55; color: var(--text2); }
.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card { flex: 1 1 300px; min-width: 0; background: var(--surface); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.features .card { background: var(--ground); }
.card-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--icon-bg); }
.card h3 { font-size: 19px; font-weight: 700; }
.card p { font-size: 15px; line-height: 1.55; color: var(--text2); }

/* Share */
.share { padding-top: 72px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.share-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.recipe-card { flex: 1 1 380px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.recipe-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.recipe-title { font-size: 18px; font-weight: 700; }
.recipe-method { font-size: 13px; font-weight: 700; color: var(--method); }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 14px; color: var(--text2); }
.recipe-meta .ratio { color: var(--accent-text); font-weight: 700; }
.recipe-link { font-size: 15px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }

/* Languages and footer */
.langs { border-top: 1px solid var(--line); padding: 36px 0; }
.langs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 15px; color: var(--text2); }
.langs strong { font-weight: 700; color: var(--text); }
.site-footer { background: var(--band); padding: 28px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; align-items: center; font-size: 14px; color: var(--text2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 12px; }
.footer-links a { color: var(--text2); min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; }
.footer-links a:hover { color: var(--text); }

/* Content pages */
.prose { max-width: 44rem; margin: 0 auto; padding: 24px 24px 72px; font-size: 17px; line-height: 1.7; color: var(--text2); overflow-wrap: break-word; }
.prose h1 { font-size: clamp(30px, 7vw, 40px); font-weight: 800; line-height: 1.15; color: var(--text); margin-bottom: 20px; }
.prose h2 { font-size: 24px; font-weight: 800; line-height: 1.25; color: var(--text); margin: 40px 0 12px; }
.prose h3 { font-size: 19px; font-weight: 700; color: var(--text); margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.4em; }
.prose li { margin-bottom: 6px; }
.prose a { text-underline-offset: 3px; }
.prose code { font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

@media (max-width: 480px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 16px; padding-bottom: 48px; }
  .features { padding: 48px 0; }
  .share { padding-top: 48px; padding-bottom: 48px; }
  .hero-lead { font-size: 17px; }
  .btn { width: 100%; justify-content: center; }
  .prose { padding-left: 16px; padding-right: 16px; }
}

/* Phone width: keep the logo and the Download button on one row.
   The page sections stay one scroll away and the footer keeps the
   privacy link. */
@media (max-width: 639px) {
  .nav a:not(.btn-download) { display: none; }
  .site-header { flex-wrap: nowrap; gap: 8px; }
  .brand { gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .brand-name { font-size: 18px; }
  .nav a.btn-download { margin-left: 0; padding: 0 14px; }
}
