/* ============================================================
   Chrome: nav, footer, mode switch
   ============================================================ */

/* ---- Nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: transform 0.55s var(--ease), border-color 0.4s var(--ease), color 0.4s;
}
/* Frosted backdrop lives on a pseudo-element: backdrop-filter on the header itself
   would trap the fixed full-screen drawer inside the 76px bar. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  transition: opacity 0.4s var(--ease);
}
.nav--solid { border-bottom-color: var(--line); }
.nav--solid::before { opacity: 1; }
.nav--hidden { transform: translateY(-101%); }
.nav--open { border-bottom-color: transparent; }
.nav--open::before { opacity: 0; }
.nav__inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.nav__mark { color: var(--accent); display: inline-flex; transition: transform 0.6s var(--ease); }
.nav__brand:hover .nav__mark { transform: rotate(-90deg); }
.nav__name { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 300; font-size: 16px; white-space: nowrap; }
.nav__name b { font-weight: 400; }
.nav__name i { font-style: normal; font-weight: 200; color: var(--text-faint); }
.nav__role {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); padding-left: 14px; margin-left: 2px;
  border-left: 1px solid var(--line);
}
[dir="rtl"] .nav__role { border-left: none; border-right: 1px solid var(--line); padding-left: 0; padding-right: 14px; letter-spacing: 0; }
@media (max-width: 1100px) { .nav__role { display: none; } }

.nav__links {
  display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav__burger { display: none; flex-direction: column; gap: 6px; padding: 12px 6px; margin-inline-start: 4px; }
.nav__burger span { width: 24px; height: 1.5px; background: var(--text); transition: transform 0.45s var(--ease), opacity 0.35s var(--ease); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }
@media (max-width: 860px) { .nav__burger { display: flex; } }
.nav__link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; font-size: 13px; font-weight: 500; border-radius: 999px;
  color: var(--text-dim); position: relative; transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--line); }
.nav__link.is-active { color: var(--bg); background: var(--text); }
.nav__link.is-active .nav__idx { color: var(--bg); opacity: 0.55; }
.nav__idx { font-size: 9px; color: var(--accent); opacity: 0.9; }
@media (max-width: 860px) { .nav__links { display: none; } }

/* ---- Full-screen mobile menu ---- */
.nav__drawer {
  position: fixed; inset: 0; z-index: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: 112px; padding-bottom: 34px;
  background: var(--bg);
  clip-path: inset(0 0 100% 0); transition: clip-path 0.75s var(--ease-io);
  visibility: hidden;
}
.nav--open .nav__drawer { clip-path: inset(0 0 0 0); visibility: visible; }
.nav__drawer { transition: clip-path 0.75s var(--ease-io), visibility 0s linear 0.75s; }
.nav--open .nav__drawer { transition: clip-path 0.75s var(--ease-io), visibility 0s; }
.nav__dlinks { display: flex; flex-direction: column; }
.nav__dlink {
  display: flex; align-items: baseline; gap: 16px; text-align: start;
  padding: 8px 0; font-size: clamp(40px, 12vw, 72px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--text); border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(36px);
  transition: opacity 0.5s var(--ease), transform 0.8s var(--ease), color 0.3s;
}
.nav--open .nav__dlink { opacity: 1; transform: none; }
.nav__dlink .nav__idx { font-size: 11px; transform: translateY(-1.6em); }
.nav__dlink.is-active { color: var(--accent); }
.nav__dlink.is-active .nav__dtxt { font-weight: 100; }
[dir="rtl"] .nav__dlink.is-active .nav__dtxt { font-family: var(--arabic); font-style: normal; }
.nav__dfoot { display: flex; flex-direction: column; gap: 8px; font-size: 12px; letter-spacing: 0.04em; color: var(--text-dim); }
.nav__dfoot a { color: var(--accent); }
@media (min-width: 861px) { .nav__drawer { display: none; } }

.nav__right { display: flex; align-items: center; gap: 14px; }
.nav__contact { padding: 11px 20px; gap: 10px; }
.nav__contact .nav__pulse { background: #0c0c0d; animation: none; box-shadow: none; width: 6px; height: 6px; }
@media (max-width: 560px) { .nav__contact { display: none; } }

/* ---- Mode switch ---- */
.modeswitch { display: flex; align-items: center; gap: 4px; }
.ms__btn {
  display: inline-flex; align-items: center; gap: 5px; height: 38px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--text-faint); padding: 0 11px; border: 1px solid var(--line); border-radius: 999px;
  transition: all 0.3s var(--ease);
}
.ms__btn:hover { border-color: var(--line-strong); color: var(--text); }
.ms__on { color: var(--accent); }
.ms__sep { opacity: 0.4; }
.ms__theme { width: 38px; justify-content: center; padding: 0; }

