:root {
  --cream: #f4ead9;
  --paper: #fff8ee;
  --crust: #7a3d1b;
  --crust-dark: #4a220f;
  --filling: #b11c24;
  --gold: #c8962a;
  --ink: #1a100c;
  --muted: #6e5344;
  --line: rgba(74, 34, 15, 0.14);
  --shadow: 0 28px 70px rgba(26, 16, 12, 0.18);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}
a { color: var(--crust); }
img { max-width: 100%; display: block; }
.wrap { width: min(1160px, calc(100% - 36px)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 234, 217, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.mark {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2px #fff8ee, 0 0 0 4px var(--crust);
}
.mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-name span { color: var(--filling); font-style: italic; }
nav { display: flex; flex-wrap: wrap; gap: 2px; }
nav a {
  text-decoration: none; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; font-size: 0.94rem;
}
nav a:hover, nav a.active { color: var(--ink); background: rgba(177, 28, 36, 0.08); }

.hero {
  position: relative;
  min-height: min(86vh, 760px);
  display: grid;
  align-items: end;
  color: #fff8ee;
  background: #3a1d10 center/cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,16,12,.15) 10%, rgba(26,16,12,.72) 100%);
}
.hero-copy { position: relative; z-index: 1; padding: 48px 0 56px; max-width: 720px; }
.kicker {
  text-transform: uppercase; letter-spacing: .2em; font-size: .72rem;
  font-weight: 700; color: #f3d27a; margin: 0 0 10px;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; margin: 0 0 14px; }
h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 500; letter-spacing: -.03em; }
h1 em { font-style: italic; color: #f3d27a; }
.lede { font-size: 1.2rem; max-width: 38rem; color: rgba(255,248,238,.88); }
.lede.dark { color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; border: 0; cursor: pointer;
  border-radius: 999px; padding: 13px 22px; font: inherit; font-weight: 600;
  text-align: center;
}
.btn-primary { background: var(--filling); color: #fff8ee; }
.btn-primary:hover { background: #8e1218; }
.btn-ghost { background: transparent; color: #fff8ee; box-shadow: inset 0 0 0 1.5px rgba(255,248,238,.55); }
.btn-ghost.dark { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  background: var(--paper);
}
.split img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.split-copy { padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }

.section { padding: 72px 0; }
.grid-3, .grid-4 { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: start; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}
.photo-card { padding: 0; overflow: hidden; }
.photo-card img { width: 100%; height: 210px; object-fit: cover; }
.photo-card img.cover {
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
  background: #f4ead9;
}
.photo-card .pad { padding: 18px 20px 22px; }
.photo-card h3 { font-size: 1.25rem; }

.books { background: #2a160e; color: #fff8ee; }
.books .kicker { color: #f3d27a; }
.books h2 { color: #fff8ee; }
.book {
  background: #3a2216;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(243,210,122,.18);
}
.book h3 { font-size: 1.2rem; }
.book p { color: rgba(255,248,238,.78); font-size: .95rem; }
.book a { color: #f3d27a; }

.formula {
  overflow-x: auto;
  background: #1a100c;
  color: #f4ead9;
  border-radius: 18px;
  padding: 22px 24px;
  font-family: var(--mono);
  font-size: .92rem;
  line-height: 1.7;
}
.gold { color: #f3d27a; }
.formula-plate {
  margin: 28px 0 36px;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.formula-plate img {
  width: min(920px, 100%);
  height: auto;
  margin: 0 auto;
}

.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li {
  display: grid; grid-template-columns: 150px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.ingredients code { font-family: var(--mono); color: var(--filling); font-weight: 600; }

.oven {
  background: var(--paper);
  border: 2px dashed rgba(177,28,36,.35);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
}
.timer-face {
  width: min(220px, 70%);
  aspect-ratio: 1;
  margin: 18px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff8ee 0 54%, transparent 55%),
    conic-gradient(from -90deg, var(--filling) 0 38%, #e8c48a 38% 100%);
  box-shadow: inset 0 0 0 14px #7a3d1b, 0 16px 30px rgba(26,16,12,.15);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--crust-dark);
}

.digits {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .04em;
  word-break: break-all;
  background: #1a100c;
  color: #f3e6d4;
  border-radius: 18px;
  padding: 20px;
  max-height: 340px;
  overflow: auto;
}
.digits .hit { background: #c8962a; color: #1a100c; border-radius: 3px; }
.digit-tin {
  margin-top: 28px;
  padding: 14px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 0, #f3d27a 0 8%, transparent 42%),
    radial-gradient(circle at 82% 100%, #c8962a 0 6%, transparent 36%),
    linear-gradient(180deg, #9a4e22, #5c2c14);
  box-shadow:
    inset 0 0 0 7px #7a3d1b,
    inset 0 0 0 10px #e8c48a,
    0 18px 36px rgba(26,16,12,.22);
}
.tin-rim {
  background: #1a100c;
  border-radius: 18px;
  overflow: hidden;
}
.tin-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  font-size: .86rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #f3d27a;
  border-bottom: 1px solid rgba(243,210,122,.18);
}
.digit-sheet {
  margin: 0;
  padding: 18px 20px 22px;
  max-height: 420px;
  overflow: auto;
  font-family: var(--mono);
  font-size: .92rem;
  line-height: 1.75;
  letter-spacing: .08em;
  color: #f3e6d4;
  white-space: pre-wrap;
  word-break: break-word;
}
.digit-sheet .lead {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #e24a3b;
  letter-spacing: 0;
  margin-right: .35rem;
}
.digit-sheet .d0 { color: #9a7d68; }
.digit-sheet .d1 { color: #f3d27a; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 20px; }
.controls input, .controls select, form input, form textarea {
  font: inherit; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
form { display: grid; gap: 12px; }
form textarea { min-height: 140px; resize: vertical; }
label { font-size: .88rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.note-form { gap: 18px; }
.note-form .field {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 12px 16px;
  align-items: center;
}
.note-form .field-top { align-items: start; }
.note-form .field-top label { padding-top: 12px; }
.note-form input,
.note-form textarea { width: 100%; }
.note-form .btn {
  justify-self: end;
  justify-content: center;
  text-align: center;
  min-width: 11.5rem;
}
.note-form #form-status { margin: 0; }
.baker { display: grid; gap: 18px; }
.baker .field {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 12px 16px;
  align-items: center;
}
.baker .btn { justify-self: end; min-width: 11.5rem; }
.baker .input-group {
  display: grid;
  grid-template-columns: 4.2rem 1fr 7rem;
  gap: 10px 14px;
  align-items: center;
}
.baker .inline-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .95rem;
}
.baker-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.baker input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(90deg, var(--filling), var(--gold));
  border-radius: 999px;
  outline: none;
}
.baker input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--crust-dark);
  border: 3px solid #fff8ee;
  box-shadow: 0 1px 4px rgba(26,16,12,.35);
  cursor: pointer;
}
.baker input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--crust-dark);
  border: 3px solid #fff8ee;
  cursor: pointer;
}
.baker .error { color: var(--filling); margin: 0; font-size: .92rem; }
#output.digits { max-height: 420px; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

.photo-strip {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 10px;
  margin: 28px 0 8px;
}
.photo-strip img {
  width: 100%; height: 240px; object-fit: cover; border-radius: 16px;
}

footer {
  background: #1a100c; color: rgba(255,248,238,.7);
  padding: 36px 0 44px; font-size: .95rem;
}
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: #f3d27a; }

.mobile-nav { display: none; gap: 8px; padding: 0 0 12px; overflow-x: auto; }
.mobile-nav a {
  white-space: nowrap; text-decoration: none; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; background: rgba(122,61,27,.08); font-size: .86rem;
}

@media (max-width: 900px) {
  nav { display: none; }
  .mobile-nav { display: flex; }
  .split, .grid-3, .grid-4, .grid-2, .photo-strip, .ingredients li {
    grid-template-columns: 1fr;
  }
  .photo-strip img { height: 200px; }
  .note-form .field,
  .note-form .field-top,
  .baker .field,
  .baker .input-group { grid-template-columns: 1fr; align-items: stretch; }
  .note-form .field-top label { padding-top: 0; }
}
