/* ============================================================
   Khaled Ghanem — Portfolio
   Dark engineering theme
   ============================================================ */

:root {
  --bg: #0a0e17;
  --bg-raised: #101624;
  --bg-card: #121a2b;
  --border: rgba(148, 163, 196, 0.14);
  --border-strong: rgba(148, 163, 196, 0.28);
  --text: #e6ebf5;
  --text-dim: #9aa6bf;
  --text-faint: #6b7691;

  /* Category accents */
  --c-hw: #f59e0b;        /* hardware design — amber  */
  --c-iot: #a78bfa;       /* embedded & iot — violet  */
  --c-ai: #22d3ee;        /* ai & vision — cyan       */

  --radius: 14px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-icon { display: grid; place-items: center; }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 196, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 196, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 45%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 45%, black 30%, transparent 75%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
}

.hero-glow-1 {
  width: 560px; height: 560px;
  background: var(--c-ai);
  top: -180px; right: -120px;
}

.hero-glow-2 {
  width: 480px; height: 480px;
  background: var(--c-iot);
  bottom: -200px; left: -140px;
}

.hero-traces { position: absolute; inset: 0; width: 100%; height: 100%; }

.trace {
  fill: none;
  stroke: rgba(34, 211, 238, 0.22);
  stroke-width: 1.6;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: traceDraw 3.2s ease-out forwards;
}

.t2 { animation-delay: 0.35s; stroke: rgba(167, 139, 250, 0.22); }
.t3 { animation-delay: 0.7s; stroke: rgba(245, 158, 11, 0.20); }
.t4 { animation-delay: 1.0s; stroke: rgba(34, 211, 238, 0.18); }

.pad {
  fill: rgba(34, 211, 238, 0.4);
  opacity: 0;
  animation: padIn 0.5s ease-out 2.4s forwards;
}

@keyframes traceDraw { to { stroke-dashoffset: 0; } }
@keyframes padIn { to { opacity: 1; } }

.hero-content {
  position: relative;
  text-align: center;
  max-width: 880px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  animation: fadeUp 0.7s ease-out both;
}

.hero-role {
  margin-top: 1rem;
  color: var(--c-ai);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  animation: fadeUp 0.7s ease-out 0.12s both;
}

.accent-gradient {
  background: linear-gradient(100deg, var(--c-ai) 0%, #6ee7b7 45%, var(--c-iot) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 1.8rem auto 0;
  max-width: 600px;
  color: var(--text-dim);
  font-size: 1.12rem;
  animation: fadeUp 0.7s ease-out 0.24s both;
}

.hero-sub .accent-gradient { font-weight: 600; }

.hero-motto {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  color: var(--text);
}

/* ============ HERO I/O TAGLINE ============ */
.hero-io {
  margin: 1.75rem auto 0;
  animation: fadeUp 0.7s ease-out 0.24s both;
}

.hero-io-track {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: clamp(0.65rem, 2.2vw, 1.05rem);
  padding: 0.72rem clamp(1.05rem, 3vw, 1.5rem) 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(12, 18, 30, 0.78), rgba(12, 18, 30, 0.78)) padding-box,
    linear-gradient(95deg, rgba(167, 139, 250, 0.35), rgba(34, 211, 238, 0.12) 50%, rgba(34, 211, 238, 0.35)) border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
  overflow: visible;
}

.hero-io-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24rem;
  min-width: 4.5rem;
}

.hero-io-tag {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero-io-word {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.12rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-io-in { color: #c4b5fd; }
.hero-io-out { color: var(--c-ai); }

.hero-io-bridge {
  position: relative;
  z-index: 1;
  align-self: center;
  width: clamp(2.8rem, 9vw, 4rem);
  height: 2px;
  margin-bottom: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.25), rgba(34, 211, 238, 0.25));
}

.hero-io-signal {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 0;
  animation: heroIoSignalMove 3.2s ease-in-out infinite;
}

.hero-io-signal-core {
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0fdff;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.95);
  transform: translate(-50%, -50%);
}

