/* =================================================================
   Emily Aldea — Game Programmer Portfolio
   Theme: "Modern Gaming" — dark UI, tasteful neon, subtle HUD touches
   -----------------------------------------------------------------
   Quick palette edit: change the --accent / --accent-2 values below
   and the whole site re-themes.
   ================================================================= */

:root {
  /* Surfaces */
  --bg:        #0a0b10;
  --bg-elev:   #11131c;
  --bg-elev-2: #171a26;
  --bg-alt:    #0c0e15;

  /* Lines & text */
  --border:    rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text:      #e9ecf5;
  --text-dim:  #9aa3b8;
  --text-faint:#5c6479;

  /* Accents (the neon) */
  --accent:    #22d3ee;   /* electric cyan  */
  --accent-2:  #a855f7;   /* violet         */
  --accent-3:  #f43f9d;   /* magenta (used very sparingly) */
  --grad:      linear-gradient(115deg, var(--accent), var(--accent-2));
  --grad-soft: linear-gradient(115deg, rgba(34,211,238,.18), rgba(168,85,247,.18));

  /* FX */
  --glow:      0 0 0 1px rgba(34,211,238,.35), 0 0 24px -4px rgba(34,211,238,.55);
  --shadow:    0 18px 40px -22px rgba(0,0,0,.9);
  --radius:    16px;
  --radius-sm: 10px;

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1180px;
  --gut:  clamp(20px, 5vw, 64px);
}

/* ---------------- Reset / base ---------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--font-mono); font-size: 0.85em; color: var(--accent); background: rgba(34,211,238,.08); padding: 2px 6px; border-radius: 6px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #04121a; padding: 10px 16px;
  font-weight: 600; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.86rem;
  letter-spacing: 0.02em;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--border-hi);
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--grad); color: #04121a; border-color: transparent; font-weight: 700;
}
.btn--primary:hover { box-shadow: 0 12px 30px -10px rgba(34,211,238,.6); }
.btn--ghost { background: rgba(255,255,255,.02); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: #fff; box-shadow: var(--glow); }
.btn--lg { padding: 16px 30px; font-size: 1rem; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); }

.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.brand__mark {
  width: 22px; height: 22px; display: inline-block;
  background: var(--grad);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 16px -2px rgba(34,211,238,.7);
}
.brand__text { font-size: 1.05rem; }
.brand__dot { color: var(--accent); }

.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links > a:not(.btn) {
  font-size: 0.92rem; color: var(--text-dim); position: relative; padding: 4px 0;
  transition: color .2s ease;
}
.nav__links > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--grad); transition: width .25s ease; border-radius: 2px;
}
.nav__links > a:not(.btn):hover { color: var(--text); }
.nav__links > a.is-active { color: var(--text); }
.nav__links > a.is-active::after { width: 100%; }
.nav__resume { margin-left: 4px; }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__mobile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px var(--gut) 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
/* Respect the [hidden] attribute — without this, display:flex above would
   override [hidden] and the menu would show on desktop. It is only revealed
   when the JS toggle removes [hidden] on a narrow screen. */
.nav__mobile[hidden] { display: none; }
/* Belt-and-braces: never show the mobile menu at desktop widths */
@media (min-width: 861px) { .nav__mobile { display: none !important; } }

.nav__mobile a { padding: 12px 4px; color: var(--text-dim); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: .92rem; }
.nav__mobile a:last-child { border-bottom: 0; color: var(--accent); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(560px, 88vh, 880px);
  display: flex; align-items: center;
  padding: 90px var(--gut) 70px;
}
.hero__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; width: 100%; }

/* animated faint grid */
.hero__grid {
  position: absolute; inset: -2px; z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 38%, #000 35%, transparent 78%);
  animation: gridDrift 28s linear infinite;
}
@keyframes gridDrift { to { background-position: 56px 56px; } }

/* glowing blobs */
.hero__glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 18% 30%, rgba(34,211,238,.22), transparent 70%),
    radial-gradient(42% 52% at 82% 68%, rgba(168,85,247,.20), transparent 72%);
  filter: saturate(1.1);
}

