/* ═══════════════════════════════════════════════════════════
   Jhonnatan Barbosa — Portfolio Styles
   Updated: fluid container, mobile nav, improved breakpoints,
   all component styles merged from inline <style>
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #161619;
  --surface: #1d1d21;
  --surface-hover: #232328;
  --border: #2c2c32;
  --border-soft: #232327;
  --text: #dddbd6;
  --text-mid: #a09e97;
  --text-dim: #918f89;
  --accent: #a8b87a;
  --accent-dim: #7a8a55;
  --note-bg: rgba(168,184,122,0.06);
  --note-border: rgba(168,184,122,0.25);
  --shadow-soft: 0 4px 24px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.15);
  --shadow-glow: 0 4px 32px rgba(168,184,122,0.08), 0 1px 8px rgba(0,0,0,0.2);
  --transition-lift: transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s ease, border-color 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── SCROLL PROGRESS BAR ──────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), rgba(140,160,210,0.7));
  z-index: 100;
  pointer-events: none;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(168,184,122,0.3);
}

/* ── ANIMATED GRADIENT BORDER KEYFRAMES ──────────────────── */
@keyframes border-rotate {
  0%   { --border-angle: 0deg; }
  100% { --border-angle: 360deg; }
}
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

body {
  font-family: 'Geist', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-size: 13.5px;
  /* ── Dot grid pattern fills the blank background ── */
  background-image:
    radial-gradient(circle, rgba(168,184,122,0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* ── Ambient glow blobs — fixed in viewport, sit behind everything ── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
}
body::before {
  width: 600px; height: 600px;
  top: -120px; left: -180px;
  background: radial-gradient(circle, rgba(168,184,122,0.045) 0%, transparent 70%);
}
body::after {
  width: 500px; height: 500px;
  bottom: 10%; right: -140px;
  background: radial-gradient(circle, rgba(140,160,210,0.035) 0%, transparent 70%);
}

::selection { background: var(--accent); color: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* stagger children inside a section */
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.07s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.21s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.28s; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── FLUID CONTAINER ─────────────────────────────────────
   Scales from ~720px up to 1140px with comfortable padding.
   On 1080p (1920px) this fills ~60% of viewport — still
   readable without the text lines getting too long.
   On 720p (1280px) it fills ~89% — nice and snug.
   ────────────────────────────────────────────────────────── */
.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3vw, 3rem);
  position: relative;
  z-index: 1;
}

/* ── Faint vertical guide rails at content edges ── */
.page::before,
.page::after {
  content: '';
  position: fixed;
  top: 0; bottom: 0;
  width: 1px;
  pointer-events: none;
  z-index: 0;
}
.page::before {
  left: calc(50% - 570px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(168,184,122,0.08) 15%,
    rgba(168,184,122,0.04) 50%,
    rgba(168,184,122,0.08) 85%,
    transparent 100%
  );
}
.page::after {
  right: calc(50% - 570px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(168,184,122,0.08) 15%,
    rgba(168,184,122,0.04) 50%,
    rgba(168,184,122,0.08) 85%,
    transparent 100%
  );
}

/* Hide guide rails when viewport is too narrow for them */
@media (max-width: 1200px) {
  .page::before,
  .page::after { display: none; }
}

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(22,22,25,0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
nav.scrolled {
  background: rgba(22,22,25,0.95);
  border-bottom-color: var(--border-soft);
  box-shadow: 0 1px 12px rgba(0,0,0,0.3);
}

/* ── Noise / grain overlay for depth ── */
nav::after { display: none; }
main.page::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

nav .nav-inner {
  max-width: 1140px; margin: 0 auto;
  padding: 0.6rem clamp(1.25rem, 3vw, 3rem);
  display: flex; justify-content: space-between; align-items: center;
  position: relative;
}

nav .name {
  font-family: 'Instrument Serif', serif;
  font-size: 1.05rem; color: var(--text);
}

nav .nav-links { display: flex; gap: 1.4rem; list-style: none; }

nav .nav-links a {
  color: var(--text-dim); font-size: 0.8rem; font-weight: 500;
  text-decoration: none; transition: color 0.25s ease;
  position: relative;
}
nav .nav-links a:hover { color: var(--text); }

/* ── Nav active state (set via JS IntersectionObserver) ── */
nav .nav-links a.active {
  color: var(--accent);
}
nav .nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.7;
}

/* ── MOBILE NAV TOGGLE ─────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 28px; height: 20px;
  position: relative;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  position: absolute; left: 0;
  width: 100%; height: 2px;
  background: var(--text-dim);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }

.nav-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ── INTRO ───────────────────────────────────────────────── */
.intro {
  padding: 3rem 0 2.25rem;
  border-bottom: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
  position: relative;
  z-index: 1;
}

/* ── Staggered intro entrance ── */
.intro h1,
.intro p,
.intro-links {
  opacity: 0;
  transform: translateY(20px);
  animation: intro-in 0.7s cubic-bezier(0.22,1,0.36,1) forwards;
}
.intro h1      { animation-delay: 0.1s; }
.intro p       { animation-delay: 0.3s; }
.intro-links   { animation-delay: 0.5s; }

@keyframes intro-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .intro h1, .intro p, .intro-links {
    opacity: 1; transform: none; animation: none;
  }
}
.intro::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim) 0%, var(--border-soft) 50%, transparent 100%);
}

