/* Screen Lama — dusk violet, editorial center, hairline borders, no shadows */

:root {
  --bg: #141019;
  --bg-2: #1b1524;
  --ink: #ede9fe;
  --muted: #a79dc4;
  --accent: #a78bfa;
  --line: rgba(167, 139, 250, 0.28);
  --line-soft: rgba(167, 139, 250, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name {
  font-family: "Archivo", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top nav: brand lives here and only here ---------- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.02rem; }
.brand-name em { font-style: normal; color: var(--accent); }
.topnav .links { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.86rem; }
.topnav .links a { color: var(--muted); }
.topnav .links a.here { color: var(--ink); border-bottom: 1px solid var(--accent); }
.topnav .links a:hover { color: var(--ink); text-decoration: none; }

/* ---------- editorial column ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 56px; }

.masthead { padding: 22px 0 14px; text-align: center; }
.kicker {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
}
.masthead h1 { font-size: 1.65rem; font-weight: 800; }
.masthead h1 em { font-style: normal; color: var(--accent); }
.masthead .dek { color: var(--muted); font-size: 0.95rem; margin-top: 7px; }

@media (min-width: 560px) {
  .masthead { padding: 42px 0 24px; }
  .masthead h1 { font-size: 2.35rem; }
  .masthead .dek { font-size: 1.05rem; }
}

/* ---------- the instrument, framed like a plate in a journal ---------- */
.plate { border: 1px solid var(--line); margin: 6px 0 10px; }
.plate-cap {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.plate-body { padding: 14px 12px 16px; }
@media (min-width: 560px) { .plate-body { padding: 20px 20px 22px; } }

/* the screen swatch itself */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #ffffff;
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage-hint {
  font-size: 0.8rem;
  font-family: "IBM Plex Sans", sans-serif;
  color: rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.55);
  padding: 4px 10px;
  pointer-events: none;
  mix-blend-mode: luminosity;
}

/* fullscreen overlay fallback (iPhone Safari has no element fullscreen) */
.fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  cursor: pointer;
}
.fs-overlay.on { display: block; }
.fs-note {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-size: 0.82rem;
  color: rgba(0, 0, 0, 0.55);
  background: rgba(255, 255, 255, 0.6);
  padding: 5px 12px;
  white-space: nowrap;
  transition: opacity 0.4s;
}
.fs-note.dark { color: rgba(255, 255, 255, 0.75); background: rgba(0, 0, 0, 0.45); }
.fs-note.faded { opacity: 0; }

/* ---------- controls ---------- */
.controls { margin-top: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font: 500 0.85rem "IBM Plex Sans", sans-serif;
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip .dot { width: 12px; height: 12px; border: 1px solid rgba(237, 233, 254, 0.35); display: inline-block; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.chip:hover { border-color: var(--accent); }

.row2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.hexbox {
  width: 108px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font: 500 0.9rem "IBM Plex Mono", ui-monospace, monospace;
  padding: 8px 10px;
}
.hexbox:focus { outline: none; border-color: var(--accent); }
input[type="color"] {
  width: 42px;
  height: 37px;
  padding: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
}

.btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #17111f;
  font: 600 0.95rem "IBM Plex Sans", sans-serif;
  padding: 11px 20px;
  cursor: pointer;
}
.btn:hover { background: #b9a4fb; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: rgba(167, 139, 250, 0.1); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* big slider (light panel) */
.slider-block { margin-top: 14px; }
.slider-block label { font-size: 0.82rem; color: var(--muted); display: flex; justify-content: space-between; }
input[type="range"] {
  width: 100%;
  margin-top: 6px;
  accent-color: var(--accent);
  height: 26px;
}

.readout {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
  min-height: 1.4em;
}
.readout b { color: var(--ink); font-weight: 500; }

/* honesty strip */
.honesty {
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 18px 0;
}
.honesty b { color: var(--ink); font-weight: 600; }

/* ---------- article-ish sections ---------- */
section { margin-top: 44px; }
section > h2 {
  font-size: 1.3rem;
  font-weight: 800;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
section p { margin-bottom: 12px; color: var(--ink); }
section p.mut, .mut { color: var(--muted); }
section ul, section ol { margin: 0 0 12px 22px; }
section li { margin-bottom: 6px; }

.usecases { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.usecases div { background: var(--bg); padding: 12px 14px; }
.usecases b { display: block; font-family: "Archivo", sans-serif; margin-bottom: 3px; }
.usecases span { font-size: 0.88rem; color: var(--muted); }
@media (min-width: 560px) { .usecases { grid-template-columns: 1fr 1fr; } }

/* cards for companion pages / neighbours */
.cards { display: grid; gap: 10px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { border: 1px solid var(--line); padding: 14px 16px; color: var(--ink); display: block; }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card b { display: block; font-family: "Archivo", sans-serif; font-size: 1rem; margin-bottom: 4px; }
.card span { font-size: 0.86rem; color: var(--muted); }

/* FAQ */
details { border-bottom: 1px solid var(--line-soft); padding: 11px 0; }
details summary { cursor: pointer; font-weight: 600; font-family: "Archivo", sans-serif; }
details p { margin-top: 8px; color: var(--muted); font-size: 0.93rem; }

/* keyboard keys */
kbd {
  font: 500 0.8rem "IBM Plex Mono", ui-monospace, monospace;
  border: 1px solid var(--line);
  padding: 1px 6px;
  color: var(--ink);
  background: var(--bg-2);
}

/* ---------- blog ---------- */
.postlist { display: grid; gap: 10px; }
.postlist a { border: 1px solid var(--line); padding: 16px 18px; display: block; color: var(--ink); }
.postlist a:hover { border-color: var(--accent); text-decoration: none; }
.postlist b { font-family: "Archivo", sans-serif; font-size: 1.05rem; display: block; margin-bottom: 4px; }
.postlist span { color: var(--muted); font-size: 0.88rem; }
.postlist time { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.08em; }

article.post { padding-top: 26px; }
article.post h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
article.post .meta { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 20px; }
article.post h2 { font-size: 1.2rem; font-weight: 700; margin: 26px 0 10px; }
article.post p { margin-bottom: 13px; }
article.post figure { margin: 22px 0; border: 1px solid var(--line); }
article.post figure svg { display: block; width: 100%; height: auto; }
article.post figcaption { font-size: 0.78rem; color: var(--muted); padding: 8px 12px; border-top: 1px solid var(--line-soft); }
article.post ul, article.post ol { margin: 0 0 13px 22px; }
article.post li { margin-bottom: 6px; }

/* ---------- footer ---------- */
footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding: 18px 16px 30px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
footer .cols { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 10px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* plain-page (privacy/contact/404) */
.plain { padding-top: 30px; }
.plain h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }
.plain h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.plain p { margin-bottom: 12px; color: var(--muted); }
.plain p b, .plain p a { color: var(--ink); }
.plain p a { color: var(--accent); }
