/* ============================================
   GUANXI STUDIO — ARCADE PORTFOLIO
   ============================================ */

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

:root {
  --bg:     #060808;
  --bg2:    #0b0e0d;
  --bg3:    #111614;
  --bg4:    #181e1c;
  --border: #1c2522;

  --text:   #e8f0e0;
  --muted:  #2a3a30;
  --muted2: #58706a;

  --orange:  #ff6600;
  --green:   #00e878;
  --cyan:    #00ccff;
  --yellow:  #ffcc00;
  --red:     #ff2244;

  --grad:  linear-gradient(135deg, #ff6600, #ffcc00);
  --grad2: linear-gradient(135deg, #00ccff, #00e878);

  --r: 3px;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255,102,0,0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--orange); box-shadow: 0 0 8px var(--orange); }

/* ============================================
   SCANLINES
   ============================================ */

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9500;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.055) 3px,
    rgba(0,0,0,0.055) 4px
  );
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 16px var(--orange);
  z-index: 600;
  transition: width 0.08s linear;
}

/* ============================================
   TYPE HELPERS
   ============================================ */

.pixel-sm {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.56rem;
  line-height: 2;
  letter-spacing: 0.06em;
  color: var(--muted2);
}

.pixel-sm.accent { color: var(--orange); }

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.blink { animation: blink 0.88s step-start infinite; }

/* ============================================
   NAVIGATION
   ============================================ */

#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s;
}

#nav.scrolled {
  background: rgba(6,8,8,0.94);
  backdrop-filter: blur(22px);
  border-bottom-color: var(--border);
  box-shadow: 0 0 40px rgba(255,102,0,0.04);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
  filter: brightness(1);
  transition: filter 0.2s;
}

.logo:hover .logo-img {
  filter: brightness(0) saturate(100%) invert(45%) sepia(97%) saturate(1200%) hue-rotate(2deg) brightness(105%);
}

.nav-menu { display: flex; gap: 2.5rem; list-style: none; }

.nav-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--muted2);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.2s, text-shadow 0.2s;
  line-height: 1;
}

.nav-link:hover { color: var(--orange); text-shadow: 0 0 10px var(--orange); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

.mobile-menu.open { display: flex; }

.mobile-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: var(--muted2);
  text-decoration: none;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.08em;
  transition: color 0.2s, padding-left 0.2s;
}

.mobile-link:hover { color: var(--orange); padding-left: 2.5rem; }

/* ============================================
   HERO
   ============================================ */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 8rem 2rem 5rem;
}

/* Three.js canvas — fills hero, sits behind content */
#heroCanvas {
  position: absolute;
  top: 0; left: 0;
  display: block;
  z-index: 0;
}

/* Floating pixel symbols */
.hero-floats { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

.hf {
  position: absolute;
  font-family: 'Press Start 2P', monospace;
  opacity: 0.2;
}

.hf1 { font-size:1.1rem; top:14%; left:7%;    color:var(--orange); animation:floatPx 6s ease-in-out infinite; }
.hf2 { font-size:.75rem; top:22%; right:11%;  color:var(--green);  animation:floatPx 9s ease-in-out infinite 1s; }
.hf3 { font-size:.9rem;  bottom:32%; left:11%;color:var(--cyan);   animation:floatPx 7s ease-in-out infinite 2s; }
.hf4 { font-size:.85rem; top:62%; right:9%;   color:var(--yellow); animation:floatPx 8s ease-in-out infinite 0.5s; }
.hf5 { font-size:.65rem; bottom:22%; right:26%;color:var(--orange);animation:floatPx 5s ease-in-out infinite 3s; }
.hf6 { font-size:1rem;   top:72%; left:24%;   color:var(--green);  animation:floatPx 7s ease-in-out infinite 1.5s; }
.hf7 { font-size:.8rem;  top:42%; left:4%;    color:var(--yellow); animation:floatPx 11s ease-in-out infinite 4s; }

@keyframes floatPx {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-20px) rotate(12deg); }
}

