:root {
  --paper: #f4f1ea;
  --paper-deep: #e9e4da;
  --ink: #1e2927;
  --muted: #65706c;
  --line: #c9c9be;
  --accent: #c95032;
  --accent-dark: #9d3824;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--paper));
  --dark: #1d2725;
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "DM Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

/* Fixed grain layer: a cheap SVG turbulence filter blended over the whole
   page so flat colour fields read as paper/ink rather than a flat CSS fill. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

button,
a {
  font: inherit;
}

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

button {
  cursor: pointer;
}

::selection {
  background: var(--accent-dark);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  padding: .55rem .8rem;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 241, 234, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.scroll-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .1s linear;
}

.nav-wrap {
  min-height: 4.6rem;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  font-size: .85rem;
  font-weight: 500;
}

.nav-links a,
.nav-github {
  position: relative;
  transition: color .25s var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a:hover,
.nav-github:hover {
  color: var(--accent-dark);
}

.nav-github {
  font-size: .85rem;
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  justify-self: end;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--line);
  padding: .35rem .6rem;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .03em;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.lang-toggle-sep {
  color: var(--line);
}

.lang-toggle-option {
  transition: color .2s var(--ease), font-weight .2s var(--ease);
}

.lang-toggle-option.is-active {
  color: var(--accent-dark);
  font-weight: 700;
}

.lang-toggle-mobile {
  margin-top: .8rem;
  width: 100%;
  justify-content: center;
  padding: .65rem 0;
}

.lang-toggle-footer {
  letter-spacing: 0;
}

.menu-toggle {
  display: none;
  justify-self: end;
  width: 2.5rem;
  height: 2.5rem;
  padding: .55rem;
  border: 0;
  background: transparent;
}

.menu-toggle span {
  display: block;
  height: 1px;
  margin: .32rem 0;
  background: var(--ink);
  transition: transform .2s var(--ease);
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.mobile-menu {
  padding: 0 var(--gutter) 1.2rem;
  border-top: 1px solid var(--line);
}

.mobile-menu a {
  display: block;
  padding: .65rem 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.intro {
  padding: clamp(3.5rem, 11vh, 6.5rem) var(--gutter) clamp(4rem, 8vw, 6.5rem);
  padding-right: clamp(var(--gutter), 20vw, 16rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

/* One deliberate, orchestrated entrance — a staged reveal on load rather
   than scattered hover/scroll fades scattered through the page. */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-meta {
  animation: reveal-up .7s var(--ease) both;
}

#intro-title {
  animation: reveal-up .8s var(--ease) .08s both;
}

.intro-role {
  animation: reveal-up .8s var(--ease) .16s both;
}

.intro-bottom {
  animation: reveal-up .8s var(--ease) .24s both;
}

.intro-meta,
.section-kicker,
.project-type,
.detail-label,
.background-kind,
.contact-kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: .92rem;
  letter-spacing: 0;
}

.site-footer {
  font-family: var(--font-body);
  font-size: .8rem;
}

.intro-meta {
  color: var(--muted);
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
}

h1 {
  max-width: 1200px;
  margin: 0;
  font-size: clamp(3.2rem, 11vw, 10.5rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: .88;
  font-variation-settings: "WONK" 1;
}

.intro-role {
  margin: .6rem 0 0;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 400;
}

.intro-bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 3rem;
  max-width: 1060px;
}

.intro-bottom>p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.intro-links,
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.text-link {
  display: inline-flex;
  gap: .4rem;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: .2rem;
  font-size: .84rem;
  font-weight: 600;
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.text-link:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.text-link-strong {
  border-color: var(--ink);
}

/* Primary hero CTA gets a small magnetic pull toward the cursor — motion
   that answers the person's action, not a decorative loop. */
.intro-links .text-link-strong {
  will-change: transform;
}

.work-section,
.about-section {
  padding: clamp(4.5rem, 9vw, 8.5rem) var(--gutter);
}

.background-section {
  padding: clamp(3.5rem, 6.5vw, 6rem) var(--gutter);
}

/* Scroll-triggered reveal — the hero already gets one deliberate entrance;
   this extends the same "considered, not scattered" motion to the rest of
   the page instead of leaving every other section to just appear static. */
[data-reveal] {
  opacity: 0;
  transition: opacity .7s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
}

[data-reveal-rise] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}

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

.work-section {
  background: #eeece5;
}

.section-kicker {
  display: flex;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--ink);
  color: var(--accent-dark);
}

