/* =========================================================
   Richard Benjamim — Portfólio
   Paleta: azul-noite predominante + azuis de apoio + ciano
   ========================================================= */
:root {
  --night: #0a0a38;      /* fundo principal */
  --navy: #141c48;       /* superfícies */
  --navy-2: #1a2458;     /* superfícies elevadas */
  --royal: #16437a;      /* bordas / detalhes */
  --steel: #3a72a3;      /* apoio */
  --cyan: #00a3d9;       /* destaque */
  --white: #ffffff;
  --muted: rgba(255, 255, 255, .7);
  --faint: rgba(255, 255, 255, .5);
  --line: rgba(255, 255, 255, .1);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--cyan); color: var(--night); }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.ico { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: .01em;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--cyan); color: var(--night); }
.btn-solid:hover { background: var(--white); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.35); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); background: rgba(255,255,255,.06); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-lg { padding: 18px 34px; font-size: 17px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  font-size: 18px; line-height: 1;
  transition: background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--white); color: var(--night); }

/* ---------- Cabeçalho ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--gutter);
  transition: background-color .35s, padding .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { background: rgba(10,10,56,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-block: 12px; border-color: var(--line); }
.brand img { width: 150px; height: auto; }
.nav { display: flex; gap: 30px; margin-left: auto; }
.nav a { font-weight: 600; font-size: 15px; color: var(--muted); position: relative; padding: 4px 0; transition: color .2s; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--cyan); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:hover, .nav a.active { color: var(--white); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.menu-toggle { display: none; width: 44px; height: 44px; position: relative; margin-left: auto; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--white); border-radius: 2px; transition: transform .3s var(--ease), top .3s; }
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 25px; }
.menu-open .menu-toggle span:first-child { top: 21px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  --H: max(100svh, 640px);
  --W: max(100vw, calc(var(--H) * 1.7768));
  position: relative; height: var(--H); min-height: 640px;
  display: flex; align-items: center;
  overflow: hidden; isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: right center; }
/* escurece levemente a borda inferior para encaixar com a faixa abaixo */
.hero-media::after { content: ''; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(to top, var(--night), transparent); pointer-events: none; }
.hero-content { position: relative; padding-top: 80px; pointer-events: none; }
.hero-content > * { pointer-events: auto; }
.hero-actions { width: fit-content; }
.hero h1 { font-size: clamp(2.1rem, 3.7vw, 3.6rem); max-width: 15.5em; max-width: min(640px, 52vw); }
.hero h1 em { font-style: normal; color: var(--cyan); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(0,163,217,.18); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* botão play: posicionado sobre a foto (camisa), segue o recorte da imagem */
.play {
  position: absolute;
  left: calc(100% - var(--W) * .415);
  top: calc(50% + var(--W) / 1.7768 * .2);
  transform: translate(-50%, -50%);
  width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--white); color: var(--night);
  box-shadow: 0 10px 40px rgba(0, 163, 217, .45);
  transition: transform .3s var(--ease), background-color .3s;
  z-index: 2;
}
.play svg { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.play:hover { transform: translate(-50%, -50%) scale(1.08); background: var(--cyan); }
.play-ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); animation: pulse 2.4s var(--ease) infinite; }
.play-ring::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(0,163,217,.6); animation: pulse 2.4s .6s var(--ease) infinite; }
.play-label {
  position: absolute; left: calc(100% + 18px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; color: var(--white); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(10,10,56,.75); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
}
@keyframes pulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }

.scroll-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.4); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--white); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Faixa ---------- */
.marquee { background: var(--royal); overflow: hidden; padding: 18px 0; border-block: 1px solid rgba(255,255,255,.08); }
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 38s linear infinite; }
.marquee span { font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 2vw, 24px); white-space: nowrap; }
.marquee i { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); flex: none; }
@keyframes marquee { to { transform: translateX(calc(-50% - 14px)); } }

