/* Shared shell for the Xylene Dreams concept demos. */
:root {
  --bg: #f4ead9;
  --surface: #fffaf0;
  --ink: #1b2723;
  --muted: #6c756f;
  --line: rgba(27, 39, 35, 0.16);
  --accent: #c9a24b;
  --accent-2: #0f2a22;
  --good: #2e6a4f;
  --warn: #a36a1f;
  --bad: #a33a32;
  --display: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 3px;
  --shadow: 0 18px 50px rgba(15, 30, 24, 0.12);
}

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

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  z-index: 1;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; }
::selection { background: var(--accent); color: var(--accent-2); }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 2; }
.narrow { width: min(880px, calc(100% - 40px)); }
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 0 18px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; text-decoration: none; gap: 1px; }
.brand strong { font-family: var(--display); font-size: clamp(22px, 2.4vw, 31px); font-weight: 600; letter-spacing: 0.02em; }
.brand span { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topnav { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.topnav a { font-size: 12.5px; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; padding: 3px 0; }
.topnav a:hover { color: var(--ink); border-color: var(--accent); }
.topnav .back { color: var(--ink); font-weight: 650; }

.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: rgba(0,0,0,0.04); }
.view-switch button {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 13px; font-size: 11.5px; font-weight: 650;
}
.view-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-2); }

.hero { padding: clamp(42px, 7vw, 92px) 0 clamp(32px, 5vw, 64px); display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: 1.15fr 0.85fr; align-items: end; }
.hero h1 { font-size: clamp(48px, 8vw, 108px); margin: 0 0 18px; letter-spacing: -0.035em; }
.hero .lede { max-width: 540px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-side { padding-bottom: 8px; }
.kicker { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.section { padding: clamp(34px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.section-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 3.2vw, 46px); }
.section-head p { max-width: 460px; margin: 0; color: var(--muted); font-size: 13.5px; }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 52px); align-items: start; }
.split-wide { grid-template-columns: 1.25fr 0.75fr; }
.stack { display: grid; gap: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow);
}
.panel.flat { box-shadow: none; background: transparent; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 18px; }
.panel-head h3 { font-size: 22px; margin: 0; }
.panel-head small { color: var(--muted); font-size: 11px; }

.form-grid { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; }
.field label { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%; background: rgba(255,255,255,0.55); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; outline: none; min-height: 42px;
}
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field .hint { color: var(--muted); font-size: 10.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: var(--radius); padding: 10px 16px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-2); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, white); }
.btn.ghost { background: rgba(255,255,255,0.22); }
.btn.small { padding: 6px 10px; font-size: 11px; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn:focus-visible, .view-switch button:focus-visible, .topnav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tag.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.tag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--surface); padding: 16px; }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; padding: 9px 10px; border-bottom: 1px solid var(--line); font-weight: 650; }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .empty-row td { color: var(--muted); text-align: center; padding: 28px 10px; }
.data-table select { background: transparent; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; font-size: 11px; color: var(--ink); }

.menu-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.menu-tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 2px solid transparent; white-space: nowrap; }
.menu-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.menu-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item h4 { margin: 0 0 2px; font-family: var(--display); font-size: 17px; font-weight: 500; }
.menu-item p { margin: 0; font-size: 11.5px; color: var(--muted); max-width: 62ch; }
.menu-item .price { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.menu-section { margin-bottom: 24px; }
.menu-section > h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 4px; }
.sample-note { font-size: 10.5px; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 10px; }

.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(14px);
  background: var(--accent-2); color: #fff7e7; border: 1px solid var(--accent);
  padding: 10px 16px; border-radius: 999px; font-size: 12px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 36px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.concept-note {
  margin: 18px 0 0; padding: 12px 14px; border: 1px dashed var(--line);
  font-size: 11px; color: var(--muted); border-radius: var(--radius);
}
.concept-note b { color: var(--ink); }
.site-footer { padding: 30px 0 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent); }
.hidden { display: none !important; }

@media (max-width: 880px) {
  .hero, .split, .split-wide { grid-template-columns: 1fr; }
  .hero { padding-top: 38px; }
  .hero h1 { font-size: clamp(46px, 12vw, 76px); }
  .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; gap: 14px; }
}
@media (max-width: 520px) {
  .wrap, .narrow { width: min(100% - 28px, 1180px); }
  .panel { padding: 18px; }
  .data-table { font-size: 11.5px; }
  .data-table th:nth-child(3), .data-table td:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media print {
  .topbar, .view-switch, .btn, .site-footer, .concept-note, .toast, .hero-side, .section-head p { display: none !important; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .panel { box-shadow: none; border-color: #bbb; }
  .section { break-inside: avoid; }
}
