/* 
 * KEVIN KAMAU — PORTFOLIO STYLES
 * A modern, cyberpunk-inspired aesthetic with multi-language support.
 */

/* ── CONFIGURATION & VARIABLES ────────────────────────── */
:root {
  --speed: 0.45s;
}

/* Dark Theme (Primary) */
.t-primary {
  --bg: #0d0d0d;
  --bg2: #141414;
  --card: #1a1a1a;
  --fg: #f0ece4;
  --muted: #6e685e;
  --accent: #d4a84b;
  --accent2: #e8c87a;
  --adim: rgba(212, 168, 75, 0.1);
  --border: rgba(255, 255, 255, 0.07);
  --baccent: rgba(212, 168, 75, 0.28);
  --gridline: rgba(255, 255, 255, 0.03);
  --shadow: 0 8px 48px rgba(0, 0, 0, 0.75);
  --glow: 0 0 28px rgba(212, 168, 75, 0.2);
}

/* Light Theme (Secondary) */
.t-secondary {
  --bg: #f5f0e8;
  --bg2: #ede8dc;
  --card: #ffffff;
  --fg: #1a1410;
  --muted: #6b6055;
  --accent: #c0392b;
  --accent2: #e67e22;
  --adim: rgba(192, 57, 43, 0.09);
  --border: rgba(26, 20, 16, 0.12);
  --baccent: rgba(192, 57, 43, 0.35);
  --gridline: rgba(26, 20, 16, 0.05);
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  --glow: 0 0 24px rgba(192, 57, 43, 0.14);
}

/* ── RESET & BASE ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Syne", sans-serif;
  transition: background var(--speed), color var(--speed);
  overflow-x: hidden;
  line-height: 1.6;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

body.lang-ar {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  direction: rtl;
}

/* ── BACKGROUND & GLOBAL UI ───────────────────────────── */
#grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(var(--gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: 38px 38px;
}

#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 200;
  box-shadow: var(--glow);
  transition: width 0.1s linear;
}

body.lang-ar #progress {
  left: auto;
  right: 0;
}

#cursor {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.15s, opacity 0.2s, background var(--speed);
  box-shadow: var(--glow);
}

@media (hover: none) {
  #cursor {
    display: none;
  }
}

/* ── NAVIGATION ───────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--speed);
}

.nav-logo {
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--speed);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

body.lang-ar .nav-links {
  flex-direction: row-reverse;
}

.nav-links a {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Controls (Lang & Theme) */
.controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lang-sw {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.lang-sw button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  padding: 0.32rem 0.55rem;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.05em;
}

.lang-sw button.active {
  background: var(--accent);
  color: var(--bg);
}

.lang-sw button + button {
  border-left: 1px solid var(--border);
}

body.lang-ar .lang-sw button + button {
  border-left: none;
  border-right: 1px solid var(--border);
}

.theme-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.28rem 0.28rem 0.65rem;
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed);
}

body.lang-ar .theme-pill {
  padding: 0.28rem 0.65rem 0.28rem 0.28rem;
}

.theme-pill span {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--speed);
}

.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  transition: background var(--speed), box-shadow var(--speed);
  box-shadow: var(--glow);
}

/* ── HERO SECTION ─────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.hero-eyebrow {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: color var(--speed);
}

.hero-eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--accent);
  transition: background var(--speed);
}

body.lang-ar .hero-eyebrow {
  flex-direction: row-reverse;
}

body.lang-ar .hero-eyebrow::before {
  display: none;
}

body.lang-ar .hero-eyebrow::after {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.hero-name {
  font-size: clamp(3.2rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-name .outline {
  -webkit-text-stroke: 2px var(--fg);
  color: transparent;
  transition: -webkit-text-stroke-color var(--speed), color 0.3s;
}

.hero-name .outline:hover {
  color: var(--fg);
}

.hero-name .hi {
  color: var(--accent);
  transition: color var(--speed);
}

.hero-desc {
  max-width: 500px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.82;
  margin-bottom: 2.8rem;
  transition: color var(--speed);
}

.hero-cta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

body.lang-ar .hero-cta {
  flex-direction: row-reverse;
}

.btn-pri {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent);
  color: var(--bg);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.7rem;
  border-radius: 4px;
  text-decoration: none;
  border: 2px solid var(--accent);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s,
    border-color var(--speed);
}

.btn-pri:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--glow);
}

.btn-sec {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--fg);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.7rem;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: border-color 0.25s, color 0.25s, border var(--speed);
}

.btn-sec:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 3D Canvas Wrap */
#hero3d-wrap {
  position: absolute;
  right: 6%;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: min(420px, 38vw);
  aspect-ratio: 1;
  pointer-events: all;
  cursor: grab;
  transition: right var(--speed), left var(--speed);
}

#hero3d-wrap:active {
  cursor: grabbing;
}

body.lang-ar #hero3d-wrap {
  right: auto;
  left: 6%;
}

#geo-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#face-label {
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
  pointer-events: none;
}

.hero-badge {
  position: absolute;
  bottom: 2.8rem;
  left: 3rem;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: color var(--speed);
}

.hero-badge::after {
  content: "";
  width: 55px;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

body.lang-ar .hero-badge {
  left: auto;
  right: 3rem;
  flex-direction: row-reverse;
}

body.lang-ar .hero-badge::after {
  display: none;
}

body.lang-ar .hero-badge::before {
  content: "";
  width: 55px;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

/* ── ABOUT SECTION ────────────────────────────────────── */
.about {
  padding: 8rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.sec-label {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color var(--speed);
}

.sec-label::before {
  content: "//";
  opacity: 0.45;
}

.sec-title {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.07;
  margin-bottom: 1.4rem;
  letter-spacing: -0.02em;
}

.about-p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  transition: color var(--speed);
}

/* Stats */
.stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color var(--speed);
}

.stat-lbl {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  transition: color var(--speed);
}

/* About Card */
.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background var(--speed), border-color var(--speed),
    box-shadow var(--speed);
}