/* ---------- Seções ---------- */
.section { padding-block: clamp(80px, 11vw, 140px); }
.kicker { font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 16px; }
.section h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); }
.section-head { margin-bottom: clamp(40px, 5vw, 64px); }
.section-head.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* Sobre */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.about-photo { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--navy); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 68% center; transform: scale(1.02); transition: transform 1.2s var(--ease); }
.about-photo:hover img { transform: scale(1.07); }
.about-photo figcaption { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column; background: var(--night); padding: 14px 18px; border-radius: 12px; border-left: 3px solid var(--cyan); font-weight: 700; font-size: 14px; line-height: 1.4; }
.about-photo figcaption span:last-child { color: var(--muted); font-weight: 500; }
.about-text h2 { margin-bottom: 28px; }
.about-text p:not(.kicker) { color: var(--muted); margin-bottom: 18px; max-width: 60ch; }
.pillars { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pillars li { padding: 18px; border-radius: 14px; background: var(--navy); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.pillars b { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.pillars span { color: var(--faint); font-size: 14px; line-height: 1.4; }

/* Habilidades */
.skills { background: var(--navy); }
.skill-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill {
  position: relative; padding: 28px 24px 26px; min-height: 220px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  border-radius: var(--radius); background: var(--night); border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .35s, background-color .35s;
}
.skill:hover { transform: translateY(-6px); border-color: var(--cyan); background: #0d0f42; }
.skill .n { position: absolute; top: 24px; right: 24px; font-family: var(--font-display); font-size: 13px; color: var(--faint); }
.skill svg { width: 40px; height: 40px; fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skill h3 { font-size: 18px; line-height: 1.3; font-weight: 600; }
.app-icons { display: flex; gap: 8px; }
.app-icons span { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; background: #0f1a3c; border: 1.5px solid; }
.app-icons .ai { color: #ff9a00; border-color: #ff9a00; background: #330000; }
.app-icons .ps { color: #31a8ff; border-color: #31a8ff; background: #001e36; }
.app-icons .id { color: #ff3366; border-color: #ff3366; background: #49021f; }

/* ---------- Portfólio ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; transition: all .25s; }
.filter:hover { color: var(--white); border-color: rgba(255,255,255,.35); }
.filter.is-active { background: var(--white); color: var(--night); border-color: var(--white); }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project {
  position: relative; display: block; width: 100%; text-align: left;
  border-radius: var(--radius); overflow: hidden; background: var(--navy);
  aspect-ratio: 4 / 3.4; isolation: isolate;
  transition: opacity .4s, transform .5s var(--ease);
}
.project.wide { grid-column: span 2; aspect-ratio: auto; }
.project.is-hidden { display: none; }
.project-media { position: absolute; inset: 0; }
.project-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), opacity .6s; }
.project-media img.peek { opacity: 0; }
.project-media img.peek.on { opacity: 1; }
.project:hover .project-media img { transform: scale(1.05); }
.project-info {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2;
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(10,10,56,.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  transition: transform .4s var(--ease);
}
.project-info h3 { font-size: 20px; margin-bottom: 4px; }
.project-info p { font-size: 13px; color: var(--muted); line-height: 1.4; }
.project-count { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.project-count span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); }
.project-go { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--white); color: var(--night); font-size: 20px; transition: background-color .3s, transform .4s var(--ease); }
.project:hover .project-go { background: var(--cyan); transform: rotate(-45deg); }
.project .progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; display: flex; gap: 4px; padding: 10px 14px 0; z-index: 2; opacity: 0; transition: opacity .3s; }
.project .progress i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); }
.project .progress i.on { background: var(--white); }
.project:hover .progress { opacity: 1; }
.work-note { margin-top: 28px; color: var(--faint); font-size: 14px; text-align: center; }

/* ---------- Contato ---------- */
.contact { padding-top: 0; }
.contact-box {
  text-align: center; padding-block: clamp(64px, 9vw, 120px);
  border-radius: 28px; background: var(--royal);
  max-width: calc(1240px - 2 * var(--gutter)); width: calc(100% - 2 * var(--gutter));
  position: relative; overflow: hidden;
}
.contact-box::before, .contact-box::after { content: ''; position: absolute; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.12); pointer-events: none; }
.contact-box::before { width: 520px; height: 520px; right: -180px; top: -220px; }
.contact-box::after { width: 340px; height: 340px; left: -140px; bottom: -200px; border-color: rgba(0,163,217,.4); }
.contact-box .kicker { color: var(--white); opacity: .75; }
.contact-box h2 { font-size: clamp(2.2rem, 5.6vw, 4.6rem); max-width: 14ch; margin-inline: auto; }
.contact .lead { color: rgba(255,255,255,.82); font-size: clamp(17px, 1.6vw, 20px); margin: 20px auto 40px; max-width: 46ch; }
.contact-actions { display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; z-index: 1; }
.contact-box .btn-solid { background: var(--white); }
.contact-box .btn-solid:hover { background: var(--cyan); }
.phone { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: rgba(255,255,255,.85); border-bottom: 1px solid rgba(255,255,255,.3); padding-bottom: 2px; }
.phone:hover { color: var(--white); border-color: var(--white); }

/* ---------- Rodapé ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--line); margin-top: clamp(64px, 8vw, 110px); }
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer p { color: var(--faint); font-size: 14px; }
.to-top { font-weight: 600; font-size: 14px; color: var(--muted); }
.to-top:hover { color: var(--white); }

.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: #25d366; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .3s var(--ease);
}
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }
.wa-float:hover { transform: scale(1.08); }

/* ---------- Modais ---------- */
.modal { position: fixed; inset: 0; z-index: 100; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,5,30,.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal.open { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.video-modal { display: grid; place-items: center; padding: 20px; }
.video-modal[hidden] { display: none; }
.video-frame { position: relative; width: min(1000px, 100%); aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--navy); border: 1px solid var(--line); animation: rise .45s var(--ease) both; }
.video-frame .modal-close { position: absolute; top: 14px; right: 14px; z-index: 3; }
.video-slot, .video-slot video, .video-slot iframe { width: 100%; height: 100%; border: 0; }
.video-slot video { object-fit: contain; background: #000; }
.video-soon { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 24px; }
.video-soon img { width: min(260px, 60%); }
.video-soon p { color: var(--muted); max-width: 38ch; }
.video-soon b { font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 28px); font-weight: 600; color: var(--white); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

/* Visualizador de projetos */
.viewer { background: #07072b; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer-top { display: flex; align-items: center; gap: 12px; padding: 14px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); }
.viewer-meta { flex: 1; min-width: 0; }
.viewer-cat { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.viewer-top h2 { font-size: clamp(18px, 2.2vw, 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-count { font-family: var(--font-display); font-size: 14px; color: var(--muted); padding: 0 8px; }
.info-toggle { font-family: var(--font-display); font-weight: 700; font-style: italic; }
.info-toggle[aria-expanded="true"] { background: var(--white); color: var(--night); }
.viewer-body { flex: 1; min-height: 0; display: flex; }
.stage { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px 76px; }
.stage-inner img, .stage-inner video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; animation: mediaIn .45s var(--ease) both; }
.stage-inner img { cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.stage-inner video { background: #000; }
@keyframes mediaIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.stage.zoomed .stage-inner { display: block; overflow: auto; padding: 0; cursor: zoom-out; overscroll-behavior: contain; }
.stage.zoomed .stage-inner img { max-width: none; max-height: none; width: 100%; height: auto; border-radius: 0; cursor: zoom-out; animation: none; }
.stage.zoomed .nav-btn, .stage.zoomed .zoom-hint { opacity: 0; pointer-events: none; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; font-size: 30px; padding-bottom: 4px; }
.nav-btn.prev { left: 14px; }
.nav-btn.next { right: 14px; }
.zoom-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--faint); pointer-events: none; transition: opacity .3s; white-space: nowrap; }
.viewer-info { width: 340px; flex: none; padding: 28px; border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
.viewer-info[hidden] { display: none; }
.viewer-info p { color: var(--muted); font-size: 15px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(58,114,163,.6); color: #cfe3f5; }
.viewer-info .btn { align-self: flex-start; }
.thumbs { display: flex; gap: 10px; padding: 12px clamp(14px, 3vw, 28px) 16px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--royal) transparent; }
.thumb { position: relative; flex: none; width: 92px; height: 64px; border-radius: 8px; overflow: hidden; opacity: .45; border: 2px solid transparent; transition: opacity .2s, border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .85; }
.thumb.on { opacity: 1; border-color: var(--cyan); }
.thumb .vbadge { position: absolute; inset: 0; display: grid; place-items: center; }
.thumb .vbadge::before { content: ''; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.92); }
.thumb .vbadge::after { content: ''; position: absolute; border-left: 8px solid var(--night); border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }

/* ---------- Animações de entrada ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .viewer-info { width: 290px; }
}
@media (max-width: 960px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project.wide { grid-column: span 2; aspect-ratio: 16 / 10; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 16 / 11; }
  .about-photo img { object-position: 70% 30%; }
}
@media (max-width: 820px) {
  .topbar { gap: 12px; }
  .brand img { width: 128px; }
  .menu-toggle { display: block; }
  .topbar-cta { display: none; }
  .nav {
    position: fixed; inset: 0; z-index: -1; margin: 0;
    flex-direction: column; justify-content: center; align-items: center; gap: 28px;
    background: var(--night);
    opacity: 0; pointer-events: none; transition: opacity .35s;
  }
  .nav a { font-family: var(--font-display); font-size: 30px; color: var(--white); }
  .menu-open .nav { opacity: 1; pointer-events: auto; }
  .menu-open.topbar { background: transparent; border-color: transparent; backdrop-filter: none; }

  .hero { height: auto; min-height: 0; flex-direction: column; align-items: stretch; }
  .hero-media { position: relative; inset: auto; z-index: 0; aspect-ratio: 1.2; }
  .hero-media img { object-position: 75% center; }
  .hero-media::after { height: 90px; }
  .play { left: 50%; top: 70%; width: 72px; height: 72px; }
  .play svg { width: 24px; height: 24px; }
  .play-label { font-size: 12px; left: calc(100% + 14px); }
  .hero-content { padding-top: 6px; padding-bottom: 56px; }
  .hero h1 { max-width: none; font-size: clamp(1.9rem, 7.4vw, 2.6rem); }
  .scroll-hint { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .project-grid { grid-template-columns: 1fr; gap: 16px; }
  .project, .project.wide { grid-column: auto; aspect-ratio: 4 / 4.2; }
  .skill-grid { grid-template-columns: 1fr; }
  .skill { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; padding: 20px; }
  .skill .n { top: 50%; transform: translateY(-50%); right: 18px; }
  .skill h3 { font-size: 16px; padding-right: 26px; }
  .skill svg { width: 32px; height: 32px; flex: none; }
  .app-icons span { width: 30px; height: 30px; font-size: 12px; border-radius: 7px; }
  .app-icons { gap: 5px; flex: none; }
  .pillars { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .contact-box { border-radius: 22px; padding-inline: 20px; }

  .viewer-body { flex-direction: column; }
  .stage-inner { padding: 12px; }
  .nav-btn { width: 42px; height: 42px; font-size: 24px; top: auto; bottom: 10px; transform: none; background: rgba(10,10,56,.8); }
  .nav-btn.prev { left: auto; right: 62px; }
  .nav-btn.next { right: 12px; }
  .zoom-hint { left: 16px; transform: none; bottom: 22px; }
  .viewer-info { width: auto; border-left: 0; border-top: 1px solid var(--line); padding: 18px; max-height: 38vh; gap: 14px; }
  .viewer-count { display: none; }
  .thumb { width: 72px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
