:root {
  --ink: #0c1a1d;
  --ink-2: #10262a;
  --ink-3: #163035;
  --parchment: #ede7d6;
  --sand: #9ba79b;
  --sand-dim: #6e7c78;
  --amber: #e4a15c;
  --amber-dim: rgba(228, 161, 92, 0.16);
  --line: rgba(237, 231, 214, 0.1);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1120px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--amber);
  color: var(--ink);
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.coord {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--sand-dim);
}

/* top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--sand);
  background: linear-gradient(
    to bottom,
    rgba(12, 26, 29, 0.9),
    rgba(12, 26, 29, 0)
  );
  backdrop-filter: blur(2px);
}
.topbar .brand {
  color: var(--parchment);
  letter-spacing: 0.14em;
}
.topbar nav {
  display: flex;
  gap: 22px;
}
.topbar nav a {
  transition: color 0.2s;
}
.topbar nav a:hover,
.topbar nav a:focus-visible {
  color: var(--amber);
}
@media (max-width: 640px) {
  .topbar nav {
    display: none;
  }
}

/* hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-map svg {
  width: 100%;
  height: 100%;
  display: block;
}
.contour {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1;
  opacity: 0.14;
}
.gridline {
  stroke: var(--line);
  stroke-width: 1;
}
.locus {
  fill: var(--amber);
}
.locus-ring {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
}
.hero .eyebrow {
  display: block;
  margin-bottom: 26px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.hero h1 .light {
  color: var(--sand);
  font-weight: 400;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--parchment);
  max-width: 640px;
  margin-bottom: 38px;
}
.hero .lede b {
  color: var(--amber);
  font-weight: 600;
}
.btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 13px 24px;
  border-radius: 2px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
  font-weight: 500;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(228, 161, 92, 0.28);
}
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--parchment);
  background: transparent;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--amber);
  color: var(--amber);
}
.hero-tag {
  position: absolute;
  right: 28px;
  bottom: 42px;
  z-index: 2;
  text-align: right;
  line-height: 1.7;
}
@media (max-width: 820px) {
  .hero-tag {
    display: none;
  }
}

/* sections */
section {
  position: relative;
}
.band {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 48px;
}
.sec-head .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
}
.sec-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.01em;
}

/* summary */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
}
@media (max-width: 760px) {
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}
.summary-grid .side {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--sand);
  line-height: 2;
}
.summary-grid .side span {
  color: var(--amber);
}
.summary-grid p {
  font-size: 1.15rem;
  color: var(--parchment);
}
.summary-grid p + p {
  margin-top: 20px;
  color: var(--sand);
  font-size: 1.02rem;
}

/* legend */
.legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 900px) {
  .legend {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .legend {
    grid-template-columns: 1fr;
  }
}
.legend .cell {
  background: var(--ink);
  padding: 28px 24px;
  transition: background 0.25s;
}
.legend .cell:hover {
  background: var(--ink-2);
}
.legend .cell h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend .cell h3::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 1px;
  flex: none;
}
.legend ul {
  list-style: none;
}
.legend li {
  font-size: 0.95rem;
  color: var(--parchment);
  padding: 3px 0;
}

/* projects */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 760px) {
  .projects {
    grid-template-columns: 1fr;
  }
}

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.3s,
    box-shadow 0.3s;
}
.pcard:hover {
  transform: translateY(-6px);
  border-color: rgba(228, 161, 92, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* framed screenshot — fixed box, image can never overflow */
.pcard-shot {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ink);
}
.pcard-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.55s ease;
}
.pcard:hover .pcard-shot img {
  transform: scale(1.05);
}
.pcard-idx {
  position: absolute;
  top: 10px;
  right: 11px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--parchment);
  background: rgba(12, 26, 29, 0.75);
  backdrop-filter: blur(3px);
  padding: 4px 9px;
  border-radius: 2px;
}
.pcard-noshot {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 30px 30px;
}
.pcard-noshot span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--amber);
  opacity: 0.5;
}