.intro h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.7rem; font-weight: 400;
  line-height: 1.2; letter-spacing: -0.015em;
  text-shadow: 0 0 40px rgba(168,184,122,0.08);
}

.intro p {
  color: var(--text-mid); font-size: 0.88rem;
  max-width: 520px; margin-top: 0.5rem;
}

.intro-links { display: flex; gap: 0.6rem; flex-shrink: 0; }

.intro-links a {
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-dim); padding: 0.35rem 0.8rem;
  border: 1px solid var(--border); border-radius: 4px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.intro-links a:hover {
  border-color: var(--accent-dim); color: var(--text);
  background: rgba(168,184,122,0.04);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ── TIP ─────────────────────────────────────────────────── */
.tip {
  background: var(--note-bg);
  border-left: 2px solid var(--note-border);
  padding: 0.55rem 0.85rem;
  margin: 0.85rem 0;
  font-size: 0.78rem;
  color: var(--accent);
  line-height: 1.55;
}
.tip strong {
  font-weight: 600; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-right: 0.3rem;
}

/* ── SECTIONS ────────────────────────────────────────────── */
section { padding: 2.5rem 0; position: relative; z-index: 1; }
section + section { border-top: 1px solid var(--border-soft); }

/* Ambient section glows — visible on wide screens behind content */
#projects::before {
  content: '';
  position: absolute;
  top: 40px; left: -280px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(168,184,122,0.03) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: -1;
}
#cyberpunk-analytics::before {
  content: '';
  position: absolute;
  top: 80px; right: -220px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(140,160,210,0.03) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: -1;
}
#about::before {
  content: '';
  position: absolute;
  bottom: 0; left: -200px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(210,170,120,0.025) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: -1;
}

.section-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 1.4rem;
  position: relative;
}

/* ── Section edge crosshair markers ── */
.section-header::before,
.section-header::after {
  content: '+';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent-dim);
  opacity: 0.35;
  pointer-events: none;
  letter-spacing: 0;
}
.section-header::before { left: -2.2rem; }
.section-header::after  { right: -2.2rem; }

/* Hide crosshairs when they'd overlap content on small screens */
@media (max-width: 1200px) {
  .section-header::before,
  .section-header::after { display: none; }
}

.section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.15rem; font-weight: 400;
}

.section-aside { font-size: 0.75rem; color: var(--text-dim); }

/* ── PROJECT CARDS ───────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  transition: var(--transition-lift);
  position: relative;
}

/* ── Animated gradient border overlay ── */
.project-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 7px;
  padding: 1px;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    var(--accent-dim),
    rgba(140,160,210,0.5),
    var(--accent),
    rgba(210,170,120,0.4),
    var(--accent-dim)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 2;
  animation: border-rotate 4s linear infinite;
}

.project-card:hover::before {
  opacity: 1;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}

.project-thumb {
  background: var(--surface-hover);
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.75rem; font-weight: 500;
  min-height: 160px;
  position: relative;
}
/* Gradient edge blend on thumbnails */
.project-thumb::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(29,29,33,0.4) 100%);
  pointer-events: none;
  z-index: 1;
}
.project-thumb img,
.project-thumb video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

