/* ==========================================================================
   Kettle & Kiln Roasters
   Principles taken from the reference sites (not their look):
   - Few colours: paper, ink and one muted tone. The photos supply the colour.
     Ember appears in only two places: the roast stamp and the ampersand.
   - Two typefaces with distinct jobs: a display serif for statements,
     a quiet grotesk for everything you read or click.
   - Big jumps in size, few steps: huge headings, small body, nothing in between.
   - Headings get room: the space around a heading is at least its own height.
   - One strong left edge: every section hangs off the same grid column.
   - Restrained UI: one filled button style, everything else is a text link.
   ========================================================================== */
:root {
  /* Colour: three working colours + one accent used twice */
  --paper:  #F4EFE7;
  --ink:    #1E1712;
  --muted:  #6B5D52;                  /* 5.5:1 on paper */
  --rule:   rgba(30, 23, 18, 0.16);           /* decorative dividers only */
  --field-border: #857669;                    /* 3.8:1 on paper: form controls */
  --ember:  #B5461E;                  /* stamp + ampersand only */
  --ember-on-dark: #E08A5F;
  --muted-on-dark: #A89A8D;           /* 6.5:1 on ink */
  --rule-on-dark:  rgba(244, 239, 231, 0.16);

  /* Type: two families, five sizes */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans:  "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --t-small:   0.8125rem;                                   /* labels, meta   */
  --t-body:    1.0625rem;                                   /* reading text   */
  --t-h3:      1.625rem;                                    /* item headings  */
  --t-h2:      clamp(2.4rem, 1.5rem + 3.6vw, 4.5rem);       /* section heads  */
  --t-display: clamp(3.4rem, 1.4rem + 8.4vw, 9rem);         /* the one h1     */

  /* Space: one scale, each step ~1.6x the last */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2.5rem;
  --s5: 4rem;
  --s6: 6.5rem;
  --s7: clamp(6.5rem, 4rem + 7vw, 10.5rem);   /* between sections */

  --gutter: clamp(1rem, 4vw, 3rem);
  --maxw: 1240px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }   /* .field's display:grid must not un-hide fields */
img, picture { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 em, h2 em { font-style: italic; }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .5rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- The grid: one shared left edge ---------- */
.section { padding-block: var(--s7); }
.section-rule { border-top: 1px solid var(--rule); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--s3); }
@media (min-width: 60em) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s3); row-gap: 0; }
  .grid > .label   { grid-column: 1 / span 3; padding-top: .9rem; }
  .grid > .content,
  .grid > .week,
  .grid > .light-roast { grid-column: 4 / -1; }
  .grid > .process-wide { grid-column: 1 / -1; }
}

