/* ════════════════════════════════════════════════════════════
   Rick Jungles — shared site styles
   Theme: cyan-on-dark. Used by index / projects / about / 404.
   ════════════════════════════════════════════════════════════ */

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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c232c;
  --border: #21262d;
  --cyan: #00d4ff;
  --purple: #7928ca;
  --cyan-glow: rgba(0, 212, 255, 0.4);
  --text: #e6edf3;
  --text-muted: #8b949e;
  --nav-h: 60px;
  --maxw: 1180px;
}

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

a { color: inherit; }

/* Background particle canvas (fixed behind everything) */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Generic helpers ------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  font-family: monospace;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Entrance animation (opt in with .reveal; JS adds .in, or it
   auto-plays via animation when .reveal-auto is used) */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

.reveal-auto { opacity: 0; animation: fadeUp .6s ease forwards; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .18s; }
.d3 { animation-delay: .28s; } .d4 { animation-delay: .38s; }
.d5 { animation-delay: .48s; }

/* ════════════════════════════════════════════════════════════
   NAV
   ════════════════════════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(13, 17, 23, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap { display: flex; align-items: center; justify-content: space-between; }

.nav-logo {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .6; } }

.nav-links { display: flex; gap: 0.4rem; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 7px;
  transition: color .2s ease, background .2s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--cyan); }

/* ════════════════════════════════════════════════════════════
   HERO (home)
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.3rem;
  padding: clamp(2.5rem, 7vw, 5rem) 1.5rem 2.5rem;
}

.hero-photo-wrap { position: relative; display: inline-block; }
.hero-photo-wrap::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan), var(--purple), var(--cyan));
  animation: spin 4s linear infinite;
  z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-photo {
  width: 160px; height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 4px solid var(--bg);
}

.hero-name {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 300;
  min-height: 1.6em;
}

.hero-bio {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 46ch;
}

.cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* Buttons -------------------------------------------------------- */
.btn-row { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, opacity .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--cyan); color: var(--bg); }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* Scramble/decode name — keeps layout stable while letters settle */
.scramble { white-space: pre-wrap; }

/* ── Floating photo collage (desktop hero only) ─────────────────── */
.hero-floats { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: none; }
@media (min-width: 1100px) { .hero-floats { display: block; } }

.float-photo {
  position: absolute;
  width: var(--fp-size, 140px);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  overflow: hidden;
  opacity: 0;
  animation: floatIn 1s ease forwards, drift var(--fp-dur, 9s) ease-in-out infinite;
  will-change: transform;
}
.float-photo img { width: 100%; display: block; }
.float-photo .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 0.62rem; font-family: monospace; letter-spacing: .04em;
  color: var(--text); text-align: center; padding: 0.3rem;
  background: linear-gradient(transparent, rgba(13,17,23,.92));
}
@keyframes floatIn { from { opacity: 0; transform: scale(.8) translateY(20px); } to { opacity: .92; transform: none; } }
@keyframes drift { 0%,100% { translate: 0 0; } 50% { translate: 0 -14px; } }

.fp-1 { top: 6%;  left: 3%;  --fp-size: 150px; --fp-dur: 8s;  rotate: -6deg; animation-delay: .2s, .2s; }
.fp-2 { top: 50%; left: 6%;  --fp-size: 130px; --fp-dur: 10s; rotate: 5deg;  animation-delay: .5s, .9s; }
.fp-3 { top: 8%;  right: 3%; --fp-size: 140px; --fp-dur: 9s;  rotate: 6deg;  animation-delay: .35s, .5s; }
.fp-4 { top: 52%; right: 6%; --fp-size: 135px; --fp-dur: 11s; rotate: -5deg; animation-delay: .65s, 1.2s; }

/* ── Animated stat counters ─────────────────────────────────────── */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem;
  text-align: center; max-width: 480px; margin: 0 auto;
}
.stat .num { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1; }
.stat .label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; letter-spacing: .02em; }

.hero-name-wrap { position: relative; display: inline-block; }