.project-card:nth-child(1) .project-thumb {
  background: radial-gradient(ellipse at 30% 50%, rgba(168,184,122,0.08) 0%, transparent 65%), var(--surface-hover);
}
.project-card:nth-child(2) .project-thumb {
  background: radial-gradient(ellipse at 70% 40%, rgba(140,160,210,0.07) 0%, transparent 65%), var(--surface-hover);
}
.project-card:nth-child(3) .project-thumb {
  background: radial-gradient(ellipse at 50% 60%, rgba(210,170,120,0.07) 0%, transparent 65%), var(--surface-hover);
}
.project-card:nth-child(4) .project-thumb {
  background: radial-gradient(ellipse at 40% 35%, rgba(190,130,160,0.07) 0%, transparent 65%), var(--surface-hover);
}
.project-card:nth-child(5) .project-thumb {
  background: radial-gradient(ellipse at 60% 55%, rgba(120,180,170,0.07) 0%, transparent 65%), var(--surface-hover);
}

.project-body { padding: 1.15rem 1.4rem; display: flex; flex-direction: column; justify-content: center; }

.project-top-row {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 0.2rem;
  flex-wrap: wrap; gap: 0.4rem;
}

.project-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1.02rem; font-weight: 400;
}

.project-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem; color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem; border-radius: 3px;
}

.project-desc {
  color: var(--text-mid); font-size: 0.84rem;
  margin-bottom: 0.65rem; line-height: 1.55;
}

.meta-row {
  display: flex; flex-wrap: wrap;
  gap: 0.2rem 1.1rem; font-size: 0.78rem;
  margin-bottom: 0.6rem;
}

.meta-pair { display: flex; gap: 0.3rem; }
.meta-pair .ml { color: var(--text-dim); }
.meta-pair .mv { color: var(--text); font-weight: 500; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.ptag {
  font-size: 0.66rem; font-weight: 500;
  color: var(--text-dim);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 0.12rem 0.5rem; border-radius: 3px;
}

.project-actions {
  margin-top: 0.6rem; padding-top: 0.55rem;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 1.2rem; align-items: center;
  font-size: 0.78rem; font-weight: 500;
}
.project-actions a {
  transition: color 0.15s ease, letter-spacing 0.2s ease;
}
.project-actions a:hover {
  letter-spacing: 0.01em;
}

/* ── PLAYER REVIEWS ─────────────────────────────────────── */
.player-reviews {
  margin-top: 0.55rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}
.pr-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.56rem; color: var(--accent-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pr-quotes {
  display: flex; gap: 0.75rem; margin-top: 0.35rem;
  flex-wrap: wrap;
}
.pr-quote {
  display: flex; flex-direction: column; gap: 0.1rem;
  font-size: 0.75rem; line-height: 1.45;
}
.pr-stars {
  font-size: 0.62rem; color: #d4a95a;
  letter-spacing: 0.05em;
}
.pr-text {
  color: var(--text-mid); font-style: italic;
}
.pr-attr {
  font-size: 0.65rem; color: var(--text-dim);
}

/* ── CASE STUDY ──────────────────────────────────────────── */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-top: 1rem;
}

.cs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  transition: var(--transition-lift);
}
.cs-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.cs-card .cs-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.cs-card h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 0.9rem; font-weight: 400;
  margin-bottom: 0.3rem; line-height: 1.25;
}

.cs-card p {
  font-size: 0.78rem; color: var(--text-mid); line-height: 1.5;
}

.media-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 0.6rem;
}

/* ── DASHBOARD EMBED ─────────────────────────────────────── */
.dashboard-section {
  margin-top: 1.25rem;
}

