:root {
  --ink: #0c0c0c;
  --mist: #f4f4f6;
  --line: #e6e6eb;
  --muted: #6b6b76;
}

html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: #fff;
}

.fade-up { animation: fadeUp 0.8s ease both; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

#navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

/* ========== Interactive Magnetic Dynamic Navbar ========== */
.interactive-nav-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(245, 245, 247, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(230, 230, 235, 0.85);
  border-radius: 9999px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  user-select: none;
}

.nav-magnetic-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: 
    transform 0.35s cubic-bezier(0.2, 1, 0.3, 1),
    width 0.35s cubic-bezier(0.2, 1, 0.3, 1),
    left 0.35s cubic-bezier(0.2, 1, 0.3, 1),
    opacity 0.22s ease;
}
.nav-magnetic-indicator.is-visible {
  opacity: 1;
  transform: scale(1);
}

.nav-interactive-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #52525b;
  text-decoration: none;
  border-radius: 9999px;
  z-index: 2;
  transition: color 0.25s ease;
  will-change: transform;
}
.nav-interactive-link:hover {
  color: #0a0a0a;
}
.nav-interactive-link.is-active {
  color: #0a0a0a;
  font-weight: 700;
}

.nav-link-text {
  position: relative;
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
  will-change: transform;
}

.nav-active-dot {
  position: absolute;
  bottom: 2.5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: #0a0a0a;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: dotPulse 2s infinite ease-in-out;
}

@keyframes dotPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(1.4); opacity: 1; box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }
}

/* ========== Student Dashboard Sidebar Cyber-Luxe Interactive System ========== */
.dash-sidebar {
  position: relative;
  overflow: hidden;
}
.dash-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--dash-mouse-x, -500px) var(--dash-mouse-y, -500px), rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.dash-nav-container {
  position: relative;
  z-index: 2;
}

.dash-sidebar-glider {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 24px -4px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: scale(0.95);
  transition: 
    top 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}
.dash-sidebar-glider::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #38bdf8, #818cf8, #c084fc);
  box-shadow: 0 0 10px #818cf8, 0 0 18px rgba(129, 140, 248, 0.6);
}
[dir="rtl"] .dash-sidebar-glider::after { right: 4px; }
[dir="ltr"] .dash-sidebar-glider::after { left: 4px; }

.dash-sidebar-glider.is-visible {
  opacity: 1;
  transform: scale(1);
}
.dash-sidebar-glider.is-moving {
  transform: scale(1.02, 1.06);
}

.dash-sidebar-link {
  position: relative;
  z-index: 2;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.78) !important;
  text-decoration: none !important;
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}
.dash-sidebar-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(140px circle at var(--link-mouse-x, 50%) var(--link-mouse-y, 50%), rgba(255,255,255,0.08), transparent 75%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.dash-sidebar-link:hover::before {
  opacity: 1;
}

.dash-sidebar-link svg,
.dash-sidebar-link .dash-link-icon {
  color: rgba(255, 255, 255, 0.78) !important;
  stroke: currentColor !important;
  transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), color 0.2s ease, filter 0.2s ease;
  will-change: transform;
}
.dash-sidebar-link span,
.dash-sidebar-link .dash-link-text {
  color: rgba(255, 255, 255, 0.78) !important;
  transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), color 0.2s ease;
  will-change: transform;
}

