/* Kedai Kopi Aman — style-05 "Invoice"
   Dense, commercial, price-forward. Roast date and price render like
   line items on a document: bordered, tabular, right-aligned figures. */

:root {
  /* palette — direct token map, no additions */
  --bg: #F4F5F7;
  --fg: #111418;
  --accent: #1F4FD8;
  --muted: #5F6672;
  --surface: #FFFFFF;

  /* type — base_px 15, ratio 1.2 */
  --font-heading: 'Inter Tight', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --text-xs: 0.78125rem;   /* 12.5px  base / ratio */
  --text-sm: 0.9375rem;    /* 15px    base */
  --text-base: 0.9375rem;  /* 15px    base */
  --text-md: 1.125rem;     /* 18px    base * r */
  --text-lg: 1.35rem;      /* 21.6px  base * r^2 */
  --text-xl: 1.62rem;      /* 25.92px base * r^3 */
  --text-2xl: 1.94rem;     /* 31.1px  base * r^4 */
  --text-3xl: 2.33rem;     /* 37.3px  base * r^5 */

  /* spacing — multiples of 4px */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  --radius: 4px;
  --rule: 1px solid var(--fg);

  /* every colour below is the five palette tokens above, alpha-blended —
     no new hex is introduced anywhere in this file */
  --line: color-mix(in srgb, var(--fg) 15%, transparent);       /* hairline on light surfaces */
  --rule-muted: 1px solid var(--line);
  --on-dark-muted: color-mix(in srgb, var(--bg) 65%, transparent);  /* secondary text on dark fg */
  --on-dark-faint: color-mix(in srgb, var(--bg) 40%, transparent);  /* tertiary text on dark fg */
  --on-dark-line: color-mix(in srgb, var(--bg) 12%, transparent);   /* hairline on dark fg */
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p { margin: 0 0 var(--sp-4); }

.mono, .figure, .price, .date-stamp {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ---------- document header / nav ---------- */

.site-head {
  background: var(--surface);
  border-bottom: var(--rule);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-4);
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand:hover { text-decoration: none; }

nav.primary ul {
  list-style: none;
  display: flex;
  gap: var(--sp-6);
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav.primary a {
  color: var(--fg);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  padding-bottom: var(--sp-1);
}

nav.primary a:hover,
nav.primary a[aria-current="page"] {
  text-decoration: none;
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* ---------- document meta strip (invoice feel) ---------- */

.doc-meta {
  background: var(--fg);
  color: var(--bg);
}

.doc-meta .wrap {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-2);
  padding-bottom: var(--sp-2);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}

.doc-meta span { color: var(--on-dark-muted); }
.doc-meta strong { color: var(--bg); }

/* ---------- hero ---------- */

.hero {
  border-bottom: var(--rule);
  background: var(--surface);
}

.hero .wrap {
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-16);
  max-width: 760px;
}

.hero h1 { margin-bottom: var(--sp-4); }

.hero .lede {
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 56ch;
}

.cta-row {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius);
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.btn:hover { text-decoration: none; background: var(--accent); border-color: var(--accent); }

.btn.secondary {
  background: transparent;
  color: var(--fg);
}

.btn.secondary:hover { background: var(--fg); color: var(--bg); }

/* ---------- generic section ---------- */

section {
  padding-top: var(--sp-12);
  padding-bottom: var(--sp-12);
  border-bottom: var(--rule-muted);
}

section:last-of-type { border-bottom: none; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.section-head p { margin: 0; color: var(--muted); font-size: var(--text-sm); max-width: 52ch; }

/* ---------- ledger table (roast dates + prices) ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: var(--rule);
}

.ledger caption {
  text-align: left;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: var(--sp-2) var(--sp-4);
  border-bottom: var(--rule);
}

.ledger th, .ledger td {
  border-bottom: var(--rule-muted);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--text-sm);
  vertical-align: middle;
}

.ledger thead th {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: var(--rule);
}

.ledger tbody tr:last-child td { border-bottom: none; }

.ledger td.num, .ledger th.num { text-align: right; }

.ledger .item-name { font-weight: 600; }
.ledger .slug { color: var(--muted); font-style: italic; }

/* ---------- bean grid (listing) ---------- */

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

.bean-card {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.bean-card .bean-name {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
}

.bean-line {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  border-top: var(--rule-muted);
  padding-top: var(--sp-2);
}

.bean-line dt {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.bean-line dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.bean-card .price-tag {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  margin-top: var(--sp-2);
}

.bean-card .view-link {
  margin-top: var(--sp-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ---------- filter bar ---------- */

.filter-bar {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-3);
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  margin-bottom: var(--sp-8);
}

.filter-bar .filter-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: var(--sp-2) var(--sp-1);
}

.filter-bar button {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}

.filter-bar button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ---------- key/value stat block ---------- */

.kv-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: var(--rule);
  border-left: var(--rule);
}

.kv-block > div {
  background: var(--surface);
  padding: var(--sp-4);
  border-right: var(--rule);
  border-bottom: var(--rule);
}

.kv-block dt {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}

.kv-block dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
}

/* ---------- two-column route split (for-home / for-wholesale) ---------- */

.route-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.route-card {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-6);
}

.route-card h3 { margin-bottom: var(--sp-2); }
.route-card p { color: var(--muted); }

/* ---------- bean detail page ---------- */

.bean-header {
  background: var(--surface);
  border-bottom: var(--rule);
}

.bean-header .wrap {
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-10);
}

.bean-header .eyebrow { margin-bottom: var(--sp-2); }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-8);
}

