/* Menu-illustration preview site. Plain CSS, no framework.
   Site text in one open typeface (Plus Jakarta Sans, SIL OFL); EB Garamond (SIL OFL) only inside generated menus.
   One accent: pink #E83A87 (taken from Milk Bar's own site) for large blocks and decoration; solid buttons and
   badges use the deeper #C81E69 so their white text passes 4.5:1; pink text on white is #B5205F.
   Every button and solid block carries white text. White ground, neutral light grey bands.
   No text shadows anywhere. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
/* serif for the generated menus (builder only; the browser fetches it only when a menu uses it) */
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-Italic-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --accent: #E83A87;          /* large blocks, decoration; white heading text on it is 3.9:1 (large text only) */
  --accent-btn: #C81E69;      /* solid buttons and badges: white text 5.5:1 */
  --accent-dark: #A8185A;     /* button hover: white text 7.1:1 */
  --accent-soft: #FDE7F1;     /* light tint behind small pink text */
  --on-accent: #FFFFFF;       /* text on any accent fill */
  --accent-text: #B5205F;     /* pink text on white 6.3:1, on the tint 5.4:1 */
  --code-key: #F59BC3;        /* spec keys on the dark code card 9.1:1 */
  --ink: #191919;
  --ink-2: #4A4A4A;
  --ink-3: #6F6F6F;
  --bg: #FFFFFF;
  --bg-2: #F6F6F6;
  --tile: #F2F2F0;
  --rule: #E6E6E6;
  --field: #D6D6D6;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --barh: 72px;
  --pad: clamp(18px, 4vw, 56px);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html {
  background: var(--bg); color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 100%; line-height: 1.5;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
  scroll-padding-top: calc(var(--barh) + 12px); scroll-behavior: smooth;
}
body { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.page { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); }

h1, h2 { margin: 0; font-weight: 800; letter-spacing: -0.022em; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.5rem); line-height: 1.03; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.08; }
.sub { margin: 12px 0 0; font-size: clamp(1rem, 1.3vw, 1.125rem); color: var(--ink-2); max-width: 40em; }