/* Hero main content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 1000px;
}

.insert-coin {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--yellow);
  letter-spacing: 0.12em;
  margin-bottom: 2.5rem;
  display: block;
  text-shadow: 0 0 24px var(--yellow);
  animation: fadeUp 0.8s ease both;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(4rem, 13vw, 10rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.04em;
}

.h1-first {
  display: block;
  color: var(--text);
  animation: fadeUp 0.8s ease both 0.1s, glitch 9s linear infinite 3s;
}

.h1-last {
  display: block;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.8s ease both 0.2s;
}

@keyframes glitch {
  0%,84%,100% { clip-path: none; transform: none; }
  86% { clip-path: inset(18% 0 65% 0); transform: translateX(-7px); }
  88% { clip-path: inset(60% 0 8%  0); transform: translateX(7px); }
  90% { clip-path: none; transform: none; }
  92% { clip-path: inset(40% 0 30% 0); transform: translateX(-4px); }
  94% { clip-path: none; transform: none; }
}

/* ── ARCADE VERTICAL MENU ───────────────────
   Inspired by classic game select screens.
   Items are stacked vertically; ► auto-cycles
   through them like a real arcade selector.
   ─────────────────────────────────────────── */

.arcade-menu-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
  animation: fadeUp 0.8s ease both 0.35s;
}

.am-label {
  color: var(--muted2);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
}

.arcade-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 260px;
}

.am-item {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: var(--muted2);
  text-decoration: none;
  letter-spacing: 0.1em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.3rem 0;
  transition: color 0.15s;
  cursor: pointer;
  width: 100%;
}

.am-arr {
  display: inline-block;
  width: 1.2em;
  opacity: 0;
  color: var(--yellow);
  text-shadow: 0 0 12px var(--yellow);
  flex-shrink: 0;
  transition: opacity 0.1s;
}

/* Active (selected) item */
.am-item.am-active {
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255,204,0,0.3);
}

.am-item.am-active .am-arr {
  opacity: 1;
  animation: blink 0.88s step-start infinite;
}

.am-item:hover {
  color: var(--text);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 2;
  animation: fadeUp 1s ease both 1.1s;
}

.scroll-bar {
  width: 2px; height: 40px;
  background: linear-gradient(to bottom, var(--orange), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,100% { opacity:1; transform:scaleY(1); }
  50%      { opacity:.3; transform:scaleY(0.4); }
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.75rem;
  border-radius: var(--r);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.56rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.06em;
  line-height: 1;
}

.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #050a06;
}

.btn.primary:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #050a06;
  box-shadow: 0 0 32px rgba(255,102,0,0.55), 0 10px 28px rgba(0,0,0,0.35);
  transform: translateY(-3px);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-3px);
}

/* ============================================
   MARQUEE
   ============================================ */

.marquee-wrap {
  overflow: hidden;
  padding: 1.2rem 0;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  background: var(--bg2);
  position: relative;
}

.marquee-wrap::before,
.marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 100px;
  z-index: 1;
  pointer-events: none;
}

.marquee-wrap::before { left: 0;  background: linear-gradient(to right, var(--bg2), transparent); }
.marquee-wrap::after  { right: 0; background: linear-gradient(to left,  var(--bg2), transparent); }

.marquee-track {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: max-content;
  animation: marquee 26s linear infinite;
  will-change: transform;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--mq-translate, -50%)); }
}

.mq-w {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  color: var(--muted2);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.mq-s {
  color: var(--orange);
  font-size: 0.68rem;
  flex-shrink: 0;
  text-shadow: 0 0 10px var(--orange);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 8rem 0;
  border-top: 2px solid var(--border);
  position: relative;
}

section::after {
  content: '';
  position: absolute;
  top: -2px; left: 0;
  width: 72px; height: 2px;
  background: var(--orange);
  box-shadow: 0 0 14px var(--orange);
}

.heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 3.5rem;
  padding-bottom: 0.12em;
}

/* ============================================
   ABOUT
   ============================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text .heading { margin-bottom: 2rem; }
.about-text p { color: var(--muted2); font-size: 1.05rem; margin-bottom: 1.25rem; }
.about-text strong { color: var(--text); }

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

.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 0.45rem 1rem;
  border-radius: var(--r);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: default;
}

.tag:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(255,102,0,0.07);
  box-shadow: 0 0 12px rgba(255,102,0,0.15);
}

/* ============================================
   FILTERS
   ============================================ */

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.46rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.07em;
  line-height: 1;
}

.filter:hover { border-color: var(--orange); color: var(--text); }