.hero-io-signal-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.55);
  transform: translate(-50%, -50%);
  animation: heroIoRing 1.1s ease-out infinite;
}

.hero-io-signal-ring:last-of-type {
  animation-delay: 0.55s;
}

.hero-io-side:first-of-type {
  animation: heroIoSideIn 3.2s ease-in-out infinite;
}

.hero-io-side:last-of-type {
  animation: heroIoSideOut 3.2s ease-in-out infinite;
}

@keyframes heroIoSignalMove {
  0%, 100% { left: 0%; opacity: 0; }
  6% { opacity: 1; }
  94% { left: 100%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes heroIoRing {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.75; }
  100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
}

@keyframes heroIoSideIn {
  0%, 100%, 40% { transform: scale(1); opacity: 1; }
  6%, 18% { transform: scale(1.04); opacity: 1; }
}

@keyframes heroIoSideOut {
  0%, 100%, 55% { transform: scale(1); opacity: 0.72; }
  82%, 94% { transform: scale(1.04); opacity: 1; }
}

.hero-cta {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 0.7s ease-out 0.36s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.78rem 1.7rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-ai), #38bdf8);
  color: #06121a;
  box-shadow: 0 6px 26px rgba(34, 211, 238, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(34, 211, 238, 0.4);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: var(--c-ai);
  transform: translateY(-2px);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  color: var(--text-faint);
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ SECTIONS ============ */
.section { padding: 6.5rem 1.5rem; }

.section-inner { max-width: 1180px; margin: 0 auto; }

.section-kicker {
  color: var(--c-ai);
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.section-title .accent-gradient {
  font-weight: inherit;
}

.section-sub {
  margin-top: 0.9rem;
  max-width: 640px;
  color: var(--text-dim);
}

/* ============ PILLARS ============ */
.pillars {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}

.pillar {
  --accent: var(--c-ai);
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.pillar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.85;
}

.pillar-hw { --accent: var(--c-hw); }
.pillar-iot { --accent: var(--c-iot); }
.pillar-ai { --accent: var(--c-ai); }

.pillar:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}

.pillar-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  margin-bottom: 1.2rem;
}

.pillar h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  margin-bottom: 0.55rem;
}

.pillar p {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

.pillar-count {
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 600;
}

/* ============ FILTER BAR ============ */
.filter-bar {
  margin-top: 2.4rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.52rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover { color: var(--text); border-color: var(--text-faint); }

.filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

/* ============ PROJECT GRID ============ */
.projects-grid {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}

.project-card {
  --accent: var(--c-ai);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  color: var(--text);
  padding: 0;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.3s;
}

.project-card[data-cat="hw"] { --accent: var(--c-hw); }
.project-card[data-cat="iot"] { --accent: var(--c-iot); }
.project-card[data-cat="ai"] { --accent: var(--c-ai); }

.project-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.project-card.featured { grid-column: 1 / -1; }

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d1320;
}

.featured .card-media { aspect-ratio: 21 / 9; }

.card-media img,
.card-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.project-card:hover .card-media img,
.project-card:hover .card-media video { transform: scale(1.045); }

.card-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 14, 23, 0.88) 100%);
  pointer-events: none;
}

.card-badge {
  position: absolute;
  top: 0.9rem; left: 0.9rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(10, 14, 23, 0.82);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  backdrop-filter: blur(6px);
}

.card-badge.badge-featured {
  left: auto; right: 0.9rem;
  color: #06121a;
  background: linear-gradient(135deg, var(--c-ai), #6ee7b7);
  border: none;
}

.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}

.card-play span {
  display: grid;
  place-items: center;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  color: #fff;
  transition: transform 0.2s, background 0.2s;
}

.project-card:hover .card-play span {
  transform: scale(1.1);
  background: color-mix(in srgb, var(--accent) 60%, rgba(10,14,23,0.6));
}