.about-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: background var(--speed);
}

.card-tag {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  background: var(--adim);
  padding: 0.28rem 0.65rem;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 1.4rem;
  letter-spacing: 0.14em;
  transition: color var(--speed), background var(--speed);
}

.card-row {
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  line-height: 2;
  color: var(--muted);
  transition: color var(--speed);
}

.card-row .k {
  color: var(--accent);
  transition: color var(--speed);
}

.card-row .available {
  color: var(--accent);
  transition: color var(--speed);
}

/* ── EXPERIENCE SECTION ───────────────────────────────── */
.exp-wrap {
  padding: 8rem 3rem;
  position: relative;
  z-index: 1;
  background: var(--bg);
  transition: background var(--speed);
}

.exp-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.exp-label-col {
  position: sticky;
  top: 6rem;
}

.exp-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
  transition: background var(--speed), border-color var(--speed);
}

.exp-summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.exp-stat-row {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.exp-stat {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.exp-stat-icon {
  font-size: 1.1rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.exp-stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.exp-stat-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
}

.exp-stat-lbl {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Timeline */
.exp-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 8%,
    var(--accent) 92%,
    transparent
  );
  opacity: 0.3;
}

.exp-entry {
  position: relative;
  padding: 0 0 3rem 2.4rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.exp-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.exp-entry:last-child {
  padding-bottom: 0;
}

.exp-entry::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--adim);
  transition: background var(--speed), border-color var(--speed);
}

.exp-entry.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--adim), var(--glow);
}

.exp-type {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.exp-type.work {
  background: rgba(212, 168, 75, 0.12);
  color: var(--accent);
  border: 1px solid var(--baccent);
}

.exp-type.edu {
  background: rgba(100, 181, 246, 0.1);
  color: #64b5f6;
  border: 1px solid rgba(100, 181, 246, 0.3);
}

.exp-type.open {
  background: rgba(40, 200, 64, 0.1);
  color: #28c840;
  border: 1px solid rgba(40, 200, 64, 0.3);
}

.exp-role {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.exp-org {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.exp-period {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.exp-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.58rem;
}

.exp-badge.done {
  background: rgba(212, 168, 75, 0.1);
  color: var(--accent);
}

.exp-badge.current {
  background: rgba(100, 181, 246, 0.1);
  color: #64b5f6;
}

.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.exp-bullets li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  padding-left: 1.1rem;
  position: relative;
}

.exp-bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.65rem;
  top: 0.22rem;
}

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

.exp-tag {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.18rem 0.48rem;
  border-radius: 3px;
  letter-spacing: 0.07em;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  cursor: default;
}

.exp-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--adim);
}

@media (max-width: 860px) {
  .exp-wrap {
    padding: 4.5rem 1.5rem;
  }
  .exp-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .exp-label-col {
    position: static;
  }
  /* Fix timeline dot alignment when padding changes */
  .exp-timeline::before {
    left: 1px;
  }
  .exp-entry {
    padding: 0 0 2.4rem 2rem;
  }
  .exp-entry::before {
    left: -3px;
  }
}

/* ── SKILLS SECTION ───────────────────────────────────── */
.skills-wrap {
  background: var(--bg2);
  padding: 7rem 3rem;
  position: relative;
  z-index: 1;
  transition: background var(--speed);
}

.skills-inner {
  max-width: 1300px;
  margin: 0 auto;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.9rem;
  margin-top: 2.8rem;
}

.s-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.4rem;
  cursor: default;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s,
    background var(--speed);
}

.s-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

.s-icon {
  font-size: 1.4rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
}

.s-icon i {
  width: 100%;
  height: 100%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s-name {
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.s-lvl {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--speed);
}

.s-bar {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 0.7rem;
  overflow: hidden;
}

.s-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 1.2s ease, background var(--speed);
}

/* ── PROJECTS SECTION ─────────────────────────────────── */
.proj-wrap {
  padding: 8rem 3rem;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
  margin-top: 2.8rem;
}

/* ── PROJECT DETAILS PAGE ───────────────────────────────────────────────────── */
.pd-back-btn-wrapper {
  max-width: 1300px;
  margin: 1.2rem auto 1rem;
  padding: 0 3rem;
}

.pd-back-btn {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 0.7;
}

.pd-back-btn:hover {
  opacity: 1;
  transform: translateX(-4px);
}