.filter.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #050a06;
  box-shadow: 0 0 22px rgba(255,102,0,0.4);
}

/* ============================================
   GRID & CARDS (with 3D tilt)
   ============================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  animation: cardIn 0.42s ease both;
  /* 3D tilt uses inline style; keep only non-transform transitions here */
  transition: border-color 0.25s, box-shadow 0.3s;
  will-change: transform;
  transform-style: preserve-3d;
}

.card:hover {
  border-color: var(--orange);
  box-shadow:
    0 0 0 1px var(--orange),
    0 0 30px rgba(255,102,0,0.3),
    0 0 80px rgba(255,102,0,0.08),
    0 24px 52px rgba(0,0,0,0.5);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.card-img {
  height: 240px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Scanline on card images */
.card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 5px,
    rgba(0,0,0,0.07) 5px, rgba(0,0,0,0.07) 6px
  );
  pointer-events: none;
}

.card-emoji {
  font-size: 4.5rem;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.55));
  transition: transform 0.35s ease;
  z-index: 1;
}

.card:hover .card-emoji { transform: scale(1.14) translateY(-6px); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s;
  z-index: 2;
}

.card:hover .card-overlay { opacity: 1; }

.overlay-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--orange);
  border: 2px solid var(--orange);
  padding: 0.6rem 1.2rem;
  letter-spacing: 0.1em;
  animation: glowPulse 1.2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 16px rgba(255,102,0,.4), inset 0 0 16px rgba(255,102,0,.07); }
  50%      { box-shadow: 0 0 32px rgba(255,102,0,.75), inset 0 0 24px rgba(255,102,0,.15); }
}

.card-body { padding: 1.2rem 1.4rem 1.5rem; }

.card-cat {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.46rem;
  color: var(--orange);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 8px rgba(255,102,0,0.35);
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}

.lb-overlay.open { opacity: 1; pointer-events: all; }

.lightbox {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.9);
  z-index: 1201;
  background: var(--bg2);
  border: 1px solid var(--orange);
  border-radius: var(--r);
  box-shadow: 0 0 50px rgba(255,102,0,0.28), 0 40px 80px rgba(0,0,0,0.6);
  width: min(92vw, 880px);
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: all 0.32s cubic-bezier(0.34,1.5,0.64,1);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%,-50%) scale(1);
}

.lb-close {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 1;
  width: 36px; height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--muted2);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lb-close:hover { background: var(--orange); border-color: var(--orange); color: #050a06; }

.lb-body { min-height: 480px; }

.lb-visual {
  min-height: 360px;
  overflow: hidden;
  border-radius: var(--r) 0 0 var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lb-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 4px,
    rgba(0,0,0,0.07) 4px, rgba(0,0,0,0.07) 5px
  );
  pointer-events: none;
}

.lb-emoji { font-size: 6.5rem; filter: drop-shadow(0 12px 32px rgba(0,0,0,0.6)); z-index: 1; }

.lb-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.lb-info h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 0.25rem;
}

.lb-info p { color: var(--muted2); font-size: 0.95rem; line-height: 1.75; }

.lb-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }

.lb-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 0.3rem 0.85rem;
  border-radius: var(--r);
  font-size: 0.72rem;
  font-weight: 500;
}

/* ============================================
   CONTACT
   ============================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

.contact-left p { color: var(--muted2); font-size: 1.05rem; margin-bottom: 2rem; }

.clinks { display: flex; flex-direction: column; gap: 1rem; }

.clink {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted2);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.clink:hover { color: var(--text); }

.clink-ico {
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.clink:hover .clink-ico {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(255,102,0,0.09);
  box-shadow: 0 0 12px rgba(255,102,0,0.2);
}

.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.9rem 1.2rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255,102,0,0.14);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted2); opacity: 0.5; }

/* ============================================
   FOOTER
   ============================================ */

footer {
  border-top: 2px solid var(--border);
  padding: 2.5rem 0;
  position: relative;
}