/* Base state (no JS, or before it runs): a plain stacked list — every
   project fully visible and usable. JS adds "is-ready" once it has
   measured the cards and wired up the drag/fan behavior. */
.project-stack {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.project-stack-track {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

.project-stack-track>.project-card {
  position: relative;
  background: var(--paper-deep);
  box-shadow: 0 22px 40px -26px rgba(30, 41, 39, .4);
}

.project-stack-controls {
  display: none;
}

/* Enhanced state: JS has measured the cards and taken over. Cards fan
   out like a hand of cards held at a slight angle — the active print
   forward and sharp, the others receding behind it. Uses rotateZ (a
   flat, in-plane spin) rather than rotateY/perspective, which video
   elements can't reliably render without visual corruption in some
   browsers. */
.project-stack.is-ready {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--gutter) 0;
  overflow: hidden;
}

.project-stack.is-ready .project-stack-viewport {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.project-stack.is-ready .project-stack-track {
  position: relative;
  display: block;
  width: 100%;
  touch-action: pan-y;
  cursor: grab;
}

.project-stack.is-ready .project-stack-track.is-dragging {
  cursor: grabbing;
}

.project-stack.is-ready .project-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 1px 0 var(--line);
  will-change: transform;
}

.project-stack.is-ready .project-card.is-active {
  box-shadow: 0 24px 44px -26px rgba(30, 41, 39, .4);
}

/* Neighbors are still a real click target (to bring them forward) but
   their internal links/accordion shouldn't fire while faded and tilted
   away — the whole card is the thing you interact with, not its guts. */
.project-stack.is-ready .project-card:not(.is-active) .project-media,
.project-stack.is-ready .project-card:not(.is-active) .project-card-body {
  pointer-events: none;
}

.project-stack-controls {
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.project-stack.is-ready .project-stack-controls {
  display: flex;
}

.stack-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}

.stack-nav:hover {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.stack-dots {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.stack-dot {
  width: .5rem;
  height: .5rem;
  padding: 0;
  border: 1px solid var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.stack-dot[aria-selected="true"] {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: scale(1.3);
}

@media (max-width: 760px) {
  .project-stack.is-ready {
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.project-type,
.detail-label,
.background-kind {
  color: var(--accent-dark);
}

.project-type {
  margin-bottom: .4rem;
}

.project-card h3 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.05;
}

.project-summary {
  margin: 0;
  padding-top: .5rem;
  font-size: .96rem;
  line-height: 1.6;
  color: #43504b;
}

.project-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--dark);
  transition: transform .1s linear;
}

.project-video {
  display: block;
  width: 100%;
  aspect-ratio: 1.87 / 1;
  object-fit: cover;
  background: var(--dark);
  /* Muted at rest, true color on engagement — the reveal is the interaction,
     but it never lies about what the actual product looks like. */
  filter: grayscale(.6) contrast(1.03) brightness(.97);
  transition: filter .6s var(--ease);
}

.project-media:hover .project-video {
  filter: none;
}

.media-expand {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .75rem;
  border: 0;
  color: white;
  background: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: .72rem;
  transition: background-color .25s var(--ease);
}

.media-expand:hover {
  background: color-mix(in srgb, var(--accent-dark) 82%, black);
}

.play-triangle {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

.project-card-body {
  padding: 1.6rem 1.6rem 1.85rem;
}

.detail-block+.detail-block {
  margin-top: 1.3rem;
}

.detail-block p:last-child {
  margin: 0;
  color: #43504b;
  font-size: .88rem;
  line-height: 1.7;
}

.detail-label {
  margin-bottom: .4rem !important;
}

.tech-line {
  font-family: var(--font-mono);
  font-size: .76rem !important;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
}

.tech-tags span,
.skill-chip {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: -.01em;
  line-height: 1;
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}

.tech-tags span:hover,
.skill-chip:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 32%, var(--paper));
}

.tech-tags span {
  padding: .5rem .65rem;
  color: var(--ink);
}

/* Native disclosure for the deeper case-study detail — a real control,
   not a decorative accordion reimplemented in JS. */
.project-more {
  margin-top: 1.3rem;
  border-top: 1px solid var(--line);
  padding-top: .9rem;
}

.project-more summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-style: italic;
  font-size: .92rem;
  color: var(--ink);
}

.project-more summary::-webkit-details-marker {
  display: none;
}

.project-more summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-style: normal;
  font-size: .95rem;
  color: var(--accent);
  transition: transform .25s var(--ease);
}

