@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --void: #050510;
  --deep: #150826;
  --cyan: #00f3ff;
  --magenta: #ff2e88;
  --violet: #9d4edd;
  --ink: #e8e2f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--void);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   GLOBAL NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(5, 5, 16, 0.95);
  border-bottom: 2px solid var(--cyan);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-item {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: var(--cyan);
}

.nav-item.active {
  color: var(--cyan);
  border-bottom: 1px solid var(--cyan);
}

.nav-game-slot {
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: #666688;
}

/* ==========================================================================
   HERO — home page only. Scoped to #hero so other pages scroll normally.
   ========================================================================== */
#hero {
  position: relative;
  min-height: 100vh;
  padding: 1rem;
  padding-top: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#code-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#hexfield {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 600px;
  padding: 20px;
}

.heading {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: 2px;
  margin: 0;
  color: var(--ink);
}

.subheading {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
  margin-top: 15px;
  color: var(--cyan);
  font-weight: 400;
}

/* ==========================================================================
   PROJECTS — selected work section, homepage
   ========================================================================== */
.projects {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.projects-label {
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: #8a84a0;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--deep);
  border: 1px solid transparent;
  border-radius: 0px;
  padding: 0;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-category {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
}

.card.print .card-category {
  color: var(--magenta);
}

.card.branding .card-category {
  color: var(--violet);
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.card-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #8a84a0;
  margin: 0 0 auto;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 243, 255, 0.15);
}

.card.print:hover {
  border-color: var(--magenta);
  box-shadow: 0 0 24px rgba(255, 46, 136, 0.15);
}

.card.branding:hover {
  border-color: var(--violet);
  box-shadow: 0 0 24px rgba(157, 78, 221, 0.15);
}

@media (max-width: 800px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ABOUT TEASER — homepage
   ========================================================================== */
.about-teaser {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  text-align: center;
}

.about-teaser p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.about-teaser p:last-child {
  margin-bottom: 0;
  color: #8a84a0;
}

/* ==========================================================================
   CONTACT TEASER — homepage
   ========================================================================== */
.contact-teaser {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
  text-align: center;
}

.contact-line {
  font-size: 1rem;
  color: var(--ink);
  margin: 0 0 1rem;
}

.contact-email {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid var(--cyan);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-email:hover {
  color: var(--magenta);
  border-color: var(--magenta);
}

/* ==========================================================================
   WORK - GRID LAYOUT
   ========================================================================== */

/* --- WORK CONTAINER & HEADER --- */
.work-container {
  max-width: 1200px;
  margin: 110px auto 60px auto; /* Margin ensures gap below navbar */
  padding: 0 24px;
}

.gallery-header {
  margin-bottom: 30px;
}

.title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0px;
}

.gallery-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
}

/* --- FILTER DROPDOWN CONTAINER --- */
.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #14141d;
  border: 1px solid #282838;
  padding: 8px 16px;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.filter-wrapper:hover {
  border-color: #00f3ff;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.filter-icon {
  width: 16px;
  height: 16px;
  stroke: #00f3ff;
  flex-shrink: 0;
}

/* Custom Select Styling */
.filter-select {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  outline: none;
  padding-right: 18px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Custom Dropdown Arrow Accent */
.filter-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: #00f3ff;
  position: absolute;
  right: 14px;
  pointer-events: none;
}

.filter-select option {
  background-color: #14141d;
  color: var(--ink);
  padding: 10px;
}

/* --- PHOTOGRAPHIC TILE GRID --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
}

/* Base Tile Styling - NO BORDERS. Scoped to .work-container so it never
   collides with the homepage's separate .card style above. */
.work-container .card {
  position: relative;
  height: auto;
  display: block;
  background-color: #12121a;
  border: none;
  border-radius: 0%;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.work-container .card:hover {
  transform: scale(1.01);
  box-shadow: 0 0 0 1px #00f3ff;
}

/* Image Container */
.work-container .card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #44445a;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* Wide tiles fill the row more naturally */
.work-container .card-wide {
  grid-column: span 2;
}

.work-container .card-wide .card-image {
  aspect-ratio: 8 / 3;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Minimalist Text Overlay Bar */
.work-container .card-info {
  padding: 10px 12px;
  background: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: none;
}

/* Micro Typography */
.work-container .card-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #e0e0e8;
  margin: 0;
}

.work-container .card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #00f3ff;
  opacity: 0.8;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.work-container .card-tag:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Mobile Responsiveness for Wide Cards */
@media (max-width: 600px) {
  .work-container .card-wide {
    grid-column: span 1;
  }
  .work-container .card-wide .card-image {
    aspect-ratio: 4 / 3;
  }
}

/* ==========================================================================
   WORK MODAL — opens when a gallery card is clicked
   ========================================================================== */
.work-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 16, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 2rem;
}

.work-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.work-modal {
  background: var(--deep);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.work-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.work-modal-close:hover {
  color: var(--magenta);
}

.work-modal-tag {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  font-weight: 700;
}

.work-modal h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  margin: 0.75rem 0 1rem;
  color: var(--ink);
}

.work-modal-desc {
  color: #8a84a0;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.work-modal-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.work-modal-ph {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px dashed rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a84a0;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}

.work-modal-link-wrap {
  margin-top: 1.5rem;
}

.work-modal-link {
  display: inline-block;
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-modal-link:hover {
  color: var(--magenta);
}

.project-page {
  max-width: 1000px;
  margin: 110px auto 60px;
  padding: 0 24px;
}

.project-header {
  margin-bottom: 2rem;
}

.project-kicker {
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-page h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin: 0 0 1rem;
}

.project-summary {
  color: #dfe5f8;
  line-height: 1.7;
  max-width: 700px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.project-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a84a0;
  padding: 1rem;
  text-align: center;
}

.project-back {
  display: inline-block;
  margin-top: 2rem;
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-back:hover {
  color: var(--magenta);
}