/* ─────────────────────────────────────────────────────────────────
   SE Theme — Base: Reset · Typography · Body
   ───────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Headings ──────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: .02em;
  margin-bottom: var(--s4);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; font-family: var(--font-ui); letter-spacing: .05em; text-transform: uppercase; }
h5 { font-size: 1rem;    font-family: var(--font-ui); }
h6 { font-size: .9rem;   font-family: var(--font-ui); color: var(--text-dim); }

/* ── Body text ─────────────────────────────────────────────── */
p { margin-bottom: var(--s4); color: var(--text); }
p:last-child { margin-bottom: 0; }

strong, b { color: var(--text-bright); font-weight: 600; }
em, i { font-style: italic; }
small { font-size: .85em; color: var(--text-dim); }
mark  { background: rgba(0,255,231,.15); color: var(--clr-neon); padding: 0 3px; border-radius: 2px; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

/* ── Links ─────────────────────────────────────────────────── */
a {
  color: var(--clr-neon);
  text-decoration: none;
  transition: color var(--t-fast), opacity var(--t-fast);
}
a:hover { color: var(--text-bright); opacity: .9; }
a:focus-visible {
  outline: 2px solid var(--clr-neon);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Lists ─────────────────────────────────────────────────── */
ul,ol { padding-left: var(--s5); margin-bottom: var(--s4); }
li { margin-bottom: var(--s1); }

/* Styled inside .entry-content */
.entry-content ul li::marker { color: var(--clr-neon); }
.entry-content ol li::marker { color: var(--clr-neon); font-family: var(--font-mono); font-size: .85em; }

/* ── Inline code ────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: .85em;
  color: var(--text-code);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius);
  white-space: nowrap;
}

/* ── Code blocks ─────────────────────────────────────────────── */
pre {
  background: #020810;
  border: 1px solid rgba(0,255,231,.1);
  border-left: 3px solid var(--clr-neon);
  border-radius: var(--radius);
  padding: var(--s5);
  overflow-x: auto;
  margin-bottom: var(--s5);
  position: relative;
  tab-size: 2;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .88em;
  color: #a8c8e8;
  white-space: pre;
  line-height: 1.8;
}

/* Copy button for code blocks (injected by theme.js) */
.se-copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,255,231,.08);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t-fast);
}
.se-copy-btn:hover {
  background: rgba(0,255,231,.15);
  color: var(--clr-neon);
  border-color: var(--border-hover);
}

/* ── Blockquote ──────────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--clr-neon);
  background: var(--bg2);
  padding: var(--s4) var(--s5);
  margin: var(--s5) 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
  font-style: italic;
}
blockquote cite {
  display: block;
  margin-top: var(--s2);
  font-size: .85em;
  font-style: normal;
  color: var(--clr-neon);
  font-family: var(--font-ui);
}

/* ── Tables ──────────────────────────────────────────────────── */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--s5);
  font-size: .9rem;
}
.entry-content th {
  background: rgba(0,255,231,.05);
  color: var(--clr-neon);
  font-family: var(--font-ui);
  font-size: .8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border);
  text-align: left;
}
.entry-content td {
  padding: var(--s2) var(--s3);
  border: 1px solid rgba(255,255,255,.04);
  vertical-align: top;
}
.entry-content tr:hover td { background: rgba(0,255,231,.015); }

/* ── Media ────────────────────────────────────────────────────── */
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
  display: block;
}

.entry-content img {
  border-radius: var(--radius);
  margin-bottom: var(--s4);
}

figure { margin: var(--s5) 0; }
figcaption {
  font-size: .8rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: var(--s2);
  font-family: var(--font-ui);
}

/* ── Horizontal rule ─────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--s6) 0;
}
hr.se-divider {
  border-color: var(--clr-neon);
  opacity: .3;
  box-shadow: 0 0 8px rgba(0,255,231,.2);
}

/* ── Forms ────────────────────────────────────────────────────── */
input, textarea, select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--clr-neon);
  box-shadow: 0 0 0 3px rgba(0,255,231,.12);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* ── Buttons ─────────────────────────────────────────────────── */
.se-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: var(--s2) var(--s5);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-mid);
  text-decoration: none;
  white-space: nowrap;
}

.se-btn-primary {
  background: var(--clr-neon);
  color: #000;
  border-color: var(--clr-neon);
}
.se-btn-primary:hover {
  background: transparent;
  color: var(--clr-neon);
  box-shadow: var(--glow-neon);
}

.se-btn-outline {
  background: transparent;
  color: var(--clr-neon);
  border-color: var(--clr-neon);
}
.se-btn-outline:hover {
  background: var(--clr-neon);
  color: #000;
  box-shadow: var(--glow-neon);
}

.se-btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.se-btn-ghost:hover {
  color: var(--text-bright);
  border-color: var(--border-hover);
}

/* ── Utility classes ──────────────────────────────────────────── */
.sr-only { position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.text-neon   { color: var(--clr-neon); }
.text-green  { color: var(--clr-green); }
.text-dim    { color: var(--text-dim); }
.text-mono   { font-family: var(--font-mono); }
.text-ui     { font-family: var(--font-ui); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2       { gap: var(--s2); }
.gap-4       { gap: var(--s4); }
.hidden      { display: none !important; }
.truncate    { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes se-fade-in      { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@keyframes se-glow-pulse   { 0%,100%{box-shadow:0 0 8px rgba(0,255,231,.2)} 50%{box-shadow:0 0 24px rgba(0,255,231,.5)} }
@keyframes se-scan         { 0%{background-position:0 0} 100%{background-position:0 100%} }
@keyframes se-blink        { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes se-slide-in-right { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:none} }

.se-fade-in   { animation: se-fade-in .4s ease both; }
.se-glow      { animation: se-glow-pulse 2s ease-in-out infinite; }

/* Skip navigation link — hidden until focused (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s4);
  z-index: calc(var(--z-modal) + 10);
  background: var(--bg);
  color: var(--clr-neon);
  border: 2px solid var(--clr-neon);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: .85rem;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: var(--s4);
  outline: none;
}