.project-more[open] summary::after {
  transform: rotate(45deg);
}

.project-more-body {
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.project-engineering .engineering-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.engineering-list li {
  position: relative;
  padding-left: 1.1rem;
  color: #43504b;
  font-size: .88rem;
  line-height: 1.65;
}

.engineering-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-actions {
  margin-top: 1.4rem;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: .5rem;
  width: 100%;
}

.media-strip button {
  display: block;
  position: relative;
  width: 100%;
  height: 72px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  background: var(--dark);
  transition: border-color .25s var(--ease);
}

.media-strip button:hover {
  border-color: var(--line);
}

.media-strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--dark);
  filter: grayscale(.6) contrast(1.03) brightness(.97);
  transition: transform .5s var(--ease), opacity .4s var(--ease), filter .5s var(--ease);
}

.media-strip button:hover img {
  transform: scale(1.05);
  opacity: 1;
  filter: none;
}

.media-strip button::after {
  content: '+';
  position: absolute;
  top: .3rem;
  right: .3rem;
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(29, 39, 37, .6);
  font-family: var(--font-mono);
  font-size: .72rem;
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.media-strip button:hover::after {
  opacity: 1;
}

.about-section {
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  align-items: start;
  grid-template-columns: 1.4fr .6fr;
  gap: clamp(2.5rem, 8vw, 7rem);
  padding: clamp(4rem, 7vw, 6rem) 0;
}

.about-grid h2,
.contact-section h2 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.about-grid h2 {
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  margin-bottom: .5rem;
}

.contact-section h2 {
  font-size: clamp(2.1rem, 4.2vw, 5rem);
}

.skills-list {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.skills-list>div {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.skills-list dt {
  display: block;
  margin-bottom: .7rem;
}

.skills-list>div:nth-child(1) {
  --cat-color: var(--accent-dark);
}

.skills-list>div:nth-child(2) {
  --cat-color: #356a5a;
}

.skills-list>div:nth-child(3) {
  --cat-color: #6a5fa0;
}

.skills-list>div:nth-child(4) {
  --cat-color: #416182;
}

.skills-list dt {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .92rem;
  font-weight: 400;
  color: var(--cat-color, var(--accent));
}

.skills-list dd {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.skills-list .skill-chip {
  padding: .55rem .75rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 15%, var(--paper));
  transition: transform .25s var(--ease), background-color .25s var(--ease);
}

.skills-list .skill-chip:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 30%, var(--paper));
}

.learning-note {
  margin-left: .25rem;
  color: var(--muted);
  font-size: .6rem;
  font-weight: 500;
}

.background-section {
  background: var(--paper-deep);
}

.background-list {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 8vw, 9rem);
  padding-top: clamp(3.5rem, 6vw, 5.75rem);
}

.background-list article:nth-child(2) {
  margin-top: 3.25rem;
  transition-delay: .1s;
}

.background-list article {
  position: relative;
  display: flex;
  min-height: 280px;
  flex-direction: column;
  padding: 0 0 1.8rem;
  border-bottom: 1px solid var(--line);
  transition: transform .35s var(--ease), opacity .7s var(--ease);
}

.background-list article:hover {
  transform: translateY(-3px);
}

.background-list article:hover h3 {
  color: var(--accent);
}

.background-list h3 {
  margin: .8rem 0 .7rem;
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  font-weight: 600;
  transition: color .3s var(--ease);
}

.background-place {
  margin-bottom: 1.6rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.background-detail {
  max-width: 34rem;
  margin: 0;
  color: #43504b;
  font-size: .95rem;
  line-height: 1.75;
}

.contact-section {
  padding: clamp(5rem, 10vw, 9rem) var(--gutter);
  background: var(--dark);
  color: #f6f2eb;
}

.contact-kicker {
  margin-bottom: 1.2rem;
  color: #f0997c;
}

.contact-section h2 {
  max-width: 850px;
}

.contact-form {
  max-width: 640px;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1.75rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.form-row--full {
  grid-column: 1 / -1;
}

.form-row label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .82rem;
  color: #cfc3b8;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: .55rem 0;
  border: 0;
  border-bottom: 1px solid #70807a;
  background: transparent;
  color: #f6f2eb;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color .25s var(--ease);
}

html[lang="ar"] .contact-form input,
html[lang="ar"] .contact-form textarea {
  font-family: "Cairo", "IBM Plex Sans", Arial, sans-serif;
}

.contact-form textarea {
  resize: vertical;
  min-height: 92px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #f0997c;
  outline: none;
}

.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .9rem;
  margin-top: .5rem;
}

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.4rem;
  border: 1px solid #f6f2eb;
  background: transparent;
  color: #f6f2eb;
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .01em;
  appearance: none;
  transition: color .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease);
}

