/* redbeanco apex site — the workbench world.
   Extends the incumbent identity (near-black #12100f, bean red #b3352c,
   lighter red #d9695f) into a complete system. Public Sans is the
   typed-label voice; Fragment Mono is the data voice. One alarm ink:
   #d9695f, reserved for the unverified citation and small interactive red
   text; #b3352c lives at display scale and in rules. */

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 800;
  src: url('assets/fonts/publicsans-var.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Fragment Mono';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/fragmentmono-400.woff2') format('woff2');
  font-display: swap;
}

:root {
  --ground: #12100f;
  --panel: #1a1614;
  --panel-2: #242019;
  --text: #ece7e5;
  --muted: #9a938f;
  --bean: #b3352c;
  --red: #d9695f;
  --rule: rgba(236, 231, 229, 0.28);
  --rule-soft: rgba(236, 231, 229, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 3px 8px -2px rgba(0, 0, 0, 0.4);

  --sans: 'Public Sans', system-ui, sans-serif;
  --mono: 'Fragment Mono', ui-monospace, monospace;

  --step-0: 1.0625rem;
  --step-1: 1.4rem;
  --step-2: 1.85rem;
  --step-3: 2.4rem;
  --step-4: clamp(2.4rem, 4.4vw + 1rem, 3.9rem);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--panel-2) transparent; }

::selection { background: var(--bean); color: var(--text); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 72rem; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: var(--step-3); line-height: 1.15; margin: 0 0 1.1rem; }
h3 { font-size: var(--step-1); line-height: 1.25; margin: 0 0 0.45rem; }
p { margin: 0 0 1rem; }
a { color: var(--red); text-decoration: none; }
a:hover { color: #e88a81; }

section p, footer p { max-width: 66ch; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }

/* --- header: the workbench rail ------------------------------------------ */

.bench-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ground);
  border-bottom: 1px solid var(--rule-soft);
}

.bench-rail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.4rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  padding-inline-end: 1rem;
  margin-inline-end: auto;
}
.bean-mark { width: 1.4rem; height: 1.4rem; }

.tabs { display: flex; align-items: stretch; gap: 0.25rem; }
.tab {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}
.tab:hover { color: var(--text); border-bottom-color: var(--rule); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--bean); }

/* --- sections: one ground, panels raise ---------------------------------- */

