*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0d0d0d;
  --bg-surface: #141414;
  --text:       #e8e3dc;
  --text-muted: #7a756e;
  --accent:     #c8b89a;
  --border:     rgba(200,184,154,0.12);
  --serif:      'Cormorant Garamond', Georgia, serif;
  --sans:       'Montserrat', sans-serif;
  --nav-h:      72px;
  --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
}
.nav-links a {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

/* ── Nav Dropdown ── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: -12px;
  background: rgba(13,13,13,0.98);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
  z-index: 101;
  min-width: 220px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-dropdown-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.nav-dropdown-section:last-child {
  border-bottom: none;
}
.nav-dropdown-label {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 16px;
  margin-bottom: 6px;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 16px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s var(--ease);
}
.nav-dropdown-item:hover {
  color: var(--accent);
  padding-left: 22px;
}

/* ── Pages ── */
.page { padding-top: var(--nav-h); min-height: 100vh; }
.page.active { display: block; }

/* ── HOME ── */

/* ── Grid ── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /*
    ═══════════════════════════════════════════════
    GRID SPACING
    gap       → space between the two cards
    padding   → breathing room from page edges
    Change these two values to adjust card spacing.
    ═══════════════════════════════════════════════
  */
  gap: 24px;
  padding: 0 48px 32px;
  background: transparent;
}

.works-wrap {
  border-top: none;
  border-bottom: none;
  margin: 24px 0 32px 0;
}

.works-header {
  padding: 32px 48px;
}
.works-header-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 6px;
}
.works-header-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 16/9;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--ease), filter 0.6s var(--ease);
  filter: brightness(0.7) saturate(0.85);
}
.project-card:hover img {
  transform: scale(1.04);
  filter: brightness(0.55) saturate(0.7);
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 36px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
  pointer-events: none;
}

.project-card-num {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.project-card:hover .project-card-num {
  opacity: 1; transform: translateY(0);
}

.project-card-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--text);
}

.project-card-meta {
  margin-top: 8px;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  transform: translateY(0);
  transition: color 0.3s;
}
.project-card:hover .project-card-meta { color: var(--accent); }

.project-card-arrow {
  position: absolute;
  top: 28px; right: 28px;
  width: 36px; height: 36px;
  border: 1px solid rgba(200,184,154,0.35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  color: var(--accent);
  font-size: 0.9rem;
}
.project-card:hover .project-card-arrow {
  opacity: 1; transform: scale(1);
}

/* ── Footer ── */
.site-footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-footer p {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── PROJECT PAGE ── */
#page-project {}

.project-hero {
  position: relative;
  height: clamp(320px, 34vh, 420px);
  min-height: 320px;
  overflow: hidden;
  background: #1a1a1a;
}
.project-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}
.project-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 64px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
}
.project-hero-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.project-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 300;
  line-height: 1.05;
  max-width: 680px;
}
.project-hero-meta {
  margin-top: 20px;
  display: flex;
  gap: 40px;
}
.project-hero-meta-item {}
.project-hero-meta-item .meta-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.project-hero-meta-item .meta-val {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text);
}

.project-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 64px;
}

.project-intro {
  margin-bottom: 80px;
}
.project-desc {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
  max-width: 680px;
}
.project-specs {}
.project-specs h3 {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}
.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--text-muted); letter-spacing: 0.1em; }
.spec-val { color: var(--text); }

/* Gallery */
.gallery-section {}
.gallery-section-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Placeholder image slots */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.gallery-item {
  position: relative;
  background: var(--bg-surface);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Image slider (used on Dungeon Crawl project) */
.image-slider {
  position: relative;
  max-width: 100%;
  margin-bottom: 20px;
}
.image-slider .slides {
  position: relative;
  width: 100%;
  /* aspect ratio is set via --slider-aspect (computed from image natural size) */
  padding-top: var(--slider-aspect, 56.25%);
  overflow: hidden;
}
.image-slider .slides img{
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.12s linear, transform 0.7s var(--ease);
}
.image-slider .slides img.active { opacity: 1; }
.image-slider input[type="range"] {
  width: 100%;
  margin-top: calc(16px + 8px);
  appearance: none;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), rgba(200,184,154,0.15));
  border-radius: 4px;
}
.image-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  border: 2px solid rgba(0,0,0,0.25);
}
.image-slider input[type="range"]:focus { outline: none; }

