/* Performance: opacity/shadow CSS; shake = Web Animations API */

/* ===== Contact card: glow + JS Web Animations API shake (not CSS transform fight) ===== */
#hero-biz-card-root {
  width: min(280px, 72vw);
  margin-inline-start: auto;
  position: relative;
  z-index: 40;
  overflow: visible;
  pointer-events: auto;
}
html[dir="rtl"] #hero-biz-card-root {
  margin-inline-start: 0;
  margin-inline-end: auto;
}

.fm-biz-card {
  width: 100%;
  border-radius: 18px;
  position: relative;
  z-index: 40;
  pointer-events: auto;
  /* opacity-only entrance — never locks transform */
  animation: fmCardIn 0.4s ease both;
}
@keyframes fmCardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fm-biz-card__shake {
  width: 100%;
  border-radius: 18px;
  display: block;
  /* WAAPI will set transform; keep compositor layer ready */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.fm-biz-card__face {
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(96, 73, 110, 0.35) 0%, rgba(24, 1, 31, 0.85) 45%, rgba(0, 0, 0, 0.92) 100%);
  box-shadow:
    0 10px 40px rgba(182, 0, 168, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: start;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
html[dir="rtl"] .fm-biz-card__face {
  text-align: start;
  font-family: "Cairo", "Kanit", system-ui, sans-serif;
}
html[dir="rtl"] .fm-biz-card__label {
  letter-spacing: 0.06em;
  text-transform: none;
}
html[dir="rtl"] .fm-biz-card__name {
  letter-spacing: 0;
  text-transform: none;
}
.fm-biz-card.is-shaking .fm-biz-card__face,
.fm-biz-card:hover .fm-biz-card__face {
  border-color: rgba(233, 179, 255, 0.65);
  box-shadow:
    0 14px 44px rgba(182, 0, 168, 0.4),
    0 0 0 1px rgba(182, 0, 168, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.fm-biz-card__label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(215, 226, 234, 0.55);
  margin-bottom: 6px;
}
.fm-biz-card__name {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
  background: linear-gradient(90deg, #fff 0%, #e9b3ff 50%, #ffc9a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fm-biz-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: clamp(0.72rem, 1.1vw, 0.85rem);
  color: #d7e2ea;
  text-decoration: none;
  min-height: 28px;
  position: relative;
  z-index: 5;
}
.fm-biz-card__row:hover { opacity: 0.85; }
.fm-biz-card__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.75;
}
.fm-biz-card__hint,
.fm-biz-card__face--back,
.fm-biz-card__flip,
.fm-biz-card__status { display: none !important; }

/* Meet Me = same width as contact card */
#contact {
  position: relative;
  z-index: 40 !important;
  pointer-events: auto !important;
  overflow: visible !important;
  align-items: stretch !important;
  width: min(280px, 72vw);
  margin-left: auto;
}
#contact > a,
#contact a[href="#meet-me"],
#contact a.fm-meet-btn {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  align-self: stretch !important;
  padding: 0.85rem 1.5rem !important;
  min-height: 48px !important;
  white-space: nowrap;
}

/* ===== Role line: same as before, slightly cleaner wrap ===== */
.fm-role-line {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15em 0.1em;
  max-width: min(280px, 42vw) !important;
  position: relative;
  z-index: 15;
  pointer-events: auto !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  font-weight: 300 !important;
  line-height: 1.45 !important;
  font-size: clamp(0.75rem, 1.4vw, 1.5rem) !important;
}
.fm-role-kicker,
.fm-role-grid,
.fm-role-num {
  display: none !important;
}
.fm-role-chip {
  display: inline;
  color: #d7e2ea;
  cursor: default;
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  min-height: 0;
  transform: translate3d(0, 0, 0);
  transition:
    color 0.2s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 0.25s ease;
}
.fm-role-text {
  all: unset;
}
.fm-role-chip:hover {
  color: var(--role-c, #e9b3ff);
  transform: translate3d(0, -3px, 0);
  text-shadow: 0 0 14px color-mix(in srgb, var(--role-c, #e9b3ff) 45%, transparent);
  border: none;
  background: none;
  box-shadow: none;
}
.fm-role-dot {
  display: inline !important;
  opacity: 0.45;
  user-select: none;
  pointer-events: none;
  padding: 0 0.05em;
}

/* ===== Nav: BIG click targets + line highlight ===== */
nav {
  position: relative;
  z-index: 50 !important;
  pointer-events: auto !important;
}
nav a.fm-nav-link,
.fm-nav-link {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  /* large hit box */
  min-height: 44px;
  padding: 10px 14px !important;
  margin: 0 2px;
  text-decoration: none !important;
  opacity: 1 !important;
  color: #d7e2ea;
  transition: color 0.2s ease;
  z-index: 50;
  pointer-events: auto !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fm-nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #b600a8, #be4c00, #e9b3ff);
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.fm-nav-link::before {
  content: "";
  position: absolute;
  inset: 4px 2px;
  border-radius: 999px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: -1;
}
.fm-nav-link:hover,
.fm-nav-link:focus-visible {
  color: #fff !important;
  outline: none;
}
.fm-nav-link:hover::after,
.fm-nav-link:focus-visible::after {
  transform: scaleX(1);
  animation: fmNavLine 1.1s linear infinite;
}
.fm-nav-link:hover::before,
.fm-nav-link:focus-visible::before {
  border-color: rgba(233, 179, 255, 0.5);
  background: rgba(182, 0, 168, 0.14);
  box-shadow: 0 0 18px rgba(182, 0, 168, 0.28);
}
@keyframes fmNavLine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
nav a.fm-nav-link:nth-child(1):hover::after { background: linear-gradient(90deg, #e9b3ff, #b600a8); }
nav a.fm-nav-link:nth-child(2):hover::after { background: linear-gradient(90deg, #7dd3fc, #2563eb); }
nav a.fm-nav-link:nth-child(3):hover::after { background: linear-gradient(90deg, #fdba74, #be4c00); }
nav a.fm-nav-link:nth-child(4):hover::after { background: linear-gradient(90deg, #6ee7b7, #059669); }

/* Hero video must not steal clicks from nav/card */
section .pointer-events-none {
  /* keep as is for video wrapper */
}
/* Contact column clickable; on phone face is above it (see lang-toggle.css) */
#contact {
  position: relative;
  z-index: 30 !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
@media (max-width: 639.98px) {
  /* Do not float contact over the face on phones */
  #contact {
    z-index: 20 !important;
  }
  section.fm-hero .pointer-events-none.fm-hero-media {
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fm-biz-card:hover { animation: none; }
  .fm-role-chip:hover { transform: none; }
  .fm-nav-link:hover::after { animation: none; }
  .fm-biz-card:hover .fm-biz-card__face--front { opacity: 1; transform: none; }
  .fm-biz-card:hover .fm-biz-card__face--back { opacity: 0; }
}

/* ----- Modal: fast path ----- */
.fm-meet-root[hidden] { display: none !important; }
.fm-meet-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 1rem;
  contain: layout style;
  /* isolate from page paint */
  isolation: isolate;
}
.fm-meet-backdrop {
  position: absolute;
  inset: 0;
  /* NO backdrop-filter — that was freezing the page */
  background: rgba(0, 0, 0, 0.82);
  animation: fmFade 0.18s ease both;
}
@keyframes fmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fm-meet-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0c0c10;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  color: #d7e2ea;
  animation: fmPop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  contain: content;
  transform: translateZ(0);
}
@keyframes fmPop {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.fm-meet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem 1rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  /* solid bg only — no blur */
  background: #0c0c10;
  z-index: 2;
}
.fm-meet-head__text {
  min-width: 0;
  flex: 1;
}
.fm-meet-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #f4f6f8;
  line-height: 1.15;
}
.fm-meet-meta {
  margin: 0.45rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  font-size: 0.78rem;
  color: rgba(215, 226, 234, 0.58);
  line-height: 1.35;
}
.fm-meet-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(215, 226, 234, 0.28);
  flex-shrink: 0;
}
.fm-meet-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 246, 248, 0.82);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.fm-meet-pill--accent {
  border-color: rgba(233, 179, 255, 0.35);
  background: rgba(182, 0, 168, 0.14);
  color: #e9b3ff;
}
/* Close X — optical center, SVG, no text baseline drift */
.fm-meet-close {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(244, 246, 248, 0.78);
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  touch-action: manipulation;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.fm-meet-close svg {
  display: block;
  width: 15px;
  height: 15px;
  pointer-events: none;
}
.fm-meet-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.fm-meet-close:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.12);
}
.fm-meet-close:focus {
  outline: none;
}
.fm-meet-close:focus-visible {
  outline: 2px solid rgba(233, 179, 255, 0.7);
  outline-offset: 2px;
  border-color: rgba(233, 179, 255, 0.45);
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .fm-meet-close { transition: none; }
  .fm-meet-close:active { transform: none; }
}

.fm-meet-body { padding: 1rem 1.25rem 1.35rem; }
.fm-meet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 800px) {
  .fm-meet-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}

.fm-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1rem;
  contain: layout style;
}
.fm-card h3 {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ----- Calendar (shadcn / react-day-picker inspired) ----- */
.fm-cal {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  --cell-size: 2.35rem;
}
.fm-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.fm-cal-title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}
.fm-cal-navbtn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #d7e2ea;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.fm-cal-navbtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(233, 179, 255, 0.4);
}
.fm-cal-navbtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.fm-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.25rem;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(215, 226, 234, 0.45);
}
.fm-cal-weekdays span {
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.fm-cal-cell {
  width: 100%;
  aspect-ratio: 1;
  max-height: var(--cell-size);
  min-height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #d7e2ea;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  position: relative;
}
.fm-cal-pad {
  pointer-events: none;
  visibility: hidden;
}
.fm-cal-muted,
.fm-cal-cell:disabled {
  color: rgba(215, 226, 234, 0.28);
  cursor: not-allowed;
  opacity: 0.55;
}
.fm-cal-open:not(:disabled):hover {
  background: rgba(182, 0, 168, 0.18);
  color: #fff;
}
.fm-cal-open:not(:disabled)::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(233, 179, 255, 0.7);
}
.fm-cal-cell.active {
  background: linear-gradient(123deg, #18011f 7%, #b600a8 37%, #7621b0 72%, #be4c00 100%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 1;
}
.fm-cal-cell.active::after { display: none; }
.fm-cal-today:not(.active) {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
@media (min-width: 800px) {
  .fm-cal { --cell-size: 2.6rem; }
}

.fm-days, .fm-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.fm-slots {
  max-height: 220px;
  overflow: auto;
  content-visibility: auto;
}
.fm-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #d7e2ea;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.82rem;
  /* avoid layout thrash */
  touch-action: manipulation;
}
.fm-chip:hover { border-color: #b600a8; }
.fm-chip.active {
  background: linear-gradient(123deg, #18011f 7%, #b600a8 37%, #7621b0 72%, #be4c00 100%);
  border-color: transparent;
  outline: 2px solid #fff;
  outline-offset: -2px;
  color: #fff;
}
.fm-empty { color: rgba(215, 226, 234, 0.55); font-size: 0.88rem; }
.fm-picked {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: rgba(215, 226, 234, 0.7);
}

.fm-field { margin-bottom: 0.75rem; }
.fm-field label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.3rem;
}
.fm-field input, .fm-field textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #d7e2ea;
  padding: 0.7rem 0.85rem;
  font: inherit;
}
.fm-field input:focus, .fm-field textarea:focus {
  outline: 1px solid #b600a8;
  border-color: #b600a8;
}

.fm-submit {
  width: 100%;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(123deg, #18011f 7%, #b600a8 37%, #7621b0 72%, #be4c00 100%);
  box-shadow: 0 4px 4px rgba(181, 1, 167, 0.25), 4px 4px 12px #7721b1 inset;
  outline: 2px solid #fff;
  outline-offset: -3px;
  touch-action: manipulation;
}
.fm-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.fm-msg {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.fm-msg.ok { background: rgba(62, 205, 163, 0.12); border: 1px solid rgba(62, 205, 163, 0.35); }
.fm-msg.err { background: rgba(255, 80, 80, 0.1); border: 1px solid rgba(255, 80, 80, 0.35); }

/* Freeze page under modal — biggest lag fix */
body.fm-meet-open {
  overflow: hidden;
}
body.fm-meet-open #root,
body.fm-meet-open #app,
body.fm-meet-open body > div:not(.fm-meet-root) {
  /* pause expensive page work */
}
body.fm-meet-open #root {
  pointer-events: none !important;
  /* stop compositing hero video/motion while modal open */
  content-visibility: auto;
  contain: strict;
}
body.fm-meet-open video {
  /* pause via JS; also hide paint cost */
  visibility: hidden !important;
}
body.fm-meet-open .fm-biz-card { animation-play-state: paused !important; }
body.fm-meet-open .fm-biz-card__flip { transition: none; }


/* Contact card only — do NOT unclip whole hero section (causes right-side
   horizontal scroll gap on small screens when nav/decor overflow). */
#contact,
#contact.flex,
#hero-biz-card-root {
  overflow: visible !important;
}
#contact {
  transform: translateZ(0);
  z-index: 6;
}

/* Page never grows wider than viewport — edge-aware gutters */
html {
  overflow-x: clip;
  max-width: 100%;
}
body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}
#root {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}



/* Social rows (LinkedIn / X) — same row style, filled brand SVGs */
.fm-biz-card__row[aria-label="LinkedIn"] .fm-biz-card__icon,
.fm-biz-card__row[aria-label="X (Twitter)"] .fm-biz-card__icon {
  opacity: 0.9;
}

/* Contact card always visible — entrance animation must not stick at 0 */
#hero-biz-card-root {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-height: 1px;
}
.fm-biz-card {
  opacity: 1 !important;
  visibility: visible !important;
}
@media (prefers-reduced-motion: reduce) {
  .fm-biz-card { animation: none !important; }
}