.eyebrow {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
.eyebrow__bracket { color: var(--accent-2); }

.hero__title {
  font-size: clamp(2.3rem, 6.4vw, 4.6rem); font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 22px;
}
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub {
  max-width: 56ch; color: var(--text-dim); font-size: clamp(1rem, 1.6vw, 1.18rem); margin-bottom: 34px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 42px; }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 14px 28px;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim);
  padding-top: 26px; border-top: 1px solid var(--border);
}
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta-label { color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #34e29b;
  box-shadow: 0 0 0 0 rgba(52,226,155,.7); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,226,155,.55); }
  70% { box-shadow: 0 0 0 9px rgba(52,226,155,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,226,155,0); }
}

.hero__scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--border-hi); border-radius: 14px;
  display: grid; place-items: start center; padding-top: 8px;
}
.hero__scroll span { width: 4px; height: 8px; border-radius: 2px; background: var(--accent); animation: scrollDot 1.8s ease-in-out infinite; }
@keyframes scrollDot { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(10px); opacity: 1; } }

/* ---------------- Section shell ---------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gut); }
.section--alt { max-width: none; background: var(--bg-alt); border-block: 1px solid var(--border); }
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }

.section__head { max-width: 62ch; margin-bottom: 52px; }
.section__eyebrow { font-family: var(--font-mono); color: var(--accent); font-size: .8rem; letter-spacing: .14em; margin-bottom: 14px; }
.section__title { font-size: clamp(1.8rem, 4vw, 2.9rem); font-weight: 700; margin-bottom: 16px; }
.section__lead { color: var(--text-dim); font-size: 1.05rem; }

/* ---------------- Game cards ---------------- */
.game-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.game-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s ease, border-color .25s ease, box-shadow .3s ease;
}
.game-card:hover { transform: translateY(-6px); border-color: var(--border-hi); box-shadow: var(--shadow); }

