:root {
  --paper: #f6eedc;
  --paper-warm: #efe2c6;
  --char: #1f1a17;
  --char-soft: #2e2622;
  --ink: #1d2625;
  --muted: #5a4f43;
  --oak: #a46b32;
  --amber: #e29930;
  --brine: #2f8574;
  --brine-light: #d7f3ea;
  --violet: #7e22ce;
  --violet-bg: #f5ebff;
  --rose: #c4523a;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
}

a {
  color: #1f5c4e;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
a:hover { color: var(--oak); }

body {
  margin: 0;
  font: 1.06rem/1.62 Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  background-image:
    radial-gradient(rgba(31, 26, 23, 0.1) 1px, transparent 1.3px),
    linear-gradient(180deg, #faf3e3 0%, #f2e6cd 100%);
  background-size: 10px 10px, 100% 100%;
  padding: 2rem 1.1rem 3.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--amber);
  color: var(--char);
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--char);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.pantry {
  max-width: 56rem;
  margin: 0 auto;
}

/* Charred-cedar cottage header */
.hearth-header {
  background: linear-gradient(145deg, #2b231f 0%, #1c1614 100%);
  color: #fdf5e6;
  border: 3.5px solid var(--char);
  border-radius: 18px;
  box-shadow: 7px 7px 0 var(--char);
  padding: 1.5rem 1.6rem 1.4rem;
  position: relative;
  overflow: hidden;
}

.string-lights {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: -0.6rem -0.4rem 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px dashed rgba(252, 232, 191, 0.25);
}

.bulb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff7cc;
  box-shadow: 0 0 10px 3px rgba(251, 191, 36, 0.65);
  display: inline-block;
}
.bulb:nth-child(even) {
  transform: translateY(3px);
  background: #fde68a;
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
}

.chick-badge {
  width: 84px;
  height: 84px;
  background: radial-gradient(circle at 50% 55%, #fff2c6 0%, #f3c169 68%, #c97d2e 100%);
  border: 3px solid #c98e4b;
  border-radius: 50%;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.28);
  flex-shrink: 0;
}

.imprint {
  margin: 0 0 0.25rem;
  font: 700 0.82rem/1.3 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f6ce7b;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: #fffaf0;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: #e7d8c1;
  font-style: italic;
  font-size: 1.02rem;
}

.valence-card {
  background: rgba(255, 248, 231, 0.08);
  border: 1.5px solid rgba(232, 207, 161, 0.4);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: 0.82rem/1.55 ui-monospace, Menlo, Consolas, monospace;
  color: #f8e7c9;
}
.valence-card div {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
}
.valence-card .k { color: #d1bfa7; }
.valence-card .v { font-weight: 700; color: #fde68a; }

.welcome-note {
  margin: 1.6rem 0;
  background: #fffbf2;
  border: 3px solid var(--char);
  border-radius: 14px;
  padding: 1.15rem 1.4rem;
  box-shadow: 5px 5px 0 rgba(31, 26, 23, 0.88);
}
.welcome-note p { margin: 0.55rem 0; }
.welcome-note p:first-child { margin-top: 0; }
.welcome-note p:last-child { margin-bottom: 0; }

code {
  font: 0.9em ui-monospace, Menlo, Consolas, monospace;
  background: rgba(164, 107, 50, 0.13);
  padding: 0.08em 0.35em;
  border-radius: 4px;
}

/* Interactive Chalkboard & Allotrope Bench */
.slate-frame {
  margin: 1.8rem 0;
  background: #231d19;
  border: 4px solid #7d4e22;
  border-radius: 16px;
  box-shadow: 7px 7px 0 var(--char);
  overflow: hidden;
  color: #f5ebd6;
}

.slate-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: #2f251f;
  border-bottom: 2px solid #593818;
  font: 700 0.84rem ui-monospace, Menlo, Consolas, monospace;
}

.mode-tabs, .chalk-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

button {
  font: 700 0.82rem ui-monospace, Menlo, Consolas, monospace;
  border: 2px solid #14100e;
  border-radius: 8px;
  padding: 0.38rem 0.68rem;
  cursor: pointer;
  background: #f5ebd6;
  color: #1f1a17;
  box-shadow: 2px 2px 0 #14100e;
  transition: transform 0.08s, background 0.12s;
}
button:hover { transform: translate(-1px, -1px); background: #fff8e7; }
button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #14100e; }
button[aria-pressed="true"] {
  background: var(--amber);
  color: #1b140e;
}

.sugar-btn {
  background: #dcfce7;
  color: #14532d;
}
.sugar-btn:hover { background: #bbf7d0; }

.canvas-wrap {
  position: relative;
  background: #1b2120;
}

#slate {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.slate-Tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1rem;
  background: #2c221c;
  border-top: 2px solid #593818;
  font: 0.82rem ui-monospace, Menlo, Consolas, monospace;
  color: #dfd2be;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid #fff;
}
.swatch[data-color="#f5ebd6"] { background: #f5ebd6; }
.swatch[data-color="#d97757"] { background: #d97757; }
.swatch[data-color="#fde68a"] { background: #fde68a; }
.swatch[data-color="#7dd3fc"] { background: #7dd3fc; }
.swatch[aria-pressed="true"] {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* Two-column pantry shelf: Brine Jar Sealer + Violet Post */
.two-up {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.35rem;
  margin: 1.8rem 0;
}

.card {
  background: #fffbf2;
  border: 3px solid var(--char);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  box-shadow: 5px 5px 0 var(--char);
}

.card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.28rem;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font: 700 0.76rem ui-monospace, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--oak);
}

.brine-bench {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 0.8rem;
}

.jar-svg {
  width: 108px;
  height: 142px;
  display: block;
  margin: 0 auto;
}

.brine-input {
  width: 100%;
  min-height: 4.4rem;
  padding: 0.55rem 0.65rem;
  border: 2px solid var(--char);
  border-radius: 8px;
  background: #fefcf6;
  color: var(--ink);
  font: 0.94rem/1.45 Georgia, serif;
  resize: vertical;
}

.brine-readout {
  margin-top: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--brine-light);
  border: 1.5px solid var(--brine);
  font: 0.8rem/1.5 ui-monospace, Menlo, Consolas, monospace;
  color: #133c34;
  overflow-wrap: anywhere;
}

.violet-drawer {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--violet-bg);
  border: 2px dashed var(--violet);
  font-size: 0.94rem;
}
.violet-drawer[hidden] { display: none; }
.violet-stamp {
  font: 700 0.76rem ui-monospace, Menlo, Consolas, monospace;
  color: var(--violet);
  margin: 0 0 0.35rem;
}

/* Sticky note + shelf specimens */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.2rem;
  margin: 1.8rem 0;
}

.sticky-note {
  background: #fef3c7;
  border: 3px solid var(--char);
  border-radius: 4px 16px 14px 14px;
  padding: 1.15rem 1.3rem;
  box-shadow: 5px 5px 0 var(--char);
  transform: rotate(-0.6deg);
}
.sticky-note h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

footer {
  margin-top: 2.4rem;
  padding-top: 1.1rem;
  border-top: 2px dashed rgba(31, 26, 23, 0.35);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font: 0.88rem ui-monospace, Menlo, Consolas, monospace;
}

footer a {
  color: #1e4d42;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .header-grid { grid-template-columns: auto 1fr; }
  .valence-card { grid-column: 1 / -1; }
  .two-up { grid-template-columns: 1fr; }
  .brine-bench { grid-template-columns: 1fr; }
}
