/*
Theme Name: Revengie — The Reverse Engineer
Theme URI: https://revengie.com
Author: G. F. Edward / Jack
Description: str.Heel(Jack) / The Reverse Engineer. Dark mad-lab theme for code & AI videos. YT embeds + GitHub. Domain: revengie.com.
Version: 1.2.2
Text Domain: revengie
Requires at least: 6.0
Requires PHP: 8.0
*/

:root {
  --bg: #0a0e14;
  --bg-elevated: #121820;
  --bg-card: #151c26;
  --fg: #e6f0f5;
  --muted: #8aa0af;
  --cyan: #00e5cc;
  --cyan-dim: #00a091;
  --line: #243040;
  --danger: #ff6b6b;
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --wrap: 72rem;
  --header-height: 4.25rem;
  --radius: 0.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--fg);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 229, 204, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 255, 100, 0.04), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* faint scanline / grid — mad-lab, not corporate */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(0, 229, 204, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 204, 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
}
.site { position: relative; z-index: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-underline-offset: 0.15em; }
a:hover { color: #5ff5e4; }

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  background: var(--cyan);
  color: #041018;
  padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Header — fixed, solid, never covers hero */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site {
  padding-top: var(--header-height);
  min-height: 100vh;
  /* z-index set with body grid overlay */
}
body.admin-bar .site-header { top: 32px; }
body.admin-bar .site { padding-top: calc(var(--header-height) + 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar .site { padding-top: calc(var(--header-height) + 46px); }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-height);
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--fg);
}
.site-brand img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  border-radius: 0.4rem;
  background: transparent;
  border: none;
}
.site-brand span {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none; /* keep str.Heel(Jack) casing */
  color: var(--cyan);
}
@media (max-width: 720px) {
  .site-brand .brand-tag { display: none; }
}
.brand-tag {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 400;
  text-transform: uppercase;
  margin-left: 0.2rem;
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.4rem 0.75rem;
  font: inherit;
  cursor: pointer;
  border-radius: 0.35rem;
}
.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.primary-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--cyan);
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.25rem;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 0.85rem; }
}

/* Hero — in-flow image, no crop */
.hero {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
}
.hero-stage {
  display: block;
  width: 100%;
  min-height: 12rem;
  margin: 0;
  padding: 0;
  background-color: #05080c;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  border-bottom: 1px solid var(--line);
}
.hero-stage-img {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.hero-copy {
  width: 100%;
  text-align: center;
  padding: 1.75rem 0 2.5rem;
  background: var(--bg);
}
.hero-copy-inner {
  max-width: 40rem;
  margin-inline: auto;
  padding: 0 1rem;
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.75rem;
}
.hero-copy h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.9rem;
  color: var(--fg);
}
.hero-lead {
  color: var(--muted);
  margin: 0 0 1.35rem;
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
@media (min-width: 768px) {
  .hero-stage { min-height: 16rem; }
  .hero-copy { padding: 2.1rem 0 2.75rem; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid var(--cyan);
  color: #041018;
  background: var(--cyan);
  border-radius: 0.35rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover {
  background: #5ff5e4;
  color: #041018;
}
.btn-outline {
  background: transparent;
  color: var(--fg);
}
.btn-outline:hover {
  background: rgba(0, 229, 204, 0.12);
  color: var(--cyan);
}

/* Sections */
.section {
  padding: 2.75rem 0 3.25rem;
}
.section-alt {
  background: var(--bg-elevated);
  border-block: 1px solid var(--line);
}
.section-head {
  text-align: center;
  margin-bottom: 2rem;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.5rem;
}
.section-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 600;
}
.rule {
  height: 1px;
  width: 4rem;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

/* Project / video grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
  border-color: var(--cyan-dim);
  transform: translateY(-2px);
  color: inherit;
}
.project-card-thumb {
  aspect-ratio: 16 / 9;
  background: #0d1218;
  overflow: hidden;
}
.project-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-card-body {
  padding: 1rem 1.05rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.project-card .meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.project-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
.project-card .excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.project-card .tags {
  margin-top: auto;
  padding-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan-dim);
  letter-spacing: 0.04em;
}

/* Single project */
.entry {
  padding: 2rem 0 3rem;
}
.entry-header {
  max-width: 46rem;
  margin: 0 auto 1.5rem;
  text-align: center;
}
.entry-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin: 0.4rem 0 0.75rem;
}
.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.video-wrap {
  position: relative;
  width: min(100%, 56rem);
  margin: 0 auto 1.75rem;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.entry-content {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--fg);
}
.entry-content > *:first-child { margin-top: 0; }
.entry-content a { word-break: break-word; }
.entry-content pre,
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.entry-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}
.link-box {
  max-width: 42rem;
  margin: 1.75rem auto 0;
  padding: 1.15rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
}
.link-box h2 {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}
.link-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.link-box li { margin: 0.4rem 0; }
.link-box a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
}
.link-box a:hover { text-decoration: underline; }

