/* ==========================================================================
   Hala Hendi Hassan — personal site
   Tokens → base → layout → components → sections → states
   ========================================================================== */

:root {
  --porcelain: #FFF8F6;
  --blush: #FBE6E8;
  --petal: #F3C3CB;
  --rose: #C76B80;
  --rose-deep: #9C4259;
  --rosewood: #3F1B27;
  --gold-1: #E9C6B4;
  --gold-2: #B07A66;

  --bg: var(--porcelain);
  --ink: var(--rosewood);
  --ink-soft: #6B4450;
  --accent: var(--rose-deep);
  --line: rgba(63, 27, 39, .16);
  --glass: rgba(255, 250, 249, .62);
  --glass-strong: rgba(255, 249, 247, .86);
  --glass-edge: rgba(255, 255, 255, .9);
  --shadow: 0 30px 60px -30px rgba(120, 50, 70, .35);
  --on-solid: #FFF8F6;
  --solid: var(--rosewood);
  --field: rgba(255, 255, 255, .7);
  --danger: #A3243B;

  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Jost", "Segoe UI", system-ui, sans-serif;
  --font-latin-display: "Bodoni Moda", "Didot", "Times New Roman", serif;

  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --lh: 1.6;
}

[data-theme="dark"] {
  --bg: #1B0D13;
  --ink: #FCEBEC;
  --ink-soft: #DDBFC6;
  --accent: #F2AEBC;
  --line: rgba(255, 235, 238, .18);
  --glass: rgba(52, 24, 34, .58);
  --glass-strong: rgba(40, 18, 27, .86);
  --glass-edge: rgba(255, 220, 228, .22);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
  --on-solid: #2A121B;
  --solid: #FBE6E8;
  --field: rgba(255, 255, 255, .06);
  --danger: #FF9DAE;
}