.dash-sidebar-link:hover {
  color: #ffffff !important;
}
.dash-sidebar-link:hover svg,
.dash-sidebar-link:hover .dash-link-icon {
  transform: translateY(-1px) scale(1.18) rotate(6deg);
  color: #ffffff !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}
.dash-sidebar-link:hover span,
.dash-sidebar-link:hover .dash-link-text {
  transform: translateX(-5px);
  color: #ffffff !important;
}
[dir="ltr"] .dash-sidebar-link:hover span,
[dir="ltr"] .dash-sidebar-link:hover .dash-link-text {
  transform: translateX(5px);
}

.dash-sidebar-link.is-active {
  background: #ffffff !important;
  color: #0a0a0a !important;
  font-weight: 700;
  box-shadow: 
    0 10px 25px -3px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: activeAuraBreath 3.5s infinite ease-in-out;
}
.dash-sidebar-link.is-active .dash-link-icon {
  color: #0a0a0a;
  filter: none;
}
.dash-sidebar-link.is-active .dash-link-text {
  color: #0a0a0a;
  transform: none;
}

@keyframes activeAuraBreath {
  0%, 100% { box-shadow: 0 10px 25px -3px rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 12px 30px -2px rgba(255, 255, 255, 0.28), 0 0 14px rgba(255, 255, 255, 0.15); }
}

details summary::-webkit-details-marker { display: none; }

::selection {
  background: #111;
  color: #fff;
}

/* ========== Form controls ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="url"],
textarea,
select,
.form-input {
  background-color: #ffffff !important;
  color: #0c0c0c !important;
  caret-color: #0c0c0c;
  border: 1.5px solid #dcdce3 !important;
  border-radius: 14px !important;
  -webkit-text-fill-color: #0c0c0c !important;
  opacity: 1 !important;
  color-scheme: light;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

input::placeholder,
textarea::placeholder {
  color: #9a9aa3 !important;
  -webkit-text-fill-color: #9a9aa3 !important;
  opacity: 1 !important;
}

input:focus,
textarea:focus,
select:focus,
.form-input:focus {
  outline: none !important;
  border-color: #0c0c0c !important;
  box-shadow: 0 0 0 4px rgba(12,12,12,0.07) !important;
  background-color: #ffffff !important;
  color: #0c0c0c !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #0c0c0c !important;
  caret-color: #0c0c0c !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-in-out 0s;
  border: 1.5px solid #dcdce3 !important;
}

label { color: #1a1a1a !important; }

.auth-link { color: #555 !important; }
.auth-link:hover { color: #0c0c0c !important; }

/* ========== Auth animated background ========== */
.auth-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: #f2f2f5;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,0,0,0.06), transparent 55%),
    linear-gradient(180deg, #f7f7f9 0%, #efeff3 50%, #f7f7f9 100%);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.auth-orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(20,20,20,0.18), transparent 70%);
  top: -80px;
  left: -60px;
  animation: orbFloat1 14s ease-in-out infinite;
}

.auth-orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(80,80,90,0.16), transparent 70%);
  bottom: -40px;
  right: -40px;
  animation: orbFloat2 18s ease-in-out infinite;
}

.auth-orb-3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(0,0,0,0.1), transparent 70%);
  top: 42%;
  left: 55%;
  animation: orbFloat3 12s ease-in-out infinite;
}

.auth-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(0,0,0,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(55deg);
  transform-origin: center top;
  animation: gridDrift 28s linear infinite;
  opacity: 0.7;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.auth-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 40%,
    rgba(255,255,255,0.45) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: shineSweep 8s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -35px) scale(1.08); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-40px, 30px); }
  66% { transform: translate(30px, -25px); }
}
@keyframes gridDrift {
  from { transform: perspective(600px) rotateX(55deg) translateY(0); }
  to { transform: perspective(600px) rotateX(55deg) translateY(56px); }
}
@keyframes shineSweep {
  0%, 100% { background-position: 120% 0; opacity: 0.3; }
  50% { background-position: -20% 0; opacity: 0.7; }
}

@keyframes authEnter {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes brandIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.18); transform: scale(1); }
  50% { box-shadow: 0 14px 40px rgba(0,0,0,0.28); transform: scale(1.04); }
}

.auth-enter {
  animation: authEnter 0.7s cubic-bezier(.22,1,.36,1) both;
}
.auth-brand {
  animation: brandIn 0.6s ease both;
}
.auth-logo {
  animation: logoPulse 3.5s ease-in-out infinite;
}
.auth-flash {
  animation: authEnter 0.45s ease both;
}

.auth-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.02),
    0 20px 50px rgba(0,0,0,0.08);
  transition: transform .35s ease, box-shadow .35s ease;
}
.auth-card:hover {
  box-shadow:
    0 8px 16px rgba(0,0,0,0.04),
    0 28px 60px rgba(0,0,0,0.1);
}

