/* =========================================================
   Ahmed Osam — Portfolio
   Dependency-free single-page site · EN / AR (RTL)
   ========================================================= */

:root {
  --bg: #070b16;
  --bg-soft: #0b1120;
  --card: rgba(148, 163, 184, 0.06);
  --border: rgba(148, 163, 184, 0.16);
  --text: #e6eaf2;
  --text-soft: #c3ccdb;
  --muted: #93a1b5;
  --sky: #38bdf8;
  --violet: #a78bfa;
  --green: #34d399;
  --grad: linear-gradient(100deg, var(--sky), var(--violet));
  --radius: 16px;
  --container: 1080px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Arabic", Tahoma, Helvetica, Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(167, 139, 250, 0.4); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

img { max-width: 100%; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- language visibility ---------- */

[data-lang="en"] .ar { display: none !important; }
[data-lang="ar"] .en { display: none !important; }

.skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 10px;
  z-index: 200;
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.skip-link:focus { inset-inline-start: 10px; }

/* ---------- background glow ---------- */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-glow span {
  position: absolute;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.22;
}
.bg-glow span:nth-child(1) {
  background: var(--sky);
  top: -22vw;
  left: -14vw;
}
.bg-glow span:nth-child(2) {
  background: var(--violet);
  bottom: -28vw;
  right: -16vw;
}
.bg-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 75%);
}

/* ---------- layout helpers ---------- */

.container {
  width: min(var(--container), 92%);
  margin-inline: auto;
}

.section { padding: 90px 0; }

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.01em;
  margin-bottom: 36px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-title .num {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--sky);
  font-weight: 600;
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--grad);
  color: #081018;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(167, 139, 250, 0.35); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: rgba(56, 189, 248, 0.6); }

.btn-sm { padding: 8px 15px; font-size: 0.85rem; border-radius: 10px; }

.lang-btn {
  min-width: 62px;
  justify-content: center;
  font-weight: 700;
}

/* ---------- header / nav ---------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(7, 11, 22, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  direction: ltr;
}
.logo span { color: var(--sky); }

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color 0.18s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--grad);
  border-radius: 2px;
  transition: width 0.22s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.menu-btn {
  display: none;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- hero ---------- */

.hero {
  padding: 150px 0 90px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 52px;
  align-items: center;
}

.eyebrow {
  color: var(--sky);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 12px;
  min-height: 1.7em;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-inline-start: 3px;
  vertical-align: -0.12em;
  background: var(--sky);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin-top: 20px;
}
.lead strong { color: var(--text-soft); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* code editor card */

.hero-card { animation: float 7s ease-in-out infinite alternate; }
@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

.editor {
  background:
    linear-gradient(160deg, rgba(56, 189, 248, 0.09), rgba(167, 139, 250, 0.09)),
    var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.65);
}

