:root {
  --app-height: 1vh;
  --scene-pad-top: 7rem;
  --scene-pad-bottom: 3rem;
  --bg: #060709;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f3f1ed;
  --text-soft: rgba(243, 241, 237, 0.72);
  --text-faint: rgba(243, 241, 237, 0.44);
  --accent: #9ed9ff;
  --accent-warm: #ffb98a;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --max-width: 1220px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--scene-pad-top);
}

body {
  margin: 0;
  min-height: calc(var(--app-height) * 100);
  min-height: 100dvh;
  position: relative;
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top, rgba(158, 217, 255, 0.11), transparent 26%),
    radial-gradient(circle at 80% 20%, rgba(255, 185, 138, 0.08), transparent 22%),
    linear-gradient(180deg, #050608 0%, #090a0d 48%, #050608 100%);
  color: var(--text);
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

html[lang="ar"] body {
  font-family: "Cairo", "Tajawal", sans-serif;
}

html[lang="ar"] button,
html[lang="ar"] input {
  font-family: "Cairo", "Tajawal", sans-serif;
}

a,
button,
[role="button"] {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

a {
  text-decoration: none;
}

button {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.ambient,
.grain,
.vignette,
.bg-flow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-flow {
  inset: -14%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.bg-flow--primary {
  z-index: -5;
  opacity: 0.42;
  background:
    radial-gradient(circle at 16% 22%, rgba(158, 217, 255, 0.14), transparent 24%),
    radial-gradient(circle at 82% 28%, rgba(255, 185, 138, 0.11), transparent 22%),
    radial-gradient(circle at 52% 82%, rgba(255, 255, 255, 0.04), transparent 20%);
  animation: bgFloat 24s ease-in-out infinite alternate;
}

.bg-flow--secondary {
  z-index: -4;
  opacity: 0.18;
  background:
    linear-gradient(
      120deg,
      transparent 8%,
      rgba(255, 255, 255, 0.025) 26%,
      rgba(158, 217, 255, 0.04) 48%,
      transparent 64%,
      rgba(255, 185, 138, 0.03) 82%,
      transparent 100%
    );
  mix-blend-mode: screen;
  animation: bgSweep 36s ease-in-out infinite alternate;
}

.ambient {
  filter: blur(72px);
  z-index: -3;
}

.ambient-one {
  top: -10%;
  left: -12%;
  width: 36rem;
  height: 36rem;
  background: rgba(158, 217, 255, 0.14);
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient-two {
  inset: auto -10% 10% auto;
  width: 28rem;
  height: 28rem;
  background: rgba(255, 185, 138, 0.12);
  animation: drift 16s ease-in-out infinite alternate-reverse;
}

.grain {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 3px,
      rgba(255, 255, 255, 0.015) 4px,
      transparent 5px
    );
  opacity: 0.46;
  mix-blend-mode: soft-light;
  z-index: -2;
}

.vignette {
  background: radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.48));
  z-index: -1;
}

.topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1rem 0;
}

.story,
.topbar,
.scene-rail,
.bg-flow,
.ambient,
.grain,
.vignette {
  transition:
    opacity 0.42s ease,
    transform 0.42s ease;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .story,
body.modal-open .topbar,
body.modal-open .scene-rail {
  opacity: 0.15;
  transform: scale(0.995);
  pointer-events: none;
}

body.modal-open .ambient,
body.modal-open .grain,
body.modal-open .vignette,
body.modal-open .bg-flow {
  opacity: 0.36;
}

.brand,
.lang-toggle,
.scene-meter,
.scene-dot,
.identity-portrait,
.skill-card,
.project-card,
.contact-card,
.identity-card,
.project-modal__dialog {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
}

.brand-mark {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  box-shadow: 0 0 22px rgba(158, 217, 255, 0.6);
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand strong,
.scene-copy h1,
.scene-copy h2,
.identity-card strong,
.skill-card strong,
.project-card strong,
.project-modal__panel h3,
.contact-card strong {
  letter-spacing: -0.05em;
}

.brand strong {
  font-size: 0.96rem;
}

.brand small,
.scene-kicker,
.scene-tag,
.scene-note,
.scene-link,
.panel-label,
.identity-card__line span,
.skill-card p,
.skill-index,
.project-card p,
.project-details__lead,
.project-details__block p,
.contact-card span,
.contact-card small,
.scene-meter__label,
.lang-toggle,
.scene-rail a {
  color: var(--text-soft);
}

.brand small,
.scene-kicker,
.scene-tag,
.scene-note,
.scene-link,
.panel-label,
.identity-card__line span,
.skill-card p,
.skill-index,
.project-card p,
.project-details__lead,
.project-details__block p,
.contact-card span,
.contact-card small,
.scene-meter__label,
.lang-toggle,
.scene-rail a {
  font-size: 0.88rem;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scene-meter,
.lang-toggle {
  border-radius: 999px;
  padding: 0.8rem 1rem;
}

.scene-meter {
  display: grid;
  gap: 0.05rem;
  min-width: 6.5rem;
}

.scene-meter__count {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.scene-meter__label,
.lang-toggle {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.scene-rail {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 1rem;
  z-index: 15;
  display: none;
  align-items: center;
}

[dir="rtl"] .scene-rail {
  inset-inline-end: auto;
  inset-inline-start: 1rem;
}

.scene-rail::before {
  content: "";
  position: absolute;
  inset-block: 6rem;
  inset-inline-start: 0.9rem;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.scene-rail__inner {
  display: grid;
  gap: 1rem;
}

.scene-rail a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding-inline: 0.15rem;
  opacity: 0.52;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.scene-rail a.is-active {
  opacity: 1;
  transform: translateX(-0.15rem);
}

[dir="rtl"] .scene-rail a.is-active {
  transform: translateX(0.15rem);
}

.scene-dot {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.story {
  position: relative;
  width: 100%;
}

.section {
  min-height: calc((var(--app-height) * 100) - var(--scene-pad-top) - var(--scene-pad-bottom));
  min-height: calc(100dvh - var(--scene-pad-top) - var(--scene-pad-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
}

.scene {
  position: relative;
  padding: var(--scene-pad-top) 0 var(--scene-pad-bottom);
  scroll-margin-top: 6rem;
}

.scene::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

.section-content {
  width: 100%;
  text-align: center;
}

.scene-shell {
  width: 100%;
  display: grid;
  gap: 1.75rem;
  justify-items: center;
  text-align: center;
}

.scene-shell--split {
  align-items: center;
}

.scene-shell--intro {
  min-height: calc((var(--app-height) * 100) - var(--scene-pad-top) - var(--scene-pad-bottom));
  min-height: calc(100dvh - var(--scene-pad-top) - var(--scene-pad-bottom));
  place-content: center;
  justify-items: center;
  text-align: center;
}

.scene-shell--identity {
  max-width: 680px;
  align-content: center;
}

.scene-shell--narrow {
  max-width: 900px;
}

.scene-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.scene-meta--center {
  justify-content: center;
}

.scene-number {
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.22em;
}

.scene-kicker,
.scene-tag,
.panel-label,
.skill-index {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.scene-copy {
  display: grid;
  gap: 1rem;
  width: 100%;
  justify-items: center;
  text-align: center;
}

.scene-copy--hero {
  min-height: clamp(16rem, 42vh, 26rem);
  align-content: center;
}

.scene-copy--center {
  text-align: center;
}

.scene-copy--center .scene-note {
  margin-inline: auto;
}

.scene-copy h1,
.scene-copy h2 {
  margin-top: 0;
  margin-bottom: 12px;
  max-width: 11ch;
  margin-inline: auto;
  line-height: 0.96;
}

.scene-copy h1 {
  font-size: clamp(3.5rem, 14vw, 8.4rem);
}

.scene-copy h2 {
  font-size: clamp(2rem, 8vw, 4.8rem);
}

.scene-note {
  margin-top: 0;
  margin-bottom: 12px;
  max-width: 44rem;
  margin-inline: auto;
  line-height: 1.8;
}

.scene--intro.reveal {
  opacity: 1;
  transform: none;
  filter: none;
}

.scene--intro .scene-meta,
.scene--intro .scene-copy,
.scene--intro .scene-link {
  opacity: 0;
  transform: translateY(0.85rem) scale(0.97);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

.scene--intro.is-visible .scene-meta,
.scene--intro.is-visible .scene-copy,
.scene--intro.is-visible .scene-link {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scene--intro.is-visible .scene-copy {
  transition-delay: 0.08s;
}

.scene--intro.is-visible .scene-link {
  transition-delay: 0.16s;
}

.scene--intro .scene-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.8rem, 9vw, 5.7rem);
}

.scene--intro .scene-note {
  max-width: 36rem;
  margin-inline: auto;
}

.scene-link {
  display: inline-flex;
  width: fit-content;
  margin-inline: auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
}

.scene-link:hover,
.scene-link:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.brand,
.lang-toggle,
.scene-link,
.project-card,
.contact-action,
.project-story__action,
.project-modal__close {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.identity-card {
  position: relative;
  overflow: hidden;
}

.identity-portrait {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 1.9rem;
  isolation: isolate;
}

.identity-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.34)),
    radial-gradient(circle at top, rgba(158, 217, 255, 0.22), transparent 42%);
  z-index: 1;
  pointer-events: none;
}

.identity-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.identity-portrait__hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 1.5rem;
  place-items: center;
  text-align: center;
  color: var(--text-soft);
  line-height: 1.8;
}

.identity-portrait.is-empty {
  background:
    radial-gradient(circle at top, rgba(158, 217, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.identity-portrait.is-empty .identity-portrait__hint {
  display: grid;
}

.identity-card {
  padding: 1.35rem;
  border-radius: 1.75rem;
  display: grid;
  gap: 1rem;
}

.identity-card strong {
  font-size: clamp(1.8rem, 6vw, 3rem);
}

.identity-card p {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-soft);
}

.identity-card--compact {
  width: min(100%, 320px);
  padding: 1rem 1.15rem;
  gap: 0.65rem;
}

.identity-card--compact strong {
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.identity-card__line {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.identity-card__line span {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.skills-grid,
.projects-grid,
.contact-grid {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  align-items: stretch;
}

.skills-grid {
  max-width: 860px;
}

.skill-card,
.project-card,
.contact-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  padding: 1.2rem;
  text-align: center;
  transition:
    transform 0.34s ease,
    border-color 0.34s ease,
    background 0.34s ease;
}

.skill-card::before,
.project-card::before,
.contact-card::before,
.project-modal__panel::before,
.identity-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      135deg,
      rgba(158, 217, 255, 0.16),
      transparent 28%,
      transparent 72%,
      rgba(255, 185, 138, 0.1)
    );
  pointer-events: none;
}

.skill-card:hover,
.project-card:hover,
.project-card.is-active,
.contact-card:hover {
  transform: translateY(-0.2rem);
  border-color: var(--line-strong);
}

.skill-card strong,
.project-card strong,
.contact-card strong {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 1.25rem;
}

.skill-card {
  min-height: auto;
  padding: 1rem 1.05rem;
  flex: 0 1 220px;
  max-width: 220px;
}

.skill-card strong {
  font-size: 1.08rem;
}

.skill-card p,
.project-card p,
.contact-card small {
  margin-top: 0;
  margin-bottom: 12px;
  line-height: 1.75;
}

.project-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  display: grid;
  justify-items: center;
  align-content: space-between;
  gap: 0.95rem;
  min-height: 14rem;
  flex: 0 1 320px;
  max-width: 320px;
  cursor: pointer;
}

.project-card strong {
  margin: 0;
  font-size: 1.16rem;
}

.project-card.is-active {
  box-shadow:
    0 0 0 1px rgba(158, 217, 255, 0.28),
    0 0 36px rgba(158, 217, 255, 0.18),
    0 0 70px rgba(255, 185, 138, 0.08);
}

.project-card:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow:
    0 0 0 1px rgba(158, 217, 255, 0.32),
    0 0 28px rgba(158, 217, 255, 0.14);
}

.projects-grid {
  margin-top: 0.5rem;
}

.project-card .project-open,
.contact-card button,
.contact-card a {
  margin-top: 1rem;
  margin-inline: auto;
}

.project-open,
.contact-action {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
}

.project-open {
  pointer-events: none;
}

.project-open:hover,
.project-open:focus-visible,
.contact-action:hover,
.contact-action:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  pointer-events: none;
  opacity: 0;
}

.project-modal.is-mounted {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.38);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  transition:
    opacity 0.42s ease,
    backdrop-filter 0.42s ease,
    background 0.42s ease;
}

.project-modal.is-open {
  pointer-events: auto;
}

.project-modal.is-open .project-modal__backdrop {
  opacity: 1;
  background: rgba(4, 6, 10, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(12px);
}

.project-modal__dialog {
  position: fixed;
  overflow: hidden;
  pointer-events: auto;
  border-radius: 1.9rem;
  transform-origin: center center;
  will-change: transform;
  transition:
    top 0.42s ease-in-out,
    left 0.42s ease-in-out,
    width 0.42s ease-in-out,
    height 0.42s ease-in-out,
    transform 0.42s ease-in-out,
    box-shadow 0.42s ease-in-out,
    border-color 0.42s ease-in-out;
  box-shadow:
    0 0 0 1px rgba(158, 217, 255, 0.18),
    0 0 55px rgba(158, 217, 255, 0.2),
    0 0 100px rgba(255, 185, 138, 0.08);
}

.project-modal__content {
  height: 100%;
}

.project-modal__panel {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  padding-inline-end: 4.75rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 1.15rem;
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 0.26s ease,
    transform 0.26s ease;
}

.project-modal.is-open .project-modal__panel {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.16s;
}

.project-modal__panel--story {
  padding-inline-end: 1.5rem;
}

.project-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.project-modal__panel h3 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
}

.project-modal__summary {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 44rem;
}

.project-story {
  position: relative;
  display: grid;
  gap: 0;
  isolation: isolate;
}

.project-story > * {
  position: relative;
  z-index: 1;
}

.project-story--soft::before,
.project-story--system::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.project-story--soft::before {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 185, 138, 0.14), transparent 26%),
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05), transparent 28%);
}

.project-story--system::before {
  background:
    linear-gradient(rgba(158, 217, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(158, 217, 255, 0.07) 1px, transparent 1px),
    radial-gradient(circle at top, rgba(158, 217, 255, 0.12), transparent 28%);
  background-size: 36px 36px, 36px 36px, auto;
}

.project-story__hero,
.project-story__scene {
  min-height: min(72svh, 720px);
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 2rem 1rem;
}

.project-story__hero {
  gap: 1rem;
}

.project-story__hero-line {
  max-width: 42rem;
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  line-height: 1.9;
  color: var(--text);
}

.project-story__scene {
  position: relative;
  gap: 1.25rem;
}

.project-story__scene::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(180px, 40%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.project-story--soft .project-story__hero,
.project-story--soft .project-story__scene,
.project-story--soft .project-story__footer {
  background:
    linear-gradient(180deg, rgba(255, 185, 138, 0.045), rgba(255, 255, 255, 0.018));
}

.project-story--soft .project-story__scene::before {
  background: linear-gradient(90deg, transparent, rgba(255, 185, 138, 0.2), transparent);
}

.project-story--soft .project-story__headline {
  color: #fff2e8;
}

.project-story--soft .project-story__hero-line {
  color: rgba(255, 239, 229, 0.9);
}

.project-story--soft .project-story__chip {
  border-color: rgba(255, 185, 138, 0.18);
  background: rgba(255, 185, 138, 0.08);
}

.project-story--system .project-story__hero,
.project-story--system .project-story__scene,
.project-story--system .project-story__footer {
  background:
    linear-gradient(180deg, rgba(158, 217, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.project-story--system .project-story__scene::before {
  background: linear-gradient(90deg, transparent, rgba(158, 217, 255, 0.22), transparent);
}

.project-story--system .project-story__headline {
  color: #eefbff;
}

.project-story--system .project-story__hero-line {
  color: rgba(221, 243, 255, 0.92);
}

.project-story--system .project-story__chip {
  border-color: rgba(158, 217, 255, 0.18);
  background: rgba(158, 217, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(158, 217, 255, 0.08);
}

.project-story__copy {
  display: grid;
  gap: 0.9rem;
  justify-items: center;
}

.project-story__headline,
.project-story__line {
  margin: 0;
  max-width: 18ch;
}

.project-story__headline {
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.08;
  color: var(--text);
}

.project-story__line {
  font-size: clamp(1rem, 2vw, 1.26rem);
  line-height: 1.9;
  color: var(--text-soft);
}

.project-story__chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 42rem;
}

.project-story__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.7;
}

.project-story__reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

.project-story__reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-story__footer {
  min-height: min(38svh, 320px);
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem 1rem 2.5rem;
}

.project-story__action {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.project-story__action:hover,
.project-story__action:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.project-story--soft .project-story__action {
  border-color: rgba(255, 185, 138, 0.22);
  background: rgba(255, 185, 138, 0.08);
  box-shadow: 0 0 28px rgba(255, 185, 138, 0.12);
}

.project-story--system .project-story__action {
  border-color: rgba(158, 217, 255, 0.22);
  background: rgba(158, 217, 255, 0.08);
  box-shadow: 0 0 28px rgba(158, 217, 255, 0.14);
}

.project-modal__close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
}

.project-modal__close:hover,
.project-modal__close:focus-visible {
  transform: scale(1.05);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.project-details__lead {
  margin-top: 0;
  margin-bottom: 12px;
  max-width: 58rem;
  line-height: 1.85;
}

html[lang="ar"] .section-content,
html[lang="ar"] .scene-shell,
html[lang="ar"] .scene-copy,
html[lang="ar"] .contact-card,
html[lang="ar"] .project-card,
html[lang="ar"] .project-modal__panel {
  text-align: center;
}

html[lang="ar"] .scene-copy h1,
html[lang="ar"] .scene-copy h2,
html[lang="ar"] .project-modal__panel h3 {
  letter-spacing: normal;
}

html[lang="ar"] .scene-copy h1 {
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1.35;
}

html[lang="ar"] .scene-copy h2 {
  font-size: clamp(1.85rem, 6vw, 4rem);
  line-height: 1.45;
}

html[lang="ar"] .project-modal__panel h3 {
  font-size: clamp(1.5rem, 4.5vw, 2.4rem);
  line-height: 1.5;
}

html[lang="ar"] .project-story__headline {
  font-size: clamp(1.7rem, 4.3vw, 3rem);
  line-height: 1.6;
  letter-spacing: normal;
}

html[lang="ar"] .project-story__line,
html[lang="ar"] .project-story__hero-line,
html[lang="ar"] .project-story__chip {
  font-size: 0.98rem;
  line-height: 1.9;
  letter-spacing: normal;
}

html[lang="ar"] .scene-kicker,
html[lang="ar"] .scene-tag,
html[lang="ar"] .panel-label,
html[lang="ar"] .skill-index,
html[lang="ar"] .scene-meter__label,
html[lang="ar"] .lang-toggle,
html[lang="ar"] .scene-rail a,
html[lang="ar"] .project-open,
html[lang="ar"] .project-story__action,
html[lang="ar"] .contact-action,
html[lang="ar"] .brand small {
  letter-spacing: normal;
  text-transform: none;
}

html[lang="ar"] .scene-note,
html[lang="ar"] .identity-card p,
html[lang="ar"] .skill-card p,
html[lang="ar"] .project-card p,
html[lang="ar"] .contact-card small,
html[lang="ar"] .project-modal__summary,
html[lang="ar"] .project-details__lead,
html[lang="ar"] .project-details__block p,
html[lang="ar"] .identity-card__line span {
  font-size: 0.92rem;
  line-height: 1.8;
  letter-spacing: normal;
}

.project-details__grid {
  display: grid;
  gap: 0.85rem;
}

.project-details__block {
  padding: 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 0.85rem;
}

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-tool {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  font-size: 0.78rem;
}

.contact-card {
  min-height: 12rem;
  flex: 0 1 280px;
  max-width: 320px;
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.contact-card.is-disabled {
  opacity: 0.88;
}

.contact-action[aria-disabled="true"] {
  opacity: 0.64;
  cursor: default;
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scene.is-current .scene-tag,
.scene.is-current .scene-number,
.scene.is-current .scene-kicker {
  color: var(--accent);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2rem, -1.5rem, 0) scale(1.08);
  }
}

@keyframes bgFloat {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

@keyframes bgSweep {
  from {
    transform: translate3d(-2%, 0, 0) scale(1.02);
  }
  to {
    transform: translate3d(2%, 0, 0) scale(1.06);
  }
}

@media (min-width: 760px) {
  .topbar {
    padding-inline: 1.5rem;
  }

  .scene-shell--split {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  }

  .project-details__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .scene-rail {
    display: flex;
  }

  .topbar {
    padding-inline: 2rem;
  }

  .scene-copy h2 {
    max-width: 12ch;
  }
}

@media (max-width: 759px) {
  :root {
    --scene-pad-top: 5.75rem;
    --scene-pad-bottom: 2rem;
  }

  .scene-copy h1,
  .scene-copy h2 {
    max-width: none;
  }

  .scene-shell--intro {
    min-height: calc((var(--app-height) * 100) - var(--scene-pad-top) - var(--scene-pad-bottom));
    min-height: calc(100dvh - var(--scene-pad-top) - var(--scene-pad-bottom));
  }

  .scene-meter {
    display: none;
  }

  .topbar {
    padding-bottom: 0;
  }

  .project-modal__header {
    flex-direction: column;
  }

  .project-modal__panel,
  .project-modal__panel--story {
    padding: 1.15rem;
    padding-inline-end: 1.15rem;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
  }

  .brand {
    max-width: calc(100% - 5rem);
  }

  .brand strong {
    font-size: 0.88rem;
  }

  .lang-toggle {
    padding-inline: 0.85rem;
  }
}

@media (max-width: 900px), (hover: none), (pointer: coarse) {
  .ambient,
  .grain,
  .vignette,
  .bg-flow {
    display: none;
  }

  .brand,
  .lang-toggle,
  .scene-meter,
  .scene-dot,
  .identity-portrait,
  .skill-card,
  .project-card,
  .contact-card,
  .identity-card,
  .project-modal__dialog {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  }

  .project-modal.is-open .project-modal__backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .scene--intro .scene-meta,
  .scene--intro .scene-copy,
  .scene--intro .scene-link,
  .reveal,
  .project-story__reveal {
    transition-duration: 0.42s;
  }

  .skill-card:hover,
  .project-card:hover,
  .contact-card:hover,
  .project-story__action:hover,
  .contact-action:hover,
  .scene-link:hover,
  .lang-toggle:hover,
  .project-modal__close:hover {
    transform: none;
  }

  body.modal-open .story,
  body.modal-open .topbar,
  body.modal-open .scene-rail {
    transform: none;
  }
}

html.is-mobile .ambient,
html.is-mobile .grain,
html.is-mobile .vignette,
html.is-mobile .bg-flow {
  display: none;
}

html.is-mobile .brand,
html.is-mobile .lang-toggle,
html.is-mobile .scene-meter,
html.is-mobile .scene-dot,
html.is-mobile .identity-portrait,
html.is-mobile .skill-card,
html.is-mobile .project-card,
html.is-mobile .contact-card,
html.is-mobile .identity-card,
html.is-mobile .project-modal__dialog {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}

html.is-mobile .project-modal.is-open .project-modal__backdrop {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.is-mobile .scene--intro .scene-meta,
html.is-mobile .scene--intro .scene-copy,
html.is-mobile .scene--intro .scene-link,
html.is-mobile .reveal,
html.is-mobile .project-story__reveal {
  transition-duration: 0.42s;
}

html.is-mobile .skill-card:hover,
html.is-mobile .project-card:hover,
html.is-mobile .contact-card:hover,
html.is-mobile .project-story__action:hover,
html.is-mobile .contact-action:hover,
html.is-mobile .scene-link:hover,
html.is-mobile .lang-toggle:hover,
html.is-mobile .project-modal__close:hover {
  transform: none;
}

html.is-mobile body.modal-open .story,
html.is-mobile body.modal-open .topbar,
html.is-mobile body.modal-open .scene-rail {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
