/* Chimney Fire Coffee — "Origin Ledger" */
:root {
  --navy: #12202a;
  --surface: #1b2d3a;
  --ink: #e9eef0;
  --muted: #9fb0ba;
  --gold: #f2b544;
  --teal: #4f8a9e;
  --rule: rgba(159, 176, 186, 0.24);
  --rule-strong: rgba(159, 176, 186, 0.5);
  --head: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --pad: 20px;
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--gold); color: var(--navy); padding: 8px 14px; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); }
h3 { font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.15; }
p { margin: 0 0 1em; max-width: 62ch; }

/* small reference label: the "coordinate" voice of the sheet */
.ref {
  font-family: var(--head);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin: 0 0 14px;
  display: flex; gap: 10px; align-items: baseline;
}
.ref b { color: var(--gold); font-weight: 600; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; color: var(--ink); text-decoration: none; }
.brand svg { height: 30px; width: 181px; display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 20px; flex-wrap: wrap; }
.site-nav a { font-family: var(--head); font-size: 0.9375rem; text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--gold); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--head); font-weight: 600; font-size: 1rem;
  padding: 14px 22px; border-radius: 2px; text-decoration: none;
  border: 1px solid var(--gold);
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #f7c869; }
.btn-line { color: var(--ink); border-color: var(--rule-strong); }
.btn-line:hover { border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- hero ---------- */
.hero { padding: 44px 0 40px; position: relative; }
.hero-grid { display: grid; gap: 40px; }
.hero h1 {
  font-size: clamp(2.6rem, 1.2rem + 7vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.95;
  max-width: 11ch;
}
.hero .lede { font-size: 1.1875rem; color: var(--ink); margin-top: 26px; max-width: 46ch; }

.spec { border-top: 2px solid var(--gold); align-self: end; }
.spec-title { font-family: var(--head); font-size: 0.9375rem; font-weight: 600; margin: 12px 0 4px; display: flex; justify-content: space-between; gap: 12px; }
.spec-title span { color: var(--muted); font-weight: 500; }
.spec dl { margin: 0; }
.spec .row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.spec dt { font-size: 0.875rem; color: var(--muted); }
.spec dd { margin: 0; font-family: var(--head); font-weight: 500; font-size: 1.0625rem; line-height: 1.35; }

/* ---------- figure / duotone ---------- */
.fig-section { padding: 24px 0 64px; }
.plate { margin: 0; }
.plate-frame {
  position: relative;
  border: 1px solid var(--rule-strong);
  background: var(--navy);
  aspect-ratio: 966 / 854;
  overflow: hidden;
}
.plate-frame img { width: 100%; height: 100%; object-fit: cover; filter: url(#duotone); }

.pin { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.pin::before {
  content: ""; position: absolute; left: -9px; top: -9px; width: 18px; height: 18px;
  border: 2px solid var(--gold); border-radius: 50%; background: rgba(18, 32, 42, 0.55);
}
.pin .k {
  position: absolute; left: 14px; top: -12px;
  font-family: var(--head); font-weight: 700; font-size: 0.8125rem; line-height: 1;
  background: var(--gold); color: var(--navy); padding: 5px 7px;
}
.pin .t { display: none; }

.legend { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.legend li { display: grid; grid-template-columns: 2rem 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.legend .k { font-family: var(--head); font-weight: 700; color: var(--gold); }
.legend strong { font-family: var(--head); font-weight: 600; }
.legend span.d { color: var(--muted); }

.fig-grid { display: grid; gap: 28px; }
.fig-caption p { color: var(--muted); font-size: 0.9375rem; }
.fig-caption .fig-title { font-size: 1.5rem; margin-bottom: 14px; }

/* ---------- section scaffolding ---------- */
.sheet { padding: 72px 0; border-top: 1px solid var(--rule); }
.sheet-grid { display: grid; gap: 20px; }
.sheet-head p { color: var(--muted); margin-top: 18px; }

/* ---------- ledger table ---------- */
.ledger { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ledger caption { text-align: left; font-family: var(--head); font-size: 0.9375rem; font-weight: 600; padding-bottom: 12px; caption-side: top; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
.ledger thead th { font-family: var(--head); font-size: 0.8125rem; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--rule-strong); }
.ledger tbody th { font-family: var(--head); color: var(--gold); font-weight: 700; width: 3rem; }
.ledger td.o { font-family: var(--head); font-weight: 600; font-size: 1.125rem; }
.ledger .none { color: var(--muted); }
.ledger-note { font-size: 0.9375rem; color: var(--muted); margin-top: 18px; }

@media (max-width: 719px) {
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ledger, .ledger tbody, .ledger tr, .ledger th, .ledger td { display: block; width: 100%; }
  .ledger tr { border-top: 1px solid var(--rule-strong); padding: 10px 0 6px; }
  .ledger tbody th { border: 0; padding: 4px 0; width: auto; }
  .ledger td { display: grid; grid-template-columns: 7rem 1fr; gap: 10px; border: 0; padding: 4px 0; }
  .ledger td::before { content: attr(data-label); font-family: var(--body); font-weight: 400; font-size: 0.875rem; color: var(--muted); }
}

/* ---------- products ---------- */
.products { display: grid; gap: 0; border-top: 2px solid var(--gold); }
.product { padding: 28px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 14px; }
.product-icon { width: 44px; height: 44px; color: var(--gold); }
.product p { margin: 0; }
.product dl { margin: 6px 0 0; display: grid; gap: 0; }
.product .row { display: grid; grid-template-columns: 7rem 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.product dt { color: var(--muted); }
.product dd { margin: 0; }

/* ---------- standard / own words ---------- */
.words {
  margin: 0; font-family: var(--head); font-weight: 500;
  font-size: clamp(1.375rem, 1rem + 1.6vw, 2.125rem); line-height: 1.28; letter-spacing: -0.01em;
  max-width: 34ch;
}
.words p { max-width: none; }
.words footer { font-family: var(--body); font-size: 0.9375rem; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 8px; }
.principles { list-style: none; margin: 40px 0 0; padding: 0; display: grid; border-top: 1px solid var(--rule-strong); }
.principles li { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.principles h3 { font-size: 1.25rem; margin-bottom: 8px; }
.principles h3::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--gold); margin-right: 12px; vertical-align: 0.12em; }
.principles p { color: var(--muted); margin: 0; font-size: 0.9875rem; }

/* ---------- visit ---------- */
.visit { background: var(--surface); }
.address {
  font-style: normal; font-family: var(--head); font-weight: 600;
  font-size: clamp(1.75rem, 1.1rem + 3vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em;
}
.address span { display: block; }
.address .pc { color: var(--gold); }
.visit .meta { display: grid; gap: 0; margin-top: 32px; border-top: 1px solid var(--rule-strong); max-width: 40rem; }
.visit .meta .row { display: grid; grid-template-columns: 8rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.visit .meta dt { color: var(--muted); font-size: 0.9375rem; }
.visit .meta dd { margin: 0; }

/* ---------- footer ---------- */
.site-foot { padding: 40px 0 48px; border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--muted); }
.site-foot .wrap { display: grid; gap: 20px; }
.site-foot .brand svg { height: 26px; width: 157px; }
.site-foot p { margin: 0; }

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  :root { --pad: 32px; }
  .pin .k { font-size: 0.875rem; }
  .products { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .principles { grid-template-columns: repeat(3, 1fr); column-gap: 32px; }
  .principles li { border-bottom: 0; }
}

@media (min-width: 1000px) {
  :root { --pad: 48px; }
  .hero { padding: 80px 0 56px; }
  .hero::before {
    /* the sheet's column grid, drawn faintly behind the hero */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(to right, rgba(159,176,186,.07) 1px, transparent 1px);
    background-size: calc((min(100vw, var(--max)) - 2 * var(--pad)) / 12) 100%;
    background-position: calc(max(0px, (100vw - var(--max)) / 2) + var(--pad)) 0;
  }
  .hero-grid { grid-template-columns: repeat(12, 1fr); column-gap: 24px; position: relative; }
  .hero-copy { grid-column: 1 / span 8; }
  .spec { grid-column: 9 / span 4; }

  .sheet-grid, .fig-grid { grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
  .sheet-head { grid-column: 1 / span 4; }
  .sheet-body { grid-column: 5 / span 8; }
  .fig-grid .plate { grid-column: 1 / span 8; }
  .fig-grid .fig-caption { grid-column: 9 / span 4; align-self: end; }

  .pin .k { display: none; }
  .pin .t {
    display: block; position: absolute; top: -14px; left: 26px; white-space: nowrap;
    font-family: var(--head); font-size: 0.875rem; font-weight: 500; line-height: 1.2;
    background: var(--navy); color: var(--ink); padding: 6px 10px; border-left: 3px solid var(--gold);
  }
  .pin .t b { color: var(--gold); margin-right: 8px; }
  .pin::after { content: ""; position: absolute; top: -0.5px; left: 9px; width: 17px; height: 1px; background: var(--gold); }
  .pin.l .t { left: auto; right: 26px; border-left: 0; border-right: 3px solid var(--gold); }
  .pin.l::after { left: auto; right: 9px; }

  .site-foot .wrap { grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end; }
  .site-foot .f1 { grid-column: 1 / span 4; }
  .site-foot .f2 { grid-column: 5 / span 4; }
  .site-foot .f3 { grid-column: 9 / span 4; }
}

/* One orchestrated moment: the callouts land on the photo after it loads */
@media (prefers-reduced-motion: no-preference) {
  .plate .pin { animation: pin-in 0.5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(0.5s + var(--i) * 0.18s); }
  @keyframes pin-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
