/* Journal of High School Computer Science (JHCS)
   Dark-mode tech/AI aesthetic
   Palette: near-black bg, electric blue primary, neon teal accent, subtle amber CTA */

:root {
  --bg:        #0a0e1a;
  --bg-2:      #0d1220;
  --panel:     #111a2e;
  --panel-2:   #16223d;
  --line:      #1e2a44;
  --line-2:    #263452;
  --ink:       #e6ecf5;
  --ink-dim:   #b3c0d4;
  --muted:     #7f8ea6;
  --cyan:      #00d9ff;
  --cyan-2:    #22e2ff;
  --teal:      #00e5b8;
  --amber:     #ffb84a;
  --amber-2:   #ffcf7a;
  --err:       #ff6b7a;
  --ok:        #43e089;
  --maxw:      1120px;
  --radius:    14px;
  --shadow:    0 20px 60px rgba(0,0,0,.45);
  --glow-cyan: 0 0 0 1px rgba(0,217,255,.4), 0 8px 30px rgba(0,217,255,.18);
  --sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:      "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* Subtle circuit-grid background motif */
  background-image:
    radial-gradient(1200px 700px at 85% -10%, rgba(0,217,255,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(0,229,184,.05), transparent 60%),
    linear-gradient(rgba(255,255,255,0.020) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.020) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
  background-attachment: fixed;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-2); text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,14,26,.78);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--maxw); margin: 0 auto;
  flex-wrap: wrap; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 0 12px rgba(0,217,255,.25)); }
.brand .bt {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  letter-spacing: .04em; color: var(--ink);
  display: block; line-height: 1;
}
.brand .bt::before { content: "<"; color: var(--cyan); margin-right: 1px; }
.brand .bt::after  { content: "/>"; color: var(--cyan); margin-left: 1px; }
.brand .bs {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; color: var(--muted); text-transform: uppercase;
  display: block; margin-top: 4px;
}
.menu { display: flex; gap: 2px; flex-wrap: wrap; }
.menu a {
  color: var(--ink-dim); padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; font-family: var(--mono);
  letter-spacing: .01em; transition: background-color .15s, color .15s;
}
.menu a:hover { background: rgba(0,217,255,.08); color: var(--cyan); }
.menu a.active {
  color: var(--cyan);
  background: rgba(0,217,255,.10);
  box-shadow: inset 0 0 0 1px rgba(0,217,255,.32);
}

/* ============ Hero ============ */
.hero {
  padding: 84px 0 76px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  /* Subtle animated node graph overlay via SVG data URI-ish gradient */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(0,217,255,.12), transparent 65%),
    radial-gradient(500px 260px at 85% 80%, rgba(0,229,184,.10), transparent 65%);
  pointer-events: none;
}
.hero .container { position: relative; display: grid; gap: 18px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0,217,255,.08);
  border: 1px solid rgba(0,217,255,.28);
  padding: 6px 12px; border-radius: 999px; width: fit-content;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.06; margin: 6px 0 0;
  font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink);
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--cyan), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(16px, 1.9vw, 20px);
  max-width: 780px; color: var(--ink-dim); margin: 4px 0 0;
}
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 10px;
  font-family: var(--mono); font-weight: 600; font-size: 14.5px;
  letter-spacing: .02em;
  background: var(--cyan); color: #051425;
  border: 1px solid transparent;
  cursor: pointer;
  transition: box-shadow .2s, transform .06s, background-color .2s, color .2s, border-color .2s;
}
.btn:hover {
  background: var(--cyan-2);
  color: #051425;
  box-shadow: 0 6px 24px rgba(0,217,255,.36), 0 0 0 3px rgba(0,217,255,.14);
}
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-2);
}
.btn.ghost:hover {
  background: rgba(0,217,255,.06);
  color: var(--cyan);
  border-color: rgba(0,217,255,.4);
  box-shadow: none;
}
.btn.amber {
  background: var(--amber); color: #2a1c00;
}
.btn.amber:hover {
  background: var(--amber-2);
  box-shadow: 0 6px 24px rgba(255,184,74,.35), 0 0 0 3px rgba(255,184,74,.14);
}
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.gray { background: var(--panel-2); color: var(--ink-dim); }
.btn.gray:hover { background: var(--line-2); color: var(--ink); box-shadow: none; }

