/* ============================================
   JP Summers — Portfolio base system
   ============================================ */

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

:root {
  /* Accents */
  --acc-yellow: #FFEE00;
  --acc-cyan:   #4DC9FF;
  --acc-green:  #4ADE80;
  --acc-magenta: #FF5FB3;

  /* Dark theme (default) */
  --bg:      #0A0A0A;
  --bg-2:    #141414;
  --bg-3:    #1C1C1C;
  --fg:      #EDEDED;
  --fg-dim:  #7A7A7A;
  --fg-dimmer: #4A4A4A;
  --line:    #232323;

  /* Fonts */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Menlo', monospace;

  /* Scale */
  --radius: 2px;
  --gutter: 32px;

  --motion: 1; /* multiplied into transition durations */
}

[data-theme="light"] {
  --bg:      #F4F1EC;
  --bg-2:    #E9E5DE;
  --bg-3:    #DCD7CE;
  --fg:      #111111;
  --fg-dim:  #6A6A6A;
  --fg-dimmer: #9A9A9A;
  --line:    #CFCAC2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background .4s ease;
}
body.shader-active { background: transparent; }
body.shader-active .cats a,
body.shader-active .sysbar > div,
body.shader-active .metrics .m,
body.shader-active .stack-block .cell,
body.shader-active .proj-visual,
body.shader-active .viz,
body.shader-active .qa,
body.shader-active .ab-portrait {
  background-color: rgba(10,10,10,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.shader-active footer.site-footer,
body.shader-active main {
  position: relative; z-index: 1;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--acc-yellow); color: #000; }

/* ============================================
   Shared chrome: topbar + footer
   ============================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  z-index: 50;
  mix-blend-mode: difference;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { position: relative; }
.topbar nav a[aria-current="page"]::after,
.topbar nav a:hover::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: currentColor;
}
.topbar .mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0;
}
.topbar .mark .glyph {
  width: 16px; height: 16px; display: inline-block;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><rect x='0' y='0' width='4' height='4'/><rect x='8' y='0' width='4' height='4'/><rect x='4' y='4' width='4' height='4'/><rect x='0' y='8' width='4' height='4'/><rect x='8' y='8' width='4' height='4'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><rect x='0' y='0' width='4' height='4'/><rect x='8' y='0' width='4' height='4'/><rect x='4' y='4' width='4' height='4'/><rect x='0' y='8' width='4' height='4'/><rect x='8' y='8' width='4' height='4'/></svg>") center/contain no-repeat;
}

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 24px 24px;
  margin-top: 96px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
footer.site-footer .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
footer.site-footer a { color: var(--fg); }
footer.site-footer a:hover { color: var(--acc-yellow); }
footer.site-footer .cols { display: flex; gap: 48px; }
footer.site-footer .cols div { display: flex; flex-direction: column; gap: 6px; }
footer.site-footer .cols h5 { color: var(--fg-dim); font-weight: 400; margin: 0 0 4px; font-size: 11px; }

/* ============================================
   Shared atoms
   ============================================ */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: var(--bg-3);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  border-radius: 2px;
}
.pill.yellow { background: var(--acc-yellow); color: #000; }
.pill.cyan   { background: var(--acc-cyan);   color: #000; }
.pill.green  { background: var(--acc-green);  color: #000; }
.pill.magenta{ background: var(--acc-magenta);color: #000; }

.mono { font-family: var(--font-mono); }
.tiny { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); }

/* Pixel glyph helpers */
.glyph-pix {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.12em;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-position: center;
          mask-position: center;
}
.glyph-pix.asterisk {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><rect x='5' y='0' width='2' height='2'/><rect x='5' y='10' width='2' height='2'/><rect x='0' y='5' width='2' height='2'/><rect x='10' y='5' width='2' height='2'/><rect x='2' y='2' width='2' height='2'/><rect x='8' y='2' width='2' height='2'/><rect x='2' y='8' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/><rect x='5' y='5' width='2' height='2'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><rect x='5' y='0' width='2' height='2'/><rect x='5' y='10' width='2' height='2'/><rect x='0' y='5' width='2' height='2'/><rect x='10' y='5' width='2' height='2'/><rect x='2' y='2' width='2' height='2'/><rect x='8' y='2' width='2' height='2'/><rect x='2' y='8' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/><rect x='5' y='5' width='2' height='2'/></svg>");
}
.glyph-pix.target {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='black' d='M2 2h8v2h-8zM2 10h8v2h-8zM0 4h2v4h-2zM10 4h2v4h-2zM4 4h4v1h-4zM4 7h4v1h-4zM5 5h2v2h-2z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='black' d='M2 2h8v2h-8zM2 10h8v2h-8zM0 4h2v4h-2zM10 4h2v4h-2zM4 4h4v1h-4zM4 7h4v1h-4zM5 5h2v2h-2z'/></svg>");
}
.glyph-pix.diamond {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='black' d='M5 0h2v2h-2zM3 2h2v2h-2zM7 2h2v2h-2zM1 4h2v4h-2zM9 4h2v4h-2zM3 8h2v2h-2zM7 8h2v2h-2zM5 10h2v2h-2z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='black' d='M5 0h2v2h-2zM3 2h2v2h-2zM7 2h2v2h-2zM1 4h2v4h-2zM9 4h2v4h-2zM3 8h2v2h-2zM7 8h2v2h-2zM5 10h2v2h-2z'/></svg>");
}
.glyph-pix.cross {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='black' d='M2 2h2v2h-2zM6 2h2v2h-2zM10 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM8 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2zM10 6h2v2h-2zM0 8h2v2h-2zM4 8h2v2h-2zM8 8h2v2h-2zM2 10h2v2h-2zM6 10h2v2h-2zM10 10h2v2h-2z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='black' d='M2 2h2v2h-2zM6 2h2v2h-2zM10 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM8 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2zM10 6h2v2h-2zM0 8h2v2h-2zM4 8h2v2h-2zM8 8h2v2h-2zM2 10h2v2h-2zM6 10h2v2h-2zM10 10h2v2h-2z'/></svg>");
}

/* striped placeholder image */
.placeholder {
  background:
    repeating-linear-gradient(135deg, var(--bg-2) 0 16px, var(--bg-3) 16px 32px);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}

/* Cursor blip */
@keyframes cursorBlink { 0%,50% { opacity: 1 } 50.01%,100% { opacity: 0 } }
.caret { display: inline-block; width: 0.55em; height: 1em; background: currentColor; vertical-align: -0.12em; animation: cursorBlink 1s steps(1) infinite; }

/* Containers */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
.wrap-wide { max-width: 1600px; margin: 0 auto; padding: 0 32px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 140px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 48px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 88px);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 0.9;
}
.section-head .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: right;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; transition-duration: calc(.8s * var(--motion)); }
.reveal.in { opacity: 1; transform: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all .2s ease;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn.primary { background: var(--acc-yellow); color: #000; border-color: var(--acc-yellow); }
.btn.primary:hover { background: transparent; color: var(--acc-yellow); }