.game-card__cover {
  position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center;
  overflow: hidden; isolation: isolate;
}
.game-card__cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(8,9,14,.82), transparent 62%);
}
.game-card__cover-title {
  position: relative; z-index: 2;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  letter-spacing: .04em; color: rgba(255,255,255,.94); text-align: center; padding: 0 14px;
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.game-card__tag {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(8,9,14,.6); backdrop-filter: blur(4px);
  border: 1px solid var(--border-hi); color: var(--text);
  padding: 5px 10px; border-radius: 999px;
}
/* placeholder cover gradients (swap for <img> when you have art) */
.g1 { background: radial-gradient(120% 120% at 0% 0%, #0ea5b7, #2563eb 45%, #1e1b4b); }
.g2 { background: radial-gradient(120% 120% at 100% 0%, #7c3aed, #db2777 55%, #1f1130); }
.g3 { background: radial-gradient(120% 120% at 0% 100%, #059669, #0891b2 55%, #06283d); }
.g4 { background: radial-gradient(120% 120% at 100% 100%, #f59e0b, #db2777 60%, #2a0f2a); }
.game-card__cover::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at center, #000, transparent 75%);
}

.game-card__body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.game-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.game-card__title { font-size: 1.22rem; }
.game-card__role { font-family: var(--font-mono); font-size: .74rem; color: var(--accent); white-space: nowrap; }
.game-card__desc { color: var(--text-dim); font-size: .95rem; }
.game-card__links { margin-top: auto; display: flex; gap: 18px; padding-top: 6px; }
.game-card__links a {
  font-family: var(--font-mono); font-size: .82rem; color: var(--text); border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.game-card__links a:hover { color: var(--accent); border-color: var(--accent); }

/* tag row (small inline tech tags) */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-row li {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .02em;
  color: var(--text-dim); background: rgba(255,255,255,.04);
  border: 1px solid var(--border); padding: 4px 9px; border-radius: 7px;
}

/* ---------------- Video showcase ---------------- */
.video-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.video-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .3s ease;
}
.video-card:hover { transform: translateY(-6px); border-color: var(--border-hi); box-shadow: var(--shadow); }

.video-el { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }

.video-slot {
  position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center;
  background:
    radial-gradient(70% 90% at 50% 0%, rgba(34,211,238,.12), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 12px, transparent 12px 24px),
    var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}
.video-slot::after {
  content: ""; position: absolute; inset: 12px; border: 1px dashed var(--border-hi); border-radius: 10px; pointer-events: none;
}
.video-slot__play {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 10px 30px -8px rgba(34,211,238,.6);
  transition: transform .2s ease;
}
.video-slot__play:hover { transform: scale(1.08); }
.video-slot__play span {
  width: 0; height: 0; margin-left: 4px;
  border-left: 16px solid #04121a; border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}
.video-slot__hint {
  position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; color: var(--text-faint);
}

.video-card__cap { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.video-card__cap h3 { font-size: 1.12rem; }
.video-card__cap p { color: var(--text-dim); font-size: .93rem; }

/* ---------------- Skills ---------------- */
.skills { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.skill-group {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 22px; transition: border-color .25s ease, box-shadow .3s ease, transform .25s ease;
}
.skill-group:hover { border-color: var(--border-hi); box-shadow: var(--shadow); transform: translateY(-4px); }
.skill-group__title { font-size: 1.02rem; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.skill-group__title span { color: var(--accent); font-family: var(--font-mono); font-size: .9em; }
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-row li {
  font-family: var(--font-mono); font-size: .82rem; color: var(--text);
  background: var(--grad-soft); border: 1px solid var(--border-hi);
  padding: 7px 13px; border-radius: 9px;
  transition: transform .15s ease, border-color .2s ease;
}
.chip-row li:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ---------------- About ---------------- */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.about__main p { color: var(--text-dim); margin-top: 18px; max-width: 60ch; }
.about__main em { color: var(--text); font-style: italic; }

.about__panel {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 26px; position: relative; overflow: hidden;
}
.about__panel::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--grad);
}
.facts { margin: 0; }
.facts > div { padding: 20px 0; border-bottom: 1px solid var(--border); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.facts dd { margin: 0; font-weight: 500; }
.muted { color: var(--text-dim); font-weight: 400; font-size: .9em; }

/* ---------------- Contact ---------------- */
.contact { text-align: center; }
.contact__inner { max-width: 60ch; margin: 0 auto; }
.contact__lead { margin: 0 auto 34px; }
.contact .btn--lg { font-family: var(--font-mono); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px; margin-top: 34px; }
.socials a {
  font-family: var(--font-mono); font-size: .9rem; color: var(--text-dim); position: relative; padding-bottom: 3px;
  transition: color .2s ease;
}
.socials a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--accent); transition: width .25s ease; }
.socials a:hover { color: var(--text); }
.socials a:hover::after { width: 100%; }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 26px var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint);
}
.footer__brand { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: .98rem; }
.footer__top { color: var(--text-dim); transition: color .2s ease; }
.footer__top:hover { color: var(--accent); }

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
/* stagger cards within a grid */
.game-grid .reveal:nth-child(2), .video-grid .reveal:nth-child(2), .skills .reveal:nth-child(2) { transition-delay: .08s; }
.game-grid .reveal:nth-child(3), .video-grid .reveal:nth-child(3), .skills .reveal:nth-child(3) { transition-delay: .16s; }
.game-grid .reveal:nth-child(4), .video-grid .reveal:nth-child(4), .skills .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__grid, .status-dot, .hero__scroll span { animation: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .about { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 540px) {
  .hero { min-height: 78vh; }
  .hero__meta { gap: 12px 18px; }
  .btn { padding: 11px 17px; }
  .section__head { margin-bottom: 38px; }
}

/* ---------------- Real game cover art ---------------- */
/* Sits above the gradient placeholder; if the file is missing the <img>
   removes itself (onerror) and the gradient + title show instead. */
.game-card__cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 5; }
.game-card__cover .game-card__tag { z-index: 6; }
.games-disclaimer { margin-top: 30px; max-width: 72ch; font-size: .82rem; font-style: italic; color: var(--text-faint); }

/* Real gameplay videos fill the card's 16:9 frame */
.video-el { object-fit: cover; }