/* Placeholder state (when no img src) */
.img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  min-height: 280px;
  border: 1px solid var(--border);
}
.img-placeholder svg {
  width: 28px; height: 28px;
  opacity: 0.3;
}

.gallery-spacer { height: 48px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 12px 0;
  border: none;
  background: none;
  transition: color 0.2s;
  margin-bottom: 48px;
}
.back-btn:hover { color: var(--accent); }
.back-btn svg { width: 14px; height: 14px; }

/* ── ABOUT PAGE ── */
#page-about { padding: var(--nav-h) 0 0; }
.about-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px;
}
.about-body h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 40px;
}
.about-body h2 em { color: var(--accent); font-style: italic; }
.about-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.about-skills {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.about-skills h3 {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-tag {
  padding: 7px 16px;
  border: 1px solid var(--border);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-radius: 2px;
}

/* ── CONTACT PAGE ── */
#page-contact { padding: var(--nav-h) 0 0; }
.contact-body {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px;
}
.contact-body h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  margin-bottom: 12px;
}
.contact-body > p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
  margin-bottom: 48px;
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: padding-left 0.3s var(--ease);
}
.contact-link:hover { padding-left: 8px; }
.contact-link-left {}
.contact-link-type {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.contact-link-val {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text);
}
.contact-link-arrow { color: var(--accent); font-size: 1.2rem; }

/* ── Transitions ── */
.page { animation: none; }
.page.active { animation: fadeUp 0.55s var(--ease) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Project sections (used by tech art projects) ── */
.project-sections {
  margin: 48px 0 64px;
  border-top: 1px solid var(--border);
}
.project-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: baseline;
}
.project-section-heading {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  padding-top: 2px;
}
.project-section-body {
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--text-muted);
}

/* ── Gallery layout rows ── */
.gallery-row {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.gallery-row:last-child { margin-bottom: 0; }
.gallery-row-cols-1 { grid-template-columns: 1fr; }
.gallery-row-cols-2 { grid-template-columns: 1fr 1fr; }
.gallery-row-cols-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 768px) {
  .gallery-row-cols-2,
  .gallery-row-cols-3 { grid-template-columns: 1fr; }
  .project-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
@media (max-width: 768px) {
  nav { padding: 0 24px; }
  .nav-links { gap: 24px; }
  .home-hero { padding: 48px 24px 40px; }
  .works-grid { grid-template-columns: 1fr; }
  .project-body { padding: 48px 24px; }
  .project-intro { grid-template-columns: 1fr; gap: 40px; }
  .project-hero-overlay { padding: 40px 28px; }
  .site-footer { padding: 24px; flex-direction: column; gap: 8px; text-align: center; }
  .gallery-grid.cols-2,
  .gallery-grid.cols-3 { grid-template-columns: 1fr; }
  .about-body, .contact-body { padding: 64px 24px; }
}

/* ── PCG project sections (interleaved text + images) ── */
.pcg-section {
  padding: 56px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 56px;
}
.pcg-section:first-of-type { margin-top: 40px; }

.pcg-section-num {
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.pcg-section-heading {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 18px;
}
.pcg-section-body {
  font-size: 0.85rem;
  line-height: 1.85;
  color: var(--text-muted);
  max-width: 720px;
  margin-bottom: 12px;
}
.pcg-section-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(200,184,154,0.3);
  transition: border-color 0.2s;
}
.pcg-section-body a:hover { border-color: var(--accent); }

.pcg-img-block { margin-top: 28px; }
.pcg-img-block img,
.pcg-img-block video,
.pcg-img-row img { width: 100%; height: auto; display: block; }
.pcg-img-row video { width: 100%; height: auto; display: block; }
.pcg-img-block .img-placeholder { aspect-ratio: 16/9; min-height: unset; }

.pcg-img-row {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.pcg-img-row .img-placeholder { aspect-ratio: 16/9; min-height: unset; }

.pcg-video-placeholder {
  margin-top: 28px;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-surface);
  border: 1px dashed rgba(200,184,154,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
}
.pcg-video-placeholder svg { width: 48px; height: 48px; opacity: 0.2; }
.pcg-video-placeholder span {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.4;
}

.pcg-resources { margin-top: 20px; }
.pcg-resource-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  transition: padding-left 0.25s var(--ease), color 0.2s;
}
.pcg-resource-link:hover { padding-left: 8px; color: var(--accent); }

@media (max-width: 768px) {
  .pcg-img-row { grid-template-columns: 1fr; }
}
