*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #000000;
  --copper: #8B5E3C;
  --copper-light: #C4956A;
  --copper-dim: rgba(139,94,60,0.25);
  --copper-glow: rgba(196,149,106,0.08);
  --text: #ffffff;
  --text-dim: #aaaaaa;
  --text-muted: #666666;
  --card-bg: #0a0a0a;
  --card-border: #1a1a1a;
  --card-hover: #23201c; /* Increased contrast for accessibility */
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== COPPER BORDER FRAME ===== */
.page-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  border: 3px solid var(--copper);
  box-shadow: inset 0 0 60px rgba(139,94,60,0.08);
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 12px;
  right: 30px;
  z-index: 100;
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color 0.3s;
}

nav a:hover { color: var(--copper-light); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: 1000px;
}

.hero-image {
  flex-shrink: 0;
}

.hero-image img {
  width: 180px;
  height: auto;
  display: block;
}

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.hero-text .tagline {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  line-height: 1.4;
}

.hero-bio {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 700px;
  line-height: 1.7;
  margin-top: 1.25rem;
  font-weight: 300;
}

/* ===== SECTIONS ===== */
section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--copper-light);
  margin-bottom: 2.5rem;
  text-align: center;
}

.section-divider {
  width: 60px;
  height: 1px;
  background: var(--copper);
  margin: 0 auto 3rem;
}

/* ===== ORG BLOCKS ===== */
.org-block {
  margin-bottom: 4rem;
}

.org-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #1a1a1a;
}

.org-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}

.org-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* ===== PROJECT CARDS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--card-bg);
  border: 2px solid var(--copper-light);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
}

.project-card:hover {
  border-color: #d3d3d3;
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(139,94,60,0.12);
}

.card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #050505;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.4s;
  opacity: 0.85;
}

.project-card:hover .card-image img {
  transform: scale(1.04);
  opacity: 1;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: #050505;
}

.card-body {
  padding: 1.25rem 1.5rem;
}

.card-type {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--copper-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-weight: 300;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  color: var(--text-muted);
  font-weight: 500;
  transition: border-color 0.3s;
}

.project-card:hover .tag {
  border-color: var(--copper-dim);
}

/* hidden detail source */
.project-detail { display: none; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #0a0a0a;
  border: 1px solid var(--copper);
  border-radius: 4px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  cursor: default;
  position: relative;
  animation: modalUp 0.35s ease;
  box-shadow: 0 0 80px rgba(139,94,60,0.1);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid #333;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
}

.modal-close:hover {
  border-color: var(--copper);
  color: var(--copper-light);
}

.modal-image {
  width: 100%;
  height: 260px;
  overflow: hidden;
  cursor: pointer;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.modal-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: #050505;
}

.modal-body {
  padding: 2rem 2.5rem 2.5rem;
}

.modal-type {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--copper-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.detail-section { margin-bottom: 1.25rem; }

.detail-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--copper-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.detail-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  font-weight: 300;
}

.detail-screenshots {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-top: 0.5rem;
}

.detail-screenshots img {
  height: 160px;
  border-radius: 4px;
  border: 1px solid #222;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.3s;
}

.detail-screenshots img:hover { border-color: var(--copper); }

/* ===== CAROUSEL ===== */
.carousel {
  position: relative;
  margin-top: 0.5rem;
  background: #050505;
  border: 1px solid #222;
  border-radius: 4px;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-track img {
  width: 100%;
  flex-shrink: 0;
  object-fit: contain;
  max-height: 360px;
  cursor: zoom-in;
  background: #050505;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid #444;
  color: var(--copper-light);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 5;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.9);
  border-color: var(--copper);
}

.carousel-btn-prev { left: 8px; }
.carousel-btn-next { right: 8px; }

.carousel-counter {
  text-align: center;
  padding: 0.4rem 0;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding-bottom: 0.5rem;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  padding: 0;
}

.carousel-dot.active {
  background: var(--copper-light);
}

.code-snippet {
  background: #050505;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 1rem;
  margin-top: 0.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
}

/* ===== VIDEO TOUR ===== */
.detail-video { width: 100%; border-radius: 6px; margin-top: 6px; }

