/*
 * ════════════════════════════════════════════
 * KNUCKLES GLASS — style.css
 * Shared styles inherited by ALL pages.
 *
 * HOW TO USE:
 * Add this to the <head> of every page:
 *   <link rel="stylesheet" href="style.css">
 *
 * STRUCTURE:
 *  1. Design Tokens (colors, fonts) ← change look here
 *  2. Reset & Base
 *  3. Blueprint + Scanline overlays
 *  4. Navigation
 *  5. Page wrapper
 *  6. Section dividers
 *  7. Cards (project cards, reusable)
 *  8. Terminal (shared styles)
 *  9. Instagram nudge bar
 * 10. Footer
 * 11. Typography utilities
 * 12. Animations
 * 13. Responsive / mobile
 * ════════════════════════════════════════════
 */


/* ════════════════════════════════════════════
   1. DESIGN TOKENS
   ── Change colors and fonts HERE only.
   ── Every component references these variables.
   ════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:         #0d0f0b;   /* main page background */
  --bg2:        #111410;   /* cards, panels */
  --bg3:        #080a07;   /* terminal, deep inset */

  /* Primary accent — phosphor green */
  --green:      #4aff91;
  --green-dim:  #3ab473;   /* borders, muted green */

  /* Secondary accent — blueprint blue */
  --blue:       #7ecfcf;

  /* Earth tones — organic/personal accent */
  --earth1:     #a08060;   /* warm highlight */
  --earth2:     #6b5040;   /* muted border */

  /* Text */
  --text:       #c8d4c0;   /* primary body text */
  --muted:      #4a5445;   /* secondary/faded text */

  /* Blueprint grid overlay opacity */
  --grid:       rgba(74, 255, 145, 0.04);

  /* Fonts
     ── Swap font names here to change site-wide typography
     ── Also update the Google Fonts <link> in each page <head> */
  --font-mono:  'Share Tech Mono', monospace;
  --font-serif: 'Crimson Pro', Georgia, serif;

  /* Layout */
  --max-width:  1000px;
  --page-pad:   2rem;
}


/* ════════════════════════════════════════════
   2. RESET & BASE
   ════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}


/* ════════════════════════════════════════════
   3. DECORATIVE OVERLAYS (fixed, non-interactive)
   ── Blueprint grid sits behind everything
   ── CRT scanlines sit above grid, below content
   ════════════════════════════════════════════ */

/* Blueprint grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* CRT scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.07) 2px,
    rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index: 1;
}


/* ════════════════════════════════════════════
   4. NAVIGATION
   ── Sticky top bar, scrollable on mobile
   ── .nav-logo  : site name/brand left side
   ── .shop      : highlighted shop link
   ── Standard links: muted, highlight on hover
   ──
   ── TO ADD A PAGE: copy an <a> in the HTML,
      update href and label text
   ── Keep SHOP first after the logo always
   ════════════════════════════════════════════ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 11, 0.95);
  border-bottom: 1px solid var(--green-dim);
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  text-decoration: none;
  padding: 1rem 1.5rem 1rem 0;
  border-right: 1px solid var(--green-dim);
  margin-right: 0.5rem;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(74, 255, 145, 0.4);
  flex-shrink: 0;
}

nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  padding: 1rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  transition: color 0.2s;
}
nav a:hover,
nav a.active { color: var(--green); }

/* Highlighted shop CTA in nav */
nav a.shop {
  color: var(--green);
  border: 1px solid var(--green-dim);
  margin-left: 0.5rem;
  padding: 0.4rem 1rem;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}
nav a.shop:hover {
  background: rgba(74, 255, 145, 0.08);
}


/* ════════════════════════════════════════════
   5. PAGE WRAPPER
   ── All page content sits in .wrapper
   ── z-index 2 puts it above the overlays
   ════════════════════════════════════════════ */
.wrapper {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--page-pad);
}


/* ════════════════════════════════════════════
   6. SECTION DIVIDERS
   ── Used between every major section
   ── Text label centered with fading lines
   ════════════════════════════════════════════ */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  white-space: nowrap;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green-dim), transparent);
}


/* ════════════════════════════════════════════
   7. PROJECT CARDS
   ── Reusable on homepage and branch pages
   ── .card        : green (technical) variant
   ── .card.earth  : earth-tone (personal) variant
   ──
   ── TO ADD A CARD: copy card HTML block,
      update data-index, card-tag, h3, p, href
   ════════════════════════════════════════════ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--green-dim);
  padding: 1.5rem;
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  animation: fadeIn 0.6s both;
}

/* Staggered fade-in for card grids */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* Index badge — top right corner */
.card::before {
  content: attr(data-index);
  position: absolute;
  top: -1px;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--green);
  background: var(--bg2);
  padding: 0 0.4rem;
  border: 1px solid var(--green-dim);
  border-top: none;
}