.demo-box {
  background: rgba(244,244,246,0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: start;
}
.demo-box button {
  width: 100%;
  text-align: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #0c0c0c;
  transition: border-color .15s, background .15s, transform .15s;
}
.demo-box button:hover {
  border-color: #0c0c0c;
  background: #fafafa;
  transform: translateY(-1px);
}

/* ========== Phone field ========== */
.phone-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.phone-code-wrap {
  flex: 0 0 auto;
  width: min(46%, 180px);
}
.phone-code {
  width: 100% !important;
  height: 100%;
  padding: 0.85rem 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 10px center !important;
  padding-left: 1.75rem !important;
}
html[dir="rtl"] .phone-code {
  background-position: right 10px center !important;
  padding-left: 0.65rem !important;
  padding-right: 1.75rem !important;
}
.phone-local {
  flex: 1;
  min-width: 0;
}

@media (max-width: 420px) {
  .phone-row { flex-direction: column; }
  .phone-code-wrap { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb, .auth-grid, .auth-shine, .auth-logo, .auth-enter, .auth-brand {
    animation: none !important;
  }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfcfd4; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== Unified design system (Phase 6.2) ========== */
:root {
  --radius-card: 1.25rem;
  --radius-btn: 0.9rem;
  --shadow-soft: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-card: 0 8px 40px rgba(0,0,0,0.08);
}

.btn-primary,
a.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-btn);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: #000; }

.card-surface,
.admin-card {
  border-radius: var(--radius-card) !important;
}

/* Hero — static background, no Ken Burns / zoom */
.hero-static {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  background: #0a0a0a;
  color: #fff;
  overflow: hidden;
}
@media (min-width: 768px) {
  .hero-static { align-items: center; }
}
.hero-static__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-static__bg picture {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-static__bg img {
  width: 100%;
  height: 100% !important;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: none !important;
  animation: none !important;
}
.hero-static__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 45%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.hero-static__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 8rem 1rem 5rem;
}
@media (min-width: 768px) {
  .hero-static__content { padding: 7rem 1.5rem 5rem; }
}

/* Testimonial cards */
.t-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.t-card__video {
  background: #0a0a0a;
  aspect-ratio: 9/16;
  max-height: 420px;
  width: 100%;
}
@media (min-width: 768px) {
  .t-card--media {
    display: grid;
    grid-template-columns: minmax(140px, 42%) 1fr;
    align-items: stretch;
  }
  .t-card__video { max-height: none; height: 100%; aspect-ratio: auto; min-height: 280px; }
}

/* Portfolio / testimonial reels — override global video height:auto */
video.js-portfolio-reel {
  background: #000;
  max-width: none;
}
.t-card__video video.js-portfolio-reel,
.t-card__video video.js-testimonial-video,
.t-card__video video.js-testimonial-inline,
article .js-portfolio-reel {
  height: 100%;
  width: 100%;
}
.t-card__video.is-playing .t-card__playhint {
  opacity: 0;
  pointer-events: none;
}

/* —— Virtualized PDF.js reader (lazy pages, cached bitmaps) —— */
.library-pdf-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: #ececef;
  min-height: 70vh;
}
.pdf-viewer {
  position: relative;
  width: 100%;
  min-height: 70vh;
  padding: 12px 0 48px;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
}
.pdf-viewer__loading,
.pdf-viewer__error {
  padding: 3rem 1.25rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
}
.pdf-viewer__error { color: #b91c1c; }
.pdf-page { margin: 0 auto; }
.pdf-page__canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
  border-radius: 4px;
  transform: translateZ(0);
  backface-visibility: hidden;
}
@media (max-width: 640px) {
  .library-pdf-shell { min-height: 65vh; }
  .pdf-viewer { padding: 8px 0 32px; }
}

/* Public page shells — shared responsive language */
.site-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
.site-page__inner { width: 100%; }
.page-blocks img,
.site-page img {
  max-width: 100%;
  height: auto;
}
.page-blocks .page-block--image_text {
  min-width: 0;
}
.page-blocks .page-block--image_text > * {
  min-width: 0;
}

/* Home / marketing overflow guards */
.hero-static,
.hero-static__content,
section.py-16,
section.py-24 {
  max-width: 100%;
}
.t-card { min-width: 0; }
.t-card__video video {
  max-width: 100%;
  object-fit: contain;
}

/* Legacy modal styles kept inert */
.tvm { display: none !important; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}
/* Never force canvas height:auto — breaks pdf.js page aspect */
canvas {
  max-width: none;
}

/* Our Work — click-to-play cards + hover preview */
.portfolio-card video.js-portfolio-reel {
  opacity: 0;
  pointer-events: none;
  height: 100% !important;
  max-height: none;
}
.portfolio-card.is-playing video.js-portfolio-reel {
  opacity: 1 !important;
  pointer-events: auto;
  z-index: 15;
}
.portfolio-card.is-playing .portfolio-play,
.portfolio-card.is-playing .js-portfolio-poster {
  opacity: 0;
  pointer-events: none;
}
.portfolio-card.is-loading .portfolio-play {
  opacity: 0.35;
  pointer-events: none;
}
.portfolio-card video.js-portfolio-preview {
  opacity: 0;
  transition: opacity .2s ease;
  height: 100% !important;
  max-height: none;
  pointer-events: none;
}
.portfolio-card.is-previewing:not(.is-playing):not(.is-loading) video.js-portfolio-preview {
  opacity: 1;
}
.portfolio-card.is-previewing:not(.is-playing):not(.is-loading) .js-portfolio-poster {
  opacity: 0;
}
.portfolio-play { transition: opacity .2s ease; }
.portfolio-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: portfolio-spin .7s linear infinite;
}
@keyframes portfolio-spin {
  to { transform: rotate(360deg); }
}
.portfolio-tab {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  border: 1px solid transparent;
}
.portfolio-tab.is-active {
  background: #fff;
  color: #0a0a0a;
}
.portfolio-tab--light {
  background: #f5f5f7;
  color: #6b6b76;
}
.portfolio-tab--light.is-active {
  background: #0a0a0a;
  color: #fff;
}