/* ============ Sections ============ */
section.block { padding: 64px 0; }
.section-title {
  font-family: var(--mono);
  font-size: clamp(24px, 3.4vw, 34px);
  color: var(--ink);
  margin: 0 0 10px;
  font-weight: 700; letter-spacing: -0.01em;
}
.section-title .accent { color: var(--cyan); }
.section-sub { color: var(--ink-dim); max-width: 780px; margin: 0 0 28px; }

/* ============ Stats ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--teal));
  opacity: .7;
}
.stat:hover { border-color: rgba(0,217,255,.35); transform: translateY(-2px); }
.stat .n {
  font-family: var(--mono); font-size: 30px; color: var(--cyan);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
}
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; font-family: var(--mono); letter-spacing: .04em; }

/* ============ Cards / Grid ============ */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,217,255,.35);
  box-shadow: 0 12px 40px rgba(0,217,255,.10);
}
.card h3 {
  margin: 0 0 8px; color: var(--ink);
  font-family: var(--mono); font-size: 18px; font-weight: 700;
  letter-spacing: -0.005em;
}
.card p { margin: 0; color: var(--ink-dim); font-size: 15px; }
.card .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(0,217,255,.10); color: var(--cyan);
  border: 1px solid rgba(0,217,255,.28);
  font-family: var(--mono); font-weight: 700;
  margin-bottom: 14px;
}

/* ============ Pills ============ */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--ink-dim);
  font-family: var(--mono);
  transition: border-color .2s, color .2s;
}
.pill:hover { border-left-color: var(--teal); color: var(--ink); }

/* ============ Editor / Avatar ============ */
.editor {
  display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(135deg, #0a1a2e, #0f2440);
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  border: 2px solid rgba(0,217,255,.4);
  box-shadow: 0 0 30px rgba(0,217,255,.18);
}
.editor h3 {
  margin: 0; color: var(--ink);
  font-family: var(--mono); font-size: 20px; font-weight: 700;
}
.editor .role {
  color: var(--cyan); font-family: var(--mono);
  font-weight: 600; font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase;
}
.editor p { margin: 8px 0 0; color: var(--ink-dim); font-size: 15px; }

/* ============ Timeline ============ */
.timeline { position: relative; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 18px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, var(--cyan), var(--teal), transparent);
  opacity: .5;
}
.tl-item { position: relative; padding: 0 0 22px 52px; }
.tl-item .dot {
  position: absolute; left: 8px; top: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(0,217,255,.5);
}
.tl-item h4 {
  margin: 0 0 3px; color: var(--ink);
  font-family: var(--mono); font-size: 16px; font-weight: 600;
}
.tl-item p { margin: 0; color: var(--ink-dim); font-size: 14px; }

/* ============ Article (guidelines / policy) ============ */
.article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 44px;
}
.article h2 {
  font-family: var(--mono);
  color: var(--ink);
  margin: 34px 0 12px;
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.005em;
}
.article h2:first-child { margin-top: 0; }
.article h2 .num {
  color: var(--cyan); font-family: var(--mono); margin-right: 8px;
}
.article h3 {
  color: var(--cyan); margin: 24px 0 6px;
  font-family: var(--mono); font-size: 17px; font-weight: 600;
}
.article p, .article li { color: var(--ink-dim); font-size: 15.5px; }
.article strong { color: var(--ink); }
.article ul, .article ol { padding-left: 24px; }
.article li { margin: 6px 0; }
.article code {
  font-family: var(--mono);
  background: var(--bg-2);
  color: var(--teal);
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line);
  font-size: 13.5px;
}