/* ===== PDF LINK ===== */
.pdf-link-wrap { margin-top: 0.5rem; }
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #333;
  border-radius: 4px;
  color: var(--copper-light);
  text-decoration: none;
  font-size: 0.85rem;
  transition: border-color 0.3s;
}
.pdf-link:hover { border-color: var(--copper); }

/* ===== VIDEO ===== */
.video-wrap { margin-top: 0.5rem; }
.video-player {
  width: 100%;
  max-height: 400px;
  border-radius: 4px;
  border: 1px solid #222;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.skill-category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 1.5rem;
  transition: border-color 0.3s;
}

.skill-category:hover { border-color: var(--copper-dim); }

.skill-cat-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.skill-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: transparent;
  border: 1px solid #222;
  border-radius: 3px;
  color: var(--text-dim);
  font-weight: 400;
  transition: all 0.3s;
}

.skill-tag:hover {
  border-color: var(--copper);
  color: var(--text);
}

.section-label-spaced { margin-top: 3rem; }
.profdev-grid { max-width: 520px; margin: 0 auto; }

/* ===== CERTS ===== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.cert-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cert-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--copper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cert-info h4 { font-size: 0.85rem; font-weight: 500; }
.cert-info p { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid #1a1a1a;
  padding: 3rem 2rem;
  text-align: center;
}

.footer-cta {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.footer-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid #222;
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s;
}

.footer-link:hover {
  border-color: var(--copper);
  color: var(--copper-light);
}

.footer-copy {
  margin-top: 2.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: #000000f0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
}

.lightbox.active { display: flex; }
.lightbox img {
  max-width: 85vw;
  max-height: 85vh;
  border: 1px solid var(--copper);
}

.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid #555;
  color: var(--copper-light);
  font-size: 1.4rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1001;
}

.lb-btn:hover {
  background: rgba(0,0,0,0.95);
  border-color: var(--copper);
}

.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

.lightbox.has-nav .lb-btn { display: flex; }

.lb-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  display: none;
}

.lightbox.has-nav .lb-counter { display: block; }

.lb-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid #555;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1001;
}

.lb-close:hover {
  border-color: var(--copper);
  color: var(--copper-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; gap: 1.5rem; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .hero { padding: 5rem 1.5rem 3rem; min-height: 0; }
  nav { top: 8px; right: 12px; gap: 0.75rem; }
  nav a { font-size: 0.7rem; letter-spacing: 1px; }
  section { padding: 3rem 1rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero-image img { width: 130px; }
  .hero-text h1 { font-size: 1.6rem; }
  .hero-text .tagline { font-size: 1.05rem; }
  .hero-bio { font-size: 0.85rem; }
  .section-label { font-size: 0.7rem; }
  .org-name { font-size: 1.2rem; }
  .card-body { padding: 1rem 1.25rem; }
  .card-title { font-size: 1rem; }
  .card-desc { font-size: 0.8rem; }
  .modal-content { max-height: 90vh; margin: 0.5rem; border-radius: 4px; }
  .modal-body { padding: 1.25rem 1.5rem 1.5rem; }
  .modal-title { font-size: 1.25rem; }
  .modal-image { height: 180px; }
  .detail-screenshots { gap: 0.5rem; }
  .detail-screenshots img { height: 120px; }
  .code-snippet { font-size: 0.65rem; padding: 0.75rem; max-height: 160px; }
  .carousel-track img { max-height: 250px; }
  .carousel-btn { width: 30px; height: 30px; font-size: 0.85rem; }
  .lb-btn { width: 36px; height: 36px; font-size: 1.1rem; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .certs-grid { grid-template-columns: 1fr; }
  .footer-cta { font-size: 1.3rem; }
  .footer-links { flex-direction: column; align-items: center; }
  .page-frame { border-width: 2px; }
}

@media (max-width: 480px) {
  .hero { padding: 4.5rem 1rem 2rem; }
  .hero-image img { width: 110px; }
  .hero-text h1 { font-size: 1.4rem; }
  nav { gap: 0.5rem; }
  nav a { font-size: 0.6rem; }
  .card-image { height: 150px; }
  .modal-overlay { padding: 0.5rem; }
  .modal-image { height: 140px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