.portfolio-cat__title {
  letter-spacing: -0.02em;
}
.portfolio-cat__rule {
  margin-top: 0.75rem;
  height: 2px;
  width: 3.5rem;
  border-radius: 999px;
  background: #0a0a0a;
}
.portfolio-cat__rule--light {
  background: rgba(255,255,255,0.85);
  width: 3rem;
}
.portfolio-card.is-featured::after {
  content: '★';
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 25;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: #0a0a0a;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.table-wrap,
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-sidebar {
  transition: transform .25s ease;
}
@media (max-width: 1023px) {
  .dash-sidebar {
    display: flex !important;
    transform: translateX(-110%);
  }
  html[dir="rtl"] .dash-sidebar {
    transform: translateX(110%);
  }
  .dash-sidebar.is-open {
    transform: translateX(0) !important;
  }
}

@media (max-width: 640px) {
  .admin-content { padding: 14px 12px 28px; }
  .admin-page-title { font-size: 1.15rem; }
  .admin-btn, button, .form-input, a.admin-btn {
    min-height: 44px;
  }
  h1.text-4xl { font-size: 1.85rem !important; }
  h1.text-5xl, h1.text-6xl, h1.text-7xl {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.1 !important;
  }
}

  backface-visibility: hidden;
}
@media (max-width: 640px) {
  .library-pdf-shell { min-height: 65vh; }
  .pdf-viewer { padding: 8px 0 32px; }
}

/* Public page shells — shared responsive language */
.site-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
.site-page__inner { width: 100%; }
.page-blocks img,
.site-page img {
  max-width: 100%;
  height: auto;
}
.page-blocks .page-block--image_text {
  min-width: 0;
}
.page-blocks .page-block--image_text > * {
  min-width: 0;
}

/* Home / marketing overflow guards */
.hero-static,
.hero-static__content,
section.py-16,
section.py-24 {
  max-width: 100%;
}
.t-card { min-width: 0; }
.t-card__video video {
  max-width: 100%;
  object-fit: contain;
}

/* Legacy modal styles kept inert */
.tvm { display: none !important; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}
/* Never force canvas height:auto — breaks pdf.js page aspect */
canvas {
  max-width: none;
}

/* Our Work — click-to-play cards + hover preview */
.portfolio-card video.js-portfolio-reel {
  opacity: 0;
  pointer-events: none;
  height: 100% !important;
  max-height: none;
}
.portfolio-card.is-playing video.js-portfolio-reel {
  opacity: 1 !important;
  pointer-events: auto;
  z-index: 15;
}
.portfolio-card.is-playing .portfolio-play,
.portfolio-card.is-playing .js-portfolio-poster {
  opacity: 0;
  pointer-events: none;
}
.portfolio-card.is-loading .portfolio-play {
  opacity: 0.35;
  pointer-events: none;
}
.portfolio-card video.js-portfolio-preview {
  opacity: 0;
  transition: opacity .2s ease;
  height: 100% !important;
  max-height: none;
  pointer-events: none;
}
.portfolio-card.is-previewing:not(.is-playing):not(.is-loading) video.js-portfolio-preview {
  opacity: 1;
}
.portfolio-card.is-previewing:not(.is-playing):not(.is-loading) .js-portfolio-poster {
  opacity: 0;
}
.portfolio-play { transition: opacity .2s ease; }
.portfolio-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: portfolio-spin .7s linear infinite;
}
@keyframes portfolio-spin {
  to { transform: rotate(360deg); }
}
.portfolio-tab {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  border: 1px solid transparent;
}
.portfolio-tab.is-active {
  background: #fff;
  color: #0a0a0a;
}
.portfolio-tab--light {
  background: #f5f5f7;
  color: #6b6b76;
}
.portfolio-tab--light.is-active {
  background: #0a0a0a;
  color: #fff;
}