.editor-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.editor-bar .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.editor-bar .dot:nth-child(1) { background: #ff5f57; }
.editor-bar .dot:nth-child(2) { background: #febc2e; }
.editor-bar .dot:nth-child(3) { background: #28c840; }

.file-label {
  margin-inline-start: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.editor pre {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.85;
  overflow-x: auto;
  color: #cbd5e1;
  direction: ltr;
  text-align: left;
}

.c-cm { color: #64748b; font-style: italic; }
.c-kw { color: #f472b6; }
.c-cls { color: #7dd3fc; }
.c-typ { color: #34d399; }
.c-fn { color: #c4b5fd; }

/* ---------- about ---------- */

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

.about-text p {
  color: var(--text-soft);
  margin-bottom: 16px;
  max-width: 62ch;
}
.about-text strong { color: var(--text); }

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.facts li {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.87rem;
  color: var(--muted);
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.avatar {
  width: 118px;
  height: 118px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 3px;
  background: var(--grad);
  box-shadow: 0 12px 34px rgba(56, 189, 248, 0.3);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.about-card-name { font-weight: 700; font-size: 1.15rem; }
.about-card-role { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }

.about-card-list {
  list-style: none;
  text-align: start;
}
.about-card-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.88rem;
}
.about-card-list span { color: var(--muted); }
.about-card-list strong { font-weight: 600; text-align: end; }

.status-dot { color: var(--green); }
.status-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}

/* ---------- skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.skill-card ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-card li {
  font-size: 0.82rem;
  color: #a5b4fc;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  padding: 4px 11px;
  border-radius: 999px;
}

/* ---------- projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.55);
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-head h3 { font-size: 1.12rem; }

.badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.project-card p {
  color: var(--muted);
  font-size: 0.94rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  font-size: 0.76rem;
  color: #a5b4fc;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.project-links { margin-top: auto; padding-top: 6px; }
.project-links a,
.more a {
  color: var(--sky);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.project-links a:hover,
.more a:hover { text-decoration: underline; }

.more { margin-top: 28px; color: var(--muted); font-size: 0.95rem; }

/* ---------- contact ---------- */

.contact-card {
  text-align: center;
  background:
    radial-gradient(ellipse 70% 120% at 50% 0%, rgba(56, 189, 248, 0.12), transparent),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 28px;
}
.contact-card h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.contact-card p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 30px;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ---------- footer ---------- */

.footer {
  padding: 36px 0 52px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- scroll progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  z-index: 150;
  border-radius: 0 3px 3px 0;
}
[dir="rtl"] .scroll-progress {
  left: auto;
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* ---------- reveal animations ---------- */

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

.skills-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.skills-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.skills-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.skills-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.skills-grid .reveal:nth-child(6) { transition-delay: 0.3s; }

.projects-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .reveal:nth-child(3) { transition-delay: 0.16s; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 120px;
    gap: 42px;
  }
  .about-grid { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }

  .menu-btn { display: grid; }

  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 6px;
    padding: 18px 4%;
    background: rgba(7, 11, 22, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; font-size: 1rem; }
}

@media (max-width: 480px) {
  .hero-meta { gap: 12px; }
  .contact-card { padding: 48px 20px; }
  .editor pre { font-size: 0.78rem; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 7px 11px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .caret { display: none; }
}

/* =========================================================
   FX layer — 3D camera motion, robot cursor, hologram, sound
   ========================================================= */

/* ---------- scroll-reveal "camera focus" (override) ---------- */
.reveal {
  opacity: 0;
  transform: perspective(900px) translateY(26px) rotateX(7deg);
  filter: blur(7px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- parallax background ---------- */
.bg-glow span:nth-child(1) {
  transform: translate3d(calc(var(--sy, 0) * 0.045 * 1px), calc(var(--sy, 0) * -0.05 * 1px), 0);
}
.bg-glow span:nth-child(2) {
  transform: translate3d(calc(var(--sy, 0) * -0.04 * 1px), calc(var(--sy, 0) * 0.04 * 1px), 0);
}

/* ---------- hero editor tilt ---------- */
.hero-card { perspective: 900px; }
.editor { transition: transform 0.25s ease; will-change: transform; }

/* ---------- project cards: tilt + pointer glare ---------- */
.project-card { position: relative; overflow: hidden; }
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(340px circle at var(--gx, 50%) var(--gy, 50%), rgba(56, 189, 248, 0.13), transparent 65%);
  transition: opacity 0.3s ease;
}
.project-card:hover::before { opacity: 1; }
.project-card.is-tilting {
  transition: transform 0.12s ease-out, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ---------- hologram section ---------- */
.holo-lead {
  color: var(--muted);
  max-width: 62ch;
  margin-top: -16px;
  margin-bottom: 40px;
}
.holo-stage {
  position: relative;
  perspective: 1200px;
  perspective-origin: 50% 24%;
  padding: 26px 0 40px;
  display: grid;
  place-items: center;
}
.holo-frame {
  --hrx: 6deg;
  --hry: -16deg;
  --hpx: 0deg;
  --hpy: 0deg;
  position: relative;
  width: min(860px, 100%);
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--hrx) + var(--hpy))) rotateY(calc(var(--hry) + var(--hpx)));
  transition: transform 0.25s ease-out;
  will-change: transform;
}
.holo-browser {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: #0b1120;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 34px 110px rgba(56, 189, 248, 0.16),
    0 0 80px rgba(167, 139, 250, 0.1);
  transform: translateZ(36px);
}
.holo-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: rgba(56, 189, 248, 0.07);
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}
.holo-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(125, 211, 252, 0.55); }
.holo-dot:nth-child(2) { background: rgba(167, 139, 250, 0.55); }
.holo-dot:nth-child(3) { background: rgba(52, 211, 153, 0.55); }
.holo-url {
  margin-inline-start: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #7dd3fc;
  opacity: 0.85;
  direction: ltr;
}
.holo-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0b1120; }
.holo-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 0 var(--holo-cut, 0%) 0);
}
.holo-page img {
  display: block;
  width: 100%;
  height: auto;
  animation: holoLiveScroll 46s linear infinite;
  will-change: transform;
}
@keyframes holoLiveScroll {
  0%, 3% { transform: translateY(0); opacity: 1; }
  76% { transform: translateY(calc(-100% + var(--holo-view, 100%))); opacity: 1; }
  80% { transform: translateY(calc(-100% + var(--holo-view, 100%))); opacity: 1; }
  83% { transform: translateY(calc(-100% + var(--holo-view, 100%))); opacity: 0; }
  84% { transform: translateY(0); opacity: 0; }
  88%, 100% { transform: translateY(0); opacity: 1; }
}
.holo-sheen {
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: -40%;
  width: 26%;
  background: linear-gradient(100deg, transparent, rgba(190, 240, 255, 0.5), transparent);
  transform: skewX(-14deg) translateX(0);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: holoSheen 7.5s ease-in-out 2.5s infinite;
}
@keyframes holoSheen {
  0%, 55% { transform: skewX(-14deg) translateX(0); opacity: 0; }
  60% { opacity: 0.45; }
  80% { transform: skewX(-14deg) translateX(620%); opacity: 0; }
  100% { transform: skewX(-14deg) translateX(620%); opacity: 0; }
}
.holo-live {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #7dd3fc;
}
.holo-live .en { letter-spacing: 0.16em; text-transform: uppercase; }
.holo-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.holo-float {
  transform-style: preserve-3d;
  animation: holoBob 9s ease-in-out infinite;
}
@keyframes holoBob {
  0%, 100% { transform: translateY(-5px) rotateY(-1.4deg); }
  50% { transform: translateY(6px) rotateY(1.4deg); }
}
.holo-halo {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(1080px, 122%);
  aspect-ratio: 1.3;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05) 46%, transparent 70%);
  filter: blur(34px);
  opacity: 0.85;
  pointer-events: none;
  animation: holoHaloPulse 8s ease-in-out infinite;
}
@keyframes holoHaloPulse { 50% { opacity: 0.5; } }
.holo-beam {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: min(740px, 84%);
  height: 92%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.28), rgba(56, 189, 248, 0.06) 70%, transparent);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  filter: blur(24px);
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
  animation: holoBeamPulse 9s ease-in-out infinite;
}
@keyframes holoBeamPulse { 50% { opacity: 0.32; } }
.holo-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.14), transparent 32%, rgba(167, 139, 250, 0.12)),
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.05) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
  opacity: 0.55;
}
.holo-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #7dd3fc, transparent);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.95);
  opacity: 0;
  pointer-events: none;
}
.holo-base {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -40px;
  height: 70px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.4), rgba(56, 189, 248, 0.06) 48%, transparent 72%);
  filter: blur(16px);
  transform: translateZ(-46px);
  pointer-events: none;
}
.holo-dust { position: absolute; inset: 0; pointer-events: none; }
.holo-dust span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #7dd3fc;
  opacity: 0;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  animation: holoFloat 8s linear infinite;
}
.holo-dust span:nth-child(1) { left: 7%; top: 68%; animation-delay: 0s; }
.holo-dust span:nth-child(2) { left: 16%; top: 42%; animation-delay: 1.2s; animation-duration: 10s; }
.holo-dust span:nth-child(3) { left: 26%; top: 76%; animation-delay: 2.4s; }
.holo-dust span:nth-child(4) { left: 38%; top: 55%; animation-delay: 0.8s; animation-duration: 11s; }
.holo-dust span:nth-child(5) { left: 52%; top: 82%; animation-delay: 3s; }
.holo-dust span:nth-child(6) { left: 64%; top: 48%; animation-delay: 1.6s; animation-duration: 9s; }
.holo-dust span:nth-child(7) { left: 74%; top: 70%; animation-delay: 2s; }
.holo-dust span:nth-child(8) { left: 86%; top: 38%; animation-delay: 0.4s; animation-duration: 12s; }
.holo-dust span:nth-child(9) { left: 92%; top: 64%; animation-delay: 2.8s; }
.holo-dust span:nth-child(10) { left: 45%; top: 30%; animation-delay: 3.6s; animation-duration: 13s; }
@keyframes holoFloat {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  12% { opacity: 0.6; }
  100% { transform: translateY(-90px) scale(1.15); opacity: 0; }
}
.holo-note {
  text-align: center;
  margin-top: 30px;
  color: var(--muted);
  font-size: 0.9rem;
}
.holo-note a { color: var(--sky); text-decoration: none; font-weight: 600; }
.holo-note a:hover { text-decoration: underline; }

