/* GSoftly — UI Components */

/* ─── Loading Screen ──────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #0d2535 0%, #071520 60%, #040e17 100%);
  overflow: hidden;
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

/* Corner brackets */
.ldr-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(37,150,190,0.55);
  border-style: solid;
}
.ldr-tl { top: 28px; left: 28px;  border-width: 1.5px 0 0 1.5px; }
.ldr-tr { top: 28px; right: 28px; border-width: 1.5px 1.5px 0 0; }
.ldr-bl { bottom: 28px; left: 28px;  border-width: 0 0 1.5px 1.5px; }
.ldr-br { bottom: 28px; right: 28px; border-width: 0 1.5px 1.5px 0; }

/* Center block */
.ldr-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Icon + multi-ring orbital */
.ldr-icon-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 24px;
}
.ldr-rings-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Each arc spins independently */
.ldr-arc1 { animation: ldr-cw  3.8s linear infinite; transform-origin: 80px 80px; }
.ldr-arc2 { animation: ldr-ccw 2.4s linear infinite; transform-origin: 80px 80px; }
.ldr-arc3 { animation: ldr-cw  1.5s linear infinite; transform-origin: 80px 80px; }

@keyframes ldr-cw  { to { transform: rotate( 360deg); } }
@keyframes ldr-ccw { to { transform: rotate(-360deg); } }

.ldr-icon-img {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  margin: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(37,150,190,0.8));
}

.ldr-brand {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #2596be;
  margin-bottom: 12px;
  text-shadow: 0 0 24px rgba(37,150,190,0.4);
}
.ldr-slogan {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ldr-tags {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(37,150,190,0.65);
  margin-bottom: 36px;
}

/* Progress bar */
.ldr-bar-wrap {
  width: 280px;
  height: 2px;
  background: rgba(37,150,190,0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}
.ldr-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1a7fa8, #2596be, #4db8e0);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(37,150,190,1), 0 0 20px rgba(37,150,190,0.5);
  /* JS drives width via rAF — no CSS transition needed */
}
.ldr-status {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(37,150,190,0.6);
  text-transform: uppercase;
}

/* Version badge */
.ldr-version {
  position: absolute;
  bottom: 28px;
  right: 36px;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(37,150,190,0.4);
}

/* ─── Custom Cursor ───────────────────────────── */
/* Dot and ring use transform:translate() exclusively — no left/top conflict */
#cursor-dot {
  position: fixed;
  top: -4px; left: -4px;   /* half of 8px so center aligns to pointer */
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
  pointer-events: none;
  z-index: var(--z-cursor);
  will-change: transform;
  transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
}
#cursor-ring {
  position: fixed;
  top: -18px; left: -18px;  /* half of 36px so center aligns to pointer */
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-color);
  pointer-events: none;
  z-index: var(--z-cursor);
  opacity: 0.55;
  will-change: transform;
  transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}
.cursor-hover #cursor-dot  { width: 12px; height: 12px; top: -6px; left: -6px; background: var(--white); }
.cursor-hover #cursor-ring { width: 52px; height: 52px; top: -26px; left: -26px; opacity: 0.25; border-color: var(--white); }
.cursor-click #cursor-dot  { width: 6px; height: 6px; top: -3px; left: -3px; }