/* Split CTA strip */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  max-width: 48rem;
  margin: 0 auto;
}
.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  text-align: center;
}
.cta-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.cta-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #070b10;
  padding: 2.5rem 0 2rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  margin-bottom: 0.75rem;
  border-radius: 0.4rem;
}
.footer-brand p {
  color: var(--muted);
  margin: 0;
  max-width: 24rem;
  font-size: 0.95rem;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.75rem;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col li { margin: 0.4rem 0; }
.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-col a:hover { color: var(--cyan); }
.site-end {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-align: center;
}

.empty-box {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* ==========================================================================
   Projects archive — banner-scene-only lab backdrop + left terminal stack
   ========================================================================== */
.projects-lab {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  overflow: hidden;
}
.projects-lab-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #05080c;
  background-image: var(--lab-bg);
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
/* Keep art readable: dark glass wash on left, clear-ish on right */
.projects-lab-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(6, 10, 16, 0.88) 0%,
    rgba(6, 10, 16, 0.72) 42%,
    rgba(6, 10, 16, 0.35) 68%,
    rgba(6, 10, 16, 0.2) 100%
  );
}
.projects-lab-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem 0 3rem;
  min-height: calc(100vh - var(--header-height));
}
.projects-lab-rail {
  max-width: 36rem;
  width: 100%;
}
.projects-lab-stage {
  /* spacer column so the lab art stays visible on the right */
  min-height: 12rem;
  pointer-events: none;
}
@media (max-width: 900px) {
  .projects-lab-inner {
    grid-template-columns: 1fr;
  }
  .projects-lab-stage {
    display: none;
  }
  .projects-lab-bg {
    background-position: center center;
  }
  .projects-lab-bg::after {
    background: linear-gradient(
      180deg,
      rgba(6, 10, 16, 0.82) 0%,
      rgba(6, 10, 16, 0.9) 100%
    );
  }
  .projects-lab-rail {
    max-width: none;
  }
}

/* Shared terminal chrome */
.term-window {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(8, 14, 22, 0.78);
  border: 1px solid rgba(0, 229, 204, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-bottom: 1rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
a.term-window:hover {
  border-color: rgba(0, 229, 204, 0.75);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  color: inherit;
}
.term-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  background: rgba(12, 20, 28, 0.92);
  border-bottom: 1px solid rgba(0, 229, 204, 0.18);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.term-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: 0 0 auto;
}
.term-dot-r { background: #ff5f56; }
.term-dot-y { background: #ffbd2e; }
.term-dot-g { background: #27c93f; }
.term-path {
  margin-left: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(0, 200, 180, 0.85);
}
.term-body {
  padding: 0.95rem 1.05rem 1.1rem;
}
.projects-lab-head h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}
.projects-lab-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.projects-term-list {
  display: flex;
  flex-direction: column;
  gap: 0; /* term-window has its own margin */
}
.project-term-body {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.9rem;
  align-items: start;
}
@media (max-width: 520px) {
  .project-term-body {
    grid-template-columns: 1fr;
  }
}
.project-term-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 204, 0.2);
  background: #0a1018;
}
.project-term-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-term-copy .meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.project-term-copy .meta-idx {
  color: var(--cyan);
}
.project-term-copy h2 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}
.project-term-copy .excerpt {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.term-open {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
}
.projects-lab-pager {
  margin-top: 0.5rem;
}
.projects-lab-pager .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.projects-lab-pager a,
.projects-lab-pager span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
}