.pd-hero {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8rem 3rem 4rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.pd-bg-num {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(10rem, 22vw, 20rem);
  font-weight: 800;
  color: var(--border);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.04em;
  transition: color var(--speed);
}

.pd-eyebrow {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: color var(--speed);
}

.pd-eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.pd-title {
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.pd-title .outline {
  -webkit-text-stroke: 2px var(--fg);
  color: transparent;
}

.pd-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pd-meta-item {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pd-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.pd-cta-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.pd-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.5rem;
}

.pd-tag {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  border: 1px solid var(--baccent);
  background: var(--adim);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--speed), border-color var(--speed);
}

.pd-body {
  max-width: 1300px;
  margin: 0 auto;
  padding: 5rem 3rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 5rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .pd-body {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 1.5rem;
  }
  .pd-back-btn-wrapper {
    padding: 0 1.5rem;
  }
  .pd-hero {
    padding: 6rem 1.5rem 2.5rem;
  }
  .pd-bg-num {
    display: none;
  }
  .pd-title {
    font-size: clamp(2.4rem, 9vw, 4rem);
  }
  .pd-gallery {
    grid-template-columns: 1fr;
  }
  .pd-gallery-item.wide {
    grid-column: 1;
    aspect-ratio: 16/9;
  }
  .pd-sidebar {
    position: static;
  }
  .pd-related-list {
    max-height: none;
  }
  .pd-selector {
    padding: 0 1.5rem;
  }
  .pd-tab {
    padding: 0.85rem 1rem;
    font-size: 0.6rem;
  }
  .pd-info-card { padding: 1.4rem; }
  .pd-cta-row { flex-direction: column; gap: 0.6rem; }
  .pd-cta-row .btn-pri,
  .pd-cta-row .btn-sec { width: 100%; justify-content: center; text-align: center; }
}

.pd-section-title {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pd-section-title::before {
  content: "//";
  opacity: 0.45;
}

.pd-overview {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 3rem;
  transition: color var(--speed);
}

.pd-overview p + p {
  margin-top: 1rem;
}

.pd-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 3rem;
}

.pd-gallery-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.pd-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pd-gallery-item:hover {
  border-color: var(--baccent);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

.pd-gallery-item.wide {
  grid-column: 1 / -1;
  aspect-ratio: 16/7;
}

.pd-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pd-gallery-placeholder i {
  font-size: 2rem;
}

.pd-gallery-label {
  position: absolute;
  bottom: 0.6rem;
  left: 0.8rem;
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.pd-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.pd-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  transition: color var(--speed);
}

.pd-features li::before {
  content: "▸";
  color: var(--accent);
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 0.28rem;
}

.pd-callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.4rem 1.6rem;
  margin-bottom: 3rem;
  transition: background var(--speed), border-color var(--speed);
}

.pd-callout-label {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.pd-callout p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.8;
  transition: color var(--speed);
}

.pd-sidebar {
  position: sticky;
  top: 6rem;
}

.pd-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: background var(--speed), border-color var(--speed);
}

.pd-info-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.pd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.pd-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pd-info-key {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: color var(--speed);
}

.pd-info-label {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  display: inline-block;
  margin-bottom: 1.2rem;
  transition: color var(--speed);
}

.pd-info-val {
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
  color: var(--fg);
  transition: color var(--speed);
}

.pd-info-val.accent {
  color: var(--accent);
}

.pd-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.pd-status.done {
  background: rgba(212, 168, 75, 0.12);
  color: var(--accent);
  border: 1px solid var(--baccent);
}

.pd-status.wip {
  background: rgba(100, 181, 246, 0.1);
  color: #64b5f6;
  border: 1px solid rgba(100, 181, 246, 0.3);
}

.pd-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.pd-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pd-stack-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.pd-stack-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.pd-stack-name {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--fg);
  transition: color var(--speed);
}

.pd-stack-role {
  font-size: 0.6rem;
  color: var(--muted);
  margin-left: auto;
  letter-spacing: 0.08em;
  font-family: "Space Mono", monospace;
  transition: color var(--speed);
}

.pd-related {
  margin-top: 1.5rem;
}

.pd-related-title {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.pd-related-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pd-related-list::-webkit-scrollbar {
  display: none;
}

.pd-related-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s,
    background var(--speed);
  margin-bottom: 0.75rem;
}

.pd-related-card:hover {
  border-color: var(--baccent);
  transform: translateX(4px);
  box-shadow: var(--glow);
}

.pd-related-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--adim);
  border-radius: 6px;
  flex-shrink: 0;
}

.pd-related-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pd-related-tech {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  transition: color var(--speed);
}

.pd-selector {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 3rem;
  display: flex;
  gap: 0;
  transition: background var(--speed), border-color var(--speed);
  overflow-x: auto;
  cursor: grab;
  user-select: none;
  scroll-behavior: smooth;
}

/* Hide scrollbar but keep scrolling functional */
.pd-selector::-webkit-scrollbar {
  display: none;
}
.pd-selector {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.pd-tab {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.pd-tab:hover {
  color: var(--fg);
}

.pd-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  position: relative;
  transition: color 0.2s;
}

.nav-back::before {
  content: "←";
  display: inline-block;
  transform: translateY(1px);
}

body.lang-ar .nav-back::before {
  content: "→";
}

.nav-back:hover {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.open .lightbox-content img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
}

.lightbox-close:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.lightbox-close {
  top: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .lightbox {
    padding: 1rem;
  }
  
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
  }
}

.pd-panel {
  display: none;
}

.pd-panel.active {
  display: block;
}





.p-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.28s, transform 0.28s, box-shadow 0.28s,
    background var(--speed);
}

.p-card:hover {
  border-color: var(--baccent);
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--glow);
}

.p-thumb {
  height: 190px;
  background: var(--bg2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--speed);
}

.p-thumb-inner {
  width: 68%;
  height: 68%;
  border-radius: 8px;
  border: 1px solid var(--baccent);
  background: var(--adim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  transition: transform 0.28s, background var(--speed), border-color var(--speed);
}

.p-thumb-inner i {
  font-size: 2.2rem;
}

.p-card:hover .p-thumb-inner {
  transform: scale(1.05);
}

.p-num {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  transition: color var(--speed);
}

body.lang-ar .p-num {
  left: auto;
  right: 0.9rem;
}

.p-body {
  padding: 1.4rem;
}

.p-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.p-tag {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  color: var(--accent);
  border: 1px solid var(--baccent);
  padding: 0.18rem 0.48rem;
  border-radius: 3px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color var(--speed), border-color var(--speed);
}

.p-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  line-height: 1.3;
}

.p-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.72;
  margin-bottom: 1.1rem;
  transition: color var(--speed);
}

.p-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.p-link {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  transition: background 0.22s, color 0.22s, border-color 0.22s, box-shadow 0.22s;
  white-space: nowrap;
}

/* Primary variant — filled accent */
.p-link.p-link-pri {
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
}

.p-link.p-link-pri:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--glow);
}

/* Secondary variant — ghost */
.p-link.p-link-sec {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.p-link.p-link-sec:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--adim);
}