/* ── Monster eye mascot — pinned in the header beside the logo ───── */
.nav-left { display: flex; align-items: center; gap: 12px; }
.eye {
  position: relative; flex-shrink: 0; pointer-events: none;
  --skin: #62803e; --skin-d: #3b5022; --skin-dd: #26341a;
}
.eye-socket {
  position: relative; width: 44px; height: 40px;
  background:
    radial-gradient(ellipse 60% 50% at 38% 30%, rgba(255,255,255,.12), transparent 60%),
    radial-gradient(ellipse at 50% 56%, var(--skin) 0%, var(--skin-d) 70%, var(--skin-dd) 100%);
  border-radius: 54% 46% 52% 48% / 58% 56% 44% 42%;
  box-shadow: 0 4px 12px rgba(0,0,0,.5), inset 0 -5px 9px rgba(0,0,0,.45), inset 0 4px 7px rgba(255,255,255,.10);
  display: grid; place-items: center;
}
.eye-ball {
  position: relative;
  width: 30px; height: 30px; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(190,40,30,0) 50%, rgba(185,38,28,.28) 100%),
    radial-gradient(circle at 50% 45%, #fbf7e6 52%, #ecdcab 100%);
  box-shadow: inset 0 0 6px rgba(110,50,15,.45), inset 0 -2px 5px rgba(0,0,0,.3);
  display: grid; place-items: center;
}
.eye-iris {
  position: relative;
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #b6ffe9 0%, #00d4ff 38%, #00917a 72%, #064a3d 100%);
  box-shadow: 0 0 9px rgba(0,212,255,.6), inset 0 0 5px rgba(0,0,0,.5);
  display: grid; place-items: center;
  transition: transform .09s ease-out;
}
.eye-pupil { /* reptilian vertical slit */
  width: 4px; height: 15px; border-radius: 50%;
  background: #06100a; box-shadow: 0 0 3px rgba(0,0,0,.7);
}
.eye-glint { position: absolute; top: 3px; left: 5px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.9); }

@media (max-width: 600px) {
  .nav-left { gap: 9px; }
  .eye-socket { width: 38px; height: 34px; }
  .eye-ball { width: 26px; height: 26px; }
  .eye-iris { width: 17px; height: 17px; }
  .eye-pupil { width: 4px; height: 13px; }
  .eye-glint { top: 3px; left: 4px; width: 4px; height: 4px; }
}

/* ── 3D tilt ────────────────────────────────────────────────────── */
.tilt { transform-style: preserve-3d; transition: transform .12s ease, box-shadow .25s ease, border-color .25s ease; will-change: transform; }

/* ── "Since 1984" timeline ──────────────────────────────────────── */
.timeline { position: relative; margin-top: 1rem; }
.timeline::before {
  content: ''; position: absolute; left: 18px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--cyan), var(--purple)); opacity: .5;
}
.tl-item { position: relative; padding: 0 0 2rem 52px; }
.tl-dot {
  position: absolute; left: 10px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--cyan); box-shadow: 0 0 12px var(--cyan-glow);
}
.tl-year { font-family: monospace; font-weight: 700; color: var(--cyan); font-size: 0.9rem; letter-spacing: .06em; }
.tl-card {
  display: flex; gap: 1.1rem; align-items: center; margin-top: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem; overflow: hidden;
}
.tl-card img { width: 160px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.tl-card h4 { font-size: 1.02rem; margin-bottom: 0.25rem; }
.tl-card p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.5; }
@media (min-width: 768px) {
  .timeline::before { left: 50%; transform: translateX(-1px); }
  .tl-item { width: 50%; padding: 0 0 2.4rem 0; }
  .tl-item:nth-child(odd) { left: 0; padding-right: 44px; text-align: right; }
  .tl-item:nth-child(even) { left: 50%; padding-left: 44px; }
  .tl-item:nth-child(odd) .tl-dot { left: auto; right: -9px; }
  .tl-item:nth-child(even) .tl-dot { left: -9px; }
  .tl-item:nth-child(odd) .tl-card { flex-direction: row-reverse; }
}
@media (max-width: 560px) {
  .tl-card { flex-direction: column; align-items: stretch; }
  .tl-card img { width: 100%; height: 150px; }
}

