/* twilightventures.dev, one stylesheet, no build step.
   Tokens follow the tv13 brand mark (site/tv13-logo.svg): the dark rounded ground, the magenta
   CRT body, the cyan antenna and knobs, the phosphor-green digits. Dark is the home theme; the
   light slots keep the same hues on a pale ground for a reader whose system asks for light.
   --muted is the text tint at about 60% over the background. Nothing here is wider than the
   viewport: the one fixed measure is a max-width, tables live in an overflow wrapper, images
   scale to their column. */

:root {
  color-scheme: dark;
  --bg: #0B0713;        /* the logo ground */
  --surface: #1C1226;   /* a step up from the ground, for rules, stripes and cards */
  --surface-2: #2A1B39; /* a second step, for hover and table heads */
  --text: #DCD6EA;      /* cool light grey, the tube glow on the ground */
  --muted: #8E86A6;
  --accent: #FF2BD6;    /* the magenta CRT body: links */
  --accent-2: #22E8FF;  /* the cyan antenna: headings and the current page */
  --glow: #8DFFB8;      /* the phosphor digits: the brand name, product names, "opens" */
  --halo: rgba(255, 43, 214, 0.22);
  --halo-2: rgba(34, 232, 255, 0.18);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F7F3FB;
    --surface: #E6DCF0;
    --surface-2: #D9CCE8;
    --text: #2A1B3A;
    --muted: #6C5F80;
    --accent: #B0128E;
    --accent-2: #0B7F8F;
    --glow: #1E7A48;
    --halo: rgba(176, 18, 142, 0.12);
    --halo-2: rgba(11, 127, 143, 0.1);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F7F3FB;
  --surface: #E6DCF0;
  --surface-2: #D9CCE8;
  --text: #2A1B3A;
  --muted: #6C5F80;
  --accent: #B0128E;
  --accent-2: #0B7F8F;
  --glow: #1E7A48;
  --halo: rgba(176, 18, 142, 0.12);
  --halo-2: rgba(11, 127, 143, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0713;
  --surface: #1C1226;
  --surface-2: #2A1B39;
  --text: #DCD6EA;
  --muted: #8E86A6;
  --accent: #FF2BD6;
  --accent-2: #22E8FF;
  --glow: #8DFFB8;
  --halo: rgba(255, 43, 214, 0.22);
  --halo-2: rgba(34, 232, 255, 0.18);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img, svg { max-width: 100%; }

.wrap {
  max-width: 68ch;
  margin: 0 auto;
  padding-inline: 20px;
}

body.wide .wrap { max-width: 1080px; }

/* header and nav */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--glow);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
}

nav.site {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  white-space: nowrap;
}

nav.site a:hover,
nav.site a:focus-visible { color: var(--text); }

nav.site a[aria-current="page"] {
  color: var(--accent-2);
  box-shadow: inset 0 -2px 0 var(--accent-2);
}

main { padding: 28px 0 40px; }

/* type */

h1 {
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 650;
  margin: 0 0 0.6em;
  color: var(--accent-2);
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 650;
  margin: 2em 0 0.5em;
  color: var(--accent-2);
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 650;
  margin: 1.4em 0 0.4em;
  color: var(--glow);
}

p { margin: 0 0 1em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.92em;
  background: var(--surface);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.dated {
  color: var(--muted);
  margin-top: -0.4em;
}

.lead { font-size: 1.08em; }

.muted { color: var(--muted); }

ul { padding-left: 1.2em; }
li { margin: 0.3em 0; }

ul.plain {
  list-style: none;
  padding: 0;
}

/* the hero on the front door */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
  padding: 10px 0 6px;
}

.hero img {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  flex: none;
  filter: drop-shadow(0 0 22px var(--halo)) drop-shadow(0 0 6px var(--halo-2));
}

.hero .text { flex: 1 1 280px; }

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.25em;
  text-shadow: 0 0 18px var(--halo-2);
}

.hero .lead { margin-bottom: 0.5em; }

.hero .tagline {
  color: var(--glow);
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

/* product cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 0.6em 0 0.4em;
  padding: 0;
  list-style: none;
}

.grid li { margin: 0; }

a.card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 2px 12px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--surface);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

a.card:hover,
a.card:focus-visible {
  border-color: var(--accent-2);
  background: var(--surface-2);
}

a.card img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  grid-row: 1 / span 3;
  margin-top: 2px;
}

a.card .name {
  font-weight: 600;
  color: var(--glow);
  line-height: 1.3;
}

a.card .desc {
  margin: 0;
  font-size: 0.94em;
}

a.card .tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.85em;
}

/* product rows (the older list shape, still used on the products page) */

ul.products {
  list-style: none;
  padding: 0;
  margin: 0.5em 0 0;
}

ul.products li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 2px 14px;
  padding: 12px 0;
  margin: 0;
  border-top: 1px solid var(--surface);
}