footer::after {
  content: '';
  position: absolute;
  top: -2px; left: 0;
  width: 56px; height: 2px;
  background: var(--orange);
  box-shadow: 0 0 14px var(--orange);
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo-img {
  height: 30px;
  width: auto;
  display: block;
  opacity: 0.85;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   KEYFRAMES
   ============================================ */

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .about-grid   { grid-template-columns: 1fr; gap: 3rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .lb-body      { grid-template-columns: 1fr; }
  .lb-visual    { min-height: 240px; border-radius: var(--r) var(--r) 0 0; }
}

@media (max-width: 768px) {
  .nav-menu { display: none; }
  .burger   { display: flex; }
  h1        { font-size: clamp(3.5rem, 19vw, 6rem); }
  section   { padding: 5rem 0; }
  .form-row { grid-template-columns: 1fr; }

  /* Hero: reduz padding para não engolir a tela */
  #hero { padding-top: 5.5rem; padding-bottom: 4rem; }

  /* iOS Safari: impede auto-zoom em inputs com font < 16px */
  .contact-form input,
  .contact-form textarea { font-size: 16px; }
}

@media (max-width: 540px) {
  /* Container: reduz padding lateral para ganhar espaço */
  .container { padding: 0 1.25rem; }

  /* Hero */
  #hero { padding: 5rem 1.25rem 3.5rem; }

  /* Seções: espaçamento mais compacto */
  section { padding: 3.5rem 0; }

  /* Heading: evita overflow de texto longo como "Selecionados" */
  .heading { font-size: clamp(1.9rem, 8vw, 2.5rem); }

  /* Arcade menu: remove min-width fixo para não vazar */
  .arcade-menu { min-width: unset; width: 100%; }

  /* Grid de projetos: coluna única */
  .grid { grid-template-columns: 1fr; }

  /* Filtros: scroll horizontal em vez de quebrar em múltiplas linhas */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter {
    flex-shrink: 0;
    font-size: 0.42rem;
    padding: 0.55rem 0.85rem;
  }

  /* Lightbox: padding mais justo em coluna única */
  footer .container { justify-content: center; text-align: center; }
}

/* ============================================
   CARD: IMAGEM COVER
   ============================================ */

.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

/* ============================================
   CARD: CARROSSEL
   ============================================ */

.card-carousel { position: relative; }

.card-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.7s ease;
  z-index: 1;
}

.card-slide.active { opacity: 1; }

.slide-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
  pointer-events: none;
}

.slide-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.25s;
  flex-shrink: 0;
}

.slide-dot.active {
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
}

/* ── PDF badge no card ── */
.card-pdf-badge {
  position: absolute;
  top: 12px; right: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  color: #050a06;
  background: var(--orange);
  padding: 0.3rem 0.65rem;
  border-radius: 2px;
  z-index: 3;
  line-height: 1;
}

/* ============================================
   LIGHTBOX: MODO IMAGENS
   ============================================ */

.lb-body--images {
  display: grid;
  grid-template-columns: 1fr 300px;
  min-height: 480px;
}

.lb-main-img {
  background: #050a06;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--r) 0 0 var(--r);
}

.lb-main-img img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  transition: opacity 0.18s ease;
}

.lb-main-img img.lb-fading { opacity: 0; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(6,8,8,0.85);
  border: 2px solid var(--orange);
  color: var(--orange);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.46rem;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: all 0.15s;
  line-height: 1;
}

.lb-nav:hover {
  background: var(--orange);
  color: #050a06;
  box-shadow: 0 0 20px rgba(255,102,0,0.5);
}

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

.lb-counter {
  position: absolute;
  bottom: 1rem; right: 1rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--muted2);
  background: rgba(0,0,0,0.68);
  padding: 0.35rem 0.65rem;
  border-radius: 2px;
  z-index: 4;
  letter-spacing: 0.08em;
}

.lb-sidebar {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  max-height: 80vh;
}

.lb-sidebar h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.lb-sidebar p { color: var(--muted2); font-size: 0.9rem; line-height: 1.75; }

.lb-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.lb-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.15s;
  display: block;
}

.lb-thumb.active,
.lb-thumb:hover {
  border-color: var(--orange);
  opacity: 1;
  box-shadow: 0 0 8px rgba(255,102,0,0.35);
}

/* ============================================
   LIGHTBOX: MODO PDF
   ============================================ */

.lb-body--pdf {
  display: grid;
  grid-template-columns: 1fr 260px;
  min-height: 560px;
}

.lb-pdf-frame {
  background: #111;
  overflow: hidden;
  border-radius: var(--r) 0 0 var(--r);
  display: flex;
}

