/* ============================================================
   JOSE MANCERA — modern dark / WebGL portfolio
   Midnight-green (Philadelphia Eagles) base, luminous teal-green
   accent, ambient terrain behind all.
   Content is visible by default; JS only enhances.
   ============================================================ */

:root {
  /* Palette: Philadelphia-Eagles — black + midnight green + silver,
     high value contrast (true-black base, white/silver text). */
  --bg:        #07090a;   /* true near-black */
  --bg-2:      #0d1112;
  --panel:     rgba(13, 17, 18, 0.90);
  --ink:       #f6faf9;   /* near-white headlines */
  --silver:    #c9d3d1;   /* Eagles silver — body text */
  --muted:     #aeb9b7;   /* brighter than before, for readable body copy */
  --dim:       #8a9794;   /* labels / kickers only */
  --line:      rgba(246, 250, 249, 0.10);
  --line-2:    rgba(246, 250, 249, 0.20);
  --midnight:  #004C54;   /* the Eagles midnight green — used as material blocks */
  --emerald:   #6effd8;   /* ice-mint glow accent */
  --emerald-b: #aaffe8;
  --cyan:      #4fe6dc;
  --grad:      linear-gradient(100deg, var(--emerald) 10%, var(--cyan) 90%);

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body:    "Geist", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  --maxw:   1140px;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: var(--emerald); color: #07090a; }
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ----- WebGL canvas (fixed, behind everything) ----- */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  display: block;
}
/* veil: darkens lower page so text stays readable over the mesh,
   and fades the horizon into the background at the top */
.scene-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(80% 50% at 50% 18%, rgba(110,255,216,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, transparent 26%, transparent 55%, rgba(7,9,10,0.55) 100%);
}
/* film grain */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.page { position: relative; z-index: 3; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.9rem, 2.2vh, 1.3rem) var(--gutter);
  transition: background 300ms ease, border-color 300ms ease, backdrop-filter 300ms ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 9, 10, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.nav-brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  color: var(--bg) !important;
  background: var(--emerald);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(110,255,216,0.4), 0 6px 20px rgba(110,255,216,0.18);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--emerald), 0 8px 26px rgba(110,255,216,0.3); }
.nav-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem var(--gutter) 6rem;
}
.hero-inner { max-width: 920px; width: 100%; margin: 0 auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.4rem;
}
.eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  animation: pulse 2.6s ease-in-out infinite;
}

.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 auto 1.6rem;
  color: var(--ink);
  width: fit-content;
}
.hero-title .learn-line { display: block; text-align: center; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 auto 2.2rem;
}
.hero-sub strong { color: var(--ink); font-weight: 500; }

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-bottom: 2.4rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
}
.btn-primary {
  background: var(--emerald);
  color: #07090a;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(110,255,216,0.4), 0 8px 28px rgba(110,255,216,0.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--emerald), 0 12px 34px rgba(110,255,216,0.34); }
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { border-color: var(--emerald); color: var(--emerald); }

.hero-tags {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.hero-tags li {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: rgba(0,76,84,0.18);
}

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 1.8rem;
  transform: translateX(-50%);
  width: 24px; height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.scroll-hint span {
  position: absolute;
  left: 50%; top: 8px;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--emerald);
  animation: scrolldot 1.8s ease-in-out infinite;
}
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ============================================================
   BANDS (sections over the ambient mesh)
   ============================================================ */
.band {
  position: relative;
  padding: clamp(5rem, 12vh, 8rem) var(--gutter);
  background: linear-gradient(180deg, rgba(7,9,10,0.86), rgba(7,9,10,0.93));
  border-top: 1px solid var(--line);
}
.band::before { /* glowing node at the divider */
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 64px; height: 1px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(110,255,216,0.6);
  opacity: 0.7;
}
.wrap { max-width: var(--maxw); margin: 0 auto; }

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.4rem;
}
.kicker .idx { color: var(--emerald); }
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); max-width: 120px; }