/* body */
.pcard-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 8px 8px;
}
.pcard-body .zone {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 9px;
}
.pcard-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.15;
  margin-bottom: 10px;
}
.pcard-body p {
  font-size: 0.93rem;
  color: var(--sand);
  margin-bottom: 16px;
  flex: 1;
}
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.stack span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--sand);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 2px;
}
.pcard-body .visit {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  letter-spacing: 0.05em;
}
.pcard-body .visit:hover {
  text-decoration: underline;
}
/* experience */
.rail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 760px) {
  .rail {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}
.rail h3.block {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 26px;
}
.entry {
  padding-left: 22px;
  border-left: 1px solid var(--line);
  position: relative;
  padding-bottom: 28px;
}
.entry::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 50%;
}
.entry:last-child {
  padding-bottom: 0;
}
.entry .when {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--sand-dim);
  letter-spacing: 0.05em;
}
.entry .role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 4px 0 2px;
}
.entry .org {
  font-size: 0.9rem;
  color: var(--amber);
  margin-bottom: 8px;
}
.entry p {
  font-size: 0.9rem;
  color: var(--sand);
}

/* contact */
.contact {
  padding: 110px 0 90px;
  border-top: 1px solid var(--line);
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.contact h2 .light {
  color: var(--sand);
  font-weight: 400;
}
.contact .lede {
  color: var(--sand);
  font-size: 1.1rem;
  max-width: 520px;
  margin-bottom: 44px;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
.contact-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.crow {
  background: var(--ink);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.2s;
}
.crow:hover {
  background: var(--ink-2);
}
.crow .k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sand-dim);
}
.crow .v {
  font-size: 1.02rem;
  color: var(--parchment);
  word-break: break-word;
}
.crow a.v:hover {
  color: var(--amber);
}

/* contact form */
.cform {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cform .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cform label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-dim);
}
.cform input,
.cform textarea {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 12px 14px;
  transition: border-color 0.2s;
}
.cform input:focus,
.cform textarea:focus {
  outline: none;
  border-color: var(--amber);
}
.cform textarea {
  resize: vertical;
}
.cform .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.cform button {
  align-self: flex-start;
  margin-top: 4px;
}
.flash {
  padding: 13px 16px;
  border-radius: 2px;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.flash.ok {
  background: rgba(79, 182, 160, 0.14);
  border: 1px solid rgba(79, 182, 160, 0.4);
  color: #8fd3c3;
}
.flash.err {
  background: rgba(228, 110, 92, 0.14);
  border: 1px solid rgba(228, 110, 92, 0.4);
  color: #e79c8f;
}

footer {
  padding: 30px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--sand-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
/* ===== Language toggle + Arabic / RTL ===== */
.lang-toggle {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 10px;
  color: var(--parchment) !important;
}
.lang-toggle:hover {
  border-color: var(--amber);
  color: var(--amber) !important;
}
@media (max-width: 640px) {
  .topbar nav {
    display: flex;
    gap: 14px;
  }
  .topbar nav a:not(.lang-toggle) {
    display: none;
  }
}

[dir="rtl"] {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
}
[dir="rtl"] .hero h1,
[dir="rtl"] .sec-head h2,
[dir="rtl"] .contact h2,
[dir="rtl"] .pcard-body h3,
[dir="rtl"] .entry .role,
[dir="rtl"] .pcard-noshot span {
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
[dir="rtl"] .eyebrow,
[dir="rtl"] .zone,
[dir="rtl"] .legend .cell h3,
[dir="rtl"] .rail h3.block,
[dir="rtl"] .cform label,
[dir="rtl"] .crow .k,
[dir="rtl"] .summary-grid .side,
[dir="rtl"] .topbar nav {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  letter-spacing: normal;
}
[dir="rtl"] .entry {
  border-left: none;
  border-right: 1px solid var(--line);
  padding-left: 0;
  padding-right: 22px;
}
[dir="rtl"] .entry::before {
  left: auto;
  right: -4.5px;
}
[dir="rtl"] .hero-tag {
  right: auto;
  left: 28px;
  text-align: left;
}
