:root {
  --bg: #050403;
  --bg-2: #0b0907;
  --surface: #12100c;
  --surface-2: #1a1712;
  --line: rgba(201, 163, 90, 0.22);
  --text: #efe6d4;
  --muted: #a89880;
  --accent: #c9a35a;
  --accent-2: #8b6b32;
  --ok: #c9a35a;
  --danger: #b56a52;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  --radius: 6px;
  --nav-h: 76px;
  --font: "Source Serif 4", "Amiri", Georgia, serif;
  --display: "Cormorant Garamond", "Amiri", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: #efe6d4;
  --bg-2: #e4d8c0;
  --surface: #f7f1e4;
  --surface-2: #eadfc8;
  --line: rgba(90, 68, 32, 0.2);
  --text: #1a140c;
  --muted: #6b5b45;
  --accent: #8b6b32;
  --accent-2: #5c451c;
  --shadow: 0 18px 40px rgba(40, 28, 8, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}

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

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .logo-text {
  font-family: "Amiri", "Cairo", serif;
}

h1,
h2,
h3,
.logo-text,
.hero-meta strong,
.float-card span {
  font-family: var(--display);
  font-weight: 600;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.bg-grid,
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  background-image:
    radial-gradient(rgba(201, 163, 90, 0.05) 0.7px, transparent 0.7px);
  background-size: 3px 3px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 78%);
}

html[data-theme="light"] .bg-grid {
  background-image:
    radial-gradient(rgba(80, 55, 20, 0.08) 0.7px, transparent 0.7px);
}

.bg-glow {
  background:
    radial-gradient(900px 420px at 50% -20%, rgba(201, 163, 90, 0.08), transparent 55%),
    radial-gradient(70% 50% at 50% 110%, rgba(0, 0, 0, 0.55), transparent 60%);
}

.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  width: 0;
  z-index: 80;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  isolation: isolate;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  backdrop-filter: blur(18px);
}

.nav.scrolled {
  border-bottom-color: var(--line);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--accent);
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-inline-start: auto;
  color: var(--muted);
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

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

.icon-btn,
.menu-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 2px;
  cursor: pointer;
}

.icon-btn {
  height: 42px;
  padding: 0 12px;
}

.lang-switch {
  display: inline-flex;
  direction: ltr;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}

.lang-opt {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 38px;
  padding: 0 8px;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-opt.is-active {
  background: var(--accent);
  color: #1a140c;
}

html:not([lang="ar"]) body {
  font-family: "Source Serif 4", Georgia, serif;
}

.icon-sun {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: inline;
}

html[data-theme="light"] .icon-moon {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #1a140c;
  box-shadow: none;
  letter-spacing: 0.04em;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--muted);
}

.btn.full {
  width: 100%;
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.menu-btn span {
  width: 18px;
  height: 2px;
  background: var(--text);
}

.hero {
  padding: 72px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-family: var(--mono);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(201, 163, 90, 0.15);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 10px rgba(201, 163, 90, 0);
  }
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-kicker {
  display: block;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.gradient-text {
  background: none;
  color: var(--text);
  -webkit-background-clip: unset;
  background-clip: unset;
}

html[data-theme="light"] .gradient-text {
  background: none;
  color: var(--text);
}

.hero-headline {
  margin: 6px 0 0;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-role {
  font-size: 1.25rem;
  margin: 14px 0 0;
  min-height: 2em;
}

.typed {
  color: var(--accent);
  font-weight: 800;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  margin-inline-start: 4px;
  vertical-align: -3px;
  animation: blink 1s step-end infinite;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 58ch;
}

.unity-files {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  max-width: 58ch;
  border-top: 1px solid rgba(201, 163, 90, 0.22);
}
.unity-files li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 163, 90, 0.22);
  color: var(--accent);
}
.unity-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}
.unity-facts li {
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 0.9rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
}

.hero-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-meta strong {
  display: block;
  font-size: 1.6rem;
}

.hero-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-visual {
  position: relative;
  padding: 24px 16px 32px;
  display: grid;
  gap: 18px;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 8px;
}

.hero-photo {
  width: 138px;
  height: 168px;
  object-fit: cover;
  border-radius: 0;
  border: 1px solid var(--accent);
  box-shadow: 8px 8px 0 rgba(201, 163, 90, 0.18);
  flex-shrink: 0;
  display: block;
  filter: grayscale(0.18) contrast(1.05);
}

.terminal {
  background: #070605;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  direction: ltr;
  text-align: left;
}

html[data-theme="light"] .terminal {
  background: #2a2418;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background: #8a5a44;
}
.dot.yellow {
  background: #c9a35a;
}
.dot.green {
  background: #6e7a4a;
}

.terminal-title {
  margin-inline-start: 8px;
  color: #c9a35a;
  font-family: var(--mono);
  font-size: 12px;
}

.terminal-body {
  margin: 0;
  padding: 22px 22px 48px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: #d1d5db;
  min-height: 280px;
}

.t-comment {
  color: #7a6a52;
}
.t-prompt {
  color: var(--accent);
}
.t-out {
  color: #e8dcc4;
}
.t-ok {
  color: var(--ok);
}

.blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.float-card {
  position: absolute;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.float-card span {
  display: block;
  font-weight: 800;
  font-size: 1.2rem;
}

.float-card small {
  color: var(--muted);
}

.fc-1 {
  top: 0;
  inset-inline-start: 0;
}

.fc-2 {
  bottom: 4px;
  inset-inline-end: 0;
}

.logos {
  padding: 18px 0 8px;
  color: var(--muted);
}

.logos-label {
  text-align: center;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.logo-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.section {
  padding: 92px 0;
}

.section.alt {
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 40px;
  max-width: 720px;
}

.section-head.split {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  max-width: none;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.checklist {
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-inline-start: 28px;
  margin: 10px 0;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--ok);
  font-weight: 800;
}

.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bento-card,
.skill-card,
.service,
.project,
blockquote,
.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.bento-card.wide {
  grid-column: 1 / -1;
}

.bento-card p,
.service p,
.project p {
  color: var(--muted);
}

.skills-grid,
.cards-3,
.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pills span {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.86rem;
  font-weight: 600;
}

.pills.sm span {
  font-size: 0.78rem;
  padding: 4px 10px;
}

.meters {
  margin-top: 36px;
  display: grid;
  gap: 16px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.1s ease;
}

.icon-box {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 0;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.chip.is-active {
  color: #1a140c;
  background: var(--accent);
  border-color: var(--accent);
}

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.project {
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}

.project:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.project.hidden {
  display: none;
}

.project-shots {
  height: 250px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: flex-end;
  padding: 16px 14px 0;
  background: linear-gradient(180deg, #1a140c, #0c0a08);
  overflow: hidden;
}
.project-shots img {
  height: 100%;
  width: auto;
  max-width: 34%;
  object-fit: cover;
  object-position: top;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(201, 163, 90, 0.2);
}
.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.v1 {
  background: linear-gradient(135deg, #1a140c, #3a2c16);
}
.v2 {
  background: linear-gradient(135deg, #120e0a, #2c2114);
}
.v3 {
  background: linear-gradient(135deg, #0c0a08, #2a2418);
}
.v4 {
  background: linear-gradient(135deg, #16120c, #3d2e18);
}

.mock-ui,
.mock-code {
  height: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.mock-nav,
.mock-hero,
.mock-sidebar,
.mock-table,
.mock-chart {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.mock-nav {
  height: 14px;
  width: 40%;
  margin-bottom: 12px;
}

.mock-kpis,
.mock-cards {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.mock-kpis i,
.mock-cards i {
  flex: 1;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.mock-chart {
  height: 72px;
}

.mock-hero {
  height: 54px;
  margin-bottom: 10px;
}

.mock-code span {
  display: block;
  height: 10px;
  margin: 10px 0;
  border-radius: 6px;
  background: rgba(201, 163, 90, 0.28);
}

.mock-code span:nth-child(2) {
  width: 78%;
  background: rgba(139, 107, 50, 0.4);
}
.mock-code span:nth-child(3) {
  width: 62%;
  background: rgba(167, 139, 250, 0.4);
}
.mock-code span:nth-child(4) {
  width: 88%;
}

.mock-sidebar {
  width: 24%;
  height: 100%;
  float: inline-start;
  margin-inline-end: 10px;
}

.mock-table {
  height: 100%;
}

.project-body {
  padding: 20px 22px 24px;
}

.tag {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  margin: 0 0 6px;
}

.result {
  color: var(--ok) !important;
  font-weight: 600;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-inline-start: 2px solid var(--line);
}

.timeline li {
  padding: 0 28px 32px;
  position: relative;
}

.timeline li::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  inset-inline-start: -7px;
  top: 6px;
}

.when {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.timeline p {
  color: var(--muted);
}

blockquote p {
  margin-top: 0;
  font-size: 1.15rem;
  font-style: italic;
  font-family: var(--display);
}

blockquote footer {
  color: var(--muted);
  font-weight: 700;
}

.cta-band {
  padding: 0;
}

.cta-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 36px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--surface);
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  margin: 14px 0;
}

.contact-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

.contact-list a {
  word-break: break-word;
}

#linkedinLink {
  direction: ltr;
  unicode-bidi: isolate;
}

.socials {
  display: flex;
  gap: 16px;
  font-weight: 700;
}

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

.contact-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 163, 90, 0.15);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--danger);
}

.form-note {
  margin: 0;
  font-weight: 700;
}

.form-note.ok {
  color: var(--ok);
}

.form-note.err {
  color: var(--danger);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.7s ease forwards;
  animation-play-state: paused;
}

.reveal.in {
  animation-play-state: running;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .about-grid,
  .contact-grid,
  .projects,
  .section-head.split {
    grid-template-columns: 1fr;
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 16px;
    z-index: 5;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    flex-direction: column;
    display: none;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .menu-btn {
    display: flex;
  }

  .nav-cta {
    display: none;
  }

  .skills-grid,
  .cards-3,
  .quotes,
  .bento {
    grid-template-columns: 1fr;
  }

  .cta-inner,
  .footer-inner {
    flex-direction: column;
    text-align: start;
  }

  .fc-1,
  .fc-2 {
    display: none;
  }

  .terminal-body {
    min-height: 200px;
    font-size: 12px;
    padding: 16px;
  }

  .hero-photo {
    width: 92px;
    height: 112px;
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1180px, calc(100% - 24px));
  }

  .hero {
    padding-top: 36px;
  }

  .hero-identity {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 68px 0;
  }

  .hero-cta .btn {
    width: 100%;
  }
}