.bench { padding: 4.5rem 1.5rem; }
@media (min-width: 64rem) { .bench { padding-block: 7rem; } }
.bench.quiet { padding: 3.5rem 1.5rem; }
@media (min-width: 64rem) { .bench.quiet { padding-block: 5.5rem; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

/* --- matter label: the ruling grid on artifacts --------------------------- */

.matter-label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0;
  margin: 0 0 1.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.matter-label span + span::before { content: "·"; margin: 0 0.7rem; color: var(--rule-soft); }

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-copy h1 {
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 1.3rem;
}
.hero-copy h1 .bean { color: var(--bean); }

/* full-width studio statement (home hero, no artifact) */
.studio-statement {
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 1.3rem;
  max-width: 21ch;
}
.studio-statement .bean { color: var(--bean); }

.lede { font-size: 1.18rem; line-height: 1.55; max-width: 36ch; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0 1.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 1.5rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
  color: var(--text);
  background: transparent;
  transition: background-color 150ms ease-out, border-color 150ms ease-out,
    transform 100ms ease-out;
}
.btn:hover { background: var(--panel); border-color: var(--rule); }
.btn:active { transform: translateY(1px); }

.btn-stamp {
  background: var(--bean);
  border-color: var(--bean);
  color: #ffffff;
  box-shadow: var(--shadow);
}
.btn-stamp:hover { background: #a52f27; border-color: #a52f27; color: #ffffff; }

/* --- the demo artifact (citation chip) --------------------------------------- */

.artifact {
  padding: clamp(1.1rem, 2.5vw, 1.7rem);
  position: relative;
}
.artifact .matter-label { margin-bottom: 1.1rem; }

.meter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
.meter-label { color: var(--text); font-weight: 700; }
.meter-time { color: var(--text); font-variant-numeric: tabular-nums; }

.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.9rem; }
.bars i { width: 3px; background: var(--text); border-radius: 1px; height: 30%; }
.meter.live .bars i { animation: level 1.1s ease-in-out infinite; }
.meter.live .bars i:nth-child(2) { animation-delay: 0.12s; }
.meter.live .bars i:nth-child(3) { animation-delay: 0.24s; }
.meter.live .bars i:nth-child(4) { animation-delay: 0.36s; }
.meter.live .bars i:nth-child(5) { animation-delay: 0.48s; }
.meter:not(.live) .bars i:nth-child(odd) { height: 55%; }
@keyframes level { 0%, 100% { height: 22%; } 50% { height: 92%; } }

.lines { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; counter-reset: line; }
.lines li { counter-increment: line; display: grid; grid-template-columns: 2.1rem 5.6rem 1fr; gap: 0.55rem; padding: 0.3rem 0; }
.lines li::before { content: counter(line, decimal-leading-zero); color: var(--rule-soft); font-variant-numeric: tabular-nums; }
.spk { color: var(--muted); letter-spacing: 0.03em; }

.wf-heading {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 1.2rem 0 0.7rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule-soft);
}

.bullet { margin: 0 0 0.9rem; padding-left: 1.6rem; position: relative; }
.tick { position: absolute; left: 0; top: 0.25rem; width: 1rem; height: 1rem; color: var(--text); }
.tick svg { width: 100%; height: 100%; display: block; }
.tick-warn { color: var(--red); }

.cite {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.55rem 0.3rem;
  border-block: 3px double var(--text);
  background: rgba(236, 231, 229, 0.05);
}
.cite-t { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cite-q { font-family: var(--mono); font-size: 0.78rem; color: var(--text); }

.cite-miss {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 0.6rem 0.28rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 3px;
  transform: rotate(-1deg);
  background: rgba(217, 105, 95, 0.08);
}

.cite.pre-stamp { opacity: 0; transform: scale(1.35) rotate(-7deg); }
.cite.pre-stamp.stamp {
  opacity: 1;
  transform: scale(1) rotate(-0.6deg);
  transition: transform 220ms cubic-bezier(0.2, 0.75, 0.25, 1.05), opacity 90ms ease-out;
}

.approve {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  border-block: 1px solid var(--rule-soft);
  padding: 0.3rem 0.1rem;
}

/* --- products ledger ---------------------------------------------------------- */

.ledger { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 18rem);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: 1.9rem 0;
  border-top: 1px solid var(--rule-soft);
}
.entry:first-child { border-top: none; padding-top: 0.6rem; }
.entry-no { font-family: var(--mono); font-size: 2.6rem; line-height: 1; color: var(--bean); font-variant-numeric: tabular-nums; }
.entry-body p { margin: 0; max-width: 52ch; color: var(--muted); }
.entry-body h3 a { color: var(--text); }
.entry-body h3 a:hover { color: var(--red); }
.entry-art { justify-self: end; display: flex; align-items: center; }

/* --- infra note ---------------------------------------------------------------- */

.infra-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.infra-list { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 0.85rem; }
.infra-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 1rem; }
.infra-list li:first-child { border-top: 1px solid var(--rule-soft); }
.infra-list .where { color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- contact -------------------------------------------------------------------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.email-display {
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  color: var(--text);
  padding: 0.8rem 1.2rem;
  border-block: 3px double var(--bean);
  word-break: break-all;
}
.email-display:hover { background: rgba(179, 53, 44, 0.12); }
.contact-notes { font-size: 0.95rem; color: var(--muted); }
.contact-notes ul { padding-left: 1.2rem; }

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

.bench-foot { border-top: 1px solid var(--rule-soft); padding: 2.2rem 0 2.6rem; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; align-items: baseline; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 0; }

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

@media (max-width: 900px) {
  .hero-grid, .infra-grid, .contact-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 3rem minmax(0, 1fr); }
  .entry-art { grid-column: 2; justify-self: start; margin-top: 0.6rem; }
  .bench-rail { flex-wrap: wrap; padding-block: 0.5rem; }
  .wordmark { margin-inline-end: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tab, .btn, .cite, a { transition: none; }
  .meter.live .bars i { animation: none; height: 55%; }
  .cite.pre-stamp { opacity: 1; transform: none; }
}