/* ---------- robot cursor ---------- */
.cursor-robot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 320;
  width: 44px;
  height: 44px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 0.25s ease;
  will-change: transform;
}
.cursor-robot.visible { opacity: 1; }
.cursor-robot svg { display: block; transition: transform 0.12s ease; }
.cursor-robot .head {
  fill: rgba(11, 17, 32, 0.94);
  stroke: rgba(125, 211, 252, 0.9);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.55));
  transition: stroke 0.15s ease;
}
.cursor-robot .antenna { stroke: rgba(125, 211, 252, 0.75); stroke-width: 1.6; }
.cursor-robot .antenna-tip {
  fill: var(--violet);
  filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.9));
  animation: antennaPulse 2.2s ease-in-out infinite;
}
.cursor-robot .eye {
  fill: #7dd3fc;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.9));
  transition: fill 0.15s ease;
}
.cursor-robot .mouth { stroke: rgba(125, 211, 252, 0.7); stroke-width: 1.4; stroke-linecap: round; }
.cursor-robot .ear { stroke: rgba(125, 211, 252, 0.6); stroke-width: 1.6; stroke-linecap: round; }
.cursor-robot.is-active .eye { fill: #f0abfc; }
.cursor-robot.is-active .head { stroke: rgba(240, 171, 252, 0.95); }
.cursor-robot.is-down svg { transform: scale(0.86); }
@keyframes antennaPulse { 50% { opacity: 0.4; } }
@media (hover: hover) and (pointer: fine) {
  html.robot-cursor,
  html.robot-cursor body,
  html.robot-cursor a,
  html.robot-cursor button,
  html.robot-cursor .project-card,
  html.robot-cursor .skill-card,
  html.robot-cursor .holo-browser { cursor: none; }
}
@media (hover: none), (pointer: coarse) {
  .cursor-robot { display: none; }
}

/* ---------- ambient sound toggle ---------- */
.sound-btn {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 18px;
  z-index: 140;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.sound-btn:hover { color: var(--text); border-color: rgba(56, 189, 248, 0.5); }
.sound-btn[aria-pressed="true"] {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}
.sound-btn .wave-1, .sound-btn .wave-2 { opacity: 0.22; transition: opacity 0.25s ease; }
.sound-btn[aria-pressed="true"] .wave-1 { opacity: 0.85; animation: wavePulse 2.4s ease-in-out infinite; }
.sound-btn[aria-pressed="true"] .wave-2 { opacity: 0.5; animation: wavePulse 2.4s ease-in-out 0.3s infinite; }
@keyframes wavePulse { 50% { opacity: 0.25; } }

/* ---------- motion preferences ---------- */
/* ---------- contact extras ---------- */
.btn-icon { display: inline-flex; align-items: center; gap: 8px; }
.btn-icon .ico { flex: 0 0 auto; }
.contact-social { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.contact-social a {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-soft);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-social a:hover {
  color: var(--sky);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.16);
}

/* ---------- light closing zone (dark → light) ---------- */

.lightzone {
  position: relative;
  margin-top: 48px;
  padding: 44px 0 0;
  border-radius: 48px 48px 0 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 240, 214, 0.85), transparent 62%),
    linear-gradient(180deg, rgba(247, 241, 231, 0) 0, #f7f1e7 150px, #f7f1e7 100%);
  color: #2b241b;
  overflow: hidden;
}
.lightzone::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 236, 200, 0.75), transparent);
}
.lightzone .contact-card {
  background:
    radial-gradient(ellipse 70% 120% at 50% 0%, rgba(190, 160, 110, 0.14), transparent),
    rgba(255, 253, 247, 0.92);
  border-color: rgba(84, 63, 38, 0.14);
  box-shadow: 0 30px 90px rgba(84, 63, 38, 0.14);
}
.lightzone .contact-card h2 { color: #241c13; }
.lightzone .contact-card p { color: #6b5b47; }
.lightzone .contact-card .btn-primary {
  background: linear-gradient(135deg, #2a2118, #4a3826);
  color: #f8f1e3;
  box-shadow: 0 12px 34px rgba(42, 33, 24, 0.28);
}
.lightzone .contact-card .btn-primary:hover { box-shadow: 0 16px 42px rgba(42, 33, 24, 0.38); }
.lightzone .contact-card .btn-ghost {
  border-color: rgba(84, 63, 38, 0.22);
  color: #3a2e20;
}
.lightzone .contact-card .btn-ghost:hover {
  border-color: rgba(84, 63, 38, 0.55);
  background: rgba(84, 63, 38, 0.05);
}
.lightzone .contact-social a {
  background: #fffdf7;
  border-color: rgba(84, 63, 38, 0.16);
  color: #5c4b36;
}
.lightzone .contact-social a:hover {
  color: #2a2118;
  border-color: rgba(84, 63, 38, 0.45);
  box-shadow: 0 10px 26px rgba(84, 63, 38, 0.16);
}
.lightzone .footer {
  border-top-color: rgba(84, 63, 38, 0.12);
  color: #7c6b55;
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .cursor-robot { display: none; }
  .holo-dust { display: none; }
  .holo-frame { transform: none !important; }
  .holo-scan { display: none; }
  .holo-page { clip-path: none; }
  .holo-page img { animation: none; }
  .holo-sheen, .holo-float, .holo-halo, .holo-beam, .holo-live-dot { animation: none; }
  .holo-sheen { display: none; }
  html.robot-cursor,
  html.robot-cursor body,
  html.robot-cursor a,
  html.robot-cursor button { cursor: auto; }
}
