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

/* ─── VARIABLES ──────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --ink: #111110;
  --ink-muted: #666660;
  --ink-faint: #aaa9a2;
  --accent: #2b4cff;
  --grid-color: rgba(17,17,16,0.07);
  --grid-size: 40px;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --nav-w: 200px;
}

/* ─── BASE ────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  cursor: none;
  overflow-x: hidden;
}

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

/* ─── CUSTOM CURSOR — "+" crosshair ──────────────────── */
#cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px; height: 22px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
/* horizontal + vertical bars form the cross */
#cursor::before, #cursor::after {
  content: '';
  position: absolute;
  background: #fff;               /* difference blend → inverts over anything */
}
#cursor::before {                 /* horizontal bar */
  top: 50%; left: 0;
  width: 100%; height: 1.5px;
  transform: translateY(-50%);
}
#cursor::after {                  /* vertical bar */
  left: 50%; top: 0;
  height: 100%; width: 1.5px;
  transform: translateX(-50%);
}

/* ring no longer used for the crosshair look */
#cursor-ring { display: none; }

body.cursor-hover #cursor { width: 30px; height: 30px; }

/* ─── NAV ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-w);
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 48px 32px;
  border-right: 1px solid rgba(17,17,16,0.1);
  background: rgba(242,240,235,0.88);
  backdrop-filter: blur(8px);
}

nav .site-name {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
  display: block;
  margin-bottom: 56px;
  font-weight: 500;
}
/* handwritten logo image (falls back to the typed name) */
nav .site-name .logo-img {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
}
nav .site-name .logo-text { display: none; }

nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

nav ul li a {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}

nav ul li a::before {
  content: '—';
  position: absolute;
  left: -18px;
  opacity: 0;
  transition: opacity 0.2s, left 0.2s;
  color: var(--accent);
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--ink);
  transform: translateX(4px);
}

nav ul li a:hover::before,
nav ul li a.active::before {
  opacity: 1;
  left: -14px;
}

/* project sub-list (accordion under Projects) */
nav .subnav {
  list-style: none;
  margin: 4px 0 4px 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
nav .subnav.open { max-height: 400px; }
nav .subnav li a {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--ink-faint);
  padding: 3px 0 3px 0;
  transition: color 0.2s, transform 0.2s;
}
nav .subnav li a::before { content: none; }
nav .subnav li a:hover,
nav .subnav li a.active {
  color: var(--ink);
  transform: translateX(3px);
}

nav .nav-footer {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* ─── MAIN ───────────────────────────────────────────── */
main {
  margin-left: var(--nav-w);
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

a { color: inherit; }

/* content links — black text, electric-blue underline */
.content-link,
.bio-link,
a.exh-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.content-link:hover,
.bio-link:hover,
a.exh-link:hover {
  color: var(--accent);
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  nav {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0; top: auto;
    flex-direction: row;
    align-items: center;
    padding: 14px 20px;
    border-right: none;
    border-top: 1px solid rgba(17,17,16,0.1);
    background: rgba(242,240,235,0.96);
  }

  nav .site-name { display: none; }
  nav .nav-footer { display: none; }

  nav ul {
    flex-direction: row;
    gap: 16px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
  }

  nav ul li a::before { display: none; }
  nav ul li a:hover, nav ul li a.active { transform: none; }
  nav ul li a.active { color: var(--ink); font-weight: 500; }

  main { margin-left: 0; padding-bottom: 70px; }
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }
}