/* ---- Footer ---- */
.footer { position: relative; z-index: 1; overflow: hidden; padding-top: clamp(90px, 12vw, 170px); padding-bottom: 28px; border-top: 1px solid var(--line); margin-top: 40px; background: var(--bg); }
.footer::before {
  content: ""; position: absolute; left: 50%; top: 0; width: min(900px, 90vw); height: 420px; transform: translate(-50%, -55%);
  background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none; opacity: 0.9;
}
.footer__cta { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; margin-bottom: clamp(64px, 8vw, 110px); }
@media (max-width: 820px) { .footer__cta { grid-template-columns: 1fr; gap: 44px; } }
.footer__title { font-size: clamp(48px, 8.4vw, 136px); font-weight: 300; letter-spacing: -0.035em; margin-top: 22px; margin-bottom: 18px; line-height: 0.95; }
.footer__tline { display: block; }
.footer__sub { font-size: clamp(15px, 1.3vw, 17px); max-width: 40ch; line-height: 1.6; }
.footer__mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 30px;
  font-size: clamp(18px, 2.2vw, 28px); font-weight: 300; letter-spacing: 0; color: var(--text);
  padding-bottom: 8px; position: relative;
}
.footer__mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-strong); }
.footer__mail::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); z-index: 1; }
.footer__mail:hover::before { transform: scaleX(1); }
.footer__mail:hover { color: var(--accent); }
.footer__mail .arrow { transition: transform 0.4s var(--ease); color: var(--accent); }
.footer__mail:hover .arrow { transform: translate(3px, -3px); }
[dir="rtl"] .footer__mail { direction: ltr; }

.footer__badge { position: relative; width: clamp(150px, 15vw, 220px); aspect-ratio: 1; display: grid; place-items: center; justify-self: end; }
@media (max-width: 820px) { .footer__badge { justify-self: start; } }
.footer__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; overflow: visible; }
.footer__ring text { font-family: var(--mono); font-size: 11px; text-transform: uppercase; fill: var(--text-dim); }
[dir="rtl"] .footer__ring text { font-family: var(--arabic); font-size: 13px; }
.footer__badgecore {
  width: 64%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-weight: 400; font-size: 16px; letter-spacing: 0;
  transition: transform 0.6s var(--ease), background 0.4s;
}
.footer__badge:hover .footer__badgecore { transform: scale(1.1); background: var(--text); color: var(--bg); }
.footer__badgearrow { font-size: 22px; transition: transform 0.5s var(--ease); }
.footer__badge:hover .footer__badgearrow { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .footer__ring { animation: none; } }

.footer__cols { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-block: 44px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .footer__cols { grid-template-columns: 1fr 1fr; } .footer__col:last-child { grid-column: 1 / -1; } }
.footer__h { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; font-weight: 400; }
[dir="rtl"] .footer__h { letter-spacing: 0.04em; font-family: var(--arabic); }
.footer__link { display: block; width: fit-content; font-size: 15px; color: var(--text-dim); padding: 5px 0; text-align: start; transition: color 0.3s var(--ease), transform 0.4s var(--ease); }
.footer__link:hover { color: var(--text); transform: translateX(4px); }
[dir="rtl"] .footer__link:hover { transform: translateX(-4px); }
.footer__static:hover { color: var(--text-dim); transform: none; }
.footer__static.mono { font-size: 13px; }
.footer__avail { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text); }

.footer__giant {
  position: relative; direction: ltr;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: clamp(30px, 12.2vw, 230px); font-weight: 200; line-height: 0.9; letter-spacing: -0.05em; white-space: nowrap;
  padding-block: clamp(16px, 2.6vw, 36px) clamp(26px, 3.4vw, 48px);
  background: linear-gradient(180deg, var(--text) 25%, color-mix(in srgb, var(--text) 10%, transparent) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  user-select: none;
}
.footer__giant em { font-style: normal; font-weight: 100; padding-inline: 0.08em; }

.footer__base { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.footer__admin, .footer__top { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); transition: color 0.3s var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.footer__admin:hover, .footer__top:hover { color: var(--accent); }
.footer__admin::before { content: ""; width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; opacity: 0.6; }

/* ---- Page transition ---- */
.page { animation: pageIn 0.9s var(--ease) both; position: relative; z-index: 1; }
@keyframes pageIn {
  from { transform: translateY(24px); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

main { padding-top: 76px; }
main.main--bleed { padding-top: 0; }
.footer__ring text { direction: ltr; }
[dir="rtl"] .footer__base, [dir="rtl"] .footer__admin, [dir="rtl"] .footer__top,
[dir="rtl"] .footer__avail, [dir="rtl"] .nav__dfoot { letter-spacing: 0; font-family: var(--arabic); }
[dir="rtl"] .footer__base { text-transform: none; }
@media (max-width: 480px) {
  .nav__name b, .nav__name i { display: none; }
  .nav__right { gap: 8px; }
  .modeswitch .ms__btn { padding: 0 9px; }
}