.card:hover {
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(74, 255, 145, 0.07);
}

/* Earth variant */
.card.earth { border-color: var(--earth2); }
.card.earth::before { color: var(--earth1); border-color: var(--earth2); }
.card.earth:hover { border-color: var(--earth1); box-shadow: 0 8px 30px rgba(160, 128, 96, 0.08); }
.card.earth .card-accent { background: var(--earth1); box-shadow: 0 0 8px var(--earth1); }

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--blue);
  letter-spacing: 0.15em;
  margin-bottom: 0.6rem;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Glowing status dot — bottom right */
.card-accent {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.5;
  box-shadow: 0 0 8px var(--green);
}


/* ════════════════════════════════════════════
   8. TERMINAL (shared styles)
   ── Full interactive terminal on homepage
   ── Simpler read-only version on branch pages
   ── Color utility classes: t-green, t-blue, etc.
   ════════════════════════════════════════════ */
.terminal {
  background: var(--bg3);
  border: 1px solid var(--green-dim);
  margin-bottom: 3rem;
  animation: fadeIn 0.6s 0.6s both;
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--green-dim);
  background: rgba(74, 255, 145, 0.03);
}

.term-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.term-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-left: 0.25rem;
}

.term-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  max-height: 320px;
  overflow-y: auto;
}

/* Terminal color utilities
   ── Use these classes on <span> inside terminal output */
.t-green { color: var(--green); }
.t-dim   { color: var(--green-dim); }
.t-blue  { color: var(--blue); }
.t-earth { color: var(--earth1); }
.t-text  { color: var(--text); }
.t-muted { color: var(--muted); }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.prompt { color: var(--green); font-family: var(--font-mono); }

.term-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex: 1;
  caret-color: var(--green);
}

/* Blinking block cursor */
.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--green);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}


/* ════════════════════════════════════════════
   9. INSTAGRAM NUDGE BAR
   ── Shown at bottom of homepage
   ── Update text + link in HTML when new post drops
   ════════════════════════════════════════════ */
.ig-nudge {
  border: 1px solid var(--earth2);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  animation: fadeIn 0.6s 0.8s both;
}

.ig-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--earth1);
  box-shadow: 0 0 10px var(--earth1);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.ig-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--earth1);
  letter-spacing: 0.08em;
  flex: 1;
}

.ig-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--earth1);
  text-decoration: none;
  border: 1px solid var(--earth2);
  padding: 0.4rem 1rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.ig-link:hover { background: rgba(160, 128, 96, 0.1); }


/* ════════════════════════════════════════════
   10. FOOTER
   ── Update email in HTML if it changes
   ════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--muted);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}


/* ════════════════════════════════════════════
   11. TYPOGRAPHY UTILITIES
   ── Reusable text classes across all pages
   ════════════════════════════════════════════ */

/* Monospace text block */
.mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.mono span { color: var(--green); }

/* Small system/status line */
.sys-line {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.sys-line span { color: var(--green); }

/* Page/section heading */
.page-title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--green);
  line-height: 1;
  text-shadow: 0 0 30px rgba(74, 255, 145, 0.2);
}

/* Italic intro/tagline */
.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--earth1);
  margin-top: 0.5rem;
  font-weight: 300;
}

/* Status badge — inline pill */
.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--green-dim);
  color: var(--green);
  margin-top: 0.75rem;
}
.status-badge.earth {
  border-color: var(--earth2);
  color: var(--earth1);
}
.status-badge.active::before { content: '● '; }
.status-badge.wip::before    { content: '◐ '; }
.status-badge.done::before   { content: '○ '; }

/* Standard CTA button */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.65rem 1.75rem;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  color: var(--bg);
  background: var(--green);
}
.btn-primary:hover {
  box-shadow: 0 0 25px rgba(74, 255, 145, 0.35);
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green-dim);
}
.btn-outline:hover {
  background: rgba(74, 255, 145, 0.06);
  border-color: var(--green);
}

/* Back link for branch pages */
.back-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--green); }


/* ════════════════════════════════════════════
   12. ANIMATIONS
   ── Referenced by components above
   ════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 20px rgba(74, 255, 145, 0.2); }
  50%       { text-shadow: 0 0 40px rgba(74, 255, 145, 0.5); }
}


/* ════════════════════════════════════════════
   13. RESPONSIVE / MOBILE
   ── Adjustments for smaller screens
   ════════════════════════════════════════════ */
@media (max-width: 600px) {
  :root {
    --page-pad: 1.25rem;
  }

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

  .ig-nudge {
    flex-direction: column;
    align-items: flex-start;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