/* ── CONTACT SECTION ──────────────────────────────────── */
.contact-wrap {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: var(--bg2);
  padding: 7rem 3rem 5rem;
  transition: background var(--speed);
}

.contact-wrap::before {
  content: "CONTACT";
  position: absolute;
  font-size: clamp(5rem, 14vw, 13rem);
  font-weight: 800;
  color: var(--border);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
  transition: color var(--speed);
}

body.lang-ar .contact-wrap::before {
  content: "تواصل";
}

.contact-inner {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.contact-top {
  text-align: center;
}

.contact-top .sec-label {
  justify-content: center;
}

.contact-big {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.contact-sub {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: 560px;
  margin: 0 auto;
  transition: color var(--speed);
}

.contact-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

/* Atom Animation Styles */
.atom-col {
  display: flex;
  flex-direction: column;
}

.atom-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 520px;
  min-height: 300px;
  flex: 1;
}

.atom-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.orbit-ellipse {
  fill: none;
  stroke: rgba(212, 168, 75, 0.35);
  stroke-width: 1.2;
  filter: drop-shadow(0 0 5px rgba(212, 168, 75, 0.4));
  transition: stroke var(--speed);
}

.t-secondary .orbit-ellipse {
  stroke: rgba(192, 57, 43, 0.3);
  filter: drop-shadow(0 0 5px rgba(192, 57, 43, 0.3));
}

.atom-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  animation: atomFloat 4s ease-in-out infinite;
}

@keyframes atomFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

.atom-profile-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--accent), var(--accent2), var(--accent));
  box-shadow: 0 0 24px rgba(212, 168, 75, 0.55), 0 0 60px rgba(212, 168, 75, 0.2);
  position: relative;
  transition: background var(--speed), box-shadow var(--speed);
}

.t-secondary .atom-profile-ring {
  background: conic-gradient(#c0392b, #e67e22, #c0392b);
  box-shadow: 0 0 24px rgba(192, 57, 43, 0.45), 0 0 60px rgba(192, 57, 43, 0.18);
}

.atom-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  display: block;
  transition: border-color var(--speed);
}

.atom-avatar-emoji {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--bg2);
  border: 3px solid var(--bg);
  transition: border-color var(--speed), background var(--speed);
}

.atom-online-dot {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  transition: border-color var(--speed);
}

.orbit-node {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #fff;
  transform: translate(-50%, -50%);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.orbit-node:hover {
  box-shadow: 0 0 22px rgba(212, 168, 75, 0.75), 0 0 55px rgba(212, 168, 75, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border-color: var(--accent);
}

.t-secondary .orbit-node {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.14);
  color: var(--fg);
}

.t-secondary .orbit-node:hover {
  box-shadow: 0 0 22px rgba(192, 57, 43, 0.5), 0 0 40px rgba(192, 57, 43, 0.2);
  border-color: var(--accent);
}

.orbit-node .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.orbit-node .lbl {
  font-family: "Space Mono", monospace;
  font-size: 0.3rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.t-secondary .orbit-node .lbl {
  color: var(--muted);
}

.n-github .icon { color: #e2e8f0; }
.n-linkedin .icon { color: #60a5fa; }
.n-twitter .icon { color: #e2e8f0; }
.n-email .icon { color: #f9a8d4; }

.t-secondary .n-github .icon { color: #333; }
.t-secondary .n-linkedin .icon { color: #0077b5; }
.t-secondary .n-twitter .icon { color: #333; }
.t-secondary .n-email .icon { color: var(--accent); }

/* Atom Mobile */
.atom-mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.atom-mobile-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--accent), var(--accent2), var(--accent));
  box-shadow: 0 0 24px rgba(212, 168, 75, 0.5);
  position: relative;
  animation: atomFloat 4s ease-in-out infinite;
  transition: background var(--speed), box-shadow var(--speed);
}

.t-secondary .atom-mobile-ring {
  background: conic-gradient(#c0392b, #e67e22, #c0392b);
}

.atom-mobile-ring .atom-avatar-emoji {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg2);
  border: 3px solid var(--bg);
  object-fit: cover;
  transition: border-color var(--speed), background var(--speed);
}

.atom-mobile-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  background: #22c55e;
  border-radius: 50%;
  border: 3px solid var(--bg);
  transition: border-color var(--speed);
}

.mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  width: 100%;
}

.mobile-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.85rem 0.4rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.t-secondary .mobile-node {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--fg);
}

.mobile-node:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(212, 168, 75, 0.5);
  border-color: var(--accent);
}

.mobile-node .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-node .lbl {
  font-family: "Space Mono", monospace;
  font-size: 0.44rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.t-secondary .mobile-node .lbl {
  color: var(--muted);
}

.mobile-node.n-github .icon { color: #e2e8f0; }
.mobile-node.n-linkedin .icon { color: #60a5fa; }
.mobile-node.n-twitter .icon { color: #e2e8f0; }
.mobile-node.n-email .icon { color: #f9a8d4; }

.t-secondary .mobile-node.n-github .icon { color: #333; }
.t-secondary .mobile-node.n-linkedin .icon { color: #0077b5; }
.t-secondary .mobile-node.n-twitter .icon { color: #333; }
.t-secondary .mobile-node.n-email .icon { color: var(--accent); }

/* Contact Form Card */
.cf-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: background var(--speed), border-color var(--speed);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.cf-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: background var(--speed);
}

.cf-tag {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  background: var(--adim);
  padding: 0.28rem 0.65rem;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 1.5rem;
  letter-spacing: 0.14em;
  transition: color var(--speed), background var(--speed);
}

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

.cf-group {
  margin-bottom: 1.2rem;
}

.cf-label {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  transition: color var(--speed);
}

.cf-input,
.cf-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: "Syne", sans-serif;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  outline: none;
  resize: none;
  transition: border-color 0.25s, box-shadow 0.25s, background var(--speed),
    color var(--speed);
}

body.lang-ar .cf-input,
body.lang-ar .cf-textarea {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  text-align: right;
}

.cf-input::placeholder,
.cf-textarea::placeholder {
  color: var(--muted);
  opacity: 0.55;
}

.cf-input:focus,
.cf-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--adim);
}

.cf-input.err {
  border-color: #ff5f57 !important;
}

.cf-textarea {
  min-height: 120px;
  flex: 1;
}

.cf-submit {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 6px;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  margin-top: 0.4rem;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cf-submit:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--glow);
}

.cf-submit.sending {
  opacity: 0.65;
  pointer-events: none;
}

.cf-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cf-success {
  display: none;
  text-align: center;
  padding: 2rem 0;
}

.cf-success.show {
  display: block;
}

.cf-success-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.cf-success-title {
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  margin-bottom: 0.5rem;
  transition: color var(--speed);
}

.cf-success-msg {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  transition: color var(--speed);
}

.cf-again {
  margin-top: 1.2rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.cf-again:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ct-fi {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.ct-fi.vis {
  opacity: 1;
  transform: translateY(0);
}

/* ── FOOTER ───────────────────────────────────────────── */
footer {
  padding: 1.8rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 1;
  transition: border-color var(--speed);
}

body.lang-ar footer {
  flex-direction: row-reverse;
}

.f-copy {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  transition: color var(--speed);
  white-space: nowrap;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

body.lang-ar .footer-meta {
  flex-direction: row-reverse;
}

.f-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--glow);
  display: inline-block;
  transition: background var(--speed), box-shadow var(--speed);
}

/* ── UTILS ────────────────────────────────────────────── */
.divider {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 3rem;
  height: 1px;
  background: var(--border);
  position: relative;
  z-index: 1;
  transition: background var(--speed);
}

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

.fi.vis {
  opacity: 1;
  transform: translateY(0);
}

/* ── MOBILE NAVIGATION ───────────────────────────────── */
.nav-mobile-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 10001;
  border-radius: 4px;
  transition: background 0.2s;
  pointer-events: auto;
}

.nav-mobile-btn:hover {
  background: var(--adim);
}

.nav-mobile-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s, background var(--speed);
}

.nav-mobile-btn span:last-child { width: 14px; }

.nav-mobile-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 22px; }
.nav-mobile-btn.active span:nth-child(2) { transform: translateY(-7px) rotate(-45deg); width: 22px; }

#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

#mobile-menu.open { transform: translateY(0); }

#mobile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.5;
}

/* Accent line at top of menu */
#mobile-menu::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.mm-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem;
  width: 100%;
}

.mm-close-btn {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  z-index: 10001;
}

.mm-close-btn:hover {
  background: var(--adim);
  border-color: var(--accent);
}

.mm-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mm-links li {
  overflow: hidden;
}

.mm-links a {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  font-weight: 800;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.25s, padding-left 0.25s;
  display: block;
  padding: 0.35rem 0;
  position: relative;
}

.mm-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transition: left 0.25s, right 0.25s, opacity 0.25s;
}

