/* ============================================================================
Name: Robbie Bennett

Class: CS321 - Software Engineering

File: style.css

Purpose: Defines the visual layout, typography, and responsive design for
the portfolio website, compatible with GitHub Pages.
============================================================================ */


/* === GitHub Pages Full-Width Patch === */
html, body, main, #app, #root, #___gatsby {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
}

/* === Root Variables === */
:root {
  --nav-h: 64px;
  --accent: #ff6b6b;
}

/* === Global Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  font-size: 100%;
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  background: #f9f9fb;
  color: #333;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Layout Normalization for GitHub Pages === */
main, section, #hero, .hero-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding-left: 4vw;
  padding-right: 4vw;
}

/* === Navbar === */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  width: 100%;
}

nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: .75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color .2s, transform .2s;
}

nav a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* === Section Base === */
.page {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 1rem 6rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}

.page.active {
  opacity: 1;
  transform: translateY(0);
}

/* === Hero Section === */
#hero {
  background: linear-gradient(135deg, #ffecec, #fff);
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 6rem 2rem 4rem;
}

.hero-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding-top: 2rem;
}

/* Hero Photo */
.hero-photo {
  width: clamp(220px, 22vw, 300px);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* Hero Text + Pac-Man */
.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  margin-top: -2.5rem;
  flex: 1;
}

.hero-text h2 {
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.hero-text p {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  margin: 0.2rem 0;
  max-width: 550px;
  color: #333;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-top: 0.6rem;
}

.cta-btn:hover {
  background: #ff4a4a;
  transform: translateY(-2px);
}

/* === About Section === */
#about {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6rem 2rem 8rem;
  min-height: 100vh;
  scroll-snap-align: start;
}

.about-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 1200px;
  width: 100%;
  align-items: center;
}

.about-text {
  text-align: left;
  line-height: 1.6;
  color: #333;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}

.about-text h2 {
  color: var(--accent);
  font-size: clamp(2rem, 3.5vw, 2.4rem);
  margin-bottom: 1rem;
  text-align: left;
}

.about-photo {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

/* === Projects === */
#projects h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

#projects article {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1rem auto;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  width: 85%;
  max-width: 700px;
  transition: transform .2s, box-shadow .2s;
}

#projects article:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}

/* === Skills === */
#skills h2 {
  color: var(--accent);
  margin-bottom: 1rem;
}

#skills ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  max-width: 800px;
}

#skills li {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: .6rem 1rem;
  font-weight: 600;
}

/* === Game Break === */
#game-break {
  background: #fff;
}

#game-break h2, #game-break p {
  text-align: center;
  color: var(--accent);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto;
}

.game-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
  text-align: center;
}

.play-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s;
}

.play-btn:hover {
  transform: scale(1.05);
}

/* === Footer (Stable, Centered, No Overlap) === */
footer {
  position: relative;
  width: 100%;
  background: var(--accent);
  color: white;
  text-align: center;
  padding: 1rem 0;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  margin-top: auto;
}

/* === Game Overlay === */
.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.game-overlay.active {
  display: flex;
}

.game-content {
  position: relative;
  width: 90%;
  height: 80%;
  max-width: 1000px;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(255,107,107,0.4);
}

#gameFrame {
  width: 100%;
  height: 100%;
  border: none;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: .4rem .8rem;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
}

.close-btn:hover {
  background: #ff4040;
}

/* === Responsive === */
@media (max-width: 900px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-photo {
    width: 70%;
    margin: 0 auto;
  }

  .hero-text {
    align-items: center;
    margin-top: 0;
    text-align: center;
  }

  #container3D {
    width: 260px;
    height: 260px;
  }

  .about-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-photo {
    width: 80%;
    margin: 0 auto 1rem auto;
  }

  .about-text {
    text-align: center;
  }
}

/* === Section Title Color Overrides === */
#about h2 {
  color: #0077ff; /* Blue for About */
}

#projects h2 {
  color: #00b36b; /* Green for Projects */
}

#skills h2 {
  color: #9b59b6; /* Purple for Skills */
}

#game-break h2 {
  color: #ff8c00; /* Orange for Game Break */
}