[lang="ar"] {
  --font-display: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --lh: 1.85;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
html:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
  line-height: var(--lh);
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[lang="ar"] body { font-size: clamp(1.06rem, 1rem + .3vw, 1.22rem); letter-spacing: 0; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.latin { font-family: var(--font-latin-display); direction: ltr; unicode-bidi: isolate; }

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

.skip {
  position: fixed; inset-block-start: 12px; inset-inline-start: 12px; z-index: 200;
  padding: 12px 18px; background: var(--solid); color: var(--on-solid); border-radius: 999px;
  text-decoration: none; transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; }

/* ---------- scene + fallback ---------- */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100%; height: 100vh; height: 100lvh; z-index: 0;
  display: block; opacity: 0; transition: opacity 1.2s ease;
}
.webgl #scene { opacity: 1; }

.fallback-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(60vmax 50vmax at 85% 10%, #FBD3D9 0%, transparent 60%),
    radial-gradient(50vmax 50vmax at 5% 90%, #F9DDD5 0%, transparent 60%),
    linear-gradient(180deg, #FFF8F6, #FCE9EA);
}
[data-theme="dark"] .fallback-bg {
  background:
    radial-gradient(60vmax 50vmax at 85% 10%, #4A1F2E 0%, transparent 60%),
    radial-gradient(50vmax 50vmax at 5% 90%, #3A1A22 0%, transparent 60%),
    linear-gradient(180deg, #1B0D13, #241018);
}
.fallback-bg i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(243,195,203,.35) 55%, rgba(199,107,128,.18));
  box-shadow: inset 0 0 30px rgba(255,255,255,.6), 0 30px 60px -20px rgba(160,70,95,.3);
}
[data-theme="dark"] .fallback-bg i { opacity: .35; }
.fallback-bg i:nth-child(1) { width: 22vmax; height: 22vmax; inset-block-start: 8%; inset-inline-end: -6vmax; }
.fallback-bg i:nth-child(2) { width: 9vmax; height: 9vmax; inset-block-end: 14%; inset-inline-start: 6%; }
.fallback-bg i:nth-child(3) { width: 5vmax; height: 5vmax; inset-block-start: 42%; inset-inline-start: 46%; }
.webgl .fallback-bg { display: none; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: linear-gradient(160deg, #FFF8F6, #FBE1E4);
  transition: opacity .9s ease, visibility 0s linear .9s;
}
[data-theme="dark"] .loader { background: linear-gradient(160deg, #1B0D13, #2B121C); }
html:not(.js) .loader, .is-ready .loader { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__inner { display: grid; gap: 18px; justify-items: center; }
.loader__mark { font-size: 2.6rem; font-style: italic; letter-spacing: .04em; color: var(--ink); }
.loader__bar { width: 120px; height: 1px; background: var(--line); overflow: hidden; }
.loader__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: load 1.6s var(--ease) infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.progress { position: fixed; inset-block-start: 0; inset-inline: 0; height: 2px; z-index: 120; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--rose)); transform: scaleX(0); transform-origin: left; }
[dir="rtl"] .progress i { transform-origin: right; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  transition: background .4s, backdrop-filter .4s, box-shadow .4s, transform .5s var(--ease);
}
.nav.is-stuck {
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.nav__mono {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); font-style: italic; font-size: 1.05rem;
  background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.nav__name { font-size: 1.05rem; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; }
.nav.is-stuck .nav__name { opacity: 1; transform: none; }

.nav__links { display: flex; gap: clamp(14px, 2.2vw, 34px); }
.nav__links a {
  position: relative; text-decoration: none; font-size: .98rem; padding: 12px 2px; color: var(--ink);
}
.nav__links a::after {
  content: ""; position: absolute; inset-inline: 2px; inset-block-end: 8px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
[dir="rtl"] .nav__links a::after { transform-origin: right; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }

.nav__tools { display: flex; align-items: center; gap: 8px; }
.tool {
  min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: inline-grid; place-items: center; font-size: .95rem; transition: background .3s, border-color .3s;
}
.tool:hover { border-color: var(--accent); }
.tool--icon { padding: 0; width: 44px; }
#langToggle[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif; }
#langToggle[lang="en"] { font-family: "Jost", sans-serif; }
[data-theme="light"] .i-sun, [data-theme="dark"] .i-moon { display: none; }
.nav__menu { display: none; }
.nav__menu path { transition: transform .4s var(--ease); transform-origin: 12px 12px; }
.nav__menu[aria-expanded="true"] .m1 { transform: translateY(3.5px) rotate(45deg); }
.nav__menu[aria-expanded="true"] .m2 { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav__menu { display: inline-grid; }
  .nav__name { display: none; }
  .nav__links {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 4px;
    padding: 96px var(--gutter) 48px;
    background: var(--glass-strong); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
    opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s linear .4s;
  }
  .nav__links a { font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3rem); line-height: 1.25; padding: 8px 0; }
  .nav__links a::after { display: none; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transition-delay: 0s; }
}

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; font-weight: 500; font-size: 1rem; line-height: 1.2; text-align: center;
  transition: background .35s, color .35s, border-color .35s, box-shadow .35s, transform .2s;
  will-change: transform;
}
.btn--solid { background: var(--solid); color: var(--on-solid); box-shadow: 0 16px 30px -16px rgba(63, 27, 39, .6); }
.btn--solid:hover { background: var(--accent); color: var(--bg); }
.btn--ghost {
  border-color: var(--line); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn--ghost:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }

/* ---------- layout ---------- */
main, .footer { position: relative; z-index: 1; }
.wrap { width: min(1280px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(80px, 13vh, 150px); }

.h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 4.2rem); line-height: 1.08; letter-spacing: -.01em;
  margin-block-end: clamp(32px, 6vh, 64px); text-wrap: balance;
}
.h2--xl { font-size: clamp(2.6rem, 1.4rem + 5vw, 5.8rem); font-style: italic; }
[lang="ar"] .h2 { line-height: 1.35; letter-spacing: 0; font-weight: 700; }
[lang="ar"] .h2--xl { font-style: normal; }
.h3 { font-family: var(--font-body); font-weight: 500; font-size: 1rem; color: var(--accent); }

.panel {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 28px;
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--shadow);
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: center;
  padding: 110px var(--gutter) 150px;
}
.hero__copy { position: relative; z-index: 2; max-width: min(62ch, 58vw); }
.hero__name {
  font-weight: 400; line-height: .92; letter-spacing: -.025em;
  font-size: clamp(3.4rem, 9.6vw, 10.5rem);
  margin-block-end: clamp(20px, 3.5vh, 40px);
  text-align: start;
}
[dir="rtl"] .hero__name { text-align: end; }
.line { display: block; overflow: hidden; padding-block: .06em .12em; margin-block: -.06em -.12em; }
.line--it { font-style: italic; font-size: .64em; letter-spacing: -.01em; padding-inline: .04em; }
.line__in { display: inline-block; will-change: transform; }
.js .line__in { transform: translateY(115%); }
.is-ready .line__in { transform: none; transition: transform 1.3s var(--ease) .15s; }
.is-ready .line--it .line__in { transition-delay: .3s; }

.hero__role { font-size: clamp(1.1rem, 1rem + .6vw, 1.5rem); line-height: 1.45; max-width: 30ch; color: var(--ink); }
[lang="ar"] .hero__role { line-height: 1.8; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: clamp(24px, 4vh, 40px); }
.js .hero__role, .js .hero__cta, .js .hero__facts { opacity: 0; transform: translateY(14px); }
.is-ready .hero__role, .is-ready .hero__cta, .is-ready .hero__facts { opacity: 1; transform: none; transition: opacity 1s ease .7s, transform 1s var(--ease) .7s; }
.is-ready .hero__cta { transition-delay: .85s; }
.is-ready .hero__facts { transition-delay: 1s; }

.hero__slot {
  position: absolute; z-index: 1; inset-block-end: 58px; inset-inline-end: clamp(8px, 4vw, 80px);
  height: min(88svh, 60vw); aspect-ratio: 972 / 1280; pointer-events: none;
}
.hero__slot img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.webgl .hero__slot img { opacity: 0; }

.hero__facts {
  position: absolute; z-index: 3; inset-inline: var(--gutter); inset-block-end: 24px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 22px;
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: var(--shadow);
}
.hero__facts > div { padding: 16px clamp(16px, 2.4vw, 32px); border-inline-start: 1px solid var(--line); }
.hero__facts > div:first-child { border-inline-start: 0; }
.hero__facts dt { font-size: .88rem; color: var(--accent); font-weight: 500; }
.hero__facts dd { font-family: var(--font-display); font-size: clamp(1.05rem, .9rem + .7vw, 1.5rem); line-height: 1.3; }

@media (max-width: 900px) {
  .hero { display: block; padding: 104px var(--gutter) 28px; min-height: 0; }
  .hero__copy { max-width: none; }
  .hero__name { font-size: clamp(3.6rem, 19vw, 7rem); }
  .hero__slot {
    position: relative; inset: auto; height: auto; width: min(92vw, 62svh); margin: 20px auto -46px;
  }
  .hero__facts { position: relative; inset: auto; grid-template-columns: 1fr; }
  .hero__facts > div { border-inline-start: 0; border-block-start: 1px solid var(--line); padding: 12px 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
  .hero__facts > div:first-child { border-block-start: 0; }
  .hero__facts dd { text-align: end; }
}

/* ---------- profile ---------- */
.profile__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.profile__grid .h2 { grid-column: 1 / -1; }
.profile__text { grid-column: 1 / span 7; }
.lead {
  font-family: var(--font-display); font-size: clamp(1.6rem, 1.1rem + 2.2vw, 3rem); line-height: 1.22;
  margin-block-end: clamp(28px, 5vh, 48px); text-wrap: pretty;
}
[lang="ar"] .lead { line-height: 1.6; }
.lead .w { transition: opacity .5s ease; }
.js .lead.is-split .w { opacity: .18; }
.js .lead.is-split .w.on { opacity: 1; }
.profile__text > p:not(.lead) { max-width: 62ch; color: var(--ink-soft); margin-block-end: 1em; }
.seeking { grid-column: 1 / span 7; margin-block-start: clamp(32px, 6vh, 56px); padding: clamp(24px, 3vw, 40px); }
.seeking__list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-block: 14px 18px; }
.seeking__list li {
  font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 1vw, 1.8rem); line-height: 1.3;
  padding-block: 14px; border-block-end: 1px solid var(--line);
}
.seeking__note { color: var(--ink-soft); }
@media (max-width: 900px) {
  .profile__text, .seeking { grid-column: 1 / -1; }
  .seeking__list { grid-template-columns: 1fr; }
}

/* ---------- competencies ---------- */
.comp__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 40px; margin-block-end: clamp(28px, 5vh, 48px); }
.comp__head .h2 { margin: 0; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .3s, color .3s, border-color .3s;
}
.chip:hover { border-color: var(--accent); }
.chip.is-on { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }

.comp__list {
  display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(20px, 3vw, 48px);
  border-block-start: 1px solid var(--line);
}
.comp__list li {
  position: relative; padding-block: 18px; padding-inline-start: 26px;
  border-block-end: 1px solid var(--line);
  font-family: var(--font-display); font-size: clamp(1.1rem, .95rem + .7vw, 1.5rem); line-height: 1.3;
  transition: opacity .45s ease, color .45s ease;
}
[lang="ar"] .comp__list li { line-height: 1.6; }
.comp__list li::before {
  content: ""; position: absolute; inset-inline-start: 2px; inset-block-start: calc(18px + .5em);
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--petal) 55%, var(--rose));
  box-shadow: 0 0 0 1px rgba(199, 107, 128, .35);
  transition: transform .45s var(--ease);
}
.comp__list li.is-dim { opacity: .28; }
.comp__list li.is-dim::before { transform: scale(.5); }
.comp__count { margin-block-start: 18px; color: var(--ink-soft); font-size: .95rem; min-height: 1.6em; }
@media (max-width: 1000px) { .comp__list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .comp__list { grid-template-columns: 1fr; } }

