/* Variable-weight ranges: Cormorant wght 300..700 for the cursor-proximity
   weight morph on the h1; JetBrains Mono 100..800. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=JetBrains+Mono:ital,wght@0,100..800&display=swap');

:root {
  --bg-void:          #060606;
  --text-high:        #f0ece4;
  --text-mid:         #ece8e0;
  --text-low:         #5a5753;
  --border-thin:      rgba(255, 255, 255, 0.08);
  --font-serif:       'Cormorant Garamond', Georgia, serif;
  --font-mono:        'JetBrains Mono', monospace;
  --transition-speed: 0.22s;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-void);
  color: var(--text-high);
  font-family: var(--font-serif);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Configure-style corner glows — opacity ~30% below original */
body::before {
  content: '';
  position: fixed;
  top: -320px;
  left: -320px;
  width: 860px;
  height: 860px;
  background: radial-gradient(ellipse at center, rgba(28, 52, 105, 0.18) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -280px;
  right: -280px;
  width: 780px;
  height: 780px;
  background: radial-gradient(ellipse at center, rgba(58, 22, 92, 0.14) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text-high);
}

/* ─── Background canvas ─────────────────────────────── */
#الخلفية {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ─── Asset Layer System ────────────────────────────── */
.asset-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  perspective: 2000px;
}

.asset-item {
  position: fixed;
  object-fit: cover;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.5));
  opacity: 0;
  transform-origin: center;
  transition: opacity 1s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform, opacity;
  border-radius: 2px;
}

/* Speaker — top-right, elegant float */
.asset-speaker {
  width: 320px;
  height: 360px;
  top: 8%;
  right: -150px;
  transform: perspective(1600px) rotateY(-25deg) rotateX(3deg);
  animation: floatAsset 6s ease-in-out infinite;
}

/* DAC — middle-right */
.asset-dac {
  width: 260px;
  height: 180px;
  top: 45%;
  right: -120px;
  transform: perspective(1400px) rotateY(-30deg) rotateX(-5deg);
  animation: floatAsset 7s ease-in-out infinite 0.4s;
}

/* Headphones — bottom-left */
.asset-headphones {
  width: 340px;
  height: 300px;
  bottom: 12%;
  left: -160px;
  transform: perspective(1500px) rotateY(28deg) rotateX(-2deg);
  animation: floatAsset 6.5s ease-in-out infinite 0.2s;
}

/* Clip mic — left side, mid */
.asset-clipmic {
  width: 240px;
  height: 280px;
  top: 50%;
  left: -110px;
  transform: perspective(1300px) rotateY(35deg) rotateX(8deg);
  animation: floatAsset 7.5s ease-in-out infinite 0.6s;
}

/* Boom arm — bottom-right */
.asset-boomarm {
  width: 280px;
  height: 360px;
  bottom: 8%;
  right: -140px;
  transform: perspective(1450px) rotateY(-32deg) rotateX(-3deg);
  animation: floatAsset 8s ease-in-out infinite 0.3s;
}

/* Artistic images — subtle depth layers */
.asset-art1 {
  width: 220px;
  height: 300px;
  top: 25%;
  right: -100px;
  transform: perspective(1200px) rotateY(-20deg);
  animation: floatAsset 7.2s ease-in-out infinite 0.5s;
}

.asset-art2 {
  width: 200px;
  height: 260px;
  bottom: 28%;
  left: -95px;
  transform: perspective(1250px) rotateY(25deg);
  animation: floatAsset 6.8s ease-in-out infinite 0.7s;
}

.asset-art3 {
  width: 240px;
  height: 280px;
  top: 60%;
  right: -110px;
  transform: perspective(1350px) rotateY(-28deg);
  animation: floatAsset 7.3s ease-in-out infinite 0.4s;
}

@keyframes floatAsset {
  0%, 100% {
    opacity: 0.18;
    transform: perspective(inherit) rotateY(var(--rotY, 0deg)) rotateX(var(--rotX, 0deg)) translateY(0) translateX(0);
  }
  50% {
    opacity: 0.28;
    transform: perspective(inherit) rotateY(var(--rotY, 0deg)) rotateX(var(--rotX, 0deg)) translateY(-15px) translateX(8px);
  }
}

/* Reveal on scroll */
.asset-item.reveal {
  opacity: 0.35 !important;
}