.dashboard-embed {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.dashboard-embed iframe {
  width: 100%;
  height: 740px;
  border: none;
  display: block;
}

.dashboard-label {
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-label span {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.dashboard-label a {
  font-size: 0.72rem;
  color: var(--text-dim);
  transition: color 0.15s;
}
.dashboard-label a:hover { color: var(--accent); }

/* ── CASE STUDY RETROSPECTIVE ───────────────────────────── */
.cs-retro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.cs-retro-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.cs-retro-title {
  font-family: 'Instrument Serif', serif;
  font-size: 0.95rem; font-weight: 400;
  margin-bottom: 0.45rem; line-height: 1.25;
}
.cs-retro-body p {
  font-size: 0.8rem; color: var(--text-mid);
  line-height: 1.6; margin-bottom: 0.5rem;
}
.cs-retro-body p:last-child { margin-bottom: 0; }

/* ── ABOUT ───────────────────────────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem; align-items: start;
}

.about-photo {
  width: 110px; height: 135px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--text-dim);
  overflow: hidden;
}
.about-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.about-body p {
  color: var(--text-mid); font-size: 0.88rem;
  margin-bottom: 0.6rem; max-width: 580px; line-height: 1.6;
}

.about-body .design-philosophy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin: 0.85rem 0;
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.6;
}
.about-body .design-philosophy strong {
  color: var(--text);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.3rem;
}

.tools-row {
  margin-top: 0.75rem;
  display: flex; flex-wrap: wrap;
  gap: 0.3rem 1.8rem;
  font-size: 0.8rem;
}

.tools-row .tr-item { display: flex; gap: 0.3rem; }
.tools-row dt { color: var(--text-dim); font-weight: 500; }
.tools-row dd { color: var(--text); margin: 0; }

/* ── LOOKING FOR ─────────────────────────────────────────── */
.looking-for {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.55;
}
.looking-for strong {
  color: var(--text);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.3rem;
}

/* ── ABOUT SUB-SECTIONS ─────────────────────────────────── */
.about-block {
  margin-bottom: 0.5rem;
}

.about-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

/* ── SITE FOOTER ────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  font-family: 'Geist Mono', monospace;
  font-size: 0.66rem;
  color: var(--text-dim);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 480px) {
  .site-footer {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    padding: 1rem 1.25rem;
  }
}

/* ── CONTACT ─────────────────────────────────────────────── */
.contact-row {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem; margin-top: 0.75rem;
}

.contact-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem; color: var(--text);
  text-decoration: none;
  transition: var(--transition-lift);
  display: flex; align-items: center; gap: 0.4rem;
}
.contact-item:hover {
  border-color: var(--accent-dim);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.contact-item .ci-label { color: var(--text-dim); font-size: 0.72rem; }

/* ── ADDITIONAL WORK GRID ────────────────────────────────── */
.additional-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.additional-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 68px 1fr;
  transition: var(--transition-lift);
}
.additional-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.additional-item .ai-thumb {
  background: var(--surface-hover);
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.58rem;
  font-weight: 500;
  min-height: 90px;
  position: relative;
}
.additional-item .ai-thumb img,
.additional-item .ai-thumb video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

.additional-item .ai-body {
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.additional-item .ai-name {
  font-family: 'Instrument Serif', serif;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.25;
}

.additional-item .ai-genre {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.additional-item .ai-role {
  font-size: 0.72rem;
  color: var(--text-mid);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.additional-item .ai-link {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 500;
}

/* ── DOCUMENT GRID ───────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.doc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  transition: var(--transition-lift);
}
.doc-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.doc-item .doc-type {
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--accent-dim);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.doc-item .doc-type.doc-qdd { background: #8a7abf; }
.doc-item .doc-type.doc-ldd { background: #7aabb8; }
.doc-item .doc-type.doc-test { background: #b8967a; }

.doc-item .doc-body { flex: 1; min-width: 0; }

.doc-item .doc-name {
  font-family: 'Instrument Serif', serif;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.25;
}

.doc-item .doc-desc {
  font-size: 0.72rem;
  color: var(--text-mid);
  margin-top: 0.15rem;
  line-height: 1.45;
}

.doc-item a {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 500;
  display: inline-block;
}

/* ── SCOPE TABLE (Guardian's Falls) ──────────────────────── */
.scope-table {
  width: 100%; border-collapse: collapse;
  margin: 0.85rem 0; font-size: 0.8rem;
}
.scope-table th {
  text-align: left; font-family: 'Geist Mono', monospace;
  font-size: 0.6rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.scope-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top; line-height: 1.5;
}
.scope-table .feature { color: var(--text); font-weight: 500; }
.scope-table .vision { color: var(--text-dim); font-size: 0.75rem; }
.scope-table .final { color: var(--text-mid); font-size: 0.75rem; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-block; font-family: 'Geist Mono', monospace;
  font-size: 0.56rem; padding: 0.1rem 0.4rem; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.badge-shipped { background: rgba(122,171,139,0.06); border: 1px solid rgba(122,171,139,0.3); color: #7aab8b; }
.badge-evolved { background: rgba(140,160,210,0.06); border: 1px solid rgba(140,160,210,0.3); color: #8ca0d2; }
.badge-simplified { background: rgba(201,179,106,0.06); border: 1px solid rgba(201,179,106,0.3); color: #c9b36a; }
.badge-cut { background: rgba(196,115,110,0.06); border: 1px solid rgba(196,115,110,0.25); color: #c4736e; }

/* ── MECHANIC SPOTLIGHT ──────────────────────────────────── */
.mechanic-spotlight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 0.9rem 1.1rem;
  margin: 0.85rem 0;
  display: grid; grid-template-columns: 180px 1fr;
  gap: 0; overflow: hidden;
}
.mechanic-spotlight .ms-visual {
  background: var(--surface-hover);
  border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 0.72rem;
  margin: -0.9rem 0 -0.9rem -1.1rem;
  padding: 0; text-align: center; line-height: 1.45;
  overflow: hidden;
  position: relative;
}
.mechanic-spotlight .ms-visual img,
.mechanic-spotlight .ms-visual video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.mechanic-spotlight .ms-body { padding-left: 1rem; }
.mechanic-spotlight .ms-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.25rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--accent);
}
.mechanic-spotlight h4 {
  font-family: 'Instrument Serif', serif;
  font-size: 0.92rem; font-weight: 400;
  margin-bottom: 0.3rem; line-height: 1.25;
}
.mechanic-spotlight p {
  font-size: 0.78rem; color: var(--text-mid); line-height: 1.55;
}
.mechanic-spotlight .ms-iter {
  font-size: 0.75rem; color: var(--text-dim);
  padding-top: 0.35rem; border-top: 1px solid var(--border-soft);
  margin-top: 0.35rem; line-height: 1.5;
}
.mechanic-spotlight .ms-iter strong { color: var(--text-mid); font-weight: 500; }

/* ── TAKEAWAY GRID ───────────────────────────────────────── */
.takeaway-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem; margin: 0.85rem 0;
}
.takeaway-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 0.85rem 1rem;
  transition: var(--transition-lift);
}
.takeaway-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.takeaway-card h4 {
  font-family: 'Instrument Serif', serif;
  font-size: 0.85rem; font-weight: 400;
  margin-bottom: 0.2rem; line-height: 1.25;
}
.takeaway-card p {
  font-size: 0.75rem; color: var(--text-mid); line-height: 1.5;
}

/* ── GF SECTION LABELS ───────────────────────────────────── */
.gf-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.6rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.2rem; margin-top: 1.25rem;
}
.gf-label:first-child { margin-top: 0; }
.gf-subtitle {
  font-family: 'Instrument Serif', serif;
  font-size: 1rem; font-weight: 400;
  margin-bottom: 0.3rem;
}
.gf-desc {
  color: var(--text-mid); font-size: 0.82rem;
  max-width: 620px; line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  padding: 1.25rem 0; border-top: 1px solid var(--border-soft);
  font-size: 0.72rem; color: var(--text-dim);
  display: flex; justify-content: space-between;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════ */

/* ── TABLET / SMALL LAPTOP (≤900px) ──────────────────────── */
@media (max-width: 900px) {
  .project-card { grid-template-columns: 220px 1fr; }
  .cs-grid { grid-template-columns: repeat(2, 1fr); }
  .additional-grid { grid-template-columns: 1fr 1fr; }
}

/* ── MOBILE (≤720px) ─────────────────────────────────────── */
@media (max-width: 720px) {

  /* Show hamburger, collapse nav links into dropdown */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  nav .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(22,22,25,0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  nav .nav-links.show { display: flex; }

  nav .nav-links li { list-style: none; }

  nav .nav-links a {
    display: block;
    padding: 0.65rem clamp(1.25rem, 3vw, 3rem);
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-soft);
  }
  nav .nav-links a.active::after { display: none; }
  nav .nav-links a.active { border-left: 2px solid var(--accent); }
  nav .nav-links li:last-child a { border-bottom: none; }

  /* Layout collapses */
  .intro { grid-template-columns: 1fr; }
  .intro-links { margin-top: 0.5rem; }

  .project-card { grid-template-columns: 1fr; }
  .project-card:hover { transform: none; box-shadow: none; }
  .project-card::before { display: none; }
  .project-card:hover { border-color: var(--accent-dim); }
  .project-thumb {
    min-height: 140px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .project-thumb::after {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: 35%;
    background: linear-gradient(180deg, transparent 0%, rgba(29,29,33,0.5) 100%);
  }

  .cs-grid { grid-template-columns: 1fr 1fr; }
  .about-layout { grid-template-columns: 1fr; }
  .about-photo { width: 90px; height: 110px; }

  .dashboard-embed iframe { height: 560px; }

  .section-header { flex-direction: column; gap: 0.25rem; }

  .additional-grid { grid-template-columns: 1fr 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .takeaway-grid { grid-template-columns: 1fr; }

  .mechanic-spotlight { grid-template-columns: 1fr; }
  .mechanic-spotlight .ms-visual {
    margin: -0.9rem -1.1rem 0; border-right: none;
    border-bottom: 1px solid var(--border); min-height: 80px;
  }
  .mechanic-spotlight .ms-body { padding-left: 0; padding-top: 0.75rem; }

  .scope-table { font-size: 0.72rem; }

  footer { flex-direction: column; gap: 0.2rem; }
}

/* ── SMALL PHONE (≤480px) ────────────────────────────────── */
@media (max-width: 480px) {
  body { font-size: 13px; }

  .intro h1 { font-size: 1.4rem; }

  .intro-links { flex-wrap: wrap; }
  .intro-links a {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .cs-grid { grid-template-columns: 1fr; }
  .additional-grid { grid-template-columns: 1fr; }
  .contact-row { flex-direction: column; }
  .contact-item { justify-content: center; }

  .dashboard-embed iframe { height: 440px; }

  .tools-row {
    flex-direction: column;
    gap: 0.4rem;
  }

  .meta-row { font-size: 0.72rem; }
  .project-actions { flex-wrap: wrap; gap: 0.8rem; }
}

/* ══════════════════════════════════════════════════════════
   Language Switcher
   ══════════════════════════════════════════════════════════ */

.lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.lang-overlay.visible {
  display: flex;
}
.lang-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.lang-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 44px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-soft), 0 0 80px rgba(168,184,122,0.06);
  transform: translateY(0);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.lang-overlay.hidden .lang-modal {
  transform: translateY(20px);
}
.lang-modal h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
}
.lang-modal p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.lang-buttons {
  display: flex;
  gap: 12px;
}
.lang-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
}
.lang-btn:hover {
  border-color: var(--accent-dim);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.lang-btn:active { transform: translateY(0); }
.lang-btn .flag { font-size: 2rem; line-height: 1; }
.lang-btn .label { color: var(--text-mid); font-size: 0.75rem; font-weight: 400; }

/* ── Persistent toggle in nav ──────────────────────────── */
.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--text-mid);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  flex-shrink: 0;
}
.lang-toggle:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}
.lang-toggle .flag-small { font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════════
   LANGUAGE SWITCHER
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay ────────────────────────────────────────────── */
.lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.lang-overlay.visible {
  display: flex;
}
.lang-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Modal ──────────────────────────────────────────────── */
.lang-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 44px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-soft), 0 0 80px rgba(168,184,122,0.06);
  transform: translateY(0);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.lang-overlay.hidden .lang-modal {
  transform: translateY(20px);
}
.lang-modal h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
}
.lang-modal p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

/* ── Language buttons ───────────────────────────────────── */
.lang-buttons {
  display: flex;
  gap: 12px;
}
.lang-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
}
.lang-btn:hover {
  border-color: var(--accent-dim);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.lang-btn:active { transform: translateY(0); }
.lang-btn .flag { font-size: 2rem; line-height: 1; }
.lang-btn .label {
  color: var(--text-mid);
  font-size: 0.75rem;
  font-weight: 400;
}

/* ── Persistent toggle in nav ───────────────────────────── */
.lang-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text-mid);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  flex-shrink: 0;
}
.lang-toggle:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}
.lang-toggle .flag-small { font-size: 0.95rem; }
/* ══════════════════════════════════════════════════════════
   Project Detail Modals
   ══════════════════════════════════════════════════════════ */