/* ---------- experience ---------- */
.exp__list { border-block-start: 1px solid var(--line); max-width: 980px; }
.role { border-block-end: 1px solid var(--line); }
.role__h { font-weight: 400; font-size: inherit; }
.role__btn { font-weight: 400; }
.role__btn {
  display: grid; grid-template-columns: 13.5em 1fr 44px; align-items: start; gap: 6px 24px;
  width: 100%; padding: clamp(22px, 3.4vh, 34px) 0; background: none; border: 0; text-align: start;
}
.role__when { grid-row: 1 / span 2; color: var(--accent); font-weight: 500; font-size: .98rem; padding-block-start: .5em; }
.role__title { font-family: var(--font-display); font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.15; transition: color .3s; }
[lang="ar"] .role__title { line-height: 1.5; }
.role__org { grid-column: 2; color: var(--ink-soft); }
.role__btn:hover .role__title { color: var(--accent); }
.role__icon {
  grid-column: 3; grid-row: 1 / span 2; align-self: center; justify-self: end; position: relative;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--glass); transition: background .3s, border-color .3s, transform .5s var(--ease);
}
.role__icon::before, .role__icon::after {
  content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%; width: 14px; height: 1.5px;
  background: currentColor; transform: translate(-50%, -50%); transition: transform .5s var(--ease);
}
[dir="rtl"] .role__icon::before, [dir="rtl"] .role__icon::after { transform: translate(50%, -50%); }
.role__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
[dir="rtl"] .role__icon::after { transform: translate(50%, -50%) rotate(90deg); }
.role.is-open .role__icon { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.role.is-open .role__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
[dir="rtl"] .role.is-open .role__icon::after { transform: translate(50%, -50%) rotate(0deg); }

.role__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease), visibility 0s linear .6s; visibility: hidden; }
.role__panel > div { overflow: hidden; }
.role.is-open .role__panel { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.role__panel ul { padding-block-end: clamp(22px, 3.4vh, 34px); padding-inline-start: calc(13.5em + 24px); max-width: 100%; display: grid; gap: 10px; }
.role__panel li { position: relative; padding-inline-start: 22px; color: var(--ink-soft); max-width: 62ch; }
.role__panel li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: .8em; width: 10px; height: 1px; background: var(--gold-2); }
html:not(.js) .role__panel { grid-template-rows: 1fr; visibility: visible; }
@media (max-width: 760px) {
  .role__btn { grid-template-columns: 1fr 44px; }
  .role__when { grid-row: auto; grid-column: 1; padding: 0; }
  .role__title, .role__org { grid-column: 1; }
  .role__icon { grid-column: 2; grid-row: 1 / span 3; }
  .role__panel ul { padding-inline-start: 0; }
}