/* Hover peek */
.asset-item:hover {
  opacity: 0.45 !important;
  filter: drop-shadow(0 30px 80px rgba(240, 236, 228, 0.1));
}

/* ─── Main layout (index.html) ──────────────────────── */
.رئيسي {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10vh 48px 160px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 80px;
  align-items: start;
}

.home-left {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.home-right {
  position: sticky;
  top: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Shared section heading ────────────────────────── */
.عنوان {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-low);
  margin: 0;
}

/* ─── Header / hero ─────────────────────────────────── */
.رأس {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.الاسم {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text-high);
  line-height: 1.15;
  margin: 0;
}

.ترجمة {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-low);
  margin: 0;
}

/* ─── Letter swap (h1 hover, built by effects.js) ───── */
.lsw {
  display: inline-flex;
  overflow: hidden;
  /* padding keeps descenders visible at rest; margin cancels the extra height */
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.lsw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lsw-char {
  position: relative;
  display: inline-block;
  white-space: pre;
}
.lsw-p {
  display: inline-block;
  transform: translateY(0);
}
.lsw-s {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(115%);
}
.lsw-p,
.lsw-s {
  transition: transform 0.8s cubic-bezier(0.3, 1.35, 0.45, 1);
  will-change: transform;
}

/* ─── Body text sections ────────────────────────────── */
.نص,
.فلسفة {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 520px;
}

.نص .en,
.فلسفة .en {
  font-size: 17px;
  line-height: 1.62;
  color: var(--text-mid);
  margin: 0;
}

/* ─── Works section ─────────────────────────────────── */
.أعمال {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.قائمة {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.قائمة li { border-top: 1px solid var(--border-thin); }
.قائمة li:last-child { border-bottom: 1px solid var(--border-thin); }

.قائمة a {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding: 15px 0;
  color: var(--text-mid);
  text-decoration: none;
  transition: color var(--transition-speed);
}
.قائمة a:hover { color: var(--text-high); }
.قائمة a:hover .اسم { color: var(--text-high); }

.قائمة .سنة {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-low);
  padding-top: 2px;
}

.work-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.قائمة .اسم {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color var(--transition-speed);
}

.قائمة .وصف {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--text-low);
  line-height: 1.5;
  margin-top: 2px;
}

/* ─── Lately section ────────────────────────────────── */
.lately {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lately-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lately-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.lately-item {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--text-low);
  text-decoration: none;
  transition: color var(--transition-speed);
  line-height: 1.5;
}
a.lately-item:hover { color: var(--text-mid); }

.lately-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-low);
  opacity: 0.5;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Contact section ───────────────────────────────── */
.تواصل {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.حال {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--border-thin);
  padding-bottom: 5px;
  width: fit-content;
  transition: color var(--transition-speed), border-color var(--transition-speed);
}
.حال:hover {
  color: var(--text-high);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}
.en-حال { color: inherit; }
.سهم { color: var(--text-low); }

/* ─── Links / footer row ────────────────────────────── */
.روابط {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-low);
}
.روابط a {
  color: var(--text-low);
  text-decoration: none;
  transition: color var(--transition-speed);
}
.روابط a:hover { color: var(--text-mid); }
.dot { color: var(--text-low); opacity: 0.45; }

/* ─── Surface card (index right column) ─────────────── */
.surface-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--border-thin);
  border-bottom: 1px solid var(--border-thin);
  transition: border-color var(--transition-speed);
}

.surface-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.surface-card-header svg {
  width: 15px;
  height: 15px;
  color: var(--text-low);
  flex-shrink: 0;
}
.surface-card-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-high);
}
.surface-card-year {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-low);
  margin-left: auto;
}
.surface-card-desc {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--text-mid);
  line-height: 1.62;
  margin: 0;
}

/* ─── Surface gate — hidden until extension detected ─── */

/* Default: all gated content is invisible and takes no space */
.srf-gate {
  display: none;
}

/* When body gets .srf-unlocked, gates open with staggered animation */
body.srf-unlocked .srf-gate {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: srf-reveal 0.7s ease forwards;
  opacity: 0;
}
body.srf-unlocked .srf-gate--inline {
  display: block;
}
body.srf-unlocked .srf-gate--delay-1 { animation-delay: 0.1s; }
body.srf-unlocked .srf-gate--delay-2 { animation-delay: 0.35s; }
body.srf-unlocked .srf-gate--delay-3 { animation-delay: 0.55s; }
body.srf-unlocked .srf-gate--delay-4 { animation-delay: 0.8s; }