.mm-links a:hover { color: var(--accent); }

.mm-links a:hover::after {
  left: 20%;
  right: 20%;
  opacity: 0.35;
}

.mm-footer {
  margin-top: 3rem;
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  opacity: 0.5;
}

/* Pulse dot in mobile menu footer */
.pb-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: pulse 2s ease infinite;
}

#hero-easter-egg {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#hero-easter-egg:hover {
  opacity: 1;
  transform: translateX(5px);
}

#hero-easter-egg i {
  font-size: 0.9rem;
}

@media (max-width: 860px) {

  /* ── NAV ── */
  .nav-mobile-btn { display: flex; }
  .nav-links { display: none; }
  .nav-back { display: none; }
  nav { padding: 1rem 1.5rem; gap: 0.5rem; }

  /* Hide "Theme" text label on mobile to save space */
  .theme-pill span { display: none; }
  .theme-pill { padding: 0.28rem; border-radius: 50%; }

  /* Smaller icons on mobile for better accessibility */
  .theme-dot { width: 16px; height: 16px; }
  .lang-sw button { padding: 0.25rem 0.45rem; font-size: 0.55rem; }

  .controls { gap: 0.5rem; }

  /* ── HERO ── */
  .hero {
    padding: 6.5rem 1.5rem 3.5rem;
    text-align: left;
    align-items: flex-start;
    min-height: 100svh; /* use small viewport height on mobile */
  }

  .hero-eyebrow {
    font-size: 0.65rem;
    justify-content: flex-start;
    margin-bottom: 1rem;
  }

  .hero-eyebrow::before { display: none; }

  .hero-name {
    font-size: clamp(3rem, 13vw, 4.5rem);
    margin-bottom: 1.2rem;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.75;
    margin: 0 0 2rem;
    max-width: 340px;
  }

  .hero-cta {
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .btn-pri, .btn-sec {
    padding: 0.8rem 1.4rem;
    font-size: 0.7rem;
  }

  #hero-easter-egg {
    justify-content: flex-start;
    width: 100%;
    margin-top: 1.5rem;
  }

  #hero3d-wrap { display: none; }

  .hero-badge {
    position: static;
    margin-top: 2.5rem;
    justify-content: flex-start;
    font-size: 0.6rem;
  }

  /* ── ABOUT ── */
  .about {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 4.5rem 1.5rem;
  }

  .sec-title {
    font-size: clamp(1.7rem, 6vw, 2.4rem);
  }

  .about-card {
    padding: 1.6rem;
  }

  .card-row {
    font-size: 0.76rem;
    line-height: 1.9;
  }

  .stats {
    gap: 1.8rem;
  }

  .stat-num { font-size: 2rem; }

  /* ── EXPERIENCE ── */
  .exp-wrap { padding: 4.5rem 1.5rem; }

  .exp-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .exp-label-col { position: static; }

  .exp-summary-card { padding: 1.4rem; }

  .exp-entry { padding: 0 0 2.4rem 2rem; }

  .exp-role { font-size: 1rem; }

  .exp-bullets li { font-size: 0.84rem; }

  /* ── SKILLS ── */
  /* ── SKILLS — sticky hijack wrapper ── */
  .skills-wrap {
    padding: 0;
    overflow: visible; /* tall scroll budget lives here */
  }

  /* sticky viewport that pins while horizontal scroll plays out */
  .skills-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: var(--bg2);
    padding: 3rem 0;
  }

  .skills-inner {
    padding: 0 1.5rem;
  }

  .skills-inner .sec-label,
  .skills-inner .sec-title { padding: 0; }

  /* The scrolling track — overflow hidden, moved by JS scrollLeft */
  .skill-grid {
    display: flex;
    flex-direction: row;
    overflow: hidden;        /* JS drives scrollLeft, no native scroll */
    gap: 0.85rem;
    margin-top: 1.6rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 1rem 1.5rem 1.2rem;
    scrollbar-width: none;
    /* slant the whole track */
    transform: skewX(-6deg);
    transform-origin: left center;
    will-change: scroll-position;
    cursor: grab;
  }

  .skill-grid::-webkit-scrollbar { display: none; }

  .s-card {
    flex: 0 0 148px;
    flex-shrink: 0;
    padding: 1.2rem;
    /* counter-skew so card content is upright */
    transform: skewX(6deg);
    border-radius: 10px;
    transition: border-color 0.25s, box-shadow 0.25s, background var(--speed);
  }

  /* ── PROJECTS — sticky hijack wrapper ── */
  .proj-wrap {
    padding: 0;
    overflow: visible;
  }

  .proj-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: var(--bg);
    padding: 3rem 0;
  }

  /* Section label + title still padded */
  .proj-wrap > .proj-sticky > .sec-label,
  .proj-wrap > .proj-sticky > .sec-title { padding-left: 1.5rem; padding-right: 1.5rem; }

  .proj-grid {
    display: flex;
    flex-direction: row;
    overflow: hidden;       /* JS drives scrollLeft */
    gap: 1rem;
    margin-top: 1.6rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 1rem 1.5rem 1.4rem;
    scrollbar-width: none;
    transform: skewX(-5deg);
    transform-origin: left center;
    will-change: scroll-position;
    cursor: grab;
  }

  .proj-grid::-webkit-scrollbar { display: none; }

  .p-card {
    flex: 0 0 278px;
    flex-shrink: 0;
    width: 278px;
    transform: skewX(5deg);
    border-radius: 10px;
  }

  .p-thumb { height: 155px; }
  .p-body { padding: 1.2rem; }
  .p-title { font-size: 1rem; }
  .p-desc { font-size: 0.83rem; }
  .p-actions { gap: 0.5rem; }
  .p-link { padding: 0.5rem 0.9rem; font-size: 0.61rem; }

  /* progress pip strip shown below each track */
  .hscroll-pips {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 0.6rem;
  }

  .hscroll-pip {
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.3s, width 0.3s;
  }

  .hscroll-pip.active {
    background: var(--accent);
    width: 28px;
  }

  /* ── CONTACT ── */
  .contact-wrap { padding: 4.5rem 1.5rem 3.5rem; }

  .contact-wrap::before {
    font-size: clamp(3.5rem, 18vw, 8rem);
  }

  .contact-big {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .contact-sub { font-size: 0.9rem; }

  .contact-bottom { grid-template-columns: 1fr; gap: 2rem; }

  .atom-stage, .atom-col { display: none; }

  .atom-mobile { display: flex; }

  .cf-card { padding: 1.6rem; }

  .cf-row { grid-template-columns: 1fr; }

  .cf-input, .cf-textarea { font-size: 1rem; } /* prevents iOS zoom on focus */

  .cf-textarea { min-height: 100px; }

  /* ── FOOTER ── */
  footer {
    padding: 1.4rem 1.5rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
  }

  .f-copy { font-size: 0.58rem; }

  /* ── TOUCH FEEDBACK ── */
  button:active, a:active, .s-card:active, .p-card:active {
    transform: scale(0.97);
    filter: brightness(1.1);
  }

  /* ── ANIMATED MOBILE ATOM ── */
  .atom-mobile-ring {
    animation: mm-float 6s ease-in-out infinite;
  }

  @keyframes mm-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(2deg); }
    66% { transform: translateY(5px) rotate(-2deg); }
  }

  .mobile-node {
    animation: mm-node-pulse 4s ease-in-out infinite;
  }

  .mobile-node:nth-child(even) { animation-delay: 2s; }

  @keyframes mm-node-pulse {
    0%, 100% { border-color: rgba(255,255,255,0.14); box-shadow: none; }
    50% { border-color: var(--baccent); box-shadow: 0 0 15px var(--baccent); }
  }
}