.card-body {
  padding: 1.4rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-hook {
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-size: 0.94rem;
  flex: 1;
}

.card-metrics {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.metric-chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.32rem 0.66rem;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, #fff);
  white-space: nowrap;
}

.card-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.74rem;
  color: var(--text-faint);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.card-cta {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-cta svg { transition: transform 0.2s; }
.project-card:hover .card-cta svg { transform: translateX(4px); }

.project-card.hidden { display: none; }

/* ============ CONTACT ============ */
.section-contact {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 80% at 50% 110%, rgba(34, 211, 238, 0.07), transparent),
    var(--bg);
}

.contact-inner { text-align: center; }

.contact-inner .section-sub { margin-left: auto; margin-right: auto; }

.contact-links {
  margin-top: 2.6rem;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  text-decoration: none;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--c-ai);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.contact-card div { display: flex; flex-direction: column; }
.contact-card strong { font-family: var(--font-display); font-size: 1rem; }
.contact-card span { font-size: 0.82rem; color: var(--text-faint); font-family: var(--font-mono); }

/* ============ FOOTER ============ */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.8rem;
}

.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.modal.open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.82);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(960px, calc(100vw - 2rem));
  height: min(86vh, 900px);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(10, 14, 23, 0.8);
  color: var(--text);
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}

.modal-close:hover { background: rgba(255, 70, 70, 0.25); transform: rotate(90deg); }

.modal-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

/* Modal internals (built by JS) */
.m-media {
  position: relative;
  background: #060a12;
  aspect-ratio: 16 / 9;
}

.m-media img,
.m-media video,
.m-media iframe {
  width: 100%; height: 100%;
  object-fit: contain;
  border: 0;
}

.m-caption {
  padding: 0.7rem 1.2rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-dim);
  background: #060a12;
}

.m-caption:empty { display: none; }

.m-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #0b101c;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.m-thumb {
  flex: 0 0 auto;
  width: 86px; height: 52px;
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0d1320;
  padding: 0;
  position: relative;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.m-thumb img { width: 100%; height: 100%; object-fit: cover; }

.m-thumb.active, .m-thumb:hover { opacity: 1; border-color: var(--accent, var(--c-ai)); }

.m-thumb .thumb-vid {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.35);
  color: #fff;
}

.m-body { padding: 1.8rem 2rem 1.2rem; }

.m-cat {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, var(--c-ai));
}

.m-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.4rem;
  letter-spacing: -0.015em;
  padding-right: 3rem; /* keep clear of the close button */
}

.m-tags-top { margin-top: 1rem; }

.m-desc { margin-top: 1.1rem; color: var(--text-dim); max-width: 70ch; }

.m-metrics {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
}

.m-metric {
  padding: 0.95rem 1rem;
  border-radius: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, var(--c-ai));
}

.m-metric b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.18rem;
  color: var(--text);
}

.m-metric span { font-size: 0.78rem; color: var(--text-faint); }

.m-section-label {
  margin-top: 1.9rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.m-highlights { list-style: none; }

.m-highlights li {
  position: relative;
  padding-left: 1.45rem;
  margin-bottom: 0.55rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.m-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent, var(--c-ai));
}

.m-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.m-gallery-label { margin-bottom: 0; }

.m-links {
  margin-top: 2rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.m-related {
  margin-top: 1.6rem;
  padding: 0.9rem 1.1rem;
  border-radius: 11px;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.m-related button {
  background: none;
  border: none;
  color: var(--accent, var(--c-ai));
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

body.modal-open { overflow: hidden; }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 880px) {
  .pillars { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-icon) { display: none; }
  .m-body { padding: 1.4rem 1.2rem 1rem; }
  .modal-panel { width: calc(100vw - 1rem); height: 92vh; }
  .section { padding: 4.5rem 1.2rem; }
}



@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
