/* ============================================================================
 * Indipicture — production CSS
 * Additive polish only. No colour, typography, or layout redesign.
 * ==========================================================================*/
:root {
  --brand: #E82127;
  --brand-2: #ff5a5f;
  --bg: #050505;
  --bg-2: #0a0a0a;
  --border: rgba(255,255,255,0.08);
  --muted: rgba(255,255,255,0.55);
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body { background: var(--bg); color: #fff; }
body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
.font-display { font-family: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.02em; }

.text-gradient { background: linear-gradient(90deg, #fff 0%, #ffb3b6 45%, var(--brand) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

.grid-bg {
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
}

/* ---- Scroll reveal (unchanged) ----------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease-premium), transform .8s var(--ease-premium); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---- Pulsing dot (unchanged) ------------------------------------------- */
.dot-pulse { width: 6px; height: 6px; background: var(--brand); border-radius: 50%; box-shadow: 0 0 12px var(--brand); animation: dotPulse 1.6s ease-in-out infinite; display: inline-block; }
@keyframes dotPulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.55; transform:scale(0.85);} }

/* ---- Premium card lift (refined easing + subtle brand ring) ------------ */
.card-hover { transition: transform .5s var(--ease-premium), border-color .5s var(--ease-premium), box-shadow .5s var(--ease-premium); }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(232,33,39,0.45); box-shadow: 0 12px 40px -8px rgba(232,33,39,0.18), 0 0 0 1px rgba(232,33,39,0.08); }

/* ---- Soft button glow (enterprise-grade, not flashy) ------------------- */
.btn-glow { position: relative; box-shadow: 0 0 0 rgba(232,33,39,0); transition: box-shadow .45s var(--ease-premium), transform .45s var(--ease-premium), background-color .3s ease; }
.btn-glow:hover { box-shadow: 0 0 24px -4px rgba(232,33,39,0.55), 0 0 0 1px rgba(232,33,39,0.25); transform: translateY(-1px); }
.btn-glow:active { transform: translateY(0); }

/* ---- Nav link hover (soft red underline) ------------------------------- */
.nav-link { position: relative; transition: color .3s ease; }
.nav-link:hover { color: #fff; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px;
  background: var(--brand); transform: scaleX(0); transform-origin: center;
  transition: transform .35s var(--ease-premium);
}
.nav-link:hover::after, .nav-link.nav-active::after { transform: scaleX(0.6); }
.nav-link.nav-active { color: #fff; }

/* ---- Viewer canvas host ------------------------------------------------ */
.viewer-canvas { width: 100%; height: 100%; display: block; touch-action: none; }

/* ---- Command-palette scrollbar polish (unchanged) --------------------- */
#projects-list::-webkit-scrollbar,
#menu::-webkit-scrollbar { width: 6px; }
#projects-list::-webkit-scrollbar-thumb,
#menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* ---- Empty-state / studio subtle drift animation for the logo mark ---- */
@keyframes floatMark { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.float-mark { animation: floatMark 5.5s ease-in-out infinite; }

/* ---- Toast (contact success/error) ------------------------------------ */
.contact-toast { transition: opacity .4s var(--ease-premium), transform .4s var(--ease-premium); }

/* ---- Reduce motion respectfully --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .card-hover, .btn-glow, .nav-link::after, .float-mark, .dot-pulse { transition: none !important; animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================================
 * PRODUCTION ADDITIONS · footer · search · admin sidebar · badges · skeletons
 * ==========================================================================*/

/* Premium footer */
.site-footer { background: linear-gradient(180deg, #050505 0%, #030303 100%); }
.site-footer-tex {
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(232,33,39,0.16), transparent 45%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
}
.foot-link { position: relative; transition: color .3s ease, transform .3s var(--ease-premium); display: inline-block; }
.foot-link:hover { color: #fff; transform: translateX(2px); }
.social-icon {
  width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.65);
  transition: color .3s ease, border-color .3s ease, background-color .3s ease, transform .3s var(--ease-premium), box-shadow .3s ease;
}
.social-icon:hover { color: #fff; border-color: rgba(232,33,39,0.55); background: rgba(232,33,39,0.08); transform: translateY(-1px); box-shadow: 0 0 20px -6px rgba(232,33,39,0.45); }

/* Visibility badges */
.vbadge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  border: 1px solid transparent; backdrop-filter: blur(8px);
}
.vbadge-public    { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.35); color: rgb(110,231,183); }
.vbadge-protected { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.35); color: rgb(253,224,71); }
.vbadge-private   { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.75); }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Admin sidebar */
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .admin-sidebar { position: sticky; top: 56px; z-index: 10; } }
.admin-sidebar { background: #070707; border-right: 1px solid rgba(255,255,255,0.06); }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,0.65);
  font-size: 13px; transition: background .25s ease, color .25s ease, border-color .25s ease;
  border: 1px solid transparent;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.admin-nav-item.is-active { background: rgba(232,33,39,0.10); border-color: rgba(232,33,39,0.35); color: #fff; }
.admin-nav-item .ico { width: 16px; height: 16px; opacity: 0.85; }

/* Studio: control cluster (post-load) */
.studio-tool {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8); background: rgba(0,0,0,0.55); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  transition: color .25s, border-color .25s, background .25s;
}
.studio-tool:hover { color: #fff; border-color: rgba(232,33,39,0.5); background: rgba(0,0,0,0.75); }
.studio-tool.is-active { color: #fff; border-color: rgba(232,33,39,0.6); background: rgba(232,33,39,0.14); }

/* Lock badge (overlay on protected/private thumbnails) */
.lock-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 9.5px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(10px);
  border: 1px solid rgba(251,191,36,0.4); color: rgb(253,224,71);
}
.lock-badge.private { border-color: rgba(255,255,255,0.35); color: rgba(255,255,255,0.9); }

/* First-Person keyboard tooltip */
.kbd {
  display: inline-block;
  min-width: 20px; height: 20px; padding: 0 5px;
  margin-right: 3px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.92);
  font-family: 'Space Grotesk', 'Inter', ui-sans-serif;
  font-size: 10.5px; font-weight: 600;
  line-height: 18px; text-align: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4), inset 0 -1px 0 rgba(255,255,255,0.06);
}
.fp-tooltip {
  animation: fpFadeIn .18s ease-out;
  white-space: nowrap;
}
@keyframes fpFadeIn { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* -----------------------------------------------------------------------------
 * Premium motion polish (all opt-in, purely additive — respects reduced motion)
 * -------------------------------------------------------------------------- */
.card-hover { transition: box-shadow 400ms ease, border-color 400ms ease; }
.card-hover:hover {
  box-shadow: 0 30px 60px -20px rgba(232,33,39,0.16), 0 0 0 1px rgba(232,33,39,0.18) inset;
}
.btn-glow { transition: transform 220ms cubic-bezier(.2,.9,.2,1), box-shadow 300ms ease; }
.btn-glow:hover { box-shadow: 0 12px 40px -8px rgba(232,33,39,0.55), 0 0 0 1px rgba(255,255,255,0.06) inset; }

/* Sticky nav gains a subtle shadow once the page has scrolled */
header.sticky.is-scrolled { box-shadow: 0 8px 32px rgba(0,0,0,0.45); border-color: rgba(255,255,255,0.08); }

/* Hero words prepared for GSAP stagger reveal */
.motion-word { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .card-hover, .btn-glow, header.sticky.is-scrolled { transition: none !important; box-shadow: none !important; }
}

/* ============================================================================
 * PREMIUM POLISH LAYER  ·  additive-only
 * ==========================================================================*/

/* ---- Tighter section rhythm (compact enterprise cadence) ---------------- */
@media (min-width: 768px) {
  body > section.py-24, body > main > section.py-24 { padding-top: 4rem; padding-bottom: 4rem; }
}

/* ---- Card polish v2  (animated conic border + cursor-tracked highlight) - */
@property --card-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.card-hover { position: relative; isolation: isolate; }
.card-hover::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--card-angle, 0deg),
    rgba(232,33,39,0)      0deg,
    rgba(232,33,39,0.55)   90deg,
    rgba(232,33,39,0)      180deg,
    rgba(255,255,255,0.12) 270deg,
    rgba(232,33,39,0)      360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .5s var(--ease-premium);
  pointer-events: none; z-index: 1;
}
.card-hover:hover::before { opacity: 1; animation: cardBorderSpin 5s linear infinite; }
@keyframes cardBorderSpin { to { --card-angle: 360deg; } }

