/* ===========================================================
   Tony Salazar — portfolio design system (v2)
   Near-black neutral base, restrained hot-pink + cyan accents
   used only where they carry meaning (links, labels, hover
   states) — not painted across the whole page.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0b0b10;
  --bg-alt: #121218;
  --panel: #15151d;
  --line: #24242e;
  --line-soft: #1a1a22;
  --text: #eceef2;
  --text-muted: #9699a6;
  --pink: #ff3d94;
  --cyan: #38e1ff;
  --max-width: 780px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Header / nav ---------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 16, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

header.site-header nav {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

header.site-header .site-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
  text-decoration: none;
  color: var(--text);
}

header.site-header a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

header.site-header a:hover { color: var(--text); }

header.site-header .nav-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

header.site-header .nav-icons svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  transition: fill 0.2s ease;
}

header.site-header .nav-icons a:hover svg { fill: var(--pink); }

/* ---------- Layout ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.wide { max-width: 920px; }

h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-top: 3rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

h3 { font-family: var(--font-display); font-size: 1.05rem; }

.pitch {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-top: 0.6rem;
  max-width: 62ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

/* ---------- Buttons / links ---------- */

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.text-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.text-link:hover {
  color: var(--pink);
  text-decoration-color: var(--pink);
}

/* ---------- Hero image / figures ---------- */

.hero-image { margin: 1.75rem 0; }

.hero-image img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}

.hero-image figcaption {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}

/* ---------- Specs table ---------- */

table.specs {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.92rem;
}

table.specs th, table.specs td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

table.specs th {
  color: var(--text-muted);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: none;
}

table.specs td:first-child { color: var(--text); font-weight: 500; }
table.specs td.mono, table.specs th.mono { font-family: var(--font-mono); color: var(--cyan); }

/* ---------- Groups + accordion gallery ---------- */

.group-heading {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-top: 2.2rem;
  margin-bottom: 0;
}

.gallery-item { border-bottom: 1px solid var(--line); }
.gallery-item:last-child { border-bottom: none; }

.gallery-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.2s ease;
}

.gallery-item summary::-webkit-details-marker { display: none; }

.gallery-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--text-muted);
  font-weight: 700;
}

.gallery-item[open] summary::before { content: "\2212"; color: var(--pink); }
.gallery-item summary:hover { color: var(--pink); }

.gallery-body { padding: 0 0 1.5rem; }

.gallery-body img {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.gallery-body .image-pair {
  display: flex;
  gap: 0.75rem;
  max-width: 680px;
  margin: 0 auto 1rem;
}

.gallery-body .image-pair img { max-width: none; margin: 0; width: 50%; }

.gallery-body p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: left;
}

@media (max-width: 600px) {
  .gallery-body .image-pair { flex-direction: column; }
  .gallery-body .image-pair img { width: 100%; }
}

/* ---------- Callout boxes ---------- */

.repo-callout, .security-note {
  margin-top: 2.5rem;
  padding: 1.15rem 1.35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
}

.repo-callout a, .security-note a { color: var(--cyan); }

.security-note { border-left: 2px solid var(--cyan); }

.security-note .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  display: block;
  margin-bottom: 0.4rem;
}

/* ---------- Project cards (index / projects list) ---------- */

.project-list { display: flex; flex-direction: column; margin-top: 1.5rem; }

.project-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.2s ease;
}

.project-card:hover { padding-left: 0.4rem; }
.project-card:last-child { border-bottom: none; }

.project-card .project-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.project-card:hover .project-title { color: var(--pink); }

.project-card .project-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}

.project-card p { color: var(--text-muted); margin: 0.4rem 0 0; }

/* ---------- Hero node diagram (index page) ---------- */

.node-diagram { margin: 2rem 0; }
.node-diagram svg { width: 100%; height: auto; display: block; }

.node-diagram .node-line {
  stroke-dasharray: 5 7;
  animation: dash-flow 4s linear infinite;
}

.node-diagram .node-dot { filter: drop-shadow(0 0 5px currentColor); }

@keyframes dash-flow { to { stroke-dashoffset: -24; } }

@media (prefers-reduced-motion: reduce) {
  .node-diagram .node-line { animation: none; }
}

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.site-footer a { color: var(--text-muted); text-decoration: none; }
footer.site-footer a:hover { color: var(--pink); }

/* Background node-grid canvas */
#bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

/* Terminal intro box */
.terminal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem auto;
  max-width: var(--max-width);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  min-height: 7.5rem;
}
.terminal-box .prompt { color: var(--pink); }
.terminal-box .output { color: var(--cyan); }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Cursor glow */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 61, 148, 0.14), rgba(56, 225, 255, 0.05) 55%, transparent 75%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  mix-blend-mode: screen;
  will-change: left, top;
}