/* ─── Navbar ──────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-height);
  z-index: var(--z-sticky);
  transition: var(--transition-slow);
  padding: 0;
}
.navbar.transparent {
  background: transparent;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(37,150,190,0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.navbar.hidden {
  transform: translateY(-100%);
}
.navbar .nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}
.navbar .nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar .nav-logo img {
  height: 36px;
  width: auto;
}
.navbar .nav-logo span {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}
.navbar .nav-logo span em {
  font-style: normal;
  color: var(--primary-color);
}
.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar .nav-links a {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
}
.navbar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 16px; height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: transform 0.25s ease;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}
.navbar .nav-links a:hover::after,
.navbar .nav-links a.active::after { transform: translateX(-50%) scaleX(1); }
.navbar .nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.navbar .hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}
.navbar .hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}
.navbar .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.navbar .hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Mobile Nav ──────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: var(--navbar-height); left: 0; right: 0;
  background: rgba(15,23,42,0.98);
  backdrop-filter: blur(20px);
  z-index: var(--z-overlay);
  padding: var(--space-6);
  transform: translateY(-100%) scaleY(0);
  transform-origin: top;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  border-bottom: 1px solid rgba(37,150,190,0.2);
}
.mobile-menu.active {
  transform: translateY(0) scaleY(1);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: var(--font-size-base);
  font-weight: 500;
  padding: var(--space-4) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
}
.mobile-menu a:hover,
.mobile-menu a.active { color: var(--primary-color); padding-left: 8px; }

/* ─── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--border-radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-slow);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-101%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.btn:hover::before { transform: translateX(0); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-primary);
}
.btn-primary::before { background: var(--primary-dark); }
.btn-primary:hover { box-shadow: var(--shadow-primary-lg); color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.35);
}
.btn-outline::before { background: var(--primary-color); }
.btn-outline:hover   { border-color: var(--primary-color); color: var(--white);
                       box-shadow: var(--shadow-primary); }

.btn-outline-primary {
  background: transparent;
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
}
.btn-outline-primary::before { background: var(--primary-color); }
.btn-outline-primary:hover   { color: var(--white); box-shadow: var(--shadow-primary); }

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost::before { background: var(--primary-color); }
.btn-ghost:hover   { border-color: var(--primary-color); color: var(--white); }

.btn-lg { padding: 18px 36px; font-size: var(--font-size-base); }
.btn-sm { padding: 10px 20px; font-size: var(--font-size-xs); }
.btn-icon { padding: 14px; border-radius: 50%; }

/* ─── Cards ───────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-8);
  transition: var(--transition-slow);
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-color-hover);
}
.card-dark {
  background: rgba(37,150,190,0.05);
  border-color: rgba(37,150,190,0.15);
}
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* ─── Service Card ────────────────────────────── */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
  transition: var(--transition-slow);
  position: relative;
  overflow: hidden;
}
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--primary-color);
}
.service-card:hover::after { opacity: 1; }
.service-card .card-icon {
  width: 56px; height: 56px;
  border-radius: var(--border-radius);
  background: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  font-size: 1.4rem;
  color: var(--primary-color);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.service-card:hover .card-icon {
  background: var(--primary-color);
  color: var(--white);
  box-shadow: var(--shadow-primary);
}
.service-card .card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  position: relative;
  z-index: 1;
}
.service-card .card-desc {
  font-size: var(--font-size-sm);
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
}
.service-card .card-link {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.service-card:hover .card-link { gap: 10px; }

/* ─── Badge ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
}
.badge-primary { background: var(--secondary-color); color: var(--primary-color); border: 1px solid rgba(37,150,190,0.3); }
.badge-success { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(239,68,68,0.1);  color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }

/* ─── Forms ───────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-5);
}
.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--dark-secondary);
}
.form-control {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  color: var(--dark);
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(37,150,190,0.1);
}
.form-control::placeholder { color: var(--gray-light); }
textarea.form-control {
  min-height: 140px;
  resize: vertical;
}
.form-error {
  font-size: var(--font-size-xs);
  color: #dc2626;
}

/* ─── Alert / Flash messages ──────────────────── */
.alert {
  padding: 14px 20px;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-5);
}
.alert-success { background: rgba(16,185,129,0.1); color: #047857; border: 1px solid rgba(16,185,129,0.2); }
.alert-error   { background: rgba(239,68,68,0.1);  color: #b91c1c; border: 1px solid rgba(239,68,68,0.2); }
.alert-info    { background: var(--secondary-color); color: var(--primary-dark); border: 1px solid rgba(37,150,190,0.2); }

/* ─── Modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.8);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--border-color);
  padding: var(--space-10);
  max-width: 540px;
  width: 100%;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-2xl);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }

/* ─── Section Hero Banner ─────────────────────── */
.page-hero {
  background: var(--gradient-hero);
  min-height: 320px;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232596be' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-4);
}
.page-hero .breadcrumb a { color: rgba(255,255,255,0.6); }
.page-hero .breadcrumb a:hover { color: var(--white); }
.page-hero .breadcrumb span { color: var(--primary-color); }
.page-hero h1 { color: var(--white); margin-bottom: var(--space-4); }
.page-hero p  { color: rgba(255,255,255,0.7); font-size: var(--font-size-lg); max-width: 560px; }

/* ─── Footer ──────────────────────────────────── */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  position: relative;
}
.footer-wave {
  margin-bottom: -2px;
  line-height: 0;
}
.footer-inner {
  padding: 80px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand p {
  color: rgba(255,255,255,0.5);
  font-size: var(--font-size-sm);
  margin-top: var(--space-4);
  line-height: 1.7;
}
.footer-col h4 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footer-col ul li {
  margin-bottom: var(--space-3);
}
.footer-col ul a {
  color: rgba(255,255,255,0.55);
  font-size: var(--font-size-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-col ul a:hover { color: var(--primary-color); padding-left: 4px; }
.footer-bottom {
  padding-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-bottom p { font-size: var(--font-size-xs); color: rgba(255,255,255,0.4); margin: 0; }
.footer-social {
  display: flex;
  gap: var(--space-3);
}
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: var(--font-size-sm);
  transition: var(--transition);
}
.footer-social a:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
}

/* ─── Pagination ──────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  color: var(--gray);
  transition: var(--transition);
}
.pagination a:hover, .pagination .current {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

/* ─── Grid Utilities ──────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  :root { --section-py: 70px; --navbar-height: 64px; }
  .navbar .nav-links, .navbar .nav-cta { display: none; }
  .navbar .hamburger { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .page-hero { min-height: 240px; padding: 100px 0 60px; flex-direction: column; }

  /* Hero headings */
  h1, .hero-title { font-size: clamp(1.75rem, 7vw, 2.5rem) !important; word-break: break-word; }
  h2 { font-size: clamp(1.4rem, 5vw, 2rem) !important; }

  /* Breadcrumb — wrap between items but never break within a word */
  .breadcrumb, nav[aria-label="breadcrumb"] {
    flex-wrap: wrap;
    white-space: normal;
    word-break: normal;
    font-size: 0.78rem;
  }
  .breadcrumb a, .breadcrumb span, .breadcrumb i {
    white-space: nowrap;
  }

  /* Page hero content */
  .page-hero h1 { font-size: clamp(1.6rem, 6vw, 2.4rem) !important; line-height: 1.25; }
  .page-hero .hero-subtitle { font-size: 0.95rem !important; }

  /* Two-column detail layouts → stack */
  .detail-grid, .project-detail-grid,
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Prevent any element overflowing the viewport width */
  img, canvas, video, iframe, table { max-width: 100%; }
  .container { overflow-x: hidden; }
}
@media (max-width: 480px) {
  :root { --navbar-height: 60px; }
  .grid-4 { grid-template-columns: 1fr; }
  .btn-lg { padding: 14px 24px; font-size: var(--font-size-sm); }
  #cursor-dot, #cursor-ring { display: none; }
  body { cursor: auto; overflow-x: hidden; }

  /* Smaller headings on very small screens */
  h1, .hero-title { font-size: clamp(1.5rem, 8vw, 2rem) !important; }
  .page-hero h1  { font-size: clamp(1.4rem, 7vw, 1.8rem) !important; }

  /* Buttons wrap on small screens */
  .hero-cta, .btn-group { flex-wrap: wrap; gap: 12px; }
  .btn { width: 100%; justify-content: center; }
}

/* ─── Book Page Flip Transition ──────────────────────────────
   #pt-scene : perspective "camera"  (fixed, full-viewport)
   #pt-page  : the flipping page     (hinged on right edge)
   JS drives rotateY(90→0) for cover and rotateY(0→-90) for reveal.
─────────────────────────────────────────────────────────────── */

#pt-scene {
  position: fixed;
  inset: 0;
  z-index: 9998; /* below loader (9999), above everything else */
  pointer-events: none;
  /* Camera perspective — 1500px gives a natural book-depth feel */
  perspective: 1500px;
  perspective-origin: 50% 50%;
}

#pt-page {
  position: absolute;
  inset: 0;
  /* Hinge = left edge of the page */
  transform-origin: left center;
  /* Start fully invisible — shown only when an animation is running */
  transform: rotateY(-95deg);
  opacity: 0;
  will-change: transform, opacity;
  /* The back of the page is invisible so the new page shows through */
  backface-visibility: hidden;

  /* Dark paper — subtle tone variation across width adds tactile depth */
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.22)  0%,   /* left-edge binding shadow */
    #040e17               2%,
    #071a2b              18%,
    #0f172a              55%,
    #0c2030              88%,
    #071a2b             100%
  );
}

