/* ====== ROOT VARIABLES ====== */
:root {
  --gold: #E5C374;
  --gold-deep: #C5A55A;
  --teal: #84D3E0;
  --teal-deep: #006B77;
  --surface: #000000;
  --text: #E5E2E1;
  --text-secondary: #D0C5B4;
  --font-heading: 'Noto Serif', serif;
  --font-body: 'Manrope', sans-serif;
}

/* ====== RESET & BASE ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: #000;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(197, 165, 90, 0.3);
  color: var(--text);
}


/* ====== GOLD SMOKE / ATMOSPHERIC HAZE ====== */
.smoke-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.smoke-wisp {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation-play-state: paused;
}
.smoke-ready .smoke-wisp {
  opacity: 1;
  animation-play-state: running;
  transition: opacity 1.5s ease;
}

.smoke-wisp-1 {
  width: 700px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(197, 165, 90, 0.12) 0%, transparent 70%);
  bottom: 10%;
  left: 5%;
  animation: smokeDrift1 20s ease-in-out infinite;
}
.smoke-wisp-2 {
  width: 600px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(197, 165, 90, 0.09) 0%, transparent 70%);
  bottom: 25%;
  right: 10%;
  animation: smokeDrift2 25s ease-in-out infinite;
}
.smoke-wisp-3 {
  width: 500px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(132, 211, 224, 0.07) 0%, transparent 70%);
  bottom: 5%;
  left: 30%;
  animation: smokeDrift3 22s ease-in-out infinite;
}
.smoke-wisp-4 {
  width: 800px;
  height: 350px;
  background: radial-gradient(ellipse, rgba(197, 165, 90, 0.1) 0%, transparent 65%);
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  animation: smokeDrift4 18s ease-in-out infinite;
}
.smoke-wisp-5 {
  width: 500px;
  height: 220px;
  background: radial-gradient(ellipse, rgba(197, 165, 90, 0.08) 0%, transparent 70%);
  bottom: 35%;
  right: 5%;
  animation: smokeDrift5 28s ease-in-out infinite;
}

@keyframes smokeDrift1 {
  0%, 100% { transform: translateX(0) translateY(0); opacity: 0.6; }
  50%      { transform: translateX(80px) translateY(-40px); opacity: 1; }
}
@keyframes smokeDrift2 {
  0%, 100% { transform: translateX(0) translateY(0); opacity: 0.5; }
  50%      { transform: translateX(-60px) translateY(-30px); opacity: 1; }
}
@keyframes smokeDrift3 {
  0%, 100% { transform: translateX(0) translateY(0); opacity: 0.4; }
  50%      { transform: translateX(50px) translateY(-50px); opacity: 0.9; }
}
@keyframes smokeDrift4 {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.5; }
  50%      { transform: translateX(-50%) translateY(-30px) scale(1.1); opacity: 0.9; }
}
@keyframes smokeDrift5 {
  0%, 100% { transform: translateX(0) translateY(0); opacity: 0.4; }
  50%      { transform: translateX(-70px) translateY(-20px); opacity: 0.8; }
}


/* ====== VIDEO / BG FADES ====== */
.fade-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, #000, transparent);
  z-index: 1;
  pointer-events: none;
}
.fade-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to top, #000, transparent);
  z-index: 1;
  pointer-events: none;
}

/* ====== FILM GRAIN ====== */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.08;
}
.grain-overlay svg {
  width: 100%;
  height: 100%;
}
@media (max-width: 767px) {
  .grain-overlay { display: none; }
  .smoke-wisp-3, .smoke-wisp-4, .smoke-wisp-5 { display: none; }
  .smoke-wisp-1, .smoke-wisp-2 { animation-duration: 30s; }
}

/* ====== LOADER ====== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loader .loader-text {
  font-family: var(--font-heading);
  font-size: 4rem;
  letter-spacing: -2px;
}
#loader .loader-au { color: var(--gold); opacity: 0; }
#loader .loader-rity { color: var(--teal); opacity: 0; }

/* ====== CANVAS ====== */
#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 2s ease;
}
#particle-canvas.visible {
  opacity: 1;
}

/* ====== LOGO COMPOSITING ====== */
.logo-piece {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ====== SCROLL INDICATOR ====== */
.scroll-indicator {
  opacity: 0.4;
  transition: opacity 0.4s ease;
}
.scroll-indicator.hidden {
  opacity: 0;
}

/* ====== NAV ====== */
#nav {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* ====== LIQUID GOLD GLASS — for tags, pills, small elements ====== */
.liquid-gold {
  background: linear-gradient(
    160deg,
    rgba(229, 195, 116, 0.1) 0%,
    rgba(197, 165, 90, 0.03) 40%,
    rgba(229, 195, 116, 0.08) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(229, 195, 116, 0.15);
  box-shadow:
    0 0 20px rgba(197, 165, 90, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(229, 195, 116, 0.2),
    inset 0 -1px 0 rgba(229, 195, 116, 0.05);
  position: relative;
}
.liquid-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(229, 195, 116, 0.1) 0%,
    transparent 100%
  );
  border-radius: inherit;
  pointer-events: none;
}

/* ====== LIQUID GOLD GLASS — panel variant (project info, details) ====== */
.liquid-gold-panel {
  background: linear-gradient(
    160deg,
    rgba(229, 195, 116, 0.06) 0%,
    rgba(197, 165, 90, 0.02) 30%,
    rgba(197, 165, 90, 0.01) 50%,
    rgba(229, 195, 116, 0.04) 100%
  );
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(229, 195, 116, 0.1);
  box-shadow:
    0 0 40px rgba(197, 165, 90, 0.04),
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(229, 195, 116, 0.15),
    inset 0 -1px 0 rgba(229, 195, 116, 0.04);
  position: relative;
  overflow: hidden;
}
.liquid-gold-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(
    180deg,
    rgba(229, 195, 116, 0.08) 0%,
    transparent 100%
  );
  border-radius: inherit;
  pointer-events: none;
}