/* ---------------------------------------------------------------- buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease;
}
.btn-sm { height: 38px; padding: 0 16px; font-size: 0.875rem; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent-btn); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-white { background: #fff; color: var(--accent-text); }
.btn-white:hover { background: var(--accent-soft); }
.btn-ghost { background: var(--ink); color: #fff; }
.btn-ghost:hover { background: #000; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow::after { content: "→"; transition: transform .15s ease; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------------------------------------------------------------- top bar */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--barh);
  display: flex; align-items: center; gap: 28px; padding: 0 var(--pad);
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.wordmark { font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.bar-cta { margin-left: auto; }

/* ---------------------------------------------------------------- placeholders (clearly marked) */
.ph {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; text-align: center; border-radius: inherit;
  background: repeating-linear-gradient(45deg, #F1F2F4 0 14px, #E9EBEE 14px 28px);
  border: 2px dashed #BFC4CC; color: #5B616B;
}
.ph-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid #BFC4CC;
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #5B616B;
}
.ph-file { font-family: var(--mono); font-size: 0.75rem; overflow-wrap: anywhere; }
.ph-tag-inline { margin-left: auto; background: transparent; color: #C9CED6; border-color: #4B5059; }

/* ---------------------------------------------------------------- home: hero */
.hero {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-top: clamp(40px, 7vh, 80px); padding-bottom: clamp(32px, 5vh, 56px);
}
.hero h1 { max-width: 11em; }
.lede { margin: 20px 0 0; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 32px; }
.collage { display: grid; grid-template-columns: 1.6fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; aspect-ratio: 1.42; }
.tile { display: block; text-decoration: none; overflow: hidden; border-radius: var(--r-lg); background: var(--tile); min-height: 0; }
.tile-big { grid-row: 1 / 3; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.tile:hover img { transform: scale(1.03); }
.tile .ph { height: 100%; aspect-ratio: auto !important; }
/* transparent single-dish pictures (manifest variants): whole dish visible on the light tile */
.tile img.contain { object-fit: contain; padding: 7%; }
.cat-img img.contain { object-fit: contain; }
.dish-card img.contain { object-fit: contain; padding: 7%; }

.cats { display: flex; gap: clamp(16px, 3vw, 36px); padding-bottom: clamp(40px, 6vh, 64px); }
.cat { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; }
.cat-img { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--tile); display: block; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-img .ph { height: 100%; padding: 0; border-radius: 50%; }
.cat-img .ph-file, .cat-img .ph-tag { display: none; }
.cat-ph { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px dashed #BFC4CC;
  background: repeating-linear-gradient(45deg, #F1F2F4 0 8px, #E9EBEE 8px 16px); }
.cat-label { font-weight: 700; font-size: 0.9375rem; }
.cat:hover .cat-label { text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- home: bands */
.band { padding: clamp(56px, 9vh, 96px) 0; }
.band-2 { background: var(--bg-2); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; margin: 28px 0 18px; background: #fff; border: 1px solid var(--field); border-radius: 999px; }
.seg {
  border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: 0.9375rem; color: var(--ink-2);
}
.seg[aria-selected="true"], .seg[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--field); background: #fff; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 0.875rem;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.card-img { display: block; overflow: hidden; border-radius: var(--r-lg); background: var(--tile); }
.card-img img { width: 100%; }
.cmp-fig { margin: 0; }
.cmp-fig figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--ink-3); font-weight: 600; }

.pchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pchip { padding: 5px 13px; border-radius: 999px; background: #fff; border: 1px solid #F1B3CF; color: var(--accent-text); font-weight: 700; font-size: 0.875rem; }
.spec-pair { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px;
  align-items: stretch; height: 460px; }
.code-card { background: #121417; color: #E9EAEC; border-radius: var(--r-lg); padding: 24px 28px; overflow: auto; min-width: 0; }
.code-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-family: var(--mono); font-size: 0.75rem; color: #9097A1; }
.code-card pre { margin: 0; font-family: var(--mono); font-size: 0.9rem; line-height: 1.75; white-space: pre; }
.code-card .k { color: var(--code-key); }
.code-card .v { color: #F2F2F2; }
.code-card .c { color: #7C838D; }
.arrow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent-btn); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; border: 4px solid var(--bg-2);
}
.spec-img { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 0; }
.spec-img img { width: 100%; height: 100%; object-fit: contain; }

.dish-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 16px; overflow-x: auto;
  margin-top: 32px; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.dish-card { margin: 0; scroll-snap-align: start; }
.dish-card .card-img { border-radius: var(--r-md); aspect-ratio: 1; }
.dish-card img { width: 100%; height: 100%; object-fit: cover; }
.dish-card figcaption, .sheet-card figcaption { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.dish-card figcaption b, .sheet-card figcaption b { font-weight: 800; }
.dish-card figcaption span, .sheet-card figcaption span { color: var(--ink-3); font-size: 0.875rem; font-weight: 600; }
.sheet-card figcaption .link-arrow { margin-left: auto; font-size: 0.875rem; }
.sheets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.sheet-card { margin: 0; }

.cta {
  margin: clamp(56px, 9vh, 96px) 0; padding: clamp(36px, 6vw, 72px); border-radius: 28px;
  background: var(--accent); color: var(--on-accent); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.cta h2 { max-width: 14em; }

.foot { border-top: 1px solid var(--rule); padding: 32px 0 40px; color: var(--ink-3); font-size: 0.8125rem; }
.foot-in { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: baseline; }
.foot .wordmark { color: var(--ink); font-size: 1rem; }
.foot p { margin: 0; }

/* ---------------------------------------------------------------- builder */
.b-head { padding-top: clamp(28px, 5vh, 48px); padding-bottom: 24px; }
.b-head h1 { font-size: clamp(2.25rem, 4vw, 3.25rem); }
.b-grid { display: grid; grid-template-columns: minmax(380px, 560px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-bottom: 64px; }
.step { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px 22px 24px; margin-bottom: 16px; background: #fff; }
.step h2, .b-preview-h { display: flex; align-items: center; gap: 10px; font-size: 1.1875rem; letter-spacing: -0.01em; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-btn); color: var(--on-accent); font-size: 0.875rem; font-weight: 800; flex: none; }
.step .tabs { margin: 16px 0 14px; }
.tabs-sm { margin: 0 !important; }
.tabs-sm .seg { padding: 6px 14px; font-size: 0.875rem; }

.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.dish { position: relative; display: flex; flex-direction: column; gap: 8px; }
.dish-thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--tile); }
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish-name { font-weight: 700; font-size: 0.9375rem; line-height: 1.25; }
.dish-count { color: var(--ink-3); font-weight: 600; font-size: 0.8125rem; }
.add {
  position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent-btn); color: var(--on-accent); font-size: 1.5rem; line-height: 1; font-weight: 600;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.add svg { display: block; }
.add:hover { background: var(--accent-dark); }

.nodraw {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  width: 100%; height: 100%; padding: 8px; border: 2px dashed #BFC4CC; border-radius: inherit; background: #FAFAFA;
  color: #5B616B; font-size: 0.75rem; font-weight: 700; line-height: 1.2;
}
.nodraw small { font-weight: 500; font-size: 0.6875rem; }

.empty { margin: 14px 0 0; color: var(--ink-3); }
.item { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px; margin-top: 12px; }
.item-top { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.item-thumb { width: 76px; height: 76px; border-radius: var(--r-sm); overflow: hidden; background: var(--tile); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb .nodraw { font-size: 0.625rem; padding: 4px; }
.item-thumb .nodraw small { display: none; }
.item-fields { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
.item-fields .wide { grid-column: 1 / -1; }
.item-fields .feat { font-size: 0.8125rem; white-space: nowrap; }
.item-meta { grid-column: 1 / -1; font-size: 0.75rem; color: var(--ink-3); font-weight: 600; overflow-wrap: anywhere; }
.item-meta .warn { color: #8A4B00; }
.item-btns { display: flex; flex-direction: column; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--field); border-radius: 50%; background: #fff; cursor: pointer; font-size: 0.875rem; line-height: 1; color: var(--ink); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.param { margin-top: 12px; }
.param-label { font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { display: inline-block; padding: 6px 12px; border: 1px solid var(--field); border-radius: 999px; font-size: 0.8125rem; font-weight: 600; cursor: pointer; background: #fff; }
.opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); min-width: 0; }
.field input, .item input[type=text] {
  height: 42px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--r-sm); background: #fff;
  font-size: 0.9375rem; font-weight: 500; color: var(--ink); width: 100%; min-width: 0;
}
.field input:focus, .item input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.field-wide { grid-column: 1 / -1; }
.group-label { margin: 20px 0 8px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
.tile-opt { border: 2px solid var(--rule); border-radius: var(--r-md); background: #fff; padding: 10px; cursor: pointer; text-align: left; }
.tile-opt[aria-pressed="true"] { border-color: var(--ink); }
.tile-opt svg { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--bg-2); }
.tile-opt b { display: block; margin-top: 8px; font-size: 0.875rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; align-items: center; gap: 8px; border: 2px solid var(--rule); border-radius: 999px; padding: 5px 14px 5px 5px; background: #fff; cursor: pointer; font-weight: 700; font-size: 0.875rem; }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch i { width: 28px; height: 28px; border-radius: 50%; display: block; position: relative; border: 1px solid rgba(0,0,0,.12); }
.swatch i::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--sw-accent); border: 2px solid #fff; }
.opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.b-preview { align-self: stretch; }
.b-sticky { position: sticky; top: calc(var(--barh) + 16px); }
.b-preview-h { margin-bottom: 14px; }
.sheet-frame { background: #ECECEC; border-radius: var(--r-lg); padding: clamp(14px, 2vw, 28px); display: flex; justify-content: center; }
.sheet-frame svg { display: block; width: min(100%, calc((100vh - var(--barh) - 220px) * var(--ar, 0.707))); height: auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.fit-note { min-height: 1.4em; margin: 10px 2px 12px; font-size: 0.8125rem; color: var(--ink-3); font-weight: 600; }

.full { position: fixed; inset: 0; z-index: 50; background: #E9E9E9; display: flex; flex-direction: column; }
.full-bar { display: flex; align-items: center; gap: 10px; padding: 12px var(--pad); background: #fff; border-bottom: 1px solid var(--rule); }
.full-spacer { flex: 1; }
.full-stage { flex: 1; overflow: auto; padding: 28px var(--pad) 48px; }
.full-sheet { max-width: 820px; margin: 0 auto; }
.full-sheet.landscape { max-width: 1160px; }
.full-sheet svg { display: block; width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.full-status { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 0.875rem; font-weight: 600; }
.full-status:empty { display: none; }
html.full-open { overflow: hidden; }

#print-root { display: none; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .sheets { grid-template-columns: 1fr 1fr; }
  .b-grid { grid-template-columns: 1fr; }
  .b-sticky { position: static; }
  .sheet-frame svg { width: 100%; }
}
@media (max-width: 640px) {
  :root { --barh: 60px; }
  .bar { gap: 14px; }
  .wordmark { font-size: 1.0625rem; }
  .collage { aspect-ratio: 1.15; gap: 10px; }
  .spec-pair { grid-template-columns: 1fr; height: auto; }
  .code-card { max-height: 360px; }
  .spec-img { height: auto; aspect-ratio: 1; }
  .arrow { position: static; transform: rotate(90deg); margin: -8px auto; }
  .sheets { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
  .step { padding: 18px 16px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .tiles, .tiles-4 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .item-top { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .item-thumb { width: 64px; height: 64px; }
  .item-fields { grid-template-columns: 76px minmax(0, 1fr); }
  .item-fields input[data-field="name"] { grid-column: 1 / -1; }
  .item-fields .wide { grid-column: auto; }
  .item-fields input[data-field="section"] { grid-column: 1 / -1; }
  .full-bar { gap: 6px; }
  .full-bar .btn { height: 38px; padding: 0 13px; font-size: 0.875rem; }
}

/* ---------------------------------------------------------------- print: only the generated menu */
@media print {
  html, body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root svg { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.item-meta:empty { display: none; }
