/* ═══════════════════════════════════════════════════════════════
   JACKSON EIPPERT — v2
   Terminal-noir. Spacecraft HUD. Precision utility.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&family=IBM+Plex+Mono:wght@300;400;500&family=Syne:wght@400;500;600;700;800&display=swap');

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg-void:    #020304;
  --bg-deep:    #060809;
  --bg-surface: rgba(8, 12, 16, 0.92);
  --bg-raised:  rgba(14, 20, 28, 0.88);
  --bg-glass:   rgba(255, 255, 255, 0.02);

  --border-faint:  rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-medium: rgba(255, 255, 255, 0.16);

  --text-primary:   #e8edf2;
  --text-secondary: #7a8a9e;
  --text-tertiary:  #4a5568;

  --accent:        #ff6a2b;
  --accent-dim:    rgba(255, 106, 43, 0.15);
  --accent-glow:   rgba(255, 106, 43, 0.35);
  --accent-hot:    #ff8c4a;
  --accent-ember:  #e54e1a;

  --signal-green:  #2dd4a0;
  --signal-green-glow: rgba(45, 212, 160, 0.3);

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Blue Theme ──────────────────────────────────────────────── */
[data-theme="blue"] {
  --accent:        #3b82f6;
  --accent-dim:    rgba(59, 130, 246, 0.15);
  --accent-glow:   rgba(59, 130, 246, 0.35);
  --accent-hot:    #60a5fa;
  --accent-ember:  #2563eb;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-void);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

::selection {
  background: var(--accent);
  color: var(--bg-void);
}

/* ── Canvas & Overlay ────────────────────────────────────────── */
.shader-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scanline-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.22;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 4px
    );
  mix-blend-mode: overlay;
}

.scanline-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    transparent 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* ── Page Chrome ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(to bottom, rgba(2, 3, 4, 0.95) 0%, rgba(2, 3, 4, 0.8) 70%, transparent 100%);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}

.brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  transition: color 300ms var(--ease-out);
  position: relative;
}

.brand::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms var(--ease-out);
}

.brand:hover::after { transform: scaleX(1); }
.brand:hover { color: var(--accent-hot); }

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--accent);
  cursor: pointer;
  transition: background 300ms var(--ease-out), transform 300ms var(--ease-spring), box-shadow 300ms var(--ease-out);
  box-shadow: 0 0 6px var(--accent-glow);
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: scale(1.35);
  box-shadow: 0 0 12px var(--accent-glow);
}

.theme-toggle:active {
  transform: scale(0.9);
}

.nav-links {
  display: flex;
  gap: 0.15rem;
}

.nav-links a {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 200ms ease, background 200ms ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ── Layout ──────────────────────────────────────────────────── */
.page-shell {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem;
  display: grid;
  gap: 1.25rem;
}

/* ── Panel System ────────────────────────────────────────────── */
.panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  transition: border-color 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}

/* Corner accents — top-left and bottom-right */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0.25;
  transition: opacity 400ms var(--ease-out);
}

.panel::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  border-radius: var(--radius-lg) 0 0 0;
}

.panel::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-radius: 0 0 var(--radius-lg) 0;
}

.panel:hover::before,
.panel:hover::after {
  opacity: 0.55;
}

.panel:hover {
  border-color: var(--border-subtle);
}

/* ── Panel Header Variant ────────────────────────────────────── */
.panel-header {
  background: transparent;
  border: none;
  padding: 2.5rem 0 1rem;
}

.panel-header::before,
.panel-header::after { display: none; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 2.25rem 3rem;
  background:
    radial-gradient(ellipse 50% 80% at 0% 0%, var(--accent-dim) 0%, transparent 60%),
    var(--bg-surface);
  border-color: var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero::before { opacity: 0.5; }
.hero::after  { opacity: 0.5; }

.hero h1 {
  max-width: 100%;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
}

.hero p {
  max-width: 70ch;
  font-size: clamp(1rem, 1.65vw, 1.22rem);
  line-height: 1.9;
}

/* ── Typography ──────────────────────────────────────────────── */
h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 18ch;
  color: var(--text-primary);
}

h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-top: 0.85rem;
  max-width: 58ch;
}

.eyebrow {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 280ms var(--ease-out);
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
}

.button:hover::before { opacity: 1; }

.button-primary {
  background: var(--accent);
  color: var(--bg-void);
  border-color: var(--accent);
  font-weight: 600;
}

.button-primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  box-shadow: 0 0 24px var(--accent-dim), 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.button-primary:active {
  transform: translateY(0);
  background: var(--accent-ember);
}

.button-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

.button-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.button-ghost:active {
  transform: translateY(0);
}

/* ── Text Links ──────────────────────────────────────────────── */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 200ms ease, gap 300ms var(--ease-out);
}

.text-link::after {
  content: '\2192';
  font-size: 0.8rem;
  transition: transform 300ms var(--ease-out);
}

.text-link:hover {
  color: var(--accent-hot);
}

.text-link:hover::after {
  transform: translateX(4px);
}

