/* Flavor Matrix -- clean, retro, uncluttered. */

@font-face {
  font-family: "Retro";
  src: url("fonts/VT323.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f4efe6;     /* warm paper */
  --ink: #2b2622;       /* near-black ink */
  --muted: #8c8073;     /* faded ink */
  --line: #e0d8c8;      /* hairlines */
  --accent: #c4502e;    /* one warm accent */
  --bar: #d8b48a;       /* strength bar */
  --retro: "Retro", "VT323", ui-monospace, "SF Mono", Menlo, monospace;
  /* dense text stays legible but reads as terminal/retro, not modern sans */
  --body: "SF Mono", "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

/* faint CRT scanlines over everything -- subtle, doesn't fight the content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(43, 38, 34, 0.035) 0 1px,
    transparent 1px 3px
  );
}

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 28px 36px;
  min-height: 100%;
}

/* ---- header ---- */
.head { text-align: center; margin-bottom: 26px; }
.title {
  font-family: var(--retro);
  font-size: 56px;
  line-height: 1;
  letter-spacing: 1px;
  margin: 0;
  color: var(--ink);
}
.tagline {
  font-family: var(--retro);
  font-size: 21px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ---- search ---- */
.search { position: relative; max-width: 460px; margin: 0 auto; }
.box {
  width: 100%;
  font-family: var(--retro);
  font-size: 30px;
  color: var(--ink);
  background: #fbf8f1;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px 16px;
  outline: none;
  text-align: center;
  caret-color: var(--accent);
}
.box::placeholder { color: var(--muted); opacity: .6; }
.box:focus { border-color: var(--accent); }

.ac {
  position: absolute;
  left: 0; right: 0;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  background: #fbf8f1;
  border: 2px solid var(--ink);
  border-radius: 6px;
  z-index: 5;
  max-height: 280px;
  overflow-y: auto;
}
.ac li {
  font-family: var(--retro);
  font-size: 22px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.ac li.on, .ac li:hover { background: var(--accent); color: #fbf8f1; }

/* ---- results ---- */
.results { margin-top: 34px; }
.resulthead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.qname { font-family: var(--retro); font-size: 34px; line-height: 1; }
.qcat {
  font-family: var(--retro);
  font-size: 18px;
  color: var(--muted);
  text-transform: lowercase;
}

.cols { display: flex; gap: 36px; align-items: flex-start; }
.col { flex: 1 1 0; min-width: 0; }
.label {
  font-family: var(--retro);
  font-size: 22px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

/* pairs */
.pairs, .ideas { list-style: none; margin: 0; padding: 0; }
.pair { padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pair:last-child { border-bottom: none; }
.pairtop { display: flex; align-items: center; gap: 10px; }
.pairname {
  font-family: var(--retro);
  font-size: 24px;
  line-height: 1;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strength {
  flex: 0 0 64px;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.strength > i { display: block; height: 100%; background: var(--bar); }
.book {
  font-family: var(--retro);
  font-size: 15px;
  color: #fbf8f1;
  background: var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.why {
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
  display: none;
}
.pair.open .why { display: block; }
.why .lead { color: var(--ink); }

/* ideas */
.ideas li {
  font-family: var(--retro);
  font-size: 23px;
  line-height: 1.3;
  padding: 7px 0 7px 22px;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.ideas li:last-child { border-bottom: none; }
.ideas li::before {
  content: "\203A";   /* › */
  position: absolute;
  left: 4px;
  color: var(--accent);
}

/* ---- misc ---- */
.empty {
  font-family: var(--retro);
  font-size: 24px;
  color: var(--muted);
  text-align: center;
  margin-top: 40px;
}
.empty b { color: var(--accent); cursor: pointer; }
.foot {
  font-family: var(--body);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 40px;
  opacity: .7;
}

/* ---- mode toggle ---- */
.modes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 22px;
}
.mode {
  font-family: var(--retro);
  font-size: 20px;
  color: var(--muted);
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 3px 18px;
  cursor: pointer;
  transition: none;
}
.mode.on { color: #fbf8f1; background: var(--ink); border-color: var(--ink); }

/* ---- science note (pair mode) ---- */
.note {
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 18px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.note b { color: var(--ink); font-weight: 600; }

/* ---- book affinity badge on a pairing ---- */
.aff {
  font-family: var(--retro);
  font-size: 14px;
  white-space: nowrap;
  border-radius: 3px;
  padding: 1px 6px;
  color: #fbf8f1;
}
.aff.w4 { background: #8a1f3d; }   /* holy grail */
.aff.w3 { background: var(--accent); }
.aff.w2 { background: #c98a3b; }
.aff.w1 { background: #b3a48f; }

/* ---- compose mode ---- */
.brief { max-width: 560px; margin: 0 auto; }
.briefbox {
  width: 100%;
  font-family: var(--retro);
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  background: #fbf8f1;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 12px 16px;
  outline: none;
  resize: vertical;
  caret-color: var(--accent);
}
.briefbox:focus { border-color: var(--accent); }
.briefbox::placeholder { color: var(--muted); opacity: .55; }
.composebtn {
  display: block;
  margin: 12px auto 0;
  font-family: var(--retro);
  font-size: 22px;
  color: #fbf8f1;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 6px 30px;
  cursor: pointer;
}
.composebtn:active { transform: translateY(1px); }

.design { margin-top: 30px; }
.dhero {
  font-family: var(--retro);
  font-size: 30px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  margin-bottom: 20px;
}
.dsec { margin-bottom: 22px; }
.dsec h3 {
  font-family: var(--retro);
  font-size: 20px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 5px;
}
.ding {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.ding:last-child { border-bottom: none; }
.drole {
  font-family: var(--retro);
  font-size: 15px;
  color: var(--muted);
  flex: 0 0 118px;
  text-transform: uppercase;
}
.dname { font-family: var(--retro); font-size: 22px; flex: 0 0 auto; }
.dwhy { font-family: var(--body); font-size: 12px; color: var(--muted); flex: 1 1 auto; line-height: 1.45; }
.dlist { list-style: none; margin: 0; padding: 0; }
.dlist li {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  padding: 4px 0 4px 20px;
  position: relative;
}
.dlist li::before { content: "\203A"; position: absolute; left: 4px; color: var(--accent); }
.dlist.arc li { font-family: var(--body); }
.profile {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
.profile .ax { font-family: var(--retro); font-size: 16px; color: var(--muted); }
.profile .caveat { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 6px; }

@media (max-width: 560px) {
  .cols { flex-direction: column; gap: 24px; }
  .title { font-size: 44px; }
  .ding { flex-wrap: wrap; }
  .drole { flex-basis: 100%; }
}