/* Margin notes: each section's left column carries a fact, not a repeat of its heading */
.label {
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

h2 { font-size: var(--t-h2); margin-bottom: var(--s3); max-width: 15ch; }
.intro { color: var(--muted); max-width: 38ch; margin-bottom: var(--s5); }

/* ---------- Buttons & links: one filled style, the rest are links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .75rem 1.5rem;
  font: 500 var(--t-body)/1.2 var(--sans);
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 0; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: #3A2E26; }
.btn-invert:hover { background: #FFFFFF; }
.btn-small { min-height: 2.4rem; padding: .45rem 1.1rem; font-size: var(--t-small); }
.btn-invert { background: var(--paper); color: var(--ink); }

.link-arrow, .order-link {
  font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em;
}
.link-arrow:hover, .order-link:hover { text-decoration-thickness: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); min-height: 4rem; padding-block: .5rem; }

.wordmark {
  font-family: var(--serif); font-size: 1.4rem; line-height: 1;
  text-decoration: none; white-space: nowrap; letter-spacing: -0.01em;
}
.wordmark em { color: var(--ember); }
.wordmark span {
  font-family: var(--sans); font-size: .66rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  margin-left: .35rem; vertical-align: .22em;
}

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s4); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); list-style: none; margin: 0; padding: 0; }
.site-nav ul a { text-decoration: none; font-size: var(--t-small); font-weight: 500; color: var(--muted); }
.site-nav ul a:hover { color: var(--ink); }
.nav-toggle { display: none; }

@media (max-width: 56.25em) {
  .js .nav-toggle {
    display: inline-block; font: 500 var(--t-small) var(--sans);
    background: none; border: 1px solid var(--ink); border-radius: 0;
    padding: .45rem 1rem; color: var(--ink); cursor: pointer;
  }
  .site-nav { flex-direction: column; align-items: stretch; gap: var(--s2); }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: .85rem 0; font-size: var(--t-body); color: var(--ink); border-bottom: 1px solid var(--rule); }
  .js .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: var(--s1) var(--gutter) var(--s3);
  }
  .js .site-nav.is-open { display: flex; }
  .no-js .header-inner { flex-wrap: wrap; padding-block: .75rem; }
  .no-js .site-nav { width: 100%; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(4rem, 2rem + 8vw, 9rem); }
.hero-label { margin-bottom: var(--s4); }
.hero h1 { font-size: var(--t-display); line-height: .92; letter-spacing: -0.035em; font-weight: 300; margin-bottom: var(--s5); }

.hero-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--s3) var(--s5); margin-bottom: var(--s5);
}
.lede { font-size: 1.1875rem; line-height: 1.5; color: var(--muted); max-width: 36ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }

.hero-photo { position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
@media (max-width: 43.75em) { .hero-photo img { aspect-ratio: 4 / 3; } }

/* The signature detail: a rubber-stamp roast date */
.stamp {
  position: absolute; right: clamp(1rem, 4vw, 3rem); bottom: clamp(-2rem, -3vw, -1.25rem);
  display: grid; justify-items: center; gap: .15rem;
  padding: .75rem 1.15rem .65rem;
  background: var(--paper); color: var(--ember);
  border: 2px solid currentColor; outline: 1px solid currentColor; outline-offset: -6px;
  transform: rotate(-6deg);
  text-transform: uppercase;
  margin: 0;
}
.stamp-small { font: 600 .64rem/1.2 var(--sans); letter-spacing: .22em; }
.stamp-big { font: 500 1.75rem/1.05 var(--serif); letter-spacing: .06em; white-space: nowrap; }

/* ---------- Coffees ---------- */
.coffees-body { display: grid; gap: var(--s5); }
@media (min-width: 60em) {
  .coffees-body { grid-template-columns: 1.55fr 1fr; gap: var(--s5); align-items: start; }
  .coffees-photo { position: sticky; top: 6rem; }
}
.coffees-photo img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
/* Below desktop the photos go full width: portrait crops would fill the whole screen */
@media (max-width: 59.9375em) {
  .coffees-photo img, .sub-photo img { aspect-ratio: 3 / 2; }
}

.menu { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.menu-item { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.menu-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.menu-head h3 { font-size: var(--t-h3); line-height: 1.15; }
.price { font: 400 var(--t-h3)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.menu-foot { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-top: .45rem; }
.menu-meta { margin: 0; font-size: var(--t-small); color: var(--muted); }
.notes { font-family: var(--serif); font-style: italic; font-size: 1.0625rem; color: var(--ink); }
.order-link { font-size: var(--t-small); flex: none; }

/* ---------- Subscription: the one inverted band ---------- */
.subscription { background: var(--ink); color: var(--paper); }
.subscription .label { color: var(--muted-on-dark); }
.subscription :focus-visible { outline-color: var(--paper); }

.sub-body { display: grid; gap: var(--s5); margin-top: var(--s4); }
@media (min-width: 60em) { .sub-body { grid-template-columns: 1.1fr .9fr; align-items: end; } }

.sub-price { display: flex; align-items: baseline; gap: var(--s2); margin: 0; }
.sub-price .amount { font: 300 clamp(5rem, 3rem + 7vw, 9rem)/.85 var(--serif); letter-spacing: -0.04em; }
.sub-price .per { font: italic 400 var(--t-h3) var(--serif); color: var(--muted-on-dark); }
.sub-terms { margin: var(--s3) 0 var(--s5); font-size: var(--t-small); color: var(--muted-on-dark); }

.steps { list-style: none; counter-reset: step; margin: 0 0 var(--s5); padding: 0; border-top: 1px solid var(--rule-on-dark); }
.steps li {
  counter-increment: step; position: relative;
  padding: var(--s2) 0 var(--s2) 2.75rem; border-bottom: 1px solid var(--rule-on-dark); color: var(--muted-on-dark);
}
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: var(--s2);
  font: 400 var(--t-small)/1.9 var(--sans); color: var(--muted-on-dark);
}
.steps strong { color: var(--paper); font-weight: 500; }

.sub-photo img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; filter: sepia(.35) contrast(1.05) brightness(.92); }
@media (max-width: 59.9375em) { .sub-photo img { aspect-ratio: 3 / 2; } }  /* must come after the rule above */

/* ---------- Process ---------- */
.process-wide { margin: var(--s5) 0; }
.process-wide img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
@media (max-width: 43.75em) { .process-wide img { aspect-ratio: 4 / 3; } }

/* A list of rows, like a timetable, not a row of cards */
.week { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.week li { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); display: grid; gap: var(--s1) var(--s3); }
@media (min-width: 43.75em) {
  .week li { grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1.3fr); align-items: baseline; }
}
.day { font-size: var(--t-small); font-weight: 500; color: var(--muted); margin: 0; }
.week h3 { font-size: var(--t-h3); }
.week li > p:last-child { color: var(--muted); margin: 0; max-width: 40ch; }

.light-roast { display: grid; gap: var(--s4); align-items: center; margin-top: var(--s6); }
@media (min-width: 47.5em) { .light-roast { grid-template-columns: 1fr 1fr; } }
.light-roast img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.light-roast h3 { font-size: var(--t-h3); margin-bottom: var(--s2); }
.light-roast p { color: var(--muted); max-width: 36ch; margin: 0; }

/* ---------- Wholesale ---------- */
.wholesale-body { display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 47.5em) { .wholesale-body { grid-template-columns: 1fr 1fr; } }
.wholesale-body .intro { margin-bottom: var(--s4); }
.wholesale-body img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Contact ---------- */
.contact-form { display: grid; gap: var(--s3); max-width: 44rem; }
.field-row { display: grid; gap: var(--s3); }
@media (min-width: 38.75em) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--s1); margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: var(--t-small); font-weight: 500; padding: 0; }
.optional { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: transparent; border: 1px solid var(--field-border); border-radius: 0;
  padding: .75rem .9rem; min-height: 3rem;
}
textarea { resize: vertical; min-height: 8rem; }
select {
  appearance: none; padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231E1712' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
[aria-invalid="true"] { border-color: #A3261B; }
.field-error { font-size: var(--t-small); color: #A3261B; margin: 0; }

.choice { display: flex; flex-wrap: wrap; gap: var(--s1); }
.choice label {
  display: inline-flex; align-items: center; gap: .55rem; cursor: pointer;
  border: 1px solid var(--field-border); padding: .65rem 1.1rem;
  font-size: var(--t-body); font-weight: 400;
}
.choice label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { accent-color: var(--ink); margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s1); }
.form-status { margin: 0; font-weight: 500; }
.form-status.is-ok { color: #2F5E2A; }
.form-status.is-warn { color: var(--ink); }
.form-status.is-error { color: #A3261B; }
.contact-form button[disabled] { opacity: .55; cursor: progress; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: var(--s5); font-size: var(--t-small); color: var(--muted); }
.wordmark-footer { color: var(--ink); margin: 0; white-space: normal; }
@media (min-width: 60em) { .site-footer .grid > .wordmark-footer { grid-column: 1 / span 3; } }
.footer-inner p { margin: 0 0 .25rem; }
.disclaimer { margin-top: var(--s2) !important; }