.slug-note {
  color: var(--muted);
  font-style: italic;
  font-size: var(--text-xs);
}

.buy-box {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-5);
  align-self: start;
  position: sticky;
  top: var(--sp-4);
}

.buy-box .price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: var(--sp-1);
}

.buy-box .btn { width: 100%; text-align: center; margin-top: var(--sp-4); }

.size-select {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.size-select button {
  flex: 1;
  padding: var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
}

.size-select button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- forms (enquiry / contact) ---------- */

form.doc-form {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-6);
  display: grid;
  gap: var(--sp-4);
  max-width: 560px;
}

form.doc-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

form.doc-form label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

form.doc-form input,
form.doc-form textarea {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}

form.doc-form textarea { min-height: 120px; resize: vertical; }

form.doc-form .btn { justify-self: start; border: none; cursor: pointer; }

/* ---------- process steps (roastery) ---------- */

.process-steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.process-steps li {
  list-style: none;
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-4);
  counter-increment: step;
}

.process-steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.team-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.team-card {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.team-card .role {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- standard / story list ---------- */

.standard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: var(--rule);
  background: var(--surface);
}

.standard-list li {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--rule-muted);
  font-size: var(--text-sm);
}

.standard-list li:last-child { border-bottom: none; }

.standard-list li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-heading);
}

/* ---------- location / hours ---------- */

.info-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
}

.info-columns h3 { margin-bottom: var(--sp-3); }

.hours-table {
  width: 100%;
  border-collapse: collapse;
}

.hours-table td {
  padding: var(--sp-2) 0;
  border-bottom: var(--rule-muted);
  font-size: var(--text-sm);
}

.hours-table td:last-child { text-align: right; font-weight: 600; }

/* ---------- footer ---------- */

footer.site-foot {
  background: var(--fg);
  color: var(--bg);
}

footer.site-foot .wrap {
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-10);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-6);
}

footer.site-foot h4 {
  color: var(--bg);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
}

footer.site-foot p, footer.site-foot li { color: var(--on-dark-muted); font-size: var(--text-xs); }

footer.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }

footer.site-foot a { color: var(--on-dark-muted); }
footer.site-foot a:hover { color: var(--bg); }

.foot-bottom {
  border-top: 1px solid var(--on-dark-line);
}

.foot-bottom .wrap {
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--on-dark-faint);
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .wrap { padding: 0 var(--sp-4); }

  nav.primary ul { gap: var(--sp-3); }

  .bean-grid { grid-template-columns: 1fr; }
  .route-split { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr 1fr; }
  .team-list { grid-template-columns: 1fr; }
  .info-columns { grid-template-columns: 1fr; }

  footer.site-foot .wrap { grid-template-columns: 1fr 1fr; }

  .hero .wrap { padding-top: var(--sp-10); padding-bottom: var(--sp-10); }

  .buy-box { position: static; }

  .ledger { display: block; overflow-x: auto; }
}