/* ── SMALL PHONES (≤430px) ── */
@media (max-width: 430px) {
  .hero-name { font-size: clamp(2.6rem, 15vw, 3.5rem); }

  .hero-desc { font-size: 0.88rem; max-width: 100%; }

  .btn-pri, .btn-sec { width: 100%; }

  .hero-cta { flex-direction: column; }

  .about-card { padding: 1.2rem; }

  .card-row { font-size: 0.72rem; }

  .s-card { flex: 0 0 132px; }

  .p-link { padding: 0.48rem 0.8rem; }

  .cf-submit { padding: 0.85rem; font-size: 0.72rem; }

  /* Tighter section spacing */
  .about, .exp-wrap, .skills-wrap, .proj-wrap, .contact-wrap {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
}

@media (min-width: 601px) {
  .atom-mobile {
    display: none;
  }
}

/* ── TERMINAL LOADER ─────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.term-window {
  width: min(640px, 92vw);
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.07);
  animation: termPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Network Gauge Restyling - Terminal Oriented */
#net-gauge {
  margin-top: 1.2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(212, 168, 75, 0.2);
  border-radius: 4px;
  font-family: "Space Mono", monospace;
}

.ng-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.ng-label {
  font-size: 0.6rem;
  color: rgba(212, 168, 75, 0.6);
  letter-spacing: 0.1em;
}

