/* HaloAI demo site. Colors are tokens; dark mode follows the system unless data-theme says otherwise. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #62656b;
  --line: #dcdad3;
  --accent: #1f5f4a;
  --accent-text: #ffffff;
  --paper: #e9e6dc;       /* e-ink panel, light in both themes like the real glass */
  --ink: #202020;
  --frame: #2b2c2f;
  --focus: #2b7de9;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517;
    --surface: #1d1f22;
    --text: #e8e8e6;
    --muted: #a1a4aa;
    --line: #33363b;
    --accent: #5fb898;
    --accent-text: #0e1512;
    --frame: #0b0b0c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141517;
  --surface: #1d1f22;
  --text: #e8e8e6;
  --muted: #a1a4aa;
  --line: #33363b;
  --accent: #5fb898;
  --accent-text: #0e1512;
  --frame: #0b0b0c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top, .how, .layout, .foot { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 28px; border: 3px solid var(--text); border-radius: 6px; background:
  linear-gradient(var(--ink), var(--ink)) 6px 6px / 14px 3px no-repeat,
  linear-gradient(var(--ink), var(--ink)) 6px 13px / 20px 3px no-repeat, var(--paper); flex: none; }
h1 { font-size: 1.6rem; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.tagline { margin: 2px 0 0; color: var(--muted); }
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.theme-btn { min-height: 36px; padding: 4px 12px; font-size: 0.88rem; font-weight: 500; }
.sample-note { margin: 0; font-size: 0.9rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }

.how ol { list-style: none; margin: 16px auto 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: step; }
.how li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 0.92rem; }
.how li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 0.8rem; font-weight: 700; }

.layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; margin-top: 20px; align-items: start; }

.badge-frame { background: var(--frame); border-radius: 18px; padding: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
#screen { display: block; width: 100%; height: auto; aspect-ratio: 800 / 480; background: var(--paper); border-radius: 4px; image-rendering: pixelated; }
#screen.portrait { aspect-ratio: 480 / 800; }
.badge-frame:has(#screen.portrait) { max-width: 420px; margin: 0 auto; }
.screen-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.rotary { display: flex; gap: 6px; margin-left: auto; }
.ctl { font: inherit; font-weight: 600; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.ctl:hover:not(:disabled) { border-color: var(--muted); }
.ctl:disabled { opacity: 0.45; cursor: not-allowed; }
.ctl.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.ctl.small { min-width: 44px; padding: 8px 10px; }
.ctl.active { box-shadow: inset 0 0 0 2px var(--accent); }

.command { margin-top: 16px; }
.command label { display: block; font-weight: 600; margin-bottom: 6px; }
.command.adding label { color: var(--accent); }
.command-row { display: flex; gap: 8px; }
.command-row input { flex: 1; min-width: 0; font: inherit; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font: inherit; font-size: 0.88rem; padding: 6px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); }
.chip-group { width: 100%; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-top: 4px; }

.scenes { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; }
.scenes summary { cursor: pointer; font-weight: 600; }
.scenes ul { margin: 6px 0 0; padding-left: 18px; }

.panels { display: grid; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.panel h2 { font-size: 1.02rem; margin: 0 0 8px; }
.panel h2 .muted { font-weight: 400; font-size: 0.85rem; margin-left: 6px; }
.list { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.list li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.list li:first-child { border-top: 0; }
.list .day { font-weight: 600; padding-top: 10px; border-top: 0; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.list .row { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.list .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list .new { animation: flash 2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.list.compact li { padding: 4px 0; }
.tag { font-size: 0.75rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.link-btn { font: inherit; font-size: 0.85rem; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 2px 4px; min-height: 32px; }
.hint { font-size: 0.82rem; margin: 8px 0 0; }

.foot { margin-top: 28px; padding-bottom: 28px; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .how ol { grid-template-columns: repeat(2, 1fr); }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .how ol, .panels { grid-template-columns: minmax(0, 1fr); }
  .badge-frame { padding: 8px; border-radius: 12px; }
  .rotary { margin-left: 0; }
  .ctl { padding: 8px 12px; }
  h1 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .list .new { animation: none; } }