.form-submit:hover {
  color: var(--dark);
  background: #f6f2eb;
}

.form-submit:disabled {
  opacity: .55;
  cursor: default;
}

.form-status {
  margin: 0;
  font-size: .85rem;
  color: #aeb8b1;
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.form-status:not(:empty) {
  opacity: 1;
}

.form-status[data-state="success"] {
  color: #8fd4b8;
}

.form-status[data-state="error"] {
  color: #e8a598;
}

@media (max-width: 760px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.25rem;
  margin: clamp(2.5rem, 5vw, 4rem) 0 1.5rem;
}

.contact-links a,
.contact-links button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid #70807a;
  color: #f6f2eb;
  background: transparent;
  font-size: .9rem;
  font-weight: 600;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}

.contact-links a:hover,
.contact-links button:hover {
  color: #f0997c;
  border-color: #f0997c;
}

.resume-link {
  display: inline-flex;
  gap: .4rem;
  border-bottom: 1px solid #f6f2eb;
  padding-bottom: .2rem;
  font-size: .82rem;
  font-weight: 600;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}

.resume-link:hover {
  color: #f0997c;
  border-color: #f0997c;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  color: #aeb8b1;
  background: var(--dark);
  border-top: 1px solid #43504b;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 4.75rem;
  background: rgba(20, 28, 26, .96);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox-img,
.lightbox-video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid rgba(255, 255, 255, .35);
}

.lightbox-embed {
  width: min(1000px, 100%);
  height: min(60vw, 600px);
  border: 0;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 1;
  border: 0;
  color: #fff;
  background: transparent;
  font-family: var(--font-mono);
  font-size: .75rem;
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
}

.lightbox-close span {
  font-size: 1.4rem;
  vertical-align: -2px;
}

.lightbox-nav {
  top: 50%;
  font-size: 1.45rem;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 1.25rem;
}

.lightbox-next {
  right: 1.25rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  color: #f0997c;
}

@media (max-width: 760px) {
  .nav-wrap {
    grid-template-columns: 1fr auto;
    min-height: 4rem;
  }

  .nav-links,
  .nav-right {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .intro-bottom {
    align-items: start;
    flex-direction: column;
    gap: 1.8rem;
  }

  h1 {
    font-size: clamp(2.5rem, 15vw, 4.1rem);
    line-height: 1.02;
  }

  .intro-mobile-break {
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .media-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-grid {
    padding: 3.5rem 0;
  }

  .skills-list {
    margin-top: 1.5rem;
  }

  .skills-list>div {
    padding: 1.1rem 0;
  }

  .background-list {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .background-list article:nth-child(2) {
    margin-top: 0;
  }

  .lightbox {
    padding: 4.5rem 1rem 1rem;
  }

  .lightbox-nav {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   Arabic / RTL support
   ========================================================================== */

html[lang="ar"] body {
  font-family: "Cairo", "IBM Plex Sans", Arial, sans-serif;
}

html[lang="ar"] .intro-meta,
html[lang="ar"] .section-kicker,
html[lang="ar"] .project-type,
html[lang="ar"] .detail-label,
html[lang="ar"] .background-kind,
html[lang="ar"] .contact-kicker,
html[lang="ar"] .site-footer,
html[lang="ar"] .tech-line,
html[lang="ar"] .lang-toggle,
html[lang="ar"] .tech-tags span,
html[lang="ar"] .skill-chip,
html[lang="ar"] .media-expand,
html[lang="ar"] .form-row label {
  font-family: "Cairo", "IBM Plex Sans", Arial, sans-serif;
  font-style: normal;
  letter-spacing: 0;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .wordmark,
html[lang="ar"] .intro-role,
html[lang="ar"] .project h3 {
  font-family: "Cairo", "IBM Plex Sans", Arial, sans-serif;
  font-style: normal;
  letter-spacing: 0;
}

html[dir="rtl"] .play-triangle {
  border-left: 0;
  border-right: 6px solid currentColor;
}

html[dir="rtl"] .text-link span[aria-hidden="true"],
html[dir="rtl"] .resume-link span[aria-hidden="true"] {
  display: inline-block;
  transform: scaleX(-1);
}