/* ════════════════════════════════════════════════════════════════════
   Zach Spanke — shared design system
   Black & white, mono-accented, dashboard-style personal site.
   Edit tokens in :root to adjust the whole site from one place.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --black:      #0a0a0a;
  --white:      #ffffff;
  --paper:      #f6f6f6;
  --line:       #e4e4e4;
  --line-2:     #cfcfcf;
  --ink:        #0a0a0a;
  --ink-soft:   #565656;
  --ink-faint:  #9a9a9a;

  --line-dark:  rgba(255,255,255,0.14);
  --line-dark-2:rgba(255,255,255,0.30);
  --white-soft: rgba(255,255,255,0.55);
  --white-faint:rgba(255,255,255,0.34);

  --radius:     16px;
  --radius-sm:  9px;
  --shadow:     0 2px 20px rgba(0,0,0,0.05);
  --shadow-lg:  0 24px 60px rgba(0,0,0,0.16);
  --ease:       cubic-bezier(.16,1,.3,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity .25s ease;
}

body.ready   { opacity: 1; }
body.leaving { opacity: 0; }

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

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

/* ── Grain texture (subtle, whole site) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Cursor spotlight ── */
#cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(480px circle at var(--gx, 50%) var(--gy, 50%), rgba(0,0,0,0.05), transparent 55%);
  transition: opacity 0.5s ease;
}

#cursor-glow.active { opacity: 1; }

/* ── Tilt ── */
.tilt {
  transition: transform 0.3s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Staggered reveal ── */
.reveal-item {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal-in 0.55s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 0.1s);
}

@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Live status dot ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #34c759;
  animation: status-ping 2s ease-out infinite;
}

@keyframes status-ping {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line-dark);
}

.brand {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--white);
  border-radius: 1px;
  display: inline-block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.back-link {
  font-size: 12px;
  color: var(--white-soft);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--white); }

.back-link .arrow { display: inline-block; transition: transform 0.2s var(--ease); }
.back-link:hover .arrow { transform: translateX(-3px); }

.menu-trigger {
  background: none;
  border: 1px solid var(--line-dark-2);
  color: var(--white);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding: 8px 15px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.menu-trigger:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.55); }

.menu-trigger .bars { display: flex; flex-direction: column; gap: 3px; }
.menu-trigger .bars span { width: 13px; height: 1.5px; background: var(--white); display: block; }

/* ── Full-screen menu overlay ── */
#site-menu {
  position: fixed;
  inset: 0;
  background: var(--black);
  color: var(--white);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

#site-menu.open { opacity: 1; pointer-events: all; }

.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line-dark);
}

.menu-close {
  background: none;
  border: 1px solid var(--line-dark-2);
  color: var(--white);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.menu-close:hover { background: rgba(255,255,255,0.1); transform: rotate(90deg); }

.menu-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 40px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: var(--white-faint);
  transition: color 0.25s;
}

.menu-item:hover, .menu-item.current { color: var(--white); }

.menu-index {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  width: 26px;
}

.menu-title {
  font-size: clamp(20px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  transition: transform 0.25s var(--ease);
}

.menu-item:hover .menu-title { transform: translateX(8px); }

.menu-item.current .menu-index { color: var(--white); }

.menu-bottom {
  padding: 18px 40px 26px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid var(--line-dark);
}

.menu-bottom a {
  font-size: 12px;
  color: var(--white-faint);
  text-decoration: none;
  transition: color 0.2s;
}

.menu-bottom a:hover { color: var(--white); }

/* ── Interactive hover button ── */
.ihb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 100px;
  border: 1px solid var(--line-2);
  background: var(--white);
  padding: 11px 15px 11px 24px;
  padding-right: 46px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  min-width: 150px;
  transition: border-color 0.3s var(--ease);
}

.ihb:hover { border-color: var(--ink); }

.ihb-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  transform: translateX(0);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  white-space: nowrap;
}

.ihb-reveal {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--white);
  opacity: 0;
  transform: translateX(56px);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  white-space: nowrap;
}

.ihb-dot {
  position: absolute;
  left: 16px; top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--black);
  transform: scale(1);
  transition: all 0.4s var(--ease);
  z-index: 1;
}

.ihb:hover .ihb-label   { transform: translateX(-6px); opacity: 0; }
.ihb:hover .ihb-reveal  { transform: translateX(0); opacity: 1; }
.ihb:hover .ihb-dot     { left: 0; top: 0; width: 100%; height: 100%; margin-top: 0; border-radius: 100px; }

.ihb.ihb-dark {
  background: transparent;
  border-color: var(--line-dark-2);
  color: var(--white);
}

.ihb.ihb-dark .ihb-dot    { background: var(--white); }
.ihb.ihb-dark .ihb-reveal { color: var(--black); }
.ihb.ihb-dark:hover       { border-color: var(--white); }

.ihb.ihb-solid {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}
.ihb.ihb-solid .ihb-dot { background: var(--white); }
.ihb.ihb-solid .ihb-reveal { color: var(--black); }

.link-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* ── Layout primitives ── */
.page-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 40px 120px;
}

.page-wrap.wide { max-width: 1200px; }

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--ink-faint);
  display: inline-block;
}

.page-title {
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 22px;
  color: var(--ink);
}

.lede {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.85;
  max-width: 640px;
  margin-bottom: 44px;
}

.prose p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 18px;
  max-width: 660px;
}

.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: normal; color: var(--ink); font-weight: 600; }

.stat-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin: 40px 0;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 10.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 44px 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.site-footer a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.site-footer a:hover { border-color: var(--ink); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .site-header { padding: 16px 20px; }
  .menu-top { padding: 16px 20px; }
  .menu-list { padding: 16px 20px; }
  .menu-bottom { padding: 16px 20px 22px; }
  .page-wrap { padding: 48px 22px 80px; }
  .header-right { gap: 12px; }
  .back-link span.back-text { display: none; }
}