/* ---------- credentials ---------- */
.degree {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(20px, 4vw, 56px);
  padding-block: clamp(24px, 4vh, 40px); border-block: 1px solid var(--line);
}
.degree__year {
  font-size: clamp(3.4rem, 2rem + 8vw, 9rem); line-height: .9; font-style: italic; letter-spacing: -.03em;
  background: linear-gradient(120deg, var(--gold-2), var(--rose) 55%, var(--gold-1));
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-inline-end: .08em;
}
.degree__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 1.1rem + 2.2vw, 3rem); line-height: 1.15; }
[lang="ar"] .degree__title { line-height: 1.5; font-weight: 700; }
.degree__org { color: var(--ink-soft); margin-block-start: 8px; max-width: 48ch; }
@media (max-width: 620px) { .degree { grid-template-columns: 1fr; } }

.cred__sub { margin-block: clamp(40px, 7vh, 72px) 20px; }
.certs { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 22px); perspective: 1200px; }
.cert {
  position: relative; display: flex; flex-direction: column; min-height: 250px; padding: 24px;
  border-radius: 24px; border: 1px solid var(--glass-edge); background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--shadow); overflow: hidden; transform-style: preserve-3d;
  transition: transform .5s var(--ease), box-shadow .5s;
}
.cert::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .75), transparent 60%);
}
[data-theme="dark"] .cert::before { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 200, 215, .22), transparent 60%); }
.cert:hover::before { opacity: 1; }
.cert__when { color: var(--accent); font-weight: 500; font-size: .95rem; }
.cert__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 1rem + .9vw, 1.75rem); line-height: 1.2; margin-block: auto 10px; padding-block-start: 48px; }
[lang="ar"] .cert__title { line-height: 1.55; font-weight: 700; }
.cert__org { color: var(--ink-soft); font-size: .98rem; }
@media (max-width: 1100px) { .certs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .certs { grid-template-columns: 1fr; } .cert { min-height: 190px; } }