/* ====== WORK SECTION ATMOSPHERE ====== */
.work-orb {
  will-change: transform, opacity;
}
/* ====== GOLD GRADIENT TEXT ====== */
.gold-gradient-text {
  background-image: linear-gradient(135deg, #E5C374 0%, #84D3E0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== FOCUS STYLES ====== */
:focus-visible {
  outline: 2px solid rgba(229, 195, 116, 0.5);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid rgba(229, 195, 116, 0.5);
  outline-offset: 2px;
}

/* ====== PHONE CAROUSEL ====== */
.phone-frame {
  background: linear-gradient(
    160deg,
    rgba(229, 195, 116, 0.12) 0%,
    rgba(197, 165, 90, 0.04) 30%,
    rgba(197, 165, 90, 0.02) 50%,
    rgba(229, 195, 116, 0.08) 80%,
    rgba(197, 165, 90, 0.15) 100%
  );
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  border: 1px solid rgba(229, 195, 116, 0.2);
  box-shadow:
    0 0 80px rgba(197, 165, 90, 0.08),
    0 30px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(229, 195, 116, 0.25),
    inset 0 -1px 1px rgba(229, 195, 116, 0.08);
  position: relative;
  overflow: hidden;
}

/* Top highlight streak — the liquid glass shine */
.phone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(229, 195, 116, 0.15) 0%,
    rgba(229, 195, 116, 0.05) 30%,
    transparent 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* Edge reflection — subtle gold rim light */
.phone-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    160deg,
    rgba(229, 195, 116, 0.5) 0%,
    rgba(229, 195, 116, 0.1) 25%,
    transparent 50%,
    rgba(229, 195, 116, 0.05) 75%,
    rgba(229, 195, 116, 0.35) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.phone-frame {
  --phone-scale: 0.678; /* fallback: (270 - 16) / 375 */
}

.phone-iframe {
  width: 375px;
  height: 812px;
  border: 0;
  transform-origin: top left;
  transform: scale(var(--phone-scale));
  transition: opacity 400ms ease;
}


/* ====== SHOW ME GLITCH ====== */
@keyframes glitchFlicker {
  0%, 100% { color: rgba(229, 195, 116, 0.7); text-shadow: none; }
  92% { color: rgba(229, 195, 116, 0.7); text-shadow: none; }
  93% { color: #84D3E0; text-shadow: -1px 0 rgba(229,195,116,0.3); }
  94% { color: rgba(229, 195, 116, 0.7); text-shadow: none; }
  96% { color: rgba(229, 195, 116, 0.7); text-shadow: none; }
  96.5% { color: #E5C374; text-shadow: 1px 0 rgba(132,211,224,0.2); }
  97% { color: rgba(229, 195, 116, 0.7); text-shadow: none; }
}
.glitch-text {
  animation: glitchFlicker 5s ease-in-out infinite;
}

/* ====== PIPELINE BUTTONS ====== */
.pipeline-btn {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.pipeline-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(229,195,116,0.08) 0%, transparent 70%);
  transition: opacity 0.3s ease;
}
.pipeline-btn:hover::after {
  opacity: 1;
}
.pipeline-btn:active {
  transform: scale(0.98);
}

/* "One of one" gold/cyan gradient text */
.pipe-one-of-one {
  background: linear-gradient(135deg, #E5C374 30%, #84D3E0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Phone interactive scroll ── */
.phone-frame.scrollable .phone-iframe {
  pointer-events: auto !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.phone-frame.scrollable .phone-iframe::-webkit-scrollbar {
  display: none;
}
.phone-frame.scrollable {
  border-color: rgba(229, 195, 116, 0.35);
}

/* ── Phone tap hint ── */
/* ── Phone tap hint — pulse popup ── */
.phone-tap-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  cursor: pointer;
  animation: hintPulse 3s ease-in-out infinite;
  pointer-events: none;
}
.phone-tap-hint span {
  font-family: var(--font-body);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(229, 195, 116, 0.85);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(229, 195, 116, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 9999px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.phone-tap-hint .hint-icon {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.9; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(3px); }
}
.phone-tap-hint.hidden {
  animation: hintFadeOut 0.3s ease forwards;
}
@keyframes hintFadeOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}

/* ── Fullscreen preview ── */
#preview-overlay.active {
  opacity: 1;
  pointer-events: auto;
  overscroll-behavior: contain;
}
#preview-overlay iframe {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ── Prevent scroll bleed on phone frames ── */
.phone-frame {
  touch-action: pan-x pinch-zoom;
}

/* ── Iframe loading state ── */
.phone-frame .relative {
  background: linear-gradient(
    110deg,
    rgba(229, 195, 116, 0.03) 0%,
    rgba(229, 195, 116, 0.06) 40%,
    rgba(229, 195, 116, 0.03) 60%,
    rgba(229, 195, 116, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: iframeShimmer 1.5s ease-in-out infinite;
}
@keyframes iframeShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Work section phone scaling ── */
/* Mobile phone: viewport-relative sizing */
.showcase-phone-mobile {
  width: min(260px, 70vw);
}
.showcase-phone-inner {
  /* height = width × 1.8 (phone aspect ratio), capped at 55svh */
  /* svh = small viewport height — stays stable when mobile browser chrome appears/disappears */
  height: min(calc(min(260px, 70vw) * 1.8), 55svh);
}
#showcase-phone-desktop .phone-iframe {
  --phone-scale: 0.7; /* (280 - 16) / 375 */
}