.lb-pdf-frame embed {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: none;
  flex: 1;
}

.lb-download {
  margin-top: auto;
  font-size: 0.44rem !important;
  text-align: center;
  justify-content: center;
}

/* ============================================
   LIGHTBOX: RESPONSIVO
   ============================================ */

@media (max-width: 900px) {
  .lb-body--images {
    grid-template-columns: 1fr;
  }
  .lb-main-img {
    min-height: 260px;
    border-radius: var(--r) var(--r) 0 0;
  }
  .lb-main-img img { max-height: 50vw; }
  .lb-sidebar { max-height: none; border-left: none; border-top: 1px solid var(--border); }
  .lb-thumbs  { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }

  .lb-body--pdf { grid-template-columns: 1fr; }
  .lb-pdf-frame embed { min-height: 340px; }
}

@media (max-width: 540px) {
  .lb-nav { width: 32px; height: 32px; font-size: 0.4rem; }
}

/* ============================================
   SERVICE CARD BADGE
   ============================================ */

.svc-count {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 3;
  background: rgba(6,8,8,.82);
  border: 1px solid rgba(255,102,0,.5);
  color: var(--orange);
  font-family: 'Press Start 2P', monospace;
  font-size: .42rem;
  letter-spacing: .06em;
  padding: .35rem .65rem;
  border-radius: 3px;
  line-height: 1;
  pointer-events: none;
}

/* ============================================
   PICKER PANEL
   ============================================ */

.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,8,.75);
  backdrop-filter: blur(8px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.picker-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.picker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1101;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.picker.open {
  transform: translateY(0);
  pointer-events: all;
}

.picker-inner {
  background: #0b0e0d;
  border-top: 2px solid rgba(255,102,0,.45);
  border-left: 1px solid rgba(255,102,0,.14);
  border-right: 1px solid rgba(255,102,0,.14);
  border-radius: 14px 14px 0 0;
  max-height: 78vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 2.5rem 3rem;
  position: relative;
  box-shadow: 0 -28px 80px rgba(255,102,0,.07), 0 -3px 0 rgba(255,102,0,.28);
}

.picker-inner::-webkit-scrollbar { width: 3px; }
.picker-inner::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 99px; }
.picker-inner::-webkit-scrollbar-track { background: transparent; }

.picker-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  padding-right: 3rem;
  border-bottom: 1px solid rgba(255,102,0,.14);
}

.picker-header h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: .3rem 0 .5rem;
}

.picker-header p {
  color: var(--muted2);
  font-size: .9rem;
  margin: 0;
}

.picker-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: 1px solid rgba(255,102,0,.35);
  color: var(--muted2);
  font-family: 'Press Start 2P', monospace;
  font-size: .55rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
  line-height: 1;
}
.picker-close:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #050a06;
}

/* ── PROJECT CARDS INSIDE PICKER ── */

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
}

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

.pcard {
  cursor: pointer;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  overflow: hidden;
  animation: pcardIn .35s ease both;
  transition: border-color .2s, transform .28s cubic-bezier(.22,1,.36,1), box-shadow .2s;
}
.pcard:hover {
  border-color: var(--orange);
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(255,102,0,.2), 0 0 0 1px rgba(255,102,0,.25);
}

.pcard-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #0f1212;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.pcard:hover .pcard-img img { transform: scale(1.07); }

.pcard-pdf {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#ff6600,#ff2244);
  font-family: 'Press Start 2P', monospace;
  font-size: .5rem;
  color: #fff;
  letter-spacing: .08em;
}

.pcard-fallback {
  width: 100%;
  height: 100%;
}

.pcard-info {
  padding: .75rem .85rem .9rem;
}

.pcard-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .35rem;
}

.pcard-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: .4rem;
  color: var(--orange);
  letter-spacing: .06em;
  line-height: 1;
}

/* ── PICKER RESPONSIVE ── */

@media (max-width: 768px) {
  .picker-inner { padding: 1.5rem 1.5rem 2.5rem; }
  .picker-grid  { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .75rem; }
}

@media (max-width: 540px) {
  .picker-inner        { padding: 1.25rem 1rem 2rem; }
  .picker-grid         { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .picker-header h3    { font-size: 1.4rem; }
  .picker-header       { padding-right: 2.5rem; }
}