.toc {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 28px;
  font-family: var(--mono);
}
.toc strong { color: var(--cyan); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.toc ol { margin: 10px 0 0; padding-left: 22px; }
.toc a { color: var(--ink-dim); font-size: 14px; }
.toc a:hover { color: var(--cyan); }

/* ============ Tables ============ */
table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0; font-size: 14.5px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
th, td {
  padding: 12px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--bg-2); color: var(--cyan);
  font-family: var(--mono); font-weight: 600;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
}
tbody tr:hover { background: rgba(0,217,255,.03); }
tbody tr:last-child td { border-bottom: none; }

/* ============ Callout ============ */
.callout {
  border-left: 3px solid var(--amber);
  background: rgba(255,184,74,.06);
  border-radius: 10px;
  padding: 16px 20px; margin: 18px 0;
  color: var(--ink-dim); font-size: 14.5px;
}
.callout strong { color: var(--amber); }

/* ============ Cover / TOC ============ */
.cover-band {
  background:
    radial-gradient(500px 220px at 80% -10%, rgba(0,217,255,.14), transparent 70%),
    linear-gradient(160deg, var(--bg-2), var(--panel));
  color: var(--ink);
  padding: 54px 0;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cover-band .vol {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--cyan);
}
.cover-band h2 {
  font-family: var(--mono);
  font-size: clamp(24px, 4vw, 34px);
  margin: 12px auto 10px; max-width: 780px;
  color: var(--ink); font-weight: 700; letter-spacing: -0.01em;
}
.cover-band p { color: var(--ink-dim); max-width: 660px; margin: 0 auto; }

.toc-issue {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.toc-issue .toc-head {
  background: var(--bg-2);
  color: var(--ink);
  padding: 18px 24px;
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--line);
}
.toc-issue .toc-head .meta { font-size: 12px; color: var(--muted); letter-spacing: .06em; font-weight: 500; }
.toc-entry {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  transition: background-color .15s;
}
.toc-entry:hover { background: rgba(0,217,255,.03); }
.toc-entry:last-child { border-bottom: none; }
.toc-entry .cat {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan); font-weight: 600;
}
.toc-entry h3 {
  font-family: var(--mono); color: var(--ink);
  margin: 6px 0 4px; font-size: 17px; font-weight: 600;
}
.toc-entry .authors { color: var(--muted); font-size: 14px; }
.toc-entry .pp { color: var(--muted); font-size: 13px; float: right; font-family: var(--mono); }

/* ============ Masthead (top of home) ============ */
.masthead {
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  border-bottom: 1px solid var(--line);
}
.masthead .container { padding: 34px 24px 26px; }
.mh-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; text-align: center; }
.mh-top img { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 0 24px rgba(0,217,255,.28)); }
.mh-titles { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mh-titles .pre {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .32em; text-transform: uppercase; color: var(--cyan);
}
.mh-titles h1 {
  font-family: var(--mono); color: var(--ink);
  font-size: clamp(28px, 4.6vw, 42px);
  margin: 4px 0;
  font-weight: 800; line-height: 1.08;
  letter-spacing: -0.02em;
}
.mh-titles h1 .accent { color: var(--cyan); }
.mh-titles .sub { color: var(--ink-dim); font-size: 15px; font-family: var(--mono); }

/* ============ Footer ============ */
.site-footer {
  background: var(--bg-2);
  color: var(--ink-dim);
  margin-top: 40px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
}
.site-footer .container {
  display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; align-items: center;
}
.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--cyan); }
.site-footer .small { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.site-footer strong { color: var(--ink); font-family: var(--mono); }

/* ============ Fade-in on scroll ============ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; text-align: center; }
  .avatar { margin: 0 auto; }
  .article { padding: 28px 22px; }
  .hero { padding: 60px 0 52px; }
}

/* ============ Selection ============ */
::selection { background: rgba(0,217,255,.35); color: #fff; }