.ng-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.ng-quality {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.ng-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 0.8rem;
  position: relative;
  overflow: hidden;
}

#ng-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ng-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.8rem;
}

.ng-item {
  text-align: center;
}

.ng-item-val {
  font-size: 0.85rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
}

.ng-item-lbl {
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ng-footer {
  margin-top: 0.8rem;
  text-align: right;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
}

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

.term-bar {
  background: #1e1e1e;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.term-btns {
  display: flex;
  gap: 0.42rem;
}

.tb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.tb-r { background: #ff5f57; }
.tb-y { background: #febc2e; }
.tb-g { background: #28c840; }

.term-title {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.1em;
  margin: 0 auto;
}

.term-body {
  padding: 1.4rem 1.6rem 1rem;
  min-height: 200px;
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.75;
  color: #c8c8c8;
}

.term-line {
  min-height: 1.4rem;
  white-space: pre-wrap;
}

.tl-prompt { color: #d4a84b; }
.tl-cmd { color: #f0ece4; }
.tl-ok { color: #28c840; }
.tl-info { color: #64b5f6; }
.tl-dim { color: rgba(255, 255, 255, 0.32); }
.tl-accent { color: #d4a84b; }

.tl-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: #d4a84b;
  vertical-align: middle;
  animation: blink 0.75s step-end infinite;
  margin-top: 0.2rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.term-pw {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.term-pb {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4a84b, #e8c87a);
  transition: width 0.25s ease;
  box-shadow: 0 0 10px rgba(212, 168, 75, 0.5);
}

.skip-hint {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
  padding: 0.5rem;
  letter-spacing: 0.1em;
}

/* ── POP BROWSER ─────────────────────────────────────── */
#pop-browser {
  position: fixed;
  z-index: 8000;
  display: none;
  flex-direction: column;
  background: #111;
  border: 1px solid rgba(212, 168, 75, 0.35);
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 60px rgba(212, 168, 75, 0.08);
  overflow: hidden;
  min-width: 340px;
  min-height: 260px;
}

#pop-browser.open {
  display: flex;
}

#pb-titlebar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.55rem 0.8rem;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

#pb-titlebar:active {
  cursor: grabbing;
}

.pb-btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.pb-btn:hover {
  opacity: 0.8;
  transform: scale(1.15);
}

#pb-close { background: #ff5f57; }
#pb-minimise { background: #febc2e; }
#pb-maximise { background: #28c840; }

#pb-urlbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem;
  flex: 1;
  min-width: 0;
}

#pb-back,
#pb-fwd,
#pb-refresh {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

#pb-back:hover,
#pb-fwd:hover,
#pb-refresh:hover {
  color: #d4a84b;
  background: rgba(212, 168, 75, 0.1);
}

#pb-url-display {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0.28rem 0.9rem;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s, color 0.2s;
  min-width: 0;
}

.pb-scheme { color: rgba(212, 168, 75, 0.6); }
.pb-domain { color: rgba(255, 255, 255, 0.75); }

#pb-open-ext {
  background: transparent;
  border: 1px solid rgba(212, 168, 75, 0.3);
  color: rgba(212, 168, 75, 0.7);
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
}

#pb-open-ext:hover {
  background: rgba(212, 168, 75, 0.15);
  color: #d4a84b;
}

#pb-loadbar-wrap {
  height: 2px;
  background: transparent;
  flex-shrink: 0;
  overflow: hidden;
}

#pb-loadbar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4a84b, #e8c87a);
  box-shadow: 0 0 8px rgba(212, 168, 75, 0.6);
  transition: width 0.3s ease;
}

#pb-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0d0d0d;
}

#pb-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

#pb-blocked {
  position: absolute;
  inset: 0;
  display: none;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  font-family: "Space Mono", monospace;
}

#pb-blocked.show { display: flex; }

.pb-blocked-inner {
  max-width: 440px;
  width: 92%;
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid rgba(212, 168, 75, 0.25);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  animation: pb-cyber-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.pb-blocked-decor {
  position: absolute;
  top: 10px;
  right: 15px;
  display: flex;
  gap: 4px;
}

.pb-blocked-decor span { width: 8px; height: 1px; background: rgba(212, 168, 75, 0.3); }
.pb-blocked-decor span.d-2 { width: 16px; }

.pb-blocked-content {
  padding: 1.8rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pb-blocked-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 168, 75, 0.05);
  border: 1px solid rgba(212, 168, 75, 0.2);
  border-radius: 50%;
  margin-bottom: 0.8rem;
  color: #d4a84b;
  font-size: 1.2rem;
}

.pb-icon-glow {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 168, 75, 0.2) 0%, transparent 70%);
  animation: pb-icon-pulse 2s ease-in-out infinite;
}

