:root {
  --ink: #201c23;
  --paper: #fbf7ed;
  --cream: #f2e8d3;
  --peach: #f4c6aa;
  --pink: #d87185;
  --plum: #532c48;
  --green: #435f50;
  --line: rgba(32, 28, 35, 0.18);
  --shadow: 5px 5px 0 var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 13%, rgba(216, 113, 133, 0.18) 0 1px, transparent 1.5px) 0 0 / 17px 17px,
    var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

button, select, input { font: inherit; }

.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 64px; }

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 17px;
}

.wordmark { color: var(--ink); font: 700 1.02rem Consolas, monospace; letter-spacing: -0.06em; text-decoration: none; }
.site-header p { margin: 0; color: #665f61; font-size: 0.9rem; }

.intro { max-width: 790px; padding: clamp(58px, 10vw, 120px) 0 43px; }
.eyebrow { margin: 0 0 9px; color: var(--plum); font: 500 0.74rem Consolas, monospace; letter-spacing: 0.07em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, serif; letter-spacing: -0.045em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(3.5rem, 8vw, 6.8rem); font-weight: 600; line-height: 0.84; }
.lede { max-width: 580px; margin: 27px 0 0; font-size: 1.13rem; line-height: 1.5; }

.controls {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 14px;
  align-items: end;
  padding: 19px;
  background: var(--cream);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}

.control-group { min-width: 0; }
.control-group > label, .control-group legend { display: block; min-height: 17px; margin: 0 0 8px; padding: 0; font: 600 0.77rem/17px Consolas, monospace; letter-spacing: 0.02em; }
select {
  width: 100%; min-height: 45px; padding: 0 34px 0 13px;
  appearance: none; color: var(--ink); border: 1px solid var(--ink); border-radius: 0;
  background: #fffdf7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23201c23' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.flavor-fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.flavor-options { display: flex; min-height: 45px; overflow: hidden; border: 1px solid var(--ink); background: #fffdf7; }
.flavor-options label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; cursor: pointer; font-size: 0.88rem; white-space: nowrap; }
.flavor-options label + label { border-left: 1px solid var(--line); }
.flavor-options input { accent-color: var(--plum); }
.generate-button {
  min-height: 45px; padding: 0 18px; white-space: nowrap; cursor: pointer; border: 1px solid var(--ink);
  background: var(--pink); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.generate-button:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.generate-button span { display: inline-block; margin-left: 6px; font-size: 1.25em; }

.result-section { padding-top: 76px; }
.result-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 15px; }
h2 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.5rem); font-weight: 600; line-height: 0.9; }
.text-button { padding: 5px 0; cursor: pointer; color: var(--plum); border: 0; border-bottom: 1px solid currentColor; background: transparent; font-weight: 700; }

.premise-card { position: relative; padding: clamp(27px, 5vw, 56px); overflow: hidden; border: 1px solid var(--ink); background: var(--plum); color: #fff8ed; box-shadow: var(--shadow); }
.premise-card::after { content: "✦"; position: absolute; right: -8px; bottom: -45px; color: rgba(244, 198, 170, 0.22); font: 14rem Georgia, serif; }
.premise { position: relative; z-index: 1; max-width: 940px; margin: 0; font-family: Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.7rem); font-weight: 500; line-height: 1.12; letter-spacing: -0.026em; white-space: pre-line; }
.nudge { position: relative; z-index: 1; max-width: 720px; margin: 24px 0 0; color: #f4c6aa; font-size: 0.95rem; line-height: 1.5; }

.lock-hint { margin: 22px 0 0; color: #665f61; font-size: 0.88rem; }
.ingredient-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.ingredient { position: relative; min-height: 168px; padding: 18px; color: var(--ink); border: 1px solid var(--ink); background: #fffdf7; text-align: left; }
button.ingredient { width: 100%; cursor: pointer; }
.ingredient:hover { transform: translateY(-2px); box-shadow: 2px 2px 0 var(--ink); }
.ingredient.is-locked { background: #fff1bb; box-shadow: inset 0 0 0 2px var(--ink); }
.ingredient:nth-child(2n) { background: #f8d7c4; }
.ingredient:nth-child(3n) { background: #dce7db; }
.ingredient-label { margin: 0 0 17px; color: var(--plum); font: 500 0.7rem Consolas, monospace; letter-spacing: 0.07em; text-transform: uppercase; }
.ingredient-value { margin: 0; font: 600 1.08rem/1.28 Georgia, serif; letter-spacing: -0.015em; }
.lock-glyph { position: absolute; top: 13px; right: 13px; font-size: 0.95rem; }

.bottom-note { max-width: 630px; margin: 67px auto 0; text-align: center; color: #554d50; font-size: 0.94rem; line-height: 1.5; }
.bottom-note p { margin: 0; }
.bottom-note strong { color: var(--ink); }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1160px); }
  .site-header { align-items: flex-start; gap: 12px; }
  .site-header p { max-width: 150px; text-align: right; }
  .controls { grid-template-columns: 1fr; }
  .ingredient-grid { grid-template-columns: 1fr; }
  .ingredient { min-height: auto; }
}

@media (max-width: 440px) {
  h1 { font-size: 3.4rem; }
  .flavor-options label { font-size: 0.76rem; padding: 0 4px; }
  .result-heading { align-items: flex-start; gap: 15px; }
}