/* Top-left gloss + bottom-right depth — simulates light on glossy paper */
#pt-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.05)  0%,
    transparent                40%,
    rgba(0,   0,   0,   0.14) 100%
  );
  pointer-events: none;
}

/* Left-edge spine highlight — catches light as the page turns in from left */
#pt-page::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(to right,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  pointer-events: none;
}

/* ── GSoftly loader centred on the flip panel ─────────────────
   .pt-ldr lives inside #pt-page, so it rides the flip and fades
   with the panel when opacity → 0 at the end of revealOut().
──────────────────────────────────────────────────────────────── */
.pt-ldr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  /* Lift above ::before / ::after pseudo-elements */
  z-index: 1;
}

/* Rings container — same dimensions as the main loading screen */
.pt-ldr-rings {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The SVG sits as an overlay filling the rings container */
.pt-ldr-rings .ldr-rings-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Icon image centred inside the rings */
.pt-ldr-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(37,150,190,0.45));
}

/* Brand wordmark */
.pt-ldr-brand {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.30em;
  color: #fff;
  opacity: 0.9;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Tagline */
.pt-ldr-slogan {
  font-family: 'Inter', sans-serif;
  font-size: 0.48rem;
  letter-spacing: 0.16em;
  color: rgba(37, 150, 190, 0.65);
  text-transform: uppercase;
}