@keyframes pb-icon-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.pb-status-tag {
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #d4a84b;
  background: rgba(212, 168, 75, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.6rem;
}

.pb-main-title {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.pb-main-msg {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  max-width: 280px;
  margin-bottom: 1.2rem;
}

.url-highlight { color: #d4a84b; opacity: 0.8; }

.pb-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 1.2rem;
}

.pb-data-item {
  background: rgba(10,10,10,0.4);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-data-label { font-size: 0.4rem; color: rgba(255,255,255,0.25); letter-spacing: 0.1em; }
.pb-data-val { font-size: 0.5rem; color: #fff; font-weight: 700; }

.pb-blocked-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.pb-action-btn {
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-decoration: none;
}

.pb-action-btn.primary {
  background: #d4a84b;
  color: #000;
  border: none;
  box-shadow: 0 4px 15px rgba(212, 168, 75, 0.2);
}

.pb-action-btn.primary:hover {
  transform: translateY(-2px);
  background: #fff;
}

.pb-action-btn.secondary {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}

.pb-action-btn.secondary:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.pb-blocked-bottom {
  background: rgba(0,0,0,0.2);
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.03);
  position: relative;
}

.pb-scan-line {
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 1px;
  background: #d4a84b;
  box-shadow: 0 0 10px #d4a84b;
  animation: pb-scan 3s linear infinite;
}

@keyframes pb-scan {
  0% { left: 0; }
  100% { left: 100%; }
}

.pb-bottom-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.5rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.1em;
}

@media (max-width: 480px) {
  .pb-blocked-content { padding: 2rem 1.5rem; }
  .pb-main-title { font-size: 1.2rem; }
}

#pb-blocked-open:hover { opacity: 0.85; }

/* Resize handles */
.pb-resize { position: absolute; z-index: 1; }
.pb-resize.right { top: 10px; right: 0; width: 5px; height: calc(100% - 20px); cursor: ew-resize; }
.pb-resize.bottom { left: 10px; bottom: 0; height: 5px; width: calc(100% - 20px); cursor: ns-resize; }
.pb-resize.left { top: 10px; left: 0; width: 5px; height: calc(100% - 20px); cursor: ew-resize; }
.pb-resize.top { left: 10px; top: 0; height: 5px; width: calc(100% - 20px); cursor: ns-resize; }
.pb-resize.br { bottom: 0; right: 0; width: 14px; height: 14px; cursor: nwse-resize; }
.pb-resize.bl { bottom: 0; left: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.pb-resize.tr { top: 0; right: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.pb-resize.tl { top: 0; left: 0; width: 14px; height: 14px; cursor: nwse-resize; }

#pop-browser::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(212, 168, 75, 0.3);
  border-bottom: 2px solid rgba(212, 168, 75, 0.3);
  pointer-events: none;
}

#pop-browser.minimised #pb-content,
#pop-browser.minimised #pb-loadbar-wrap {
  display: none;
}

#pop-browser.minimised {
  height: auto !important;
  min-height: 0 !important;
}

#pop-browser.maximised {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
}

/* ── MINIGAME ─────────────────────────────────────────── */
#minigame {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: "Space Mono", monospace;
  animation: mg-fade 0.3s ease;
}

@keyframes mg-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

#mg-inner {
  background: #0a0a0a;
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-radius: 12px;
  max-width: 520px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 20px rgba(212, 168, 75, 0.05);
  overflow: hidden;
  animation: mg-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mg-pop {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.mg-header {
  background: rgba(255,255,255,0.03);
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-dots { display: flex; gap: 6px; }
.mg-d { width: 10px; height: 10px; border-radius: 50%; }
.mg-d.r { background: #ff5f57; }
.mg-d.y { background: #febc2e; }
.mg-d.g { background: #28c840; }

.mg-h-title {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.2em;
  font-weight: 700;
}

#mg-content {
  padding: 2rem 2.5rem;
}

.mg-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.mg-close:hover {
  opacity: 1;
}

.mg-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #d4a84b;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.mg-title i { font-size: 1.4rem; }

.mg-score {
  color: rgba(255,255,255,0.3);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.mg-body {
  color: #c8c8c8;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.mg-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.mg-btn {
  background: rgba(212, 168, 75, 0.05);
  color: #d4a84b;
  border: 1px solid rgba(212, 168, 75, 0.2);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-btn:hover:not(:disabled) {
  background: rgba(212, 168, 75, 0.15);
  border-color: #d4a84b;
  transform: translateY(-2px);
}

.mg-btn:disabled { cursor: default; }

.mg-btn.right {
  background: rgba(40, 200, 64, 0.1) !important;
  border-color: #28c840 !important;
  color: #28c840 !important;
}

.mg-btn.wrong {
  background: rgba(255, 95, 87, 0.1) !important;
  border-color: #ff5f57 !important;
  color: #ff5f57 !important;
  animation: mg-shake 0.3s ease;
}

@keyframes mg-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.mg-result-icon { font-size: 3rem; margin-bottom: 1.5rem; color: #d4a84b; }
.mg-final-score { font-size: 2.5rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.mg-final-label { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-bottom: 2rem; }

.mg-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.mg-btn-pri {
  background: #d4a84b;
  color: #000;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.mg-btn-sec {
  background: rgba(255,255,255,0.05);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  transition: background 0.2s;
}

.mg-btn-pri:hover { transform: translateY(-2px); }
.mg-btn-sec:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 480px) {
  #mg-content { padding: 1.4rem 1.2rem; }
  .mg-btn-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .mg-title { font-size: 0.95rem; }
  .mg-body { font-size: 0.85rem; }
  #mg-inner { width: 95%; border-radius: 10px; }
  .mg-btn { padding: 0.9rem 0.75rem; font-size: 0.72rem; }
  .mg-actions { flex-direction: column; gap: 0.6rem; }
  .mg-btn-pri, .mg-btn-sec {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex;
    padding: 0.9rem;
  }

  /* Pop browser slides up from bottom on small screens */
  #pop-browser {
    left: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 80svh !important;
    border-radius: 14px 14px 0 0;
    min-width: 0;
  }
  #pb-urlbar { padding: 0 0.5rem; }
  #pb-open-ext { display: none; }
}