@keyframes srf-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Surface status card (right column) ────────────── */
.srf-status-card {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border-thin);
}
.srf-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 200, 50, 0.7);
  flex-shrink: 0;
  animation: srf-pulse-dot 2.4s ease-in-out infinite;
}
@keyframes srf-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 50, 0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(255, 200, 50, 0); }
}
.srf-status-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 200, 50, 0.5);
}

/* ─── Bush easter egg — full-width section ───────────── */
.srf-bush-section {
  margin-top: 120px;
  border-top: 1px solid rgba(255, 200, 50, 0.1);
  padding-top: 80px;
  padding-bottom: 120px;
}
body.srf-unlocked .srf-bush-section {
  flex-direction: column;
  gap: 0;
}
.srf-bush-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.srf-bush-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 200, 50, 0.45);
  margin: 0;
}
.srf-bush-quote {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-high);
  margin: 0;
  padding: 0;
  border: none;
  max-width: 820px;
}
.srf-bush-cite {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 200, 50, 0.45);
  text-decoration: none;
  transition: color 0.2s ease;
}
.srf-bush-cite:hover { color: rgba(255, 200, 50, 0.75); }
.srf-bush-cite em { font-style: italic; font-family: var(--font-serif); font-size: 12px; }
.srf-bush-note {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--text-low);
  margin: 0;
  max-width: 480px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .srf-bush-inner { padding: 0 24px; }
  .srf-bush-section { padding-top: 60px; padding-bottom: 80px; margin-top: 80px; }
}

/* ─── Field photo (right column, pixelate reveal) ───── */
.field-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border-thin);
}
.field-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.field-photo figcaption {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-low);
  opacity: 0.6;
}

/* ─── Try Surface demo card ─────────────────────────── */
.try-surface {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--border-thin);
  border-bottom: 1px solid var(--border-thin);
}

.try-surface-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.try-surface-header svg {
  width: 15px;
  height: 15px;
  color: var(--text-low);
  flex-shrink: 0;
}
.try-surface-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-high);
}

.try-surface-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.try-surface-passage {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-low);
  line-height: 1.65;
  margin: 0;
  transition: color 0.3s ease;
}

/* highlight spans start invisible */
.srf-hl {
  color: var(--text-low);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 1px;
  cursor: default;
  transition: color 0.35s ease, border-color 0.35s ease;
  position: relative;
}

/* animated in by JS */
.srf-hl.srf-hl--visible {
  color: var(--text-mid);
  border-bottom-color: rgba(255, 200, 50, 0.45);
}

/* tooltip on hover */
.srf-hl::after {
  content: attr(data-reason);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255, 200, 50, 0.7);
  background: rgba(6, 6, 6, 0.92);
  border: 1px solid rgba(255, 200, 50, 0.15);
  padding: 5px 8px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}
.srf-hl.srf-hl--visible:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.try-surface-source {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-low);
  opacity: 0.6;
  margin: 0;
}

.try-surface-replay {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-low);
  cursor: pointer;
  padding: 0;
  width: fit-content;
  transition: color var(--transition-speed);
}
.try-surface-replay:hover { color: var(--text-mid); }

/* ─── Mobile ────────────────────────────────────────── */
@media (max-width: 768px) {
  .رئيسي {
    padding: 48px 24px 80px;
  }
  .home-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .home-right {
    position: static;
  }
  .نص .en,
  .فلسفة .en {
    font-size: 16px;
  }
  /* Glow at reduced size on mobile */
  body::before {
    width: 480px;
    height: 480px;
    top: -180px;
    left: -180px;
    background: radial-gradient(ellipse at center, rgba(28, 52, 105, 0.13) 0%, transparent 65%);
  }
  body::after {
    width: 420px;
    height: 420px;
    bottom: -160px;
    right: -160px;
    background: radial-gradient(ellipse at center, rgba(58, 22, 92, 0.10) 0%, transparent 65%);
  }
}

@media (max-width: 480px) {
  .الاسم { font-size: 26px; }
}