.pd-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.pd-overlay.open { opacity: 1; pointer-events: auto; }

.pd-modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 860px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 120px rgba(168,184,122,0.04);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.pd-overlay.open .pd-modal { transform: translateY(0) scale(1); }
.pd-modal::-webkit-scrollbar { width: 6px; }
.pd-modal::-webkit-scrollbar-track { background: transparent; }
.pd-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.pd-close {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: flex-end; padding: 16px 20px 0;
}
.pd-close button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-mid); font-size: 18px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; backdrop-filter: blur(8px);
}
.pd-close button:hover {
  border-color: var(--accent-dim); color: var(--text); background: var(--surface-hover);
}

.pd-hero { padding: 8px 32px 0; }
.pd-hero-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pd-hero h2 { font-family: 'Instrument Serif', serif; font-size: 1.6rem; font-weight: 400; color: var(--text); }
.pd-badge-pill {
  font-size: 0.7rem; font-weight: 600; color: var(--accent);
  background: rgba(168,184,122,0.1); border: 1px solid rgba(168,184,122,0.2);
  padding: 3px 10px; border-radius: 5px; white-space: nowrap;
}
.pd-badge-cyan { background: rgba(126,200,200,0.1); border-color: rgba(126,200,200,0.2); color: #7ec8c8; }
.pd-badge-amber { background: rgba(212,169,90,0.1); border-color: rgba(212,169,90,0.2); color: #d4a95a; }
.pd-badge-purple { background: rgba(167,139,250,0.1); border-color: rgba(167,139,250,0.2); color: #a78bfa; }
.pd-tagline { color: var(--text-mid); font-size: 0.88rem; line-height: 1.6; max-width: 640px; }

.pd-gallery {
  display: flex; gap: 8px; padding: 20px 32px;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pd-gallery::-webkit-scrollbar { display: none; }
.pd-gallery-item {
  flex: 0 0 auto; width: 280px; height: 170px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); overflow: hidden;
  scroll-snap-align: start; position: relative;
}
.pd-gallery-item video, .pd-gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pd-gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 12px 8px; background: linear-gradient(transparent, rgba(22,22,25,0.85));
  font-size: 0.72rem; color: var(--text-mid);
}

.pd-body { padding: 0 32px 28px; }

.pd-metrics { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.pd-metric {
  flex: 1; min-width: 130px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.pd-metric .val { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.pd-metric .lbl { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.pd-section { margin-bottom: 22px; }
.pd-section-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-dim); font-weight: 600; margin-bottom: 8px;
}
.pd-section p { color: var(--text-mid); font-size: 0.84rem; line-height: 1.65; }

.pd-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.pd-detail-card {
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.pd-detail-card h4 { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.pd-detail-card p { font-size: 0.78rem; color: var(--text-dim); line-height: 1.55; }

.pd-meta-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; font-size: 0.78rem; }
.pd-meta-item .pd-ml { color: var(--text-dim); margin-right: 4px; }
.pd-meta-item .pd-mv { color: var(--text-mid); font-weight: 500; }

.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.pd-tag {
  font-size: 0.72rem; padding: 4px 12px; border-radius: 5px;
  background: rgba(168,184,122,0.08); border: 1px solid rgba(168,184,122,0.15); color: var(--accent);
}

.pd-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.pd-actions a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; font-size: 0.82rem;
  font-weight: 500; text-decoration: none; transition: transform 0.15s, border-color 0.2s;
}
.pd-actions a:hover { transform: translateY(-1px); }
.pd-actions .pd-primary { background: var(--accent); color: var(--bg); }
.pd-actions .pd-secondary {
  background: transparent; border: 1px solid var(--border); color: var(--accent);
}
.pd-actions .pd-secondary:hover { border-color: var(--accent-dim); }

.pd-divider { height: 1px; background: var(--border); margin: 20px 0; }

/* View Details button in project cards */
/* View Details button — styled in the section below */

@media (max-width: 640px) {
  .pd-overlay { padding: 12px; }
  .pd-modal { max-height: 92vh; border-radius: 12px; }
  .pd-hero, .pd-body { padding-left: 20px; padding-right: 20px; }
  .pd-gallery { padding: 16px 20px; }
  .pd-gallery-item { width: 240px; height: 150px; }
  .pd-details-grid { grid-template-columns: 1fr; }
  .pd-hero h2 { font-size: 1.3rem; }
  .pd-metrics { gap: 6px; }
  .pd-metric { min-width: 100px; padding: 10px 12px; }
  .pd-close { padding: 12px 16px 0; }
}

/* ── Doc thumbnails (CSS-only mini page previews) ──────── */
.doc-preview {
  width: 52px;
  height: 64px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Corner fold */
.doc-preview::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 12px; height: 12px;
  background: linear-gradient(225deg, var(--surface) 50%, var(--border) 50%);
}
/* Faint text lines */
.doc-preview-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 8px;
  width: 100%;
}
.doc-preview-lines span {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}
.doc-preview-lines span:nth-child(1) { width: 70%; }
.doc-preview-lines span:nth-child(2) { width: 90%; }
.doc-preview-lines span:nth-child(3) { width: 55%; }
.doc-preview-lines span:nth-child(4) { width: 80%; }
/* Type label overlay on preview */
.doc-preview .doc-preview-type {
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0.6;
}
/* Preview color variants */
.doc-preview { border-top: 2px solid var(--accent-dim); }
.doc-prev-qdd { border-top-color: #8a7abf; }
.doc-prev-ldd { border-top-color: #7aabb8; }
.doc-prev-test { border-top-color: #b8967a; }
/* Hide the old type badge — preview replaces it */
.doc-item > .doc-type { display: none; }

/* ── Prominent "View details" button in project cards ──── */
.pd-trigger {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(168,184,122,0.1);
  border: 1px solid rgba(168,184,122,0.25);
  border-radius: 6px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.pd-trigger:hover {
  background: rgba(168,184,122,0.18);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
   Print Stylesheet
   ══════════════════════════════════════════════════════════ */

@media print {
  /* Reset backgrounds for ink saving */
  :root {
    --bg: #fff;
    --surface: #fff;
    --text: #111;
    --text-mid: #333;
    --text-dim: #666;
    --accent: #4a6a2a;
    --border: #ccc;
  }

  body {
    background: #fff !important;
    background-image: none !important;
    color: #111;
    font-size: 11pt;
  }
  body::before, body::after { display: none !important; }

  /* Hide interactive/nav elements */
  nav, .scroll-progress, .lang-overlay, .lang-toggle,
  .pd-overlay, .nav-toggle, .doc-preview,
  .dashboard-embed, iframe { display: none !important; }

  /* Reset card backgrounds */
  .project-card, .cs-card, .takeaway-card, .doc-item,
  .mechanic-spotlight, .additional-item, .about-layout,
  .contact-item, .scope-table, .pd-detail-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  /* No hover effects */
  .project-card:hover, .doc-item:hover, .additional-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Video placeholders */
  video { display: none; }
  .project-thumb { display: none; }

  /* Restore doc-type badge in print (preview hidden) */
  .doc-item > .doc-type { display: inline-block !important; }

  /* Ensure links are visible */
  a { color: #4a6a2a !important; text-decoration: underline; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
    word-break: break-all;
  }
  /* Don't expand internal anchors */
  a[href^="#"]::after { content: none; }

  /* Page breaks */
  section { break-before: auto; }
  .section-header { break-after: avoid; }
  h2, h3, h4 { break-after: avoid; }

  /* Full width */
  .page { max-width: 100%; padding: 0; }
  .project-card { flex-direction: column; }

  /* Footer */
  .site-footer {
    border-top: 1px solid #ccc;
    padding-top: 12px;
    text-align: center;
  }

  /* Comments/tips hidden */
  .tip { display: none !important; }

  /* Reveal all elements (no scroll animations) */
  .reveal { opacity: 1 !important; transform: none !important; }
}