.langs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 40px; margin-block-start: clamp(40px, 7vh, 72px); padding-block-start: 24px; border-block-start: 1px solid var(--line); }
.langs dt { flex: 0 0 100%; }
.langs dd { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.2rem); }
.langs em { font-family: var(--font-body); font-style: normal; font-size: 1rem; color: var(--ink-soft); }

/* ---------- contact ---------- */
.contact__grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact__lede { color: var(--ink-soft); max-width: 44ch; }
.contact__direct { margin-block-start: clamp(28px, 5vh, 48px); border-block-start: 1px solid var(--line); }
.contact__direct li { display: grid; grid-template-columns: 7em 1fr; gap: 12px; align-items: baseline; padding-block: 14px; border-block-end: 1px solid var(--line); }
.contact__k { color: var(--accent); font-weight: 500; font-size: .95rem; }
.contact__direct a, .contact__direct li > span:last-child { font-family: var(--font-latin-display); font-size: clamp(1.15rem, 1rem + .7vw, 1.6rem); text-decoration: none; overflow-wrap: anywhere; }
[lang="ar"] .contact__direct li > span[data-i18n] { font-family: var(--font-display); }
.contact__direct a { background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .5s var(--ease); min-height: 44px; display: inline-flex; align-items: center; }
[dir="rtl"] .contact__direct a { background-position: 100% 100%; }
.contact__direct a:hover { background-size: 100% 1px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; padding: clamp(22px, 3vw, 40px); }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: .95rem; }
.field small { font-weight: 400; color: var(--ink-soft); font-size: .85rem; margin-inline-start: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--field); transition: border-color .25s, box-shadow .25s, background .25s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field select { appearance: none; -webkit-appearance: none; padding-inline-end: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%239C4259' stroke-width='1.5'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 12px; background-position: right 18px center; }
[dir="rtl"] .field select { background-position: left 18px center; }
[data-theme="dark"] .field select option { background: #2A121B; color: #FCEBEC; }
[data-theme="dark"] .field input, [data-theme="dark"] .field select { color-scheme: dark; }
/* date and time: the site's own label replaces Chrome's native field text */
.dt { position: relative; display: block; }
.dt input::-webkit-datetime-edit { opacity: 0; }
.dt input::-webkit-date-and-time-value { opacity: 0; }
/* the native indicator covers the whole field, so a click anywhere opens the picker */
.dt input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.dt::after {
  content: ""; position: absolute; inset-block-start: 50%; inset-inline-end: 17px; width: 18px; height: 18px; translate: 0 -50%;
  pointer-events: none; background: var(--accent);
  -webkit-mask: var(--dt-icon) center / contain no-repeat; mask: var(--dt-icon) center / contain no-repeat;
}
.dt--date { --dt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.dt--time { --dt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.dt__face {
  position: absolute; inset-block: 0; inset-inline: 17px 48px; display: flex; align-items: center;
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink);
}
.dt__face.is-empty { color: var(--ink-soft); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--rose); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: .9rem; min-height: 0; }
.err:empty { display: none; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 6px; }
.form__actions .btn { flex: 1 1 220px; }
.form__status { color: var(--ink-soft); font-size: .95rem; }
.form__status:empty { display: none; }
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .contact__direct li { grid-template-columns: 1fr; gap: 0; }
  .contact__direct a, .contact__direct li > span:last-child { font-size: 1.2rem; }
}

/* ---------- footer ---------- */
.footer { padding-block: 36px 44px; border-block-start: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.footer__in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 32px; color: var(--ink-soft); font-size: .95rem; }
.footer__name { font-size: 1.3rem; font-style: italic; color: var(--ink); }
.footer__top { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- scroll reveals (headings only) ---------- */
.js .h2[data-rise] { clip-path: inset(0 0 100% 0); transform: translateY(.35em); }
.js .h2[data-rise].in { clip-path: inset(-20% -5% -30% -5%); transform: none; transition: clip-path 1.1s var(--ease), transform 1.1s var(--ease); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto !important; }
  .js .lead.is-split .w { opacity: 1; }
  .js .h2[data-rise] { clip-path: none; transform: none; }
}

@media print {
  #scene, .fallback-bg, .loader, .nav, .progress, .form { display: none !important; }
  .hero__slot img { opacity: 1 !important; }
  .role__panel { grid-template-rows: 1fr !important; visibility: visible !important; }
  body { background: #fff; color: #000; }
}
