/* Mohammed Bitrou — portfolio stylesheet (4-Palette Dynamic System: Cobalt, Emerald, Copper, Teal). */

:root,
:root[data-palette="cobalt"] {
  --brand-fill: #2563eb;

  /* 1. Royal Cobalt & Midnight Navy — Light */
  --l-bg: #ffffff;
  --l-text: #111827;
  --l-text-2: #334155;
  --l-muted: #556275;
  --l-rule: #e2e8f0;
  --l-accent: #2563eb;
  --l-accent-hover: #1d4ed8;
  --l-on-accent: #ffffff;
  --l-tint: #eff6ff;
  --l-tint-edge: #bfdbfe;

  /* Alternating dark sections: Midnight Navy (#0b1324) */
  --d-bg: #0b1324;
  --d-text: #e8eef7;
  --d-text-2: #c2d0e6;
  --d-muted: #8899b5;
  --d-rule: #1d2d4a;
  --d-accent: #93c5fd;
  --d-accent-hover: #bfdbfe;
  --d-on-accent: #0b1324;
  --d-tint: #121f38;
  --d-tint-edge: #24385c;

  /* Light alternating sections */
  --t-bg: #eef4ff;
  --t-text: #111827;
  --t-text-2: #334155;
  --t-muted: #526073;
  --t-rule: #cdddf8;
  --t-accent: #2563eb;
  --t-accent-hover: #1d4ed8;
  --t-on-accent: #ffffff;
  --t-tint: #e0ecff;
  --t-tint-edge: #c3d8fb;

  --bezel: #111827;
  --bezel-ring: transparent;
  --screen: #ffffff;
  --shadow: rgba(11, 19, 36, 0.3);

  --sky: linear-gradient(180deg, #6b9ef0 0%, #99bef6 32%, #cbdef8 62%, #eaeff6 88%, #f5f1ea 100%);
  --sky-floor: #f5f1ea;
  --sky-glow: rgba(255, 245, 224, 0.72);
  --card-shadow: rgba(15, 32, 72, 0.34);

  /* Dark mode palette tokens */
  --dk-bg: #0d1117;
  --dk-text: #eceef2;
  --dk-text-2: #c9d1d9;
  --dk-muted: #94a3b8;
  --dk-rule: #212836;
  --dk-accent: #60a5fa;
  --dk-accent-hover: #93c5fd;
  --dk-on-accent: #0b1324;
  --dk-tint: #141c2b;
  --dk-tint-edge: #23314a;
  --dk-bezel: #05070b;
  --dk-bezel-ring: rgba(96, 165, 250, 0.16);
  --dk-screen: #1e2430;
  --dk-sky: linear-gradient(180deg, #02050c 0%, #050d1e 28%, #0b1b38 54%, #122852 80%, #193468 100%);
  --dk-sky-floor: #193468;
  --dk-sky-glow: rgba(96, 165, 250, 0.24);

  /* Component surface & glow tokens */
  --star-color: #e8f1ff;
  --wheel-bar-bg: #0d1322;
  --wheel-back-glow: rgba(96, 165, 250, 0.28);
  --wheel-back-grad: linear-gradient(155deg, #1d3b72 0%, #102347 45%, #071124 100%);
  --wheel-back-ring: rgba(147, 197, 253, 0.26);
  --cam-bg: #2b3040;
  --cam-ring: rgba(125, 211, 252, 0.5);
  --mock-screen-bg: #0b1020;
  --btn-hover-bg: rgba(37, 99, 235, 0.94);
  --browser-bg: #0d1222;
  --browser-bar-bg: #141224;
  --lb-bg: rgba(9, 12, 22, 0.93);
  --lb-accent: #60a5fa;
  --lb-hover: #93c5fd;
  --lb-btn-hover: rgba(59, 130, 246, 0.28);

  --font-head: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 20px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

/* 2. Emerald FinTech & Deep Forest */
:root[data-palette="emerald"] {
  --brand-fill: #059669;

  --l-bg: #ffffff;
  --l-text: #0f1f1a;
  --l-text-2: #2d423b;
  --l-muted: #526961;
  --l-rule: #dde7e3;
  --l-accent: #059669;
  --l-accent-hover: #047857;
  --l-on-accent: #ffffff;
  --l-tint: #ecfdf5;
  --l-tint-edge: #a7f3d0;

  --d-bg: #06120f;
  --d-text: #eaf5f1;
  --d-text-2: #c0d6ce;
  --d-muted: #82a096;
  --d-rule: #163029;
  --d-accent: #34d399;
  --d-accent-hover: #6ee7b7;
  --d-on-accent: #06130f;
  --d-tint: #0d221c;
  --d-tint-edge: #1c4237;

  --t-bg: #edf8f4;
  --t-text: #0f1f1a;
  --t-text-2: #2d423b;
  --t-muted: #4e665d;
  --t-rule: #c6e6da;
  --t-accent: #059669;
  --t-accent-hover: #047857;
  --t-on-accent: #ffffff;
  --t-tint: #dcf5ec;
  --t-tint-edge: #b0e4d1;

  --bezel: #0d1b17;
  --shadow: rgba(6, 18, 15, 0.3);
  --sky: linear-gradient(180deg, #52b69a 0%, #84d2bc 32%, #bce7da 62%, #e6f4ef 88%, #f4f1ea 100%);
  --sky-floor: #f4f1ea;
  --sky-glow: rgba(255, 248, 228, 0.72);
  --card-shadow: rgba(9, 25, 21, 0.34);

  --dk-bg: #091915;
  --dk-text: #ecf6f2;
  --dk-text-2: #c5dad2;
  --dk-muted: #8aa69c;
  --dk-rule: #1a352e;
  --dk-accent: #34d399;
  --dk-accent-hover: #6ee7b7;
  --dk-on-accent: #06130f;
  --dk-tint: #102620;
  --dk-tint-edge: #1f453b;
  --dk-bezel: #040b09;
  --dk-bezel-ring: rgba(52, 211, 153, 0.16);
  --dk-screen: #12241f;
  --dk-sky: linear-gradient(180deg, #020806 0%, #05130f 28%, #09221b 56%, #0f352a 82%, #154738 100%);
  --dk-sky-floor: #154738;
  --dk-sky-glow: rgba(52, 211, 153, 0.24);

  --star-color: #e6fcf5;
  --wheel-bar-bg: #081512;
  --wheel-back-glow: rgba(52, 211, 153, 0.28);
  --wheel-back-grad: linear-gradient(155deg, #134235 0%, #0b2920 45%, #05130f 100%);
  --wheel-back-ring: rgba(110, 231, 183, 0.26);
  --cam-bg: #24332e;
  --cam-ring: rgba(52, 211, 153, 0.48);
  --mock-screen-bg: #071310;
  --btn-hover-bg: rgba(5, 150, 105, 0.94);
  --browser-bg: #081411;
  --browser-bar-bg: #0f1e1a;
  --lb-bg: rgba(5, 14, 11, 0.93);
  --lb-accent: #34d399;
  --lb-hover: #6ee7b7;
  --lb-btn-hover: rgba(16, 185, 129, 0.26);
}

/* 3. Burnt Copper & Warm Obsidian */
:root[data-palette="copper"] {
  --brand-fill: #ea580c;

  --l-bg: #ffffff;
  --l-text: #1c1410;
  --l-text-2: #3f312a;
  --l-muted: #6e5a50;
  --l-rule: #ebe2dc;
  --l-accent: #ea580c;
  --l-accent-hover: #c2410c;
  --l-on-accent: #ffffff;
  --l-tint: #fff7ed;
  --l-tint-edge: #fed7aa;

  --d-bg: #100c0a;
  --d-text: #f7efe9;
  --d-text-2: #d9cac0;
  --d-muted: #9e8a7d;
  --d-rule: #2d211b;
  --d-accent: #fb923c;
  --d-accent-hover: #fdba74;
  --d-on-accent: #16110e;
  --d-tint: #1d1511;
  --d-tint-edge: #3d2b21;

  --t-bg: #fbf4ee;
  --t-text: #1c1410;
  --t-text-2: #3f312a;
  --t-muted: #6b564b;
  --t-rule: #ead6c7;
  --t-accent: #ea580c;
  --t-accent-hover: #c2410c;
  --t-on-accent: #ffffff;
  --t-tint: #f7e8dc;
  --t-tint-edge: #efcbb0;

  --bezel: #18110d;
  --shadow: rgba(22, 14, 10, 0.32);
  --sky: linear-gradient(180deg, #c26d48 0%, #e08e5a 30%, #f3b882 60%, #fae0be 86%, #fcf3e6 100%);
  --sky-floor: #fcf3e6;
  --sky-glow: rgba(255, 237, 196, 0.82);
  --card-shadow: rgba(28, 17, 11, 0.36);

  --dk-bg: #16110e;
  --dk-text: #f7efe9;
  --dk-text-2: #dacbc1;
  --dk-muted: #a38f82;
  --dk-rule: #2e231d;
  --dk-accent: #fb923c;
  --dk-accent-hover: #fdba74;
  --dk-on-accent: #16110e;
  --dk-tint: #211914;
  --dk-tint-edge: #3d2c22;
  --dk-bezel: #0b0806;
  --dk-bezel-ring: rgba(251, 146, 60, 0.16);
  --dk-screen: #241b16;
  --dk-sky: linear-gradient(180deg, #070504 0%, #110b08 30%, #21130c 58%, #3b1e10 82%, #592b13 100%);
  --dk-sky-floor: #592b13;
  --dk-sky-glow: rgba(251, 146, 60, 0.28);

  --star-color: #fff3e6;
  --wheel-bar-bg: #140f0c;
  --wheel-back-glow: rgba(251, 146, 60, 0.28);
  --wheel-back-grad: linear-gradient(155deg, #4a2412 0%, #29150c 45%, #120b08 100%);
  --wheel-back-ring: rgba(253, 186, 116, 0.26);
  --cam-bg: #332721;
  --cam-ring: rgba(251, 146, 60, 0.48);
  --mock-screen-bg: #140e0b;
  --btn-hover-bg: rgba(234, 88, 12, 0.94);
  --browser-bg: #140f0c;
  --browser-bar-bg: #211814;
  --lb-bg: rgba(16, 11, 8, 0.93);
  --lb-accent: #fb923c;
  --lb-hover: #fdba74;
  --lb-btn-hover: rgba(234, 88, 12, 0.28);
}

/* 4. Petroleum Teal & Deep Slate */
:root[data-palette="teal"] {
  --brand-fill: #0d9488;

  --l-bg: #ffffff;
  --l-text: #0f1d24;
  --l-text-2: #2c414b;
  --l-muted: #526873;
  --l-rule: #dce6ea;
  --l-accent: #0d9488;
  --l-accent-hover: #0f766e;
  --l-on-accent: #ffffff;
  --l-tint: #f0fdfa;
  --l-tint-edge: #99f6e4;

  --d-bg: #071117;
  --d-text: #eaf4f6;
  --d-text-2: #bfd4da;
  --d-muted: #829fa8;
  --d-rule: #162d38;
  --d-accent: #2dd4bf;
  --d-accent-hover: #5eead4;
  --d-on-accent: #071418;
  --d-tint: #0d2029;
  --d-tint-edge: #1c3f4d;

  --t-bg: #eef7f8;
  --t-text: #0f1d24;
  --t-text-2: #2c414b;
  --t-muted: #4f6670;
  --t-rule: #c8dfe3;
  --t-accent: #0d9488;
  --t-accent-hover: #0f766e;
  --t-on-accent: #ffffff;
  --t-tint: #dff2f3;
  --t-tint-edge: #b2dfe2;

  --bezel: #0c1820;
  --shadow: rgba(7, 17, 23, 0.3);
  --sky: linear-gradient(180deg, #4ea8b4 0%, #7ec7cf 32%, #b8e3e6 62%, #e6f3f4 88%, #f4f1ea 100%);
  --sky-floor: #f4f1ea;
  --sky-glow: rgba(255, 248, 228, 0.74);
  --card-shadow: rgba(11, 24, 32, 0.34);

  --dk-bg: #0b1820;
  --dk-text: #ebf5f7;
  --dk-text-2: #c4d8de;
  --dk-muted: #88a4ad;
  --dk-rule: #1a313d;
  --dk-accent: #2dd4bf;
  --dk-accent-hover: #5eead4;
  --dk-on-accent: #071418;
  --dk-tint: #112430;
  --dk-tint-edge: #204252;
  --dk-bezel: #050c10;
  --dk-bezel-ring: rgba(45, 212, 191, 0.16);
  --dk-screen: #132530;
  --dk-sky: linear-gradient(180deg, #03090d 0%, #07141c 28%, #0b2330 56%, #103747 82%, #154a5c 100%);
  --dk-sky-floor: #154a5c;
  --dk-sky-glow: rgba(45, 212, 191, 0.24);

  --star-color: #e6fafa;
  --wheel-bar-bg: #08131a;
  --wheel-back-glow: rgba(45, 212, 191, 0.28);
  --wheel-back-grad: linear-gradient(155deg, #123e4a 0%, #0b2630 45%, #061218 100%);
  --wheel-back-ring: rgba(94, 234, 212, 0.26);
  --cam-bg: #23333b;
  --cam-ring: rgba(45, 212, 191, 0.48);
  --mock-screen-bg: #071218;
  --btn-hover-bg: rgba(13, 148, 136, 0.94);
  --browser-bg: #081319;
  --browser-bar-bg: #102029;
  --lb-bg: rgba(6, 14, 19, 0.93);
  --lb-accent: #2dd4bf;
  --lb-hover: #5eead4;
  --lb-btn-hover: rgba(13, 148, 136, 0.28);
}

/* Arabic gets the matching Plex face, so the two languages sit on the same skeleton. */
:root[lang="ar"] {
  --font-head: "IBM Plex Sans Arabic", "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --l-bg: var(--dk-bg);
    --l-text: var(--dk-text);
    --l-text-2: var(--dk-text-2);
    --l-muted: var(--dk-muted);
    --l-rule: var(--dk-rule);
    --l-accent: var(--dk-accent);
    --l-accent-hover: var(--dk-accent-hover);
    --l-on-accent: var(--dk-on-accent);
    --l-tint: var(--dk-tint);
    --l-tint-edge: var(--dk-tint-edge);
    --bezel: var(--dk-bezel);
    --bezel-ring: var(--dk-bezel-ring);
    --screen: var(--dk-screen);
    --shadow: rgba(0, 0, 0, 0.58);
    --sky: var(--dk-sky);
    --sky-floor: var(--dk-sky-floor);
    --sky-glow: var(--dk-sky-glow);
    --card-shadow: rgba(0, 0, 0, 0.58);
    --t-bg: var(--d-bg);
    --t-text: var(--d-text);
    --t-text-2: var(--d-text-2);
    --t-muted: var(--d-muted);
    --t-rule: var(--d-rule);
    --t-accent: var(--d-accent);
    --t-accent-hover: var(--d-accent-hover);
    --t-on-accent: var(--d-on-accent);
    --t-tint: var(--d-tint);
    --t-tint-edge: var(--d-tint-edge);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --l-bg: var(--dk-bg);
  --l-text: var(--dk-text);
  --l-text-2: var(--dk-text-2);
  --l-muted: var(--dk-muted);
  --l-rule: var(--dk-rule);
  --l-accent: var(--dk-accent);
  --l-accent-hover: var(--dk-accent-hover);
  --l-on-accent: var(--dk-on-accent);
  --l-tint: var(--dk-tint);
  --l-tint-edge: var(--dk-tint-edge);
  --bezel: var(--dk-bezel);
  --bezel-ring: var(--dk-bezel-ring);
  --screen: var(--dk-screen);
  --shadow: rgba(0, 0, 0, 0.58);
  --sky: var(--dk-sky);
  --sky-floor: var(--dk-sky-floor);
  --sky-glow: var(--dk-sky-glow);
  --card-shadow: rgba(0, 0, 0, 0.58);
  --t-bg: var(--d-bg);
  --t-text: var(--d-text);
  --t-text-2: var(--d-text-2);
  --t-muted: var(--d-muted);
  --t-rule: var(--d-rule);
  --t-accent: var(--d-accent);
  --t-accent-hover: var(--d-accent-hover);
  --t-on-accent: var(--d-on-accent);
  --t-tint: var(--d-tint);
  --t-tint-edge: var(--d-tint-edge);
  color-scheme: dark;
}

/* The working tokens. With motion on, the whole page fades between tones as sections
   pass the middle of the screen (motion.js toggles body.tone-dark). Without motion,
   dark sections paint their own background. */
body {
  --bg: var(--l-bg);
  --text: var(--l-text);
  --text-2: var(--l-text-2);
  --muted: var(--l-muted);
  --rule: var(--l-rule);
  --accent: var(--l-accent);
  --accent-hover: var(--l-accent-hover);
  --on-accent: var(--l-on-accent);
  --tint: var(--l-tint);
  --tint-edge: var(--l-tint-edge);
}

html.motion body.tone-dark,
html:not(.motion) [data-tone="dark"] {
  --bg: var(--t-bg);
  --text: var(--t-text);
  --text-2: var(--t-text-2);
  --muted: var(--t-muted);
  --rule: var(--t-rule);
  --accent: var(--t-accent);
  --accent-hover: var(--t-accent-hover);
  --on-accent: var(--t-on-accent);
  --tint: var(--t-tint);
  --tint-edge: var(--t-tint-edge);
}

html:not(.motion) [data-tone="dark"] {
  background: var(--bg);
  color: var(--text);
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

html:not(.motion) {
  scroll-behavior: smooth;
}

/* Lenis takes the page over; without these it fights the browser's own scrolling. */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.7s var(--ease-out), color 0.7s var(--ease-out);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

strong {
  font-weight: 600;
  color: var(--text);
}

svg {
  flex: none;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

.skip-link {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nowrap,
.skill {
  white-space: nowrap;
}

/* Latin names inside Arabic text keep their own direction. */
bdi {
  unicode-bidi: isolate;
}

/* Header: floats over the page, hides while scrolling down. */

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  transition: transform 0.45s var(--ease-out), background-color 0.7s var(--ease-out);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-inline-end: auto;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.brand-mark .brand-rect {
  fill: var(--brand-fill);
}

.nav ul {
  display: flex;
  gap: 2px;
  list-style: none;
}

.nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.theme-toggle,
.lang-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover,
.lang-toggle:hover {
  border-color: var(--muted);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.lang-toggle {
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.theme-toggle .icon-sun,
:root[data-theme-current="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme-current="dark"] .theme-toggle .icon-sun {
  display: block;
}

@media (max-width: 719px) {
  .nav {
    display: none;
  }
}

/* Icons inside text */

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Buttons, eyebrow, small rows */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  border-color: var(--rule);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--text);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.meta-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meta-row .icon {
  width: 16px;
  height: 16px;
}

.meta-row a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.meta-row a:hover {
  text-decoration: underline;
}

/* Section titles: big uppercase display type, like the hero name. */

.section {
  padding-block: clamp(80px, 10vw, 140px);
}

.section-head {
  margin-bottom: clamp(32px, 4vw, 56px);
}

.section-title {
  font-weight: 800;
  font-size: clamp(2.25rem, 1.3rem + 3.6vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

/* Arabic has no case, and tight tracking cuts into its joins. */
:root[lang="ar"] .section-title,
:root[lang="ar"] .hero-name,
:root[lang="ar"] .statement,
:root[lang="ar"] .mq-word,
:root[lang="ar"] .screens-word,
:root[lang="ar"] .eyebrow,
:root[lang="ar"] .loader-label {
  text-transform: none;
  letter-spacing: 0;
}

:root[lang="ar"] .hero-name,
:root[lang="ar"] .section-title,
:root[lang="ar"] .statement {
  line-height: 1.12;
}

/* Hero: a framed sky with a wheel of app screens (wheel.js) and the name underneath.
   The frame is one screen tall; its clip-path shows the rounded window under the header
   (--fp: 1), or the whole screen during the entrance (--fp: 0). */

.hero {
  --frame-top: 72px;
  --frame-x: max(clamp(8px, 1.1vw, 18px), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  --frame-bottom: max(340px, clamp(42svh, calc(100svh - 400px), 58svh));
  --frame-h: max(100svh, var(--frame-bottom));
  --frame-r: clamp(18px, 2.2vw, 32px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  padding: calc(var(--frame-bottom) + clamp(22px, 3.4svh, 44px)) 0 clamp(28px, 5svh, 60px);
  overflow: hidden;
}

.hero-frame {
  --fp: 1;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 0;
  height: var(--frame-h);
  clip-path: inset(
    calc(var(--frame-top) * var(--fp)) calc(var(--frame-x) * var(--fp))
      calc((var(--frame-h) - var(--frame-bottom)) * var(--fp)) round calc(var(--frame-r) * var(--fp))
  );
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

/* Where the window is once the frame has closed in; wheel.js measures it. */
.hero-window {
  position: absolute;
  top: var(--frame-top);
  right: var(--frame-x);
  left: var(--frame-x);
  height: calc(var(--frame-bottom) - var(--frame-top));
  visibility: hidden;
  pointer-events: none;
}

.hero-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--sky) 0 0 / 100% var(--frame-bottom) no-repeat, var(--sky-floor);
}

/* The sun (or, at night, a violet glow) behind the wheel. */
.sky-glow {
  position: absolute;
  top: calc(var(--frame-bottom) * 0.66);
  left: 50%;
  width: min(150vw, 2000px);
  height: calc(var(--frame-bottom) * 1.15);
  background: radial-gradient(closest-side, var(--sky-glow), transparent);
  transform: translate(-50%, -50%);
}

/* Stars, only on the night sky (dark theme): small, many, twinkling gently. */
.sky-stars {
  position: absolute;
  top: var(--frame-top);
  right: 0;
  left: 0;
  display: none;
  height: calc(var(--frame-bottom) - var(--frame-top));
  -webkit-mask-image: linear-gradient(#000 50%, transparent 92%);
  mask-image: linear-gradient(#000 50%, transparent 92%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sky-stars {
    display: block;
  }
}

:root[data-theme="dark"] .sky-stars {
  display: block;
}

.sky-stars i {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--star-color);
  opacity: var(--o);
}

html.motion:not(.has-intro) .sky-stars i:nth-child(odd) {
  animation: twinkle var(--t) ease-in-out var(--d) infinite alternate;
  will-change: opacity;
}

@keyframes twinkle {
  to {
    opacity: calc(var(--o) * 0.45);
  }
}

/* The wheel: wheel.js sets each card's transform and visibility every frame. */
.wheel {
  position: absolute;
  inset: 0;
  perspective-origin: 50% 32%;
  cursor: grab;
}

.hero-frame.is-dragging .wheel {
  cursor: grabbing;
}

/* Only the cards take the pointer: in 3D the world's own (empty) plane sits in front of them. */
.wheel-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.wheel-card {
  --cw: var(--card-w, 220px);
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-w, 220px);
  height: var(--card-h, 145px);
  visibility: hidden;
  color: #fff;
  text-decoration: none;
  pointer-events: auto;
  will-change: transform, opacity;
  contain: layout style;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

.wheel-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: clamp(8px, calc(var(--cw) * 0.048), 14px);
}

/* Front: the web / backend system inside a sleek browser window. */
.wheel-front {
  display: flex;
  flex-direction: column;
  border: 1.5px solid color-mix(in srgb, var(--bezel) 86%, rgba(255, 255, 255, 0.22));
  background: var(--screen);
  box-shadow: 0 0 0 1px var(--bezel-ring), 0 calc(var(--cw) * 0.1) calc(var(--cw) * 0.2) calc(var(--cw) * -0.05) var(--card-shadow);
}

.wheel-bar {
  display: flex;
  align-items: center;
  gap: calc(var(--cw) * 0.02);
  height: 12%;
  min-height: 12px;
  padding: 0 4.2%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--wheel-bar-bg);
  direction: ltr;
}

.wheel-bar i {
  width: calc(var(--cw) * 0.024);
  min-width: 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.85;
}

.wheel-bar i:nth-child(1) { background: #fb7185; }
.wheel-bar i:nth-child(2) { background: #fbbf24; }
.wheel-bar i:nth-child(3) { background: #34d399; }

.wheel-url {
  flex: 1;
  max-width: 56%;
  height: 48%;
  margin-left: 2.5%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.wheel-front img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* A light sweeps across each card as it reaches the top. */
.wheel-front::after {
  content: "";
  position: absolute;
  inset: -10% -80%;
  z-index: 1;
  background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, 0.26) 50%, transparent 58%);
  opacity: 0;
  pointer-events: none;
}

.motion .is-live .wheel-front::after {
  animation: sheen 1.5s var(--ease-out) 0.1s;
}

@keyframes sheen {
  from {
    opacity: 1;
    transform: translateX(-45%);
  }
  to {
    opacity: 1;
    transform: translateX(45%);
  }
}

/* The system's name, shown on the cards near the top. */
.wheel-tag {
  position: absolute;
  bottom: 7.5%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.42em 0.85em 0.42em 0.65em;
  border-radius: 999px;
  background: rgba(12, 9, 20, 0.82);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: var(--font-body);
  font-size: clamp(9.5px, calc(var(--cw) * 0.052), 13px);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 35%);
  transition: opacity 0.45s ease, transform 0.6s var(--ease-out);
}

.wheel-tag i {
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6);
}

.is-live .wheel-tag {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Back: dynamic palette engineering card with terminal chrome and the MB monogram.
   Seen from behind during the deal, so it's mirrored back the right way round. */
.wheel-back {
  display: none;
  background:
    radial-gradient(120% 80% at 20% 0%, var(--wheel-back-glow), transparent 62%),
    var(--wheel-back-grad);
  box-shadow: inset 0 0 0 1px var(--wheel-back-ring), 0 calc(var(--cw) * 0.1) calc(var(--cw) * 0.2) calc(var(--cw) * -0.05) var(--card-shadow);
  transform: scaleX(-1);
}

.is-back .wheel-back {
  display: block;
}

.is-back .wheel-front {
  display: none;
}

.wheel-back-bar {
  position: absolute;
  top: 8%;
  left: 6%;
  right: 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0.6;
  direction: ltr;
}

.wheel-back-dots {
  display: inline-flex;
  gap: 4px;
}

.wheel-back-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--d-accent);
}

.wheel-back-code {
  color: var(--d-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(8px, calc(var(--cw) * 0.042), 11px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.wheel-mark {
  position: absolute;
  top: 56%;
  left: 50%;
  width: 24%;
  fill: none;
  stroke: var(--d-accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-50%, -50%);
}

/* First visit: the loader's night covers the page while the deck is dealt above it. */
.has-intro .hero-frame {
  --fp: 0;
  z-index: 301;
  pointer-events: none;
}

.has-intro .hero-sky {
  opacity: 0;
}

.has-intro .hero-inner {
  visibility: hidden;
}

/* The text under the frame. */
.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-text {
  display: grid;
  grid-template-areas:
    "eyebrow meta"
    "name name"
    "about actions";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(24px, 4vw, 64px);
}

.hero .eyebrow {
  grid-area: eyebrow;
}

.hero-name {
  grid-area: name;
  margin-top: clamp(10px, 1.6svh, 20px);
  font-weight: 800;
  font-size: clamp(2.5rem, 0.4rem + 6.2vw, 7.25rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.hero-name .line {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.07em;
  margin-bottom: -0.07em;
  vertical-align: top;
}

.hero-name .line-1 {
  margin-inline-end: 0.24em;
}

/* Each letter is its own element (for the slide-in), so keep words from breaking between them. */
.hero-name .line-inner {
  display: inline-block;
  white-space: nowrap;
}

.hero-name .line-2 {
  color: var(--accent);
}

.hero-name .char {
  display: inline-block;
}

.about {
  grid-area: about;
  max-width: 66ch;
  margin-top: clamp(14px, 2.4svh, 28px);
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero .hero-actions {
  grid-area: actions;
  align-self: end;
  justify-content: flex-end;
  margin-top: clamp(14px, 2.4svh, 28px);
}

.hero .meta-row {
  grid-area: meta;
  justify-content: flex-end;
}

@media (max-width: 899px) {
  .hero {
    --frame-bottom: max(300px, 46svh);
  }

  .hero-text {
    grid-template-areas: "eyebrow" "name" "about" "actions" "meta";
    grid-template-columns: minmax(0, 1fr);
  }

  .hero .hero-actions,
  .hero .meta-row {
    justify-content: flex-start;
  }

  .hero .meta-row {
    margin-top: 28px;
  }
}

/* Intro: marquee strips, the statement and the counters (a dark section). */

.intro {
  position: relative;
  padding-block: clamp(72px, 9vw, 128px) clamp(96px, 12vw, 176px);
  overflow: hidden;
}

.marquee {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.8vw, 12px);
  margin-bottom: clamp(64px, 9vw, 140px);
}

.marquee-row {
  overflow: hidden;
  white-space: nowrap;
  /* The strips are moved by transform in px, which bidi must not flip. */
  direction: ltr;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  padding-right: clamp(20px, 3vw, 48px);
  will-change: transform;
}

.mq-word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(3rem, 1rem + 8vw, 9.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.mq-b .mq-word {
  font-size: clamp(2.25rem, 0.8rem + 5.6vw, 6.5rem);
}

.mq-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}

.mq-dot {
  flex: none;
  width: clamp(12px, 1.3vw, 20px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
}

.statement {
  max-width: 1120px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.9rem, 0.9rem + 3.6vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.statement .hl {
  color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px clamp(24px, 3vw, 48px);
  margin-top: clamp(56px, 8vw, 120px);
  list-style: none;
}

.stat {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.stat-figure {
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(3.25rem, 2rem + 4.4vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  /* "20+" must not become "+20" in Arabic. */
  direction: ltr;
  text-align: start;
}

.stat-label {
  max-width: 26ch;
  margin-top: 12px;
  color: var(--text-2);
}

@media (max-width: 699px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Work: coloured panels, one per project. Stacked by default; on wide screens with
   motion they're pinned and slide sideways while you scroll (.is-horizontal). */

.work {
  padding-top: clamp(88px, 10vw, 150px);
  padding-bottom: clamp(56px, 7vw, 104px);
}

.work-pin {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vw, 56px);
}

.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.work-progress {
  display: none;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.wp-cur {
  color: var(--text);
}

.wp-bar {
  position: relative;
  width: 120px;
  height: 2px;
  overflow: hidden;
  background: var(--rule);
}

.wp-bar > span {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.track {
  display: grid;
  gap: 24px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  list-style: none;
}

.panel {
  --panel-ink: #16181c;
  --panel-ink-2: rgba(22, 24, 28, 0.76);
  --panel-rule: rgba(22, 24, 28, 0.2);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr);
  min-height: 560px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--panel-bg);
  color: var(--panel-ink);
}

.panel-dark {
  --panel-ink: #ffffff;
  --panel-ink-2: rgba(255, 255, 255, 0.8);
  --panel-rule: rgba(255, 255, 255, 0.3);
}

.panel.is-clickable {
  cursor: pointer;
}

.panel-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: clamp(26px, 3.4vw, 46px);
}

.panel-index {
  color: var(--panel-ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: start;
}

.panel-name {
  margin-top: auto;
  color: var(--panel-ink);
  font-family: "Sora", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 1.3rem + 3.2vw, 4.55rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-transform: none;
  white-space: nowrap;
}

.panel-summary {
  max-width: 46ch;
  color: var(--panel-ink-2);
  font-size: clamp(0.98rem, 0.94rem + 0.18vw, 1.05rem);
  line-height: 1.56;
}

.panel-summary strong {
  color: var(--panel-ink);
}

.panel-tech {
  margin-top: 8px;
  color: var(--panel-ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  direction: ltr;
  text-align: start;
}

.panel-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(24px, 4.5%, 48px);
  overflow: hidden;
  container-type: inline-size;
  text-decoration: none;
}

/* MacBook laptop frame for web, dashboard & backend systems. */
.laptop {
  position: relative;
  width: 94%;
  max-width: 620px;
  direction: ltr;
}

.laptop-lid {
  position: relative;
  width: 88%;
  margin-inline: auto;
  padding: 2.3% 2.3% 2.9%;
  border-radius: 14px 14px 4px 4px;
  background: #14151b;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.16), 0 30px 58px -22px rgba(0, 0, 0, 0.58);
}

.laptop-cam {
  position: absolute;
  top: 0.95%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cam-bg);
  box-shadow: inset 0 0 0 1px var(--cam-ring);
  transform: translateX(-50%);
}

.laptop-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 9px;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c1e26;
}

.laptop-bar span {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
}

.laptop-bar span:nth-child(1) { background: #fb7185; opacity: 0.85; }
.laptop-bar span:nth-child(2) { background: #fbbf24; opacity: 0.85; }
.laptop-bar span:nth-child(3) { background: #34d399; opacity: 0.85; }

.laptop-screen {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 6px 6px;
  background: var(--mock-screen-bg);
  aspect-ratio: 2 / 1;
  cursor: pointer;
}

.laptop-screen img,
.laptop-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.laptop-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.65s var(--ease-out), transform 0.85s var(--ease-out);
  pointer-events: none;
}

.laptop-slide.is-active {
  z-index: 1;
  opacity: 1;
  transform: scale(1);
}

.laptop-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.laptop-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 9, 20, 0.74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.laptop:hover .laptop-counter,
.laptop:focus-within .laptop-counter {
  opacity: 1;
}

.laptop-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 9, 20, 0.74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #ffffff;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
}

.laptop:hover .laptop-btn,
.laptop:focus-within .laptop-btn {
  opacity: 1;
}

@media (hover: none) {
  .laptop-btn {
    opacity: 0.9;
  }
}

.laptop-btn:hover {
  background: var(--btn-hover-bg);
  border-color: rgba(255, 255, 255, 0.4);
}

.laptop-btn .icon {
  width: 16px;
  height: 16px;
}

.laptop-prev {
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}

.laptop-next {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.laptop-zoom {
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
}

.laptop-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.laptop-dot {
  position: relative;
  width: 9px;
  height: 9px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-ink) 28%, transparent);
  cursor: pointer;
  transition: width 0.35s var(--ease-out), background-color 0.25s ease;
}

.laptop-dot:hover {
  background: color-mix(in srgb, var(--panel-ink) 48%, transparent);
}

.laptop-dot.is-active {
  width: 32px;
}

.laptop-dot > span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel-ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.laptop-dot.is-active > span {
  animation: laptop-progress 3.6s linear forwards;
}

.laptop.is-paused .laptop-dot.is-active > span,
html:not(.motion) .laptop-dot.is-active > span {
  animation-play-state: paused;
}

html:not(.motion) .laptop-dot.is-active > span {
  transform: scaleX(1);
}

@keyframes laptop-progress {
  to {
    transform: scaleX(1);
  }
}

.laptop-base {
  position: relative;
  height: clamp(10px, 2cqi, 15px);
  border-radius: 2px 2px 12px 12px;
  background: linear-gradient(180deg, #dde1e8 0%, #9fa6b4 68%, #676e7c 100%);
  box-shadow: 0 20px 36px -12px rgba(0, 0, 0, 0.5);
}

.panel-dark .laptop-base {
  background: linear-gradient(180deg, #565c6b 0%, #353a47 68%, #1c1f27 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 24px 42px -12px rgba(0, 0, 0, 0.65);
}

.laptop-notch {
  position: absolute;
  top: 0;
  left: 50%;
  width: 15%;
  height: 44%;
  border-radius: 0 0 6px 6px;
  background: rgba(15, 18, 26, 0.48);
  transform: translateX(-50%);
}

/* Optional floating secondary phone/card beside the laptop if added later. */
.laptop-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.laptop-wrap .panel-phone-float {
  position: absolute;
  right: 3%;
  bottom: -4%;
  z-index: 2;
  width: 24%;
  --bezel-w: 1.1cqi;
}

.panel-dark .device {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 30px 60px -24px rgba(0, 0, 0, 0.6);
}

/* A project with no screenshot yet stands its brand mark in the media area. */
.panel-mark {
  display: grid;
  place-items: center;
  padding: 10% 8%;
}

.panel-mark img {
  width: min(62%, 320px);
  height: auto;
  object-fit: contain;
}

.is-horizontal .work {
  padding-block: 0;
}

.is-horizontal .work-pin {
  justify-content: center;
  height: 100vh;
  padding-top: 64px;
}

.is-horizontal .work-progress {
  display: flex;
}

.is-horizontal .track {
  display: flex;
  width: max-content;
  max-width: none;
  margin: 0;
  gap: 28px;
  padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
}

.is-horizontal .panel {
  flex: none;
  grid-template-rows: minmax(0, 1fr);
  width: min(84vw, 1160px);
  height: min(66vh, 640px);
  min-height: 0;
}

@media (max-width: 1023px) {
  .panel {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .panel-media {
    order: -1;
    aspect-ratio: 16 / 10.5;
  }

  .panel-name {
    margin-top: 4px;
  }
}

@media (max-width: 599px) {
  .panel {
    border-radius: 24px;
  }

  .panel-media {
    aspect-ratio: 16 / 11;
    padding: 20px 14px 12px;
  }
}

/* Links and status badges under each project. */

.case-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 8px;
}

.store-link {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--panel-rule, var(--rule));
  border-radius: 999px;
  color: var(--panel-ink, var(--text));
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.store-link:hover {
  border-color: var(--panel-ink, var(--text));
}

.store-link .icon {
  width: 19px;
  height: 19px;
}

.case-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px dashed var(--panel-rule, var(--rule));
  border-radius: 999px;
  color: var(--panel-ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Brand logos are solid shapes, not strokes. */
.icon-brand {
  fill: currentColor;
  stroke: none;
}

.case-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--panel-ink, var(--accent));
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  direction: ltr;
}

.case-site:hover {
  text-decoration: underline;
}

.case-site .icon {
  width: 16px;
  height: 16px;
}

.projects-note {
  max-width: 68ch;
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

/* Optional mobile frame when showcasing responsive views. */

.device {
  position: relative;
  flex: none;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border: var(--bezel-w, 6px) solid var(--bezel);
  border-radius: 15% / 7%;
  background: var(--screen);
  box-shadow: 0 0 0 1px var(--bezel-ring), 0 28px 48px -20px var(--shadow);
}

.device-island {
  position: absolute;
  top: 2.6%;
  left: 50%;
  z-index: 2;
  width: 30%;
  height: 3.4%;
  border-radius: 999px;
  background: var(--bezel);
  transform: translateX(-50%);
}

.device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Browser window frame, used on the parallax systems wall. */

.browser {
  flex: none;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--browser-bg);
  box-shadow: 0 0 0 1px var(--tint-edge), 0 28px 48px -22px var(--shadow);
  direction: ltr;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--browser-bar-bg);
}

.browser-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.browser-bar span:nth-child(1) { background: #fb7185; opacity: 0.85; }
.browser-bar span:nth-child(2) { background: #fbbf24; opacity: 0.85; }
.browser-bar span:nth-child(3) { background: #34d399; opacity: 0.85; }

.browser img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: top center;
}

/* Systems wall: web & dashboard interfaces at different depths. */

.screens {
  position: relative;
  padding-block: clamp(36px, 5vw, 72px) clamp(16px, 2.5vw, 36px);
  overflow: hidden;
}

.resume-section {
  padding-top: clamp(56px, 6.5vw, 96px);
}

.screens-inner {
  position: relative;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.screens-word {
  position: absolute;
  top: 48%;
  left: 50%;
  color: transparent;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(5rem, 1rem + 17vw, 19.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-text-stroke: 1.5px var(--rule);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.shots {
  position: relative;
  height: clamp(860px, 98vh, 1020px);
  list-style: none;
}

.shot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  container-type: inline-size;
}

.shot-cap {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.shot:nth-child(1) { --x: 0%; --y: 0%; --w: 28%; }
.shot:nth-child(2) { --x: 36%; --y: 4%; --w: 27%; }
.shot:nth-child(3) { --x: 71%; --y: 0%; --w: 29%; }
.shot:nth-child(4) { --x: 2%; --y: 26%; --w: 28%; }
.shot:nth-child(5) { --x: 37%; --y: 30%; --w: 28%; }
.shot:nth-child(6) { --x: 72%; --y: 25%; --w: 28%; }
.shot:nth-child(7) { --x: 0%; --y: 52%; --w: 29%; }
.shot:nth-child(8) { --x: 35%; --y: 56%; --w: 28%; }
.shot:nth-child(9) { --x: 70%; --y: 51%; --w: 30%; }
.shot:nth-child(10) { --x: 2%; --y: 78%; --w: 28%; }
.shot:nth-child(11) { --x: 36%; --y: 80%; --w: 28%; }
.shot:nth-child(12) { --x: 71%; --y: 77%; --w: 29%; }

@media (max-width: 767px) {
  .screens-word {
    display: none;
  }

  .shots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
    height: auto;
  }

  .shot {
    position: static;
    width: auto;
  }

  .shot:nth-child(even) {
    margin-top: 28px;
  }
}

@media (max-width: 519px) {
  .shots {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .shot:nth-child(even) {
    margin-top: 0;
  }
}

/* Experience + sidebar */

.resume {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(40px, 6vw, 88px);
}

.jobs {
  list-style: none;
}

.job + .job {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.job-head,
.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
}

.job-head h3 {
  font-size: 1.25rem;
}

.job-detail {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.period {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-org {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.roles {
  margin-top: 18px;
  padding-inline-start: 20px;
  border-inline-start: 2px solid var(--rule);
  list-style: none;
}

.role + .role {
  margin-top: 24px;
}

.role h4 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
}

.points {
  margin-top: 10px;
  padding-inline-start: 1.15em;
  list-style-type: disc;
  color: var(--text-2);
}

.points li + li {
  margin-top: 6px;
}

.points li::marker {
  color: var(--accent);
}

.aside {
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding-inline-start: clamp(24px, 3vw, 40px);
  border-inline-start: 1px solid var(--rule);
}

.aside-title {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.skills div + div,
.awards li + li {
  margin-top: 14px;
}

.skills dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.skills dd {
  margin-top: 2px;
}

.skill,
.nowrap {
  white-space: nowrap;
}

.edu-degree,
.award-title {
  font-weight: 600;
}

.award-title a {
  font-weight: 600;
  text-decoration: none;
}

.award-title a:hover {
  text-decoration: underline;
}

.award-title .icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-inline-start: 4px;
  vertical-align: -0.1em;
}

.edu-school,
.award-detail {
  color: var(--muted);
  font-size: 0.9375rem;
}

.awards {
  list-style: none;
}

.langs div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
  border-bottom: 1px solid var(--rule);
}

.langs div:first-child {
  padding-top: 0;
}

.langs div:last-child {
  border-bottom: 0;
}

.langs dd {
  color: var(--muted);
  text-align: end;
  white-space: nowrap;
}

@media (max-width: 899px) {
  .resume {
    grid-template-columns: minmax(0, 1fr);
  }

  .aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 44px 40px;
    padding-top: 48px;
    padding-inline-start: 0;
    border-top: 1px solid var(--rule);
    border-inline-start: 0;
  }
}

@media (max-width: 559px) {
  .aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-head,
  .role-head {
    flex-direction: column;
  }
}

/* The timeline line on the left of the jobs. */

.jobs-wrap {
  position: relative;
  padding-inline-start: 28px;
}

.jobs-line {
  position: absolute;
  top: 6px;
  bottom: 6px;
  inset-inline-start: 0;
  width: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--rule);
}

.jobs-progress {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: top center;
}

/* Contact (dark): the monogram draws itself, then the big email. */

.contact {
  padding-block: clamp(96px, 12vw, 180px) clamp(80px, 9vw, 140px);
}

.contact-mark {
  width: clamp(72px, 9vw, 120px);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-title {
  margin-top: 32px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.contact-email {
  display: inline-block;
  max-width: 100%;
  margin-top: 10px;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.75rem, 0.6rem + 5.2vw, 6.25rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
  text-decoration: none;
  direction: ltr;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0% 0.06em no-repeat;
  transition: background-size 0.5s var(--ease-out), color 0.3s ease;
}

.contact-email:hover {
  color: var(--accent);
  background-size: 100% 0.06em;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  list-style: none;
}

/* Direct phone and WhatsApp links in the contact section. */
.contact-phones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin-top: 28px;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.contact-phones li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-phones a {
  color: var(--text-2);
  text-decoration: none;
  direction: ltr;
}

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

.contact-phones .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Footer */

.site-footer {
  padding-block: 28px 36px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

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

/* No-JS fallback */

.nojs {
  padding-block: 64px;
}

.nojs h1 {
  font-size: 2.5rem;
}

.nojs p {
  margin-top: 12px;
}

/* 404 */

.notfound {
  display: grid;
  min-height: 70vh;
  align-content: center;
  padding-block: 80px;
}

.notfound h1 {
  margin-top: 20px;
  font-weight: 700;
  font-size: clamp(2.25rem, 1.5rem + 4vw, 3.75rem);
  letter-spacing: -0.04em;
}

.notfound p {
  max-width: 48ch;
  margin-top: 16px;
  color: var(--text-2);
}

/* Intro loader: the night the deck is dealt on, shown only on a first visit (see index.html).
   The hero frame sits above it during the entrance (.has-intro .hero-frame). */

.loader {
  display: none;
}

.has-intro .loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: block;
  background: var(--d-bg);
  color: var(--d-text);
}

.loader-bar {
  display: flex;
  align-items: center;
  height: 72px;
}

.loader-name {
  color: var(--d-muted);
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.loader-progress {
  position: absolute;
  top: clamp(80px, 11vh, 120px);
  inset-inline-end: var(--gutter);
  text-align: end;
}

.loader-count {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.08em;
  color: var(--d-accent);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(3.5rem, 1.5rem + 7vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.loader-pct {
  margin-top: 0.1em;
  font-size: 0.26em;
  letter-spacing: 0;
}

.loader-label {
  margin-top: 12px;
  color: var(--d-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loader-skip {
  position: absolute;
  bottom: 24px;
  inset-inline-start: var(--gutter);
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--d-rule);
  border-radius: 999px;
  background: var(--d-bg);
  color: var(--d-text-2);
  font: 600 0.875rem/1 var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.loader-skip:hover {
  border-color: var(--d-muted);
  color: var(--d-text);
}

.loader-skip:focus-visible {
  outline-color: var(--d-accent);
}

/* Custom cursor (mouse + motion only; motion.js adds .has-cursor). */

.cursor {
  display: none;
}

.has-cursor .cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 700;
  display: block;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.has-cursor,
.has-cursor * {
  cursor: none !important;
}

.cursor.is-hidden {
  opacity: 0;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
  transition: opacity 0.2s ease;
}

.cursor-ring {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid color-mix(in srgb, var(--text) 55%, transparent);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), margin 0.3s var(--ease-out),
    background-color 0.3s ease, border-color 0.3s ease;
}

.cursor.is-link .cursor-ring {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.cursor.is-label .cursor-ring {
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border-color: var(--accent);
  background: var(--accent);
}

.cursor-label {
  color: var(--on-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cursor.is-label .cursor-label {
  opacity: 1;
}

.cursor.is-label .cursor-dot {
  opacity: 0;
}

/* Fullscreen Lightbox for inspecting multi-screen project interfaces. */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 580;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(16px, 3vw, 32px);
  background: var(--lb-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #f8fafc;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.lightbox-title {
  color: #ffffff;
  font-family: var(--font-head);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.35rem);
  font-weight: 700;
}

.lightbox-count {
  color: var(--lb-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  direction: ltr;
}

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

.lightbox-visit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  direction: ltr;
}

.lightbox-visit:hover {
  border-color: var(--lb-hover);
  color: var(--lb-hover);
}

.lightbox-icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lightbox-icon-btn:hover {
  background: var(--lb-btn-hover);
  border-color: var(--lb-hover);
}

.lightbox-icon-btn .icon {
  width: 20px;
  height: 20px;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin-block: 16px;
  direction: ltr;
}

.lightbox-img {
  max-width: min(90vw, 1320px);
  max-height: 74vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: clamp(4px, 1.5vw, 24px);
}

.lightbox-next {
  right: clamp(4px, 1.5vw, 24px);
}

.lightbox-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.lightbox-caption {
  max-width: 68ch;
  color: #cbd5e1;
  font-size: 0.9375rem;
}

.lightbox-dots {
  display: flex;
  gap: 8px;
  direction: ltr;
}

.lightbox-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 0.25s var(--ease-out), background-color 0.2s ease;
}

.lightbox-dots button.is-active {
  width: 28px;
  background: var(--lb-accent);
}