ul.products li:last-child { border-bottom: 1px solid var(--surface); }

ul.products img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  grid-row: 1 / span 3;
  margin-top: 2px;
}

.name { font-weight: 600; color: var(--glow); }

.desc { margin: 0; }

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94em;
}

/* the pill under a product title */

.pill {
  display: inline-block;
  padding: 1px 10px;
  border: 1px solid var(--surface-2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82em;
  margin-right: 8px;
  vertical-align: middle;
}

/* facts on a product page */

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0 0 1.2em;
  padding: 12px 14px;
  border: 1px solid var(--surface);
  border-radius: 12px;
  background: var(--surface);
}

dl.facts dt {
  color: var(--muted);
  font-size: 0.9em;
  padding-top: 0.15em;
}

dl.facts dd { margin: 0; }

/* screenshots */

figure.shot {
  margin: 1.2em 0 1.4em;
}

figure.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  background: #1E1F29;
}

figure.shot figcaption {
  color: var(--muted);
  font-size: 0.9em;
  margin-top: 0.5em;
}

/* free and pro side by side */

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 0.4em 0 1em;
}

.tier {
  border: 1px solid var(--surface);
  border-radius: 12px;
  padding: 12px 16px 6px;
  background: var(--surface);
}

.tier h2 { margin-top: 0.2em; }

.tier ul { padding-left: 1.1em; }

.tier li { font-size: 0.95em; }

/* the quoted product string */

p.q {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin-left: 0;
}

/* change notes, quoted as they are */

.notes {
  margin: 0.4em 0 1.4em;
  padding: 0;
  list-style: none;
}

.notes li {
  margin: 0 0 1em;
  padding: 0 0 0.8em;
  border-bottom: 1px solid var(--surface);
}

.notes .ver {
  font-weight: 600;
  color: var(--glow);
  margin-right: 10px;
}

.notes .when {
  color: var(--muted);
  font-size: 0.9em;
}

.notes p { margin: 0.35em 0 0; }

/* what's new list */

.entries {
  list-style: none;
  padding: 0;
  margin: 0.5em 0 0;
}

.entries li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--surface);
}

.entries li:last-child { border-bottom: 1px solid var(--surface); }

.entries img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  grid-row: 1 / span 3;
  margin-top: 2px;
}

.entries .head { margin: 0; }

.entries .head .when {
  color: var(--muted);
  font-size: 0.9em;
  margin-left: 8px;
}

.entries p { margin: 0.3em 0 0; }

/* tables */

.table-wrap {
  overflow-x: auto;
  margin: 0.6em 0 1.2em;
  border: 1px solid var(--surface);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  font-size: 0.92em;
  min-width: 100%;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 7px 10px;
  border-bottom: 1px solid var(--surface);
  white-space: nowrap;
}

thead th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  position: sticky;
  top: 0;
}

tbody th {
  font-weight: 600;
  color: var(--glow);
  background: var(--surface);
  position: sticky;
  left: 0;
}

tr:last-child td, tr:last-child th { border-bottom: 0; }

td.opens {
  color: var(--glow);
  font-weight: 600;
}

td.wrapcol { white-space: normal; }

table.formats thead th {
  writing-mode: horizontal-tb;
  font-size: 0.88em;
}

/* format chips on the front door */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0.4em 0 1em;
  list-style: none;
}

.chips li { margin: 0; }

.chips a {
  display: inline-block;
  padding: 3px 11px;
  border: 1px solid var(--surface-2);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9em;
  background: var(--surface);
}

.chips a:hover,
.chips a:focus-visible {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* short guides list */

.guides {
  list-style: none;
  padding: 0;
  margin: 0.4em 0 1em;
}

.guides li {
  padding: 10px 0;
  border-top: 1px solid var(--surface);
}

.guides li:last-child { border-bottom: 1px solid var(--surface); }

.guides .desc { margin: 0.1em 0 0; font-size: 0.95em; }

/* section links row */

.row-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 0;
  margin: 0.2em 0 1em;
  list-style: none;
}

.row-links li { margin: 0; }

/* footer */

footer.site {
  border-top: 1px solid var(--surface);
  padding: 18px 0 32px;
  color: var(--muted);
  font-size: 0.94em;
}

footer.site p { margin: 0 0 0.6em; }

.lantern {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 8px;
  color: var(--glow);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.foot-links a { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  nav.site { margin-left: 0; }
  .hero img { width: 96px; height: 96px; border-radius: 20px; }
  .hero h1 { font-size: 1.6rem; }
  dl.facts { grid-template-columns: 1fr; gap: 0 0; }
  dl.facts dd { margin-bottom: 0.5em; }
}