.card-hover::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255,255,255,0.055), transparent 45%);
  opacity: 0; transition: opacity .45s var(--ease-premium);
  pointer-events: none; z-index: 0; mix-blend-mode: screen;
}
.card-hover:hover::after { opacity: 1; }
.card-hover > * { position: relative; z-index: 2; }

/* ---- Digital Twin Viewer  ·  premium frame ------------------------------ */
#hero-viewer { isolation: isolate; }
#hero-viewer::before {
  content: ''; position: absolute; inset: -18px;
  border-radius: 22px;
  background: radial-gradient(60% 45% at 50% 55%, rgba(232,33,39,0.18), transparent 70%);
  filter: blur(24px);
  z-index: -1; pointer-events: none;
  transition: opacity .6s var(--ease-premium);
}
/* Runtime-injected corner accents */
.viewer-corner {
  position: absolute; width: 22px; height: 22px;
  border-color: rgba(255,255,255,0.35); border-style: solid; border-width: 0;
  transition: border-color .45s var(--ease-premium),
              width .5s var(--ease-premium),
              height .5s var(--ease-premium);
  pointer-events: none; z-index: 5;
}
.viewer-corner.tl { top: 10px;    left: 10px;    border-top-width: 1.5px; border-left-width: 1.5px;   border-top-left-radius: 4px; }
.viewer-corner.tr { top: 10px;    right: 10px;   border-top-width: 1.5px; border-right-width: 1.5px;  border-top-right-radius: 4px; }
.viewer-corner.bl { bottom: 10px; left: 10px;    border-bottom-width: 1.5px; border-left-width: 1.5px; border-bottom-left-radius: 4px; }
.viewer-corner.br { bottom: 10px; right: 10px;   border-bottom-width: 1.5px; border-right-width: 1.5px; border-bottom-right-radius: 4px; }
#hero-viewer:hover .viewer-corner { border-color: rgba(232,33,39,0.75); width: 30px; height: 30px; }

/* ---- Section transitions intentionally removed  -------------------------
   Per "enterprise minimalism" direction, sections rely on typography and
   whitespace to signal separation instead of decorative light halos. */

/* ---- Reduced motion respect (add polish rules) -------------------------- */
@media (prefers-reduced-motion: reduce) {
  .card-hover::before, .card-hover::after { transition: none !important; animation: none !important; }
}

/* ---- Hero storytelling scene · progress rail ---------------------------- */
.story-tick {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  transition: background-color .5s var(--ease-premium);
}
.story-tick.is-active { background: linear-gradient(90deg, #E82127, #ff7a7f); box-shadow: 0 0 12px rgba(232,33,39,0.6); }
#hero-story-name { will-change: opacity; }