/* ── Confetti canvas (easter egg) ───────────────────────────────── */
#confetti-canvas { position: fixed; inset: 0; z-index: 9998; pointer-events: none; display: none; }

/* ════════════════════════════════════════════════════════════
   PAGE SECTION wrappers (content sits above canvas)
   ════════════════════════════════════════════════════════════ */
.section { position: relative; z-index: 1; padding: 3rem 0; }
.section-tight { padding: 1.5rem 0 3rem; }

/* Featured strip (home) ----------------------------------------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

.mini-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mini-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,212,255,.15); border-color: var(--cyan); }
.mini-card .thumb { aspect-ratio: 16/10; overflow: hidden; border-bottom: 1px solid var(--border); }
.mini-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .35s ease; }
.mini-card:hover .thumb img { transform: scale(1.07); }
.mini-card .body { padding: 0.9rem 1rem 1.1rem; }
.mini-card .body h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.mini-card .body p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }

/* ════════════════════════════════════════════════════════════
   PROJECTS — master/detail (desktop) → popup (mobile)
   ════════════════════════════════════════════════════════════ */
.proj-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.proj-list { display: flex; flex-direction: column; gap: 0.7rem; }

.proj-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.7rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.proj-row:hover { border-color: var(--cyan); transform: translateX(3px); }
.proj-row.active { border-color: var(--cyan); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--cyan); }
.proj-row .row-thumb {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
}
.proj-row .row-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.proj-row .row-text { min-width: 0; }
.proj-row .row-text h3 { font-size: 0.98rem; font-weight: 700; }
.proj-row .row-text p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Detail pane --------------------------------------------------- */
.proj-detail {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.detail-accent { height: 3px; background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.detail-body { padding: 1.6rem; }

.detail-shot {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 1.2rem;
}
.detail-gallery { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.detail-gallery img {
  width: 84px; height: 56px; object-fit: cover; object-position: top;
  border-radius: 7px; border: 1px solid var(--border); cursor: pointer; opacity: .65;
  transition: opacity .2s ease, border-color .2s ease;
}
.detail-gallery img:hover, .detail-gallery img.active { opacity: 1; border-color: var(--cyan); }

.detail-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.detail-tag {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); font-family: monospace;
}
.status-badge {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted);
}
.status-badge.live { color: #3fb950; border-color: rgba(63,185,80,.4); background: rgba(63,185,80,.08); }
.status-badge.dev  { color: #d29922; border-color: rgba(210,153,34,.4); background: rgba(210,153,34,.08); }

.detail-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.7rem; }
.detail-desc { color: var(--text-muted); line-height: 1.65; margin-bottom: 1.2rem; }

.detail-sub {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); margin-bottom: 0.6rem;
}
.detail-features { list-style: none; margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.detail-features li { position: relative; padding-left: 1.4rem; color: var(--text-muted); font-size: 0.9rem; }
.detail-features li::before { content: '▸'; position: absolute; left: 0; color: var(--cyan); }

.tech-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.4rem; }
.chip {
  font-size: 0.72rem; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.28rem 0.7rem;
}

.detail-links { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* Mobile popup overlay ------------------------------------------ */
.proj-popup {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  background: rgba(7, 10, 14, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
}
.proj-popup.open { display: block; animation: fadeUp .25s ease; }
.proj-popup .popup-inner {
  max-width: 640px;
  margin: 2.5rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.popup-close {
  position: absolute; top: 0.8rem; right: 0.8rem; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(13,17,23,.8); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.popup-close:hover { border-color: var(--cyan); color: var(--cyan); }

/* ════════════════════════════════════════════════════════════
   ABOUT
   ════════════════════════════════════════════════════════════ */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
.prose p { color: var(--text-muted); line-height: 1.75; margin-bottom: 1rem; max-width: 68ch; }
.prose p strong { color: var(--text); }

.interest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem; }
.interest {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 1rem; transition: border-color .2s ease, transform .2s ease;
}
.interest:hover { border-color: var(--cyan); transform: translateY(-3px); }
.interest .emoji { font-size: 1.5rem; }
.interest h4 { font-size: 0.95rem; margin: 0.4rem 0 0.2rem; }
.interest p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }

.skills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills .chip { font-size: 0.82rem; padding: 0.35rem 0.85rem; }

.social-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.4rem; }
.social {
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 0.6rem 1rem; font-size: 0.88rem; font-weight: 500;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.social:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; }

/* ════════════════════════════════════════════════════════════
   FEEDBACK FORM (shared)
   ════════════════════════════════════════════════════════════ */
.feedback-form { display: flex; flex-direction: column; gap: 0.9rem; max-width: 620px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.form-field input, .form-field select, .form-field textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.65rem 0.85rem; color: var(--text); font-family: inherit; font-size: 0.88rem;
  outline: none; transition: border-color .2s ease, box-shadow .2s ease; resize: none; width: 100%;
}
.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2.2rem; cursor: pointer;
}
.form-field select option { background: var(--surface); color: var(--text); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}
.form-field textarea { height: 120px; }

.form-submit {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; background: var(--cyan); color: var(--bg);
  border: none; border-radius: 8px; font-family: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; align-self: flex-start; transition: opacity .2s ease, transform .15s ease;
}
.form-submit:hover { opacity: .88; transform: translateY(-1px); }
.form-submit:active { transform: translateY(0); }
.form-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.form-status { font-size: 0.82rem; padding: 0.6rem 0.9rem; border-radius: 7px; display: none; }
.form-status.success { display: block; background: rgba(0,212,255,.08); border: 1px solid rgba(0,212,255,.3); color: var(--cyan); }
.form-status.error { display: block; background: rgba(255,80,80,.08); border: 1px solid rgba(255,80,80,.3); color: #ff6b6b; }

/* ════════════════════════════════════════════════════════════
   404
   ════════════════════════════════════════════════════════════ */
.notfound {
  position: relative; z-index: 1;
  min-height: calc(100dvh - var(--nav-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1.2rem; padding: 2rem 1.5rem;
}
.notfound .code { font-size: clamp(4rem, 18vw, 9rem); font-weight: 700; line-height: 1; }
.notfound p { color: var(--text-muted); max-width: 40ch; }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
footer.site-footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 1.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}
footer.site-footer span { color: var(--cyan); }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 880px) {
  .proj-layout { grid-template-columns: 1fr; }
  .proj-detail { display: none; }   /* mobile uses popup instead */
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: 2.5rem; gap: 1rem; }
  .hero-photo { width: 124px; height: 124px; }
  .section { padding: 2.2rem 0; }
  .wrap { padding: 0 1.1rem; }
  .nav .wrap { padding: 0 1rem; }
  .nav-logo { font-size: 0.95rem; gap: 0.4rem; }
  .nav-links { gap: 0.1rem; }
  .nav-links a { padding: 0.4rem 0.5rem; font-size: 0.84rem; }
  /* Popup gets side gutters so it doesn't touch screen edges */
  .proj-popup .popup-inner { margin: 1.4rem auto; width: calc(100% - 1.6rem); }
  .btn { padding: 0.65rem 1.1rem; }
}

/* Very small phones — keep the nav on one tidy line */
@media (max-width: 380px) {
  .nav-logo .dot { display: none; }
  .nav-logo { font-size: 0.9rem; }
  .nav-links a { padding: 0.35rem 0.42rem; font-size: 0.8rem; }
}

/* Reduced motion — calm everything down, but keep all content visible.
   (Critical: zero the delays and force end-states, or delayed fade-ins
   can leave elements stuck invisible.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-auto { opacity: 1 !important; transform: none !important; animation: none !important; }
  .float-photo { opacity: .92 !important; animation: none !important; }
}
