/* ==========================================================================
   cyber.cafe — neon mono, black void, 800px centered column (Pandoc-proof)
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root{
  --bg: #000000;
  --fg: #c400ff;                 /* neon purple */
  --fg-soft: rgba(196, 0, 255, 0.80);
  --border: rgba(196, 0, 255, 0.35);
  --panel: rgba(196, 0, 255, 0.08);
  --panel-2: rgba(196, 0, 255, 0.05);
  --focus: #ff4dff;

  --col: 800px;                  /* usable writing space */
  --pad-y: 56px;
  --pad-x: 24px;

  --font: "Nimbus Mono PS", "Courier New", ui-monospace, SFMono-Regular,
          Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --weight: 400;

  color-scheme: dark;
}

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

html, body{
  height: 100%;
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: var(--weight);
  font-style: normal;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;

  /* THE IMPORTANT PART:
     Center the document flow itself so generator wrappers cannot break it. */
  display: flex;
  flex-direction: column;
  align-items: center;

  /* Page padding (outside the 800px column) */
  padding: var(--pad-y) var(--pad-x);
}

/* ---------- 800px centered column (Pandoc/static-site proof) ---------- */
/* Any top-level blocks emitted by Pandoc (header, nav#TOC, main, etc.) become the column */
body > *{
  width: min(var(--col), 100%);
  margin: 0;
}

/* Ensure common wrappers don't expand beyond the column */
header, nav, main, section, article, div, aside{
  width: 100%;
}

/* If you have a specific wrapper, it will still behave */
#content, .content, .container, .markdown-body{
  width: 100%;
}

/* ---------- Universal typography + color enforcement ---------- */
body, body *{
  color: var(--fg);
  font-family: var(--font);
  font-weight: var(--weight);
}

/* Prevent long strings (URLs, hashes) from blowing out the column */
p, li, blockquote, td, th, pre, code{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6{
  margin: 0.95em 0 0.45em;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgba(196, 0, 255, 0.35);
}

h1{ font-size: 2.4rem; }
h2{ font-size: 1.8rem; }
h3{ font-size: 1.4rem; }
h4{ font-size: 1.15rem; }
h5{ font-size: 1.05rem; }
h6{ font-size: 1.0rem; opacity: 0.9; }

/* ---------- Body text ---------- */
p{
  margin: 0 0 1em;
}

small{
  color: var(--fg-soft);
}

/* ---------- Links & focus ---------- */
a{
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover{
  text-shadow: 0 0 12px rgba(196, 0, 255, 0.35);
}

/* Modern keyboard focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 10px;
}

/* ---------- Lists ---------- */
ul, ol{
  margin: 0 0 1em 1.25em;
  padding: 0;
}

li{
  margin: 0.25em 0;
}

/* ---------- Rules ---------- */
hr{
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ---------- Blockquotes ---------- */
blockquote{
  margin: 0 0 1.2em;
  padding: 0.35em 0.9em;
  border-left: 3px solid rgba(196, 0, 255, 0.5);
  background: var(--panel-2);
  border-radius: 12px;
}

blockquote > :first-child{ margin-top: 0; }
blockquote > :last-child{ margin-bottom: 0; }

/* ---------- Code ---------- */
pre, code, kbd, samp{
  font-family: var(--font);
  font-weight: var(--weight);
}

code{
  background: var(--panel);
  border: 1px solid rgba(196, 0, 255, 0.25);
  border-radius: 10px;
  padding: 0.12em 0.32em;
}

pre{
  margin: 0 0 1.2em;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
}

pre code{
  padding: 0;
  border: none;
  background: transparent;
}

/* ---------- Tables (don’t break the column) ---------- */
table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;

  /* If a table is wide, scroll instead of expanding layout */
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

th, td{
  padding: 10px 12px;
  border: 1px solid rgba(196, 0, 255, 0.28);
  vertical-align: top;
}

th{
  background: rgba(196, 0, 255, 0.10);
}

/* ---------- Media ---------- */
img, video{
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  border: 1px solid rgba(196, 0, 255, 0.18);
}

/* ---------- Forms (in case you add them) ---------- */
input, textarea, select, button{
  background: transparent;
  border: 1px solid rgba(196, 0, 255, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
}

button{
  cursor: pointer;
}

button:hover{
  background: rgba(196, 0, 255, 0.10);
}

/* ---------- Selection ---------- */
::selection{
  background: rgba(196, 0, 255, 0.35);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Pandoc cleanup ---------- */
/* Hide Pandoc's injected title block if it duplicates your own H1 */
#title-block-header,
h1.title{
  display: none;
}

/* If Pandoc emits a TOC, keep it styled but contained */
#TOC{
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(196, 0, 255, 0.04);
  border: 1px solid rgba(196, 0, 255, 0.22);
  border-radius: 14px;
}

