/*
Theme Name: Low Latency Coffee
Theme URI: https://lowlatencycoffee.com/
Author: Low Latency Coffee
Description: The lowlatencycoffee.com landing page as a WordPress block theme: roast-curve hero, email signup (Formspree), social links, light and dark themes, and the /b/<batch> lookup on the 404 page.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: All rights reserved
Text Domain: low-latency-coffee
*/

:root {
  --bean: #E3E4D3;      /* green-coffee pale, page background */
  --ink: #2A1D17;       /* dark roast, text */
  --muted: #625D4C;     /* olive grey, secondary text */
  --grid: #C9CBB5;      /* faint graph lines */
  --cherry: #8E1F2B;    /* coffee-cherry red, the roast curve */
  --field: #F2F2E8;     /* input background */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bean: #1F1814; --ink: #E6E4D4; --muted: #A9A491;
    --grid: #3A302A; --cherry: #E0606B; --field: #2A211C;
  }
}
:root[data-theme="dark"] {
  --bean: #1F1814; --ink: #E6E4D4; --muted: #A9A491;
  --grid: #3A302A; --cherry: #E0606B; --field: #2A211C;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bean);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--cherry); }
:focus-visible { outline: 2px solid var(--cherry); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 640px; }

header.top {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 18px; gap: 16px; flex-wrap: wrap;
}
.wordmark {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em;
  text-decoration: none;
}
nav.social { display: flex; gap: 4px; margin-right: -11px; }
nav.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 8px; color: var(--ink);
}
nav.social a:hover { color: var(--cherry); }
nav.social svg { fill: currentColor; display: block; }

.hero { padding-top: clamp(56px, 11vw, 120px); }
h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-variation-settings: "wdth" 78;
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 7.25rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 14ch;
  text-wrap: balance;
}
.lead {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.3;
  color: var(--muted);
  margin: 20px 0 0;
}

/* The roast curve: the page's one bold element */
.curve { margin: clamp(32px, 6vw, 56px) 0 0; }
.curve svg { display: block; width: 100%; height: auto; overflow: visible; }
.curve .gridline { stroke: var(--grid); stroke-width: 1; }
.curve .line {
  fill: none; stroke: var(--cherry); stroke-width: 4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: draw 2.6s cubic-bezier(.45,.05,.25,1) .2s forwards;
}
.curve .mark { fill: var(--bean); stroke: var(--cherry); stroke-width: 3; r: 7px; }
.curve .label { fill: var(--muted); font-family: "IBM Plex Sans", sans-serif; font-size: 15px; }
.curve .axis { fill: var(--muted); font-family: "IBM Plex Sans", sans-serif; font-size: 13px; }
.curve .marks { opacity: 0; animation: appear .5s ease 2.5s forwards; }
.curve figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 10px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .curve .line { animation: none; stroke-dashoffset: 0; }
  .curve .marks { animation: none; opacity: 1; }
}

.body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  padding: clamp(48px, 8vw, 88px) 0 clamp(56px, 8vw, 96px);
}
.body p { margin: 0 0 1em; max-width: 34em; }
h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700; font-size: 1.5rem; line-height: 1.2;
  letter-spacing: -0.01em; margin: 0 0 12px;
}

form.signup { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
form.signup label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
form.signup input[type="email"] {
  flex: 1 1 220px; min-width: 0;
  font: inherit; color: var(--ink); background: var(--field);
  border: 1.5px solid var(--ink); border-radius: 6px;
  padding: 12px 14px;
}
form.signup input::placeholder { color: var(--muted); }
form.signup button {
  font: inherit; font-weight: 600; cursor: pointer;
  color: var(--bean); background: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 6px;
  padding: 12px 18px;
}
form.signup button:hover { background: var(--cherry); border-color: var(--cherry); }
form.signup button:disabled { opacity: .6; cursor: default; }
.hint { color: var(--muted); font-size: 0.875rem; margin-top: 10px; }
.status { font-weight: 500; margin-top: 10px; min-height: 1.6em; }
.status.error { color: var(--cherry); }

footer.site-footer {
  border-top: 1px solid var(--grid);
  padding: 24px 0 40px; color: var(--muted); font-size: 0.875rem;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* Inner pages, posts, and batch pages (/b/<batch>) */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875rem; color: var(--muted); }
.page-main { padding: clamp(40px, 9vw, 72px) 0 56px; }
.page-main h1, .notfound h1 { font-size: clamp(2.5rem, 11vw, 4.25rem); line-height: .95; max-width: none; margin: 0 0 12px; }
.page-main .entry { max-width: 40em; }
.page-main .entry > * { margin-top: 0; margin-bottom: 1em; }
.page-main .entry h2 { margin-top: 32px; }
.page-main .entry img { max-width: 100%; height: auto; border-radius: 8px; }
.post-list { list-style: none; margin: 24px 0 0; padding: 0; }
.post-list li { border-top: 1px solid var(--grid); padding: 20px 0; }
.post-list h2 { margin: 0 0 4px; }
.post-list h2 a { text-decoration: none; }
.post-list .wp-block-post-date { color: var(--muted); font-size: .875rem; }
.sub { font-family: "Bricolage Grotesque", sans-serif; font-weight: 500; font-size: 1.25rem; color: var(--muted); margin: 0 0 8px; }
.notes { color: var(--cherry); font-weight: 600; font-size: 1.125rem; margin: 0 0 28px; }
.card { background: var(--field); border: 1px solid var(--grid); border-radius: 14px; padding: 18px 18px 4px; margin: 0 0 8px; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid var(--grid); }
.row:last-child { border-bottom: 0; }
.k { color: var(--muted); font-size: .9375rem; }
.v { text-align: right; font-weight: 600; }
.fresh { margin: 0 0 14px; }
.fresh b { color: var(--cherry); }
.notfound { padding: clamp(40px, 9vw, 72px) 0 56px; }

@media (max-width: 720px) {
  header.top { flex-wrap: nowrap; gap: 8px; }
  nav.social { gap: 0; margin-right: -10px; }
  nav.social a { width: 40px; height: 44px; }
  .body { grid-template-columns: 1fr; gap: 32px; }
  .curve .label { font-size: 38px; }
  .curve .line { stroke-width: 9; }
  .curve .mark { stroke-width: 5; r: 12px; }
  .curve .axis { display: none; }
  .wrap { padding: 0 16px; }
}

/* Keep WordPress's block spacing out of the way of the hand-tuned layout */
.wp-site-blocks > * { margin-block-start: 0; }
.wp-site-blocks .wrap > * { margin-block-start: 0; }

/* Batch pages (/b/<Batch ID>), matching make_batch_pages.py */
.batch-main { padding-bottom: 16px; }
.batch-main h1 { font-size: clamp(2.5rem, 11vw, 4.25rem); line-height: .95; max-width: none; margin: clamp(40px, 9vw, 72px) 0 12px; }
.batch-main h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.batch-main ul { margin: 0; padding-left: 20px; }
.batch-main li { margin: 0 0 6px; }
.batch-main p { margin: 0 0 1em; }
.batch-main .batch-ask { margin-top: 28px; }
