:root {
  --char: #120e0b;
  --char-2: #1c1612;
  --sand: #c4a06a;
  --patina: #7a9a6a;
  --fire: #d45a28;
  --ink: #efe6d4;
  --mute: #9a8c78;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 82px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--char);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-link {
  color: var(--sand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(196, 160, 106, 0.12);
  padding: 0.05em 0.4em;
}

.sand {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.12;
  background-image: url("images/texture.webp");
  background-size: 380px auto;
  mix-blend-mode: overlay;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 10px;
  z-index: 70;
  background: var(--sand);
  color: var(--char);
  padding: 8px 12px;
}

.foundry-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(18, 14, 11, 0.94);
  border-bottom: 1px solid rgba(196, 160, 106, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
}

.brand small {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.bell-mark {
  width: 34px;
  height: 38px;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: var(--patina);
  color: var(--char);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 14px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--sand);
  color: var(--sand);
  padding: 6px 12px;
}

.foundry-nav {
  display: flex;
  gap: 14px;
  font-size: 14px;
  align-items: center;
}

.foundry-nav a {
  color: var(--mute);
}

.foundry-nav a.is-active,
.foundry-nav a:hover {
  color: var(--sand);
}

.foundry-nav .live {
  color: var(--char);
  background: var(--sand);
  padding: 6px 12px;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 14, 11, 0.88) 0%, rgba(18, 14, 11, 0.35) 55%, rgba(18, 14, 11, 0.2) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 8vh 7vw 10vh;
  max-width: 720px;
}

.kicker,
.vlabel {
  font-family: var(--mono);
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--patina);
  margin: 0 0 12px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(36px, 6vw, 76px);
}

h2 {
  font-size: clamp(24px, 3.2vw, 40px);
}

h3 {
  font-size: 20px;
}

.lead {
  color: rgba(239, 230, 212, 0.88);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid rgba(196, 160, 106, 0.35);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  padding: 10px 16px;
  border: 1px solid var(--sand);
  font-size: 14px;
}

.btn-fill {
  background: var(--sand);
  color: var(--char);
}

.btn-ghost {
  background: transparent;
}

.pit {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 84px 0;
}

.pit-head {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  margin-bottom: 32px;
}

.pit-head p:last-child {
  margin: 0;
  color: var(--mute);
}

.three,
.five {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.five {
  grid-template-columns: repeat(5, 1fr);
}

.three article,
.five article {
  background: var(--char-2);
  padding: 20px;
  border-top: 4px solid var(--patina);
}

.three ul,
.io ul,
.rule-list {
  margin: 0;
  padding-left: 1.1em;
}

.ash {
  background: var(--char-2);
}

.pour-row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 52px;
}

.pour-row.rev {
  direction: rtl;
}

.pour-row.rev > * {
  direction: ltr;
}

.idx {
  font-family: var(--mono);
  color: var(--sand);
  letter-spacing: 0.12em;
  font-size: 12px;
}

.bell-clip {
  margin: 0;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  background: #0a0806;
}

.bell-clip img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.bell-clip figcaption {
  font-size: 12px;
  color: var(--mute);
  padding: 8px 14px 12px;
}

.gate {
  margin-top: 12px;
  background: transparent;
  border: 1px solid var(--fire);
  color: var(--fire);
  padding: 8px 14px;
}

.gate.is-open {
  border-color: var(--patina);
  color: var(--patina);
}

.dial {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed rgba(196, 160, 106, 0.4);
}

.dial-label {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.slider {
  display: grid;
  grid-template-columns: 24px 1fr 56px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.slider input {
  width: 100%;
  accent-color: var(--fire);
}

.tri-state {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 13px;
}

.tri-state.ok {
  color: var(--patina);
}

.tri-state.warn {
  color: var(--sand);
}

.tri-state.late {
  color: var(--fire);
}

.rule-list {
  max-width: 46em;
}

.io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.io > div {
  background: var(--char);
  padding: 20px;
  border-left: 6px solid var(--patina);
}

footer {
  padding: 28px;
  font-size: 13px;
  color: var(--mute);
}

@media (max-width: 920px) {
  .hero-copy,
  .pit-head,
  .three,
  .five,
  .pour-row,
  .io {
    grid-template-columns: 1fr;
  }

  .pour-row.rev {
    direction: ltr;
  }

  .five {
    grid-template-columns: 1fr 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .foundry-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: var(--char-2);
    padding: 12px 20px 20px;
    gap: 10px;
  }

  .foundry-nav.open {
    display: flex;
  }
}
