/* Dark Modern Portfolio — Pedro Clavero De Dios */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #141824;
  --bg-tertiary: #1e2336;
  --text-primary: #f1f5f9;
  --text-secondary: #8b9ab5;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --border: #252d42;
  --red: #ef4444;
}

/* ========== RESET & BASE ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  max-width: 1100px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
a:visited { color: var(--accent); }

h1, h2, h3 { color: var(--text-primary); margin-top: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
ul { padding-left: 20px; }
p { margin-bottom: 12px; }

/* ========== HEADER ========== */
header {
  background-color: var(--bg-secondary);
  padding: 40px 24px 34px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
}

header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

header h2 {
  margin: 7px 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ========== NAVIGATION ========== */
nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  justify-content: center;
}

nav li { margin: 0; }

nav a {
  display: block;
  color: var(--text-secondary);
  padding: 13px 22px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

nav a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

nav a:visited { color: var(--text-secondary); }

nav a.selected {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ========== MAIN ========== */
main {
  background-color: var(--bg-primary);
  padding: 56px 36px;
  min-height: 50vh;
}

/* ========== FOOTER ========== */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

footer a { color: var(--text-secondary); margin: 0 6px; }
footer a:hover { color: var(--accent); }
footer a:visited { color: var(--text-secondary); }

/* ========== UTILITY ========== */
.muted { color: var(--text-secondary); }

.section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2.2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

/* ========== BUTTONS ========== */
.btn-primary {
  display: inline-block;
  background-color: var(--accent);
  color: #fff;
  padding: 11px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-primary:visited { color: #fff; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text-primary);
  padding: 11px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-outline:visited { color: var(--text-primary); }

/* ========== TECH TAGS (shared) ========== */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ========== HOME — HERO ========== */
#hero {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: center;
  margin-bottom: 0;
}

.hero-content { flex: 1; min-width: 280px; }

.hero-heading {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-heading .gradient {
  background: linear-gradient(135deg, #e2e8f0 20%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-bio {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 500px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.hero-tag {
  display: inline-block;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  letter-spacing: 0.2px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.headshot {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ========== HOME — STATS ========== */
.stats-strip {
  display: flex;
  margin: 52px 0 56px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.stat-item {
  flex: 1;
  padding: 28px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child { border-right: none; }

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 7px;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 500;
}

/* ========== HOME — SOCIAL ========== */
#social {
  text-align: center;
  margin: 0 0 52px;
}

#social a {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: border-color 0.2s, color 0.2s;
}

#social a:hover { border-color: var(--accent); color: var(--accent); }
#social a:visited { color: var(--text-secondary); }

/* ========== HOME — FEATURED PROJECTS ========== */
.featured-section { margin-bottom: 16px; }
.featured-section > .section-label { margin-bottom: 22px; }

.project-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  transition: border-color 0.25s;
}

.project-card:hover { border-color: var(--accent); }

.project-card-img {
  width: 400px;
  min-width: 400px;
  overflow: hidden;
}

.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.project-info h3 { font-size: 1.15rem; margin-bottom: 8px; }

.project-info > p {
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-size: 0.88rem;
  line-height: 1.75;
}

.project-info .tech-tags { margin-top: auto; }

/* ========== HOME — CTA ========== */
.cta-section {
  text-align: center;
  padding: 56px 24px;
  margin-top: 52px;
  background: linear-gradient(145deg, var(--bg-secondary) 0%, rgba(59, 130, 246, 0.06) 100%);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.cta-section h2 { margin-bottom: 8px; font-size: 1.55rem; }
.cta-section p { color: var(--text-secondary); margin-bottom: 28px; font-size: 0.95rem; }

/* ========== RESUME ========== */
.resume-main { padding-top: 0; }

.resume-header { margin-bottom: 40px; }
.resume-header h1 { margin-bottom: 4px; }
.resume-subtitle { color: var(--text-secondary); font-size: 0.88rem; margin: 0; }

.resume-row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}

.resume-row:last-child { border-bottom: none; }

.resume-row aside {
  width: 18%;
  flex-shrink: 0;
  text-align: right;
  padding-right: 30px;
  padding-top: 3px;
}

.resume-row aside h2 {
  color: var(--accent);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.resume-row section { width: 82%; }

.resume-row section address {
  font-style: normal;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 18px;
  line-height: 1.9;
}

.resume-row section > p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-size: 0.88rem;
  line-height: 1.8;
}

.resume-row section strong { color: var(--text-primary); }

.job-title {
  font-size: 1.02rem !important;
  font-weight: 600;
  color: var(--text-primary) !important;
  margin-bottom: 2px !important;
  line-height: 1.4 !important;
}

.job-meta {
  font-size: 0.8rem !important;
  color: var(--text-secondary) !important;
  margin-bottom: 12px !important;
  font-weight: 400;
  line-height: 1.5 !important;
}

.resume-row section ul {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 22px;
  line-height: 1.9;
  padding-left: 18px;
}

.resume-row section ul li { margin-bottom: 4px; }

/* Tech stack box in resume */
.tech-stack-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 16px 0 24px;
}

.tech-stack-box .tech-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

/* Skill grid */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.skill-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  transition: border-color 0.2s, color 0.2s;
}

.skill-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

abbr { text-decoration: underline dotted; cursor: help; color: inherit; }

/* ========== PORTFOLIO — FEATURED PROJECT ========== */
.featured-project { margin-bottom: 40px; }

.featured-project-card {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  overflow: hidden;
}

.featured-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.featured-images img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}

.featured-images img:first-child { border-right: 1px solid var(--border); }
.featured-images img:hover { opacity: 0.88; }

.featured-info { padding: 32px 36px; }

.featured-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 13px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.featured-info h2 {
  font-size: 1.75rem;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.featured-info h2 .featured-type {
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.featured-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 760px;
}

.featured-stats {
  display: flex;
  margin-bottom: 30px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 400px;
}

.fstat {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.fstat:last-child { border-right: none; }

.fstat-num {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 5px;
}

.fstat-label {
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.featured-section-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}

.featured-modules { margin-bottom: 26px; }

.module-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.module-chip {
  font-size: 0.71rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: border-color 0.2s, color 0.2s;
}

.module-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.featured-tech { margin-top: 24px; }

/* ========== PORTFOLIO ========== */
.portfolio-intro { margin-bottom: 36px; }
.portfolio-intro h1 { margin-bottom: 8px; }

#portfolio-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

figure {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  cursor: default;
}

figure.mangadeck-showcase {
  overflow: visible; /* Allow stacked images to slide outside */
}

figure:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

figure img { width: 100%; display: block; cursor: pointer; transition: transform 0.2s; }
figure video { width: 100%; display: block; cursor: pointer; transition: transform 0.2s; }

figure img:hover { transform: scale(1.02); }
figure video:hover { transform: scale(1.02); }

/* MangaDeck Stacked Images Animation */
.mangadeck-showcase .stacked-images {
  position: relative;
  width: 100%;
  perspective: 1000px;
  overflow: visible;
}

.stacked-images .stack-layer {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: block;
}

/* Default state — layer-1 (Classic) on top, others peeking behind */
.stacked-images .layer-1 {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 8;
}

.stacked-images .layer-2,
.stacked-images .layer-3,
.stacked-images .layer-4,
.stacked-images .layer-5,
.stacked-images .layer-6,
.stacked-images .layer-7,
.stacked-images .layer-8 {
  position: absolute;
  top: 0;
  width: 100%;
  height: auto;
}

.stacked-images .layer-2 { z-index: 7; left: 4px; }
.stacked-images .layer-3 { z-index: 6; left: 8px; }
.stacked-images .layer-4 { z-index: 5; left: 12px; }
.stacked-images .layer-5 { z-index: 4; left: 16px; }
.stacked-images .layer-6 { z-index: 3; left: 20px; }
.stacked-images .layer-7 { z-index: 2; left: 24px; }
.stacked-images .layer-8 { z-index: 1; left: 28px; }

/* On hover — fan all 8 out like a deck of cards */
.stacked-images:hover .layer-1 {
  position: relative;
  width: 100%;
  left: 0;
}

.stacked-images:hover .layer-2,
.stacked-images:hover .layer-3,
.stacked-images:hover .layer-4,
.stacked-images:hover .layer-5,
.stacked-images:hover .layer-6,
.stacked-images:hover .layer-7,
.stacked-images:hover .layer-8 {
  position: absolute;
  width: 100%;
  top: 0;
}

.stacked-images:hover .layer-2 { left: 11%; }
.stacked-images:hover .layer-3 { left: 22%; }
.stacked-images:hover .layer-4 { left: 33%; }
.stacked-images:hover .layer-5 { left: 44%; }
.stacked-images:hover .layer-6 { left: 55%; }
.stacked-images:hover .layer-7 { left: 66%; }
.stacked-images:hover .layer-8 { left: 77%; }

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10000;
}

.lightbox-close:hover {
  color: #0b63ff;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  padding: 20px;
  transition: all 0.2s;
  z-index: 10000;
}

.lightbox-arrow:hover {
  color: #0b63ff;
  transform: translateY(-50%) scale(1.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-arrow.hidden {
  display: none;
}

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

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

figcaption {
  padding: 16px 18px 2px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.fig-description {
  padding: 4px 18px 4px;
  color: var(--text-secondary);
  font-size: 0.77rem;
  line-height: 1.6;
}

.fig-tags { padding: 10px 18px 16px; }
.fig-tags .tech-tags { margin: 0; }

.other-projects {
  margin-top: 40px;
  padding: 28px 30px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.other-projects h2 { margin-bottom: 8px; font-size: 1.15rem; }
.other-projects p { color: var(--text-secondary); margin: 0; font-size: 0.88rem; line-height: 1.75; }

/* ========== MANGADECK SLIDESHOW ========== */
.manga-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: pointer;
}

.manga-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.manga-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.manga-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.manga-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 10;
}

.manga-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: background 0.35s, transform 0.35s;
}

.manga-dot.active {
  background: #fff;
  transform: scale(1.25);
}

.manga-theme-label {
  position: absolute;
  bottom: 28px;
  left: 12px;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 9px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

/* ========== BLOG ========== */
.blog-header { margin-bottom: 36px; }
.blog-header h1 { margin-bottom: 0; }

.blog-meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 6px; margin-bottom: 0;
}

.blog-article { max-width: 700px; }

.blog-article > h2 {
  color: var(--text-primary);
  font-size: 1.45rem;
  margin-top: 8px; margin-bottom: 6px;
  line-height: 1.35;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 28px 0;
  padding: 18px 24px;
  background-color: var(--bg-secondary);
  border-radius: 0 10px 10px 0;
  color: var(--text-secondary);
  line-height: 1.9;
  font-style: italic;
}

.takeaways-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 30px;
  margin: 36px 0;
}

.takeaways-box h3 { color: var(--text-primary); margin-bottom: 16px; font-size: 1.02rem; }

.takeaways-box ul { list-style: none; padding: 0; margin: 0; }

.takeaways-box ul li {
  color: var(--text-secondary);
  padding: 9px 0 9px 24px;
  position: relative;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--border);
}

.takeaways-box ul li:last-child { border-bottom: none; }

.takeaways-box ul li::before {
  content: '→';
  color: var(--accent);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.blog-links {
  margin-top: 40px;
  padding: 24px 28px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.blog-links h3 { margin-bottom: 8px; font-size: 1rem; }
.blog-links p { color: var(--text-secondary); margin: 0; font-size: 0.86rem; }

/* ========== CONTACT FORM ========== */
.contact-intro {
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 540px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 22px;
  max-width: 540px;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 7px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #3d4a5e;
}

.form-group textarea { resize: vertical; min-height: 140px; }

.form-group select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b9ab5' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.required-star { color: var(--red); }

/* ========== CONFIRMATION ========== */
.confirmation-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.confirmation-box h2 { color: var(--accent); margin-bottom: 14px; font-size: 1.4rem; }
.confirmation-box p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 10px; }

.confirmation-contact {
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 18px;
  margin: 24px 0;
}

.confirmation-contact p { margin: 6px 0; font-weight: 500; color: var(--text-secondary); }
.confirmation-contact a { color: var(--accent); }

.return-btn {
  display: inline-block;
  background-color: var(--accent);
  color: #fff;
  padding: 10px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  margin-top: 20px;
  transition: background-color 0.2s, transform 0.15s;
}

.return-btn:hover { background-color: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.return-btn:visited { color: #fff; }

/* ========== RESPONSIVE ========== */
@media (max-width: 860px) {
  .project-card { flex-direction: column; }
  .project-card-img { width: 100%; min-width: 0; height: 220px; }
  .project-card-img img { height: 100%; object-fit: cover; }
  .project-card-img video { height: 100%; object-fit: cover; }
}

@media (max-width: 700px) {
  nav ul { flex-direction: column; align-items: center; }
  nav a { padding: 10px 16px; width: 100%; text-align: center; border-bottom: none; }
  nav a:hover { border-bottom: none; }
  nav a.selected { border-bottom: none; background-color: var(--bg-tertiary); border-radius: 6px; }

  main { padding: 36px 20px; }

  #hero { flex-direction: column; align-items: center; text-align: center; }
  .hero-content { min-width: 0; }
  .hero-heading { font-size: 2.2rem; }
  .hero-bio { max-width: 100%; }
  .hero-tags { justify-content: center; }
  .hero-buttons { justify-content: center; }
  .headshot { margin: 0 auto; }

  .stats-strip { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); padding: 22px 16px; }
  .stat-item:last-child { border-bottom: none; }

  .resume-row { flex-direction: column; }
  .resume-row aside { width: 100%; text-align: left; padding-right: 0; padding-bottom: 6px; }
  .resume-row section { width: 100%; }

  #portfolio-container { grid-template-columns: 1fr; }
  .featured-info { padding: 24px 20px; }
  .featured-images img { height: 160px; }
  .featured-stats { max-width: 100%; }
  .featured-info h2 { font-size: 1.4rem; }
  .blog-article { max-width: 100%; }
  .confirmation-box { padding: 32px 22px; }
}

@media (max-width: 480px) {
  header { padding: 30px 16px 26px; }
  header h1 { font-size: 1.55rem; }
  .hero-heading { font-size: 1.85rem; }
  .project-info { padding: 18px 20px; }
  .cta-section { padding: 36px 18px; }
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
}