.band-head {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.band-head .muted { color: var(--muted); }
.band-lede {
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  color: var(--muted);
  max-width: 50ch;
  margin: 0 0 clamp(2.5rem, 5vh, 3.5rem);
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.about-photo {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 5 / 6;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) brightness(0.98) saturate(1.02);
}
.about-photo figcaption {
  position: absolute;
  left: 0.8rem; bottom: 0.7rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(7,9,10,0.6);
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.about-copy p { color: var(--muted); margin: 0 0 1.1rem; max-width: 56ch; }
.about-copy p:last-child { margin-bottom: 0; }

/* ---- Toolkit cards ---- */
.cards {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.4vw, 1.6rem);
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.4rem, 2.6vw, 2rem);
  background: linear-gradient(180deg, rgba(0,76,84,0.18), rgba(0,76,84,0.04));
  overflow: hidden;
  transition: border-color 280ms ease, transform 280ms ease, background 280ms ease;
}
.card::after { /* corner glow on hover */
  content: "";
  position: absolute;
  inset: -40% 50% 50% -40%;
  background: radial-gradient(closest-side, rgba(110,255,216,0.16), transparent);
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}
.card:hover { border-color: rgba(110,255,216,0.5); transform: translateY(-3px); }
.card:hover::after { opacity: 1; }
.card-no { font-family: var(--mono); font-size: 0.7rem; color: var(--emerald); letter-spacing: 0.1em; }
.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0.6rem;
  color: var(--ink);
}
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ---- Work ---- */
.projects { display: grid; gap: clamp(1rem, 2.5vh, 1.6rem); }
.project {
  display: grid;
  grid-template-columns: clamp(3.5rem, 8vw, 6rem) 1fr;
  gap: clamp(1rem, 3vw, 2.4rem);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0,76,84,0.15), rgba(0,76,84,0.03));
  transition: border-color 280ms ease, transform 280ms ease;
}
.project:hover { border-color: rgba(110,255,216,0.45); transform: translateY(-2px); }
.project-no { font-family: var(--mono); font-size: 0.82rem; color: var(--emerald); padding-top: 0.4rem; }
.project-main h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  color: var(--ink);
}
.project-main p { margin: 0; color: var(--muted); max-width: 60ch; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem !important; }
.tags span {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease;
}
.repo-link:hover { color: var(--emerald); }
.repo-link svg { flex: none; }

/* recorded screen demo */
.demo-video {
  margin: 1.4rem 0 0;
}
.demo-video video {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07090a;
  box-shadow: 0 0 0 1px rgba(110, 255, 216, 0.10), 0 18px 50px rgba(0, 0, 0, 0.45);
}
.demo-video figcaption {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--dim);
}

/* ---- Path timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl {
  display: grid;
  grid-template-columns: clamp(5rem, 12vw, 9rem) 1fr;
  gap: clamp(1.2rem, 4vw, 3rem);
  padding: clamp(1.4rem, 3.5vh, 2.2rem) 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.tl:first-child { border-top: 0; padding-top: 0; }
.tl-era { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--emerald); }
.tl-body h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.tl-body p { margin: 0; color: var(--muted); max-width: 52ch; }
.tl-logos { display: flex; align-items: center; gap: 1.25rem; min-height: 34px; margin-bottom: 0.8rem; }
.tl-logo {
  height: 32px; width: auto;
  filter: brightness(0) invert(0.82);   /* flatten any logo to a uniform silver silhouette */
  opacity: 0.78;
  transition: opacity 0.2s ease;
}
.tl:hover .tl-logo { opacity: 1; }
/* the Marine Corps emblem is a detailed seal; keep its detail (grayscale) instead of flattening */
.tl-logo--ega { height: 42px; filter: grayscale(1) brightness(1.7) contrast(1.05); opacity: 0.9; }

/* ---- Contact ---- */
.contact { text-align: center; }
.contact .kicker { justify-content: center; }
.contact .kicker::after { display: none; }
.contact-inner { max-width: 820px; }
.contact-head {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.contact .band-lede { margin-left: auto; margin-right: auto; }
.contact-email {
  display: inline-block;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.6vw, 2.4rem);
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 0.1em;
  transition: color 220ms ease, border-color 220ms ease;
}
.contact-email:hover { color: var(--emerald); border-color: var(--emerald); }
.contact-links {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contact-links a { color: var(--muted); text-decoration: none; transition: color 200ms ease; }
.contact-links a:hover { color: var(--emerald); }

.footer {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 2rem var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   REVEAL (JS-assisted) — visible by default without JS
   ============================================================ */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms cubic-bezier(.2,.7,.2,1), transform 800ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { width: min(74vw, 360px); aspect-ratio: 662/696; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 9px; margin-right: -9px;
    background: transparent; border: 0; cursor: pointer; position: relative; z-index: 2;
  }
  .nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ink);
    border-radius: 2px; transition: transform 0.28s ease, opacity 0.2s ease; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-brand { position: relative; z-index: 2; }

  .nav-links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: center; justify-content: center; gap: 1.7rem;
    background: rgba(7, 9, 10, 0.97);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .nav.open .nav-links { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { display: block; font-family: var(--display); font-weight: 500;
    font-size: 1.7rem; letter-spacing: -0.01em; color: var(--ink); }
  .nav-links .nav-cta { margin-top: 0.5rem; font-size: 0.95rem; }

  .tl { grid-template-columns: 1fr; gap: 0.4rem; }
  .project { grid-template-columns: 1fr; gap: 0.6rem; }
  .project-no { padding-top: 0; }
}
