/* ═══════════════════════════════════════════════
   JAMIE'S SITE — Main Stylesheet
   ═══════════════════════════════════════════════ */

/* ── TOKENS ───────────────────────────────────── */
:root {
  --bg:          #f8f9fa;
  --white:       #ffffff;
  --text:        #0d0d0d;
  --text-2:      #666666;
  --text-3:      #999999;
  --accent:      #0099ff;
  --node:        #00c4ff;
  --node-bright: #00d4ff;
  --dark:        #080808;
  --dark-card:   #101010;
  --border:      rgba(0, 0, 0, 0.07);
  --border-dark: rgba(255, 255, 255, 0.06);

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --r:    10px;
  --r-lg: 18px;
  --max:  1160px;
  --nav-h: 62px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; }
button { font-family: inherit; }

/* ── SKIP LINK ────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 0.875rem;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ══════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(248, 249, 250, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav__logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 36px;
  margin-left: auto;
}

.nav__link {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text-2);
  transition: color 0.18s var(--ease);
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 100%;
  height: 1.5px;
  background: var(--accent);
  transition: right 0.2s var(--ease);
}
.nav__link:hover,
.nav__link--active {
  color: var(--text);
}
.nav__link:hover::after,
.nav__link--active::after {
  right: 0;
}

/* hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav__toggle:hover { background: var(--border); }
.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.2s;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ══════════════════════════════════════════════
   HERO
══════════════════════════════════════════════ */
.hero {
  padding: calc(var(--nav-h) + 90px) 28px 48px;
}
.hero__inner {
  max-width: var(--max);
  margin: 0 auto;
}
.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 18px;
}
.hero__title {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 22px;
}
.hero__subtitle {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-2);
  max-width: 430px;
  line-height: 1.72;
}

/* ══════════════════════════════════════════════
   PROJECTS / SPHERE
══════════════════════════════════════════════ */
.projects {
  padding: 0 28px 72px;
}
.projects__header {
  max-width: var(--max);
  margin: 0 auto 14px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}
.projects__title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.projects__hint {
  font-size: 0.76rem;
  color: var(--text-3);
  letter-spacing: 0.01em;
}
.projects__wrap {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 48px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
}
#sphere-canvas {
  display: block;
  width: 100%;
  height: 540px;
  cursor: grab;
  outline: none;
}
#sphere-canvas:active { cursor: grabbing; }

/* ══════════════════════════════════════════════
   DARK STRIP
══════════════════════════════════════════════ */
.strip {
  background: var(--dark);
  padding: 0 28px;
}
.strip__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.info-card {
  background: var(--dark-card);
  padding: 56px 44px;
  display: flex;
  flex-direction: column;
}
.info-card__icon {
  font-size: 1.5rem;
  color: var(--node-bright);
  margin-bottom: 28px;
  display: block;
  line-height: 1;
}
.info-card__title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.info-card__text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.75;
  flex: 1;
}
.info-card__cta {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--node-bright);
  text-decoration: none;
  letter-spacing: 0.01em;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.info-card__cta:hover { opacity: 1; }

/* ══════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════ */
.contact {
  padding: 110px 28px;
  text-align: center;
}
.contact__inner { max-width: 600px; margin: 0 auto; }
.contact__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.contact__title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  line-height: 1.1;
}
.contact__email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(0, 153, 255, 0.28);
  padding-bottom: 3px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.contact__email:hover { border-color: var(--accent); }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.footer {
  background: var(--dark);
  border-top: 1px solid var(--border-dark);
  padding: 28px;
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.footer__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
}
.footer__nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}
.footer__nav a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.18s;
}
.footer__nav a:hover { color: rgba(255,255,255,0.75); }
.footer__copy {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
}

/* ══════════════════════════════════════════════
   INNER PAGE SHARED
══════════════════════════════════════════════ */
.page-hero {
  padding: calc(var(--nav-h) + 72px) 28px 60px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.page-hero__inner { max-width: var(--max); margin: 0 auto; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.18s;
}
.back-link:hover { color: var(--text); }

.page-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.page-title {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 18px;
}
.page-subtitle {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.7;
}

.section-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}
.section-pad { padding-top: 72px; padding-bottom: 72px; }

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
}
.card:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* ── Pill tags ────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: rgba(0, 153, 255, 0.1);
  color: var(--accent);
}
.pill--grey {
  background: rgba(0,0,0,0.05);
  color: var(--text-2);
}

/* ── Filter bar ───────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  padding: 7px 18px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Grid ─────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .strip__inner { grid-template-columns: 1fr; }
  .info-card { padding: 44px 36px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Nav: mobile overlay */
  .nav__links {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    z-index: 150;
  }
  .nav__links.is-open { display: flex; }
  .nav__link { font-size: 1.3rem; }
  .nav__link::after { display: none; }
  .nav__toggle { display: flex; }

  #sphere-canvas { height: 420px; }

  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }

  .footer__nav { margin-left: 0; }
  .footer__inner { gap: 16px; }
}

@media (max-width: 480px) {
  .hero { padding-top: calc(var(--nav-h) + 52px); }
  #sphere-canvas { height: 340px; }
  .info-card { padding: 36px 26px; }
  .page-hero { padding-bottom: 44px; }
}

/* ══════════════════════════════════════════════
   ACCESSIBILITY: reduced motion
══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