/* ── Grid Layouts ────────────────────────────────────────────── */
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stacked-panels {
  display: grid;
  gap: 0.75rem;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── Post Cards ──────────────────────────────────────────────── */
.post-card {
  padding: 1.75rem 2rem;
  cursor: default;
  transition: border-color 300ms var(--ease-out), transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.post-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-meta span:first-child::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.6;
}

/* ── Project Cards ───────────────────────────────────────────── */
.project-card {
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: border-color 300ms var(--ease-out), transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.project-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card .project-index {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 1rem;
}

.project-card h2 {
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.project-card p {
  flex: 1;
}

.project-card .text-link {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* Span full width for the third card if odd count */
.project-grid > :nth-child(3):last-child {
  grid-column: 1 / -1;
}

/* ── Detail Pages ────────────────────────────────────────────── */
.detail-content > :first-child {
  margin-top: 0;
}

.detail-content > * + * {
  margin-top: 0.95rem;
}

.detail-content h1 {
  max-width: 100%;
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1.1;
}

.detail-content h2 {
  margin-top: 1.5rem;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}

.detail-content h3 {
  margin-top: 1.25rem;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
}

.detail-content ul,
.detail-content ol {
  margin-top: 0.75rem;
  padding-left: 1.35rem;
  color: var(--text-secondary);
  display: grid;
  gap: 0.45rem;
}

.detail-content li {
  line-height: 1.7;
}

.detail-content p,
.detail-content li {
  max-width: 78ch;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  line-height: 1.85;
}

.detail-content a {
  color: var(--accent-hot);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 0.2em;
  transition: color 220ms ease, text-decoration-color 220ms ease;
}

.detail-content a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.detail-content .repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}

.detail-content .repo-link::after {
  content: '\2197';
  font-size: 0.78rem;
  line-height: 1;
}

.detail-content figure {
  width: 100%;
  max-width: 78ch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-raised);
}

.detail-content figure img {
  width: 100%;
  height: auto;
}

.detail-content figcaption {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border-faint);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.detail-back {
  width: fit-content;
  margin-top: 0.35rem;
}

/* ── Contact Layout ──────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.25rem;
  align-items: start;
}

.contact-info h2 {
  font-size: 1.1rem;
}

.contact-list {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.85rem;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact-list .contact-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.contact-list a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 200ms ease;
  border-bottom: 1px solid transparent;
  width: fit-content;
}

.contact-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

/* ── Contact Form ────────────────────────────────────────────── */
.contact-form-wrap h2 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.contact-form {
  display: grid;
  gap: 1.1rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
  outline: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-tertiary);
  font-weight: 300;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--accent-dim);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .button {
  justify-self: start;
  margin-top: 0.25rem;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 2rem 2.5rem;
  border-top: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-sig {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  transition: color 200ms ease;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ── Entrance Animations ─────────────────────────────────────── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.site-header {
  animation: fade-in 600ms var(--ease-out) both;
  animation-delay: 100ms;
}

.hero {
  animation: fade-up 700ms var(--ease-out) both;
  animation-delay: 200ms;
}

.panel-header {
  animation: fade-up 600ms var(--ease-out) both;
  animation-delay: 150ms;
}

.grid-two .panel:nth-child(1),
.stacked-panels .panel:nth-child(1),
.project-grid .panel:nth-child(1) {
  animation: fade-up 600ms var(--ease-out) both;
  animation-delay: 350ms;
}

.grid-two .panel:nth-child(2),
.stacked-panels .panel:nth-child(2),
.project-grid .panel:nth-child(2) {
  animation: fade-up 600ms var(--ease-out) both;
  animation-delay: 450ms;
}

.stacked-panels .panel:nth-child(3),
.project-grid .panel:nth-child(3) {
  animation: fade-up 600ms var(--ease-out) both;
  animation-delay: 550ms;
}

.contact-layout .panel:nth-child(1) {
  animation: fade-up 600ms var(--ease-out) both;
  animation-delay: 350ms;
}

.contact-layout .panel:nth-child(2) {
  animation: fade-up 600ms var(--ease-out) both;
  animation-delay: 450ms;
}

.site-footer {
  animation: fade-in 600ms var(--ease-out) both;
  animation-delay: 700ms;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0;
  }

  .nav-links a {
    padding: 0.4rem 0.6rem;
  }

  .page-shell {
    padding: 0.75rem 1.25rem 3rem;
    gap: 1rem;
  }

  .hero {
    padding: 2.25rem 1.5rem 2rem;
  }

  .panel {
    padding: 1.5rem 1.25rem;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-grid > :nth-child(3):last-child {
    grid-column: auto;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 2rem;
  }

  h1 {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .hero {
    padding: 1.75rem 1.15rem 1.5rem;
  }

  .panel {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .panel::before,
  .panel::after {
    width: 14px;
    height: 14px;
  }
}

/* ── Fallback ────────────────────────────────────────────────── */
.shader-fallback {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(255, 106, 43, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #030405 0%, #060809 100%);
}