.portfolio-cat__title {
  letter-spacing: -0.02em;
}
.portfolio-cat__rule {
  margin-top: 0.75rem;
  height: 2px;
  width: 3.5rem;
  border-radius: 999px;
  background: #0a0a0a;
}
.portfolio-cat__rule--light {
  background: rgba(255,255,255,0.85);
  width: 3rem;
}
.portfolio-card.is-featured::after {
  content: '★';
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 25;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: #0a0a0a;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.table-wrap,
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-sidebar {
  transition: transform .25s ease;
}
@media (max-width: 1023px) {
  .dash-sidebar {
    display: flex !important;
    transform: translateX(-110%);
  }
  html[dir="rtl"] .dash-sidebar {
    transform: translateX(110%);
  }
  .dash-sidebar.is-open {
    transform: translateX(0) !important;
  }
}

@media (max-width: 640px) {
  .admin-content { padding: 14px 12px 28px; }
  .admin-page-title { font-size: 1.15rem; }
  .admin-btn, button, .form-input, a.admin-btn {
    min-height: 44px;
  }
  h1.text-4xl { font-size: 1.85rem !important; }
  h1.text-5xl, h1.text-6xl, h1.text-7xl {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.1 !important;
  }
}

/* Unify public cards */
.card-surface {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}

/* ============================================================ */
/* LUXURY HERO SHOWCASE & SEQUENCED ENTRANCE ANIMATION          */
/* ============================================================ */
.hero-showcase {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  background: #050507;
  color: #fff;
  overflow: hidden;
}
@media (min-width: 768px) {
  .hero-showcase {
    align-items: center;
    min-height: 92vh;
  }
}

.hero-showcase__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-showcase__bg picture {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-showcase__img {
  width: 100%;
  height: 100% !important;
  max-width: none;
  object-fit: cover;
  object-position: center right;
  opacity: 0;
  animation: heroBgEntrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Crisp gradient shade for maximum contrast matching original visual */
.hero-showcase__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, #050507 0%, rgba(5,5,7,0.6) 50%, rgba(5,5,7,0.2) 100%);
  pointer-events: none;
}
@media (min-width: 768px) {
  .hero-showcase__shade {
    background: linear-gradient(to right, rgba(5,5,7,0.95) 0%, rgba(5,5,7,0.75) 42%, rgba(5,5,7,0.2) 75%, transparent 100%),
                linear-gradient(to top, #050507 0%, transparent 30%);
  }
  [dir="rtl"] .hero-showcase__shade {
    background: linear-gradient(to left, rgba(5,5,7,0.95) 0%, rgba(5,5,7,0.75) 42%, rgba(5,5,7,0.2) 75%, transparent 100%),
                linear-gradient(to top, #050507 0%, transparent 30%);
  }
}

.hero-showcase__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 8rem 1rem 5rem;
}
@media (min-width: 768px) {
  .hero-showcase__content {
    padding: 7rem 1.5rem 5rem;
  }
}

/* Staggered sequential entrance animation */
.hero-stagger {
  opacity: 0;
  transform: translateY(22px);
  animation: heroStaggerIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.hero-stagger-1 { animation-delay: 0.1s; }
.hero-stagger-2 { animation-delay: 0.22s; }
.hero-stagger-3 { animation-delay: 0.36s; }
.hero-stagger-4 { animation-delay: 0.5s; }
.hero-stagger-5 { animation-delay: 0.65s; }
.hero-stagger-6 { animation-delay: 0.8s; }

@keyframes heroStaggerIn {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroBgEntrance {
  0% {
    opacity: 0;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
