/* ============================================================
   HENRY BLANC-FRANCARD
   Design: patrickheng.com inspired
   Font: DM Sans
   Palette: dark (#0a0a0a), white text, accent gold
   ============================================================ */

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
html { -webkit-text-size-adjust: 100%; }

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --bg-elevated:  #111111;
  --white:        #ffffff;
  --text:         rgba(255,255,255, 0.9);
  --text-muted:   rgba(255,255,255, 0.5);
  --text-faint:   rgba(255,255,255, 0.2);
  --accent:       #fcac14;
  --border:       rgba(255,255,255, 0.1);

  --font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-expo:    cubic-bezier(0.19, 1, 0.22, 1);

  --px:           clamp(1.5rem, 5vw, 4rem);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* ─── BASE ────────────────────────────────────────────────── */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Smooth scroll wrapper managed by GSAP */
#smooth-content {
  will-change: transform;
}

::selection { background: rgba(252, 172, 20, 0.3); }

/* Scrollbar */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 9999px; }

/* ─── PRELOADER ───────────────────────────────────────────── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.preloader-counter {
  font-family: var(--font);
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 500;
  color: var(--white);
  letter-spacing: -0.05em;
  font-style: italic;
}
.preloader.hidden {
  pointer-events: none;
}

/* ─── WEBGL CANVAS ────────────────────────────────────────── */
.webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--bg);
}

/* ─── CUSTOM CURSOR ───────────────────────────────────────── */
.custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 27px; height: 27px;
  background: var(--white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  display: none;
  transform: translate(-50%, -50%) scale(1);
  transition: width 0.3s var(--ease-expo),
              height 0.3s var(--ease-expo),
              background 0.3s ease;
}
.custom-cursor.active {
  width: 45px; height: 45px;
}
@media (pointer: fine) {
  .custom-cursor { display: block; }
  * { cursor: none !important; }
}

/* ─── NAV ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--px);
  padding-top: calc(1.5rem + var(--sat));
  mix-blend-mode: difference;
  pointer-events: none;
}

.nav-logo {
  pointer-events: all;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--white);
  transition: opacity 0.2s ease;
}
.nav-logo:hover { opacity: 0.6; }

.nav-links {
  pointer-events: all;
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.05em;
  position: relative;
  transition: opacity 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-expo);
}
.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.lang-toggle {
  padding: 0;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.lang-toggle:hover {
  opacity: 1;
}

/* ─── SECTIONS (shared) ───────────────────────────────────── */
.section {
  position: relative;
  z-index: 1;
  padding: 0 var(--px);
}

.section-title {
  font-family: var(--font);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
}
.section-title-inner {
  display: inline-block;
}

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: clamp(1.5rem, 10vh, 6rem);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--font);
  font-size: clamp(3rem, min(10vw, 16vh), 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--white);
  margin-bottom: 1.5rem;
}
.hero-line {
  display: block;
  overflow: hidden;
}
.hero-line-inner {
  display: inline-block;
  transform: translateY(105%);
}

.hero-title .letter {
  display: inline-block;
  transition: color 0.4s var(--ease-out);
}

.hero-tagline {
  font-family: var(--font);
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(20px);
}

.hero-role {
  position: absolute;
  bottom: clamp(2rem, 5vw, 3.5rem);
  left: var(--px);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 2;
  opacity: 0;
}

.hero-scroll {
  position: absolute;
  bottom: clamp(2rem, 5vw, 3.5rem);
  right: var(--px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
  opacity: 0;
}
.hero-scroll-text {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}
.hero-scroll-line {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.38);
  position: relative;
  overflow: hidden;
  transform: rotate(90deg);
}
.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--white);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { left: -100%; }
  50%  { left: 100%; }
  100% { left: 100%; }
}

/* hero-role and hero-scroll share the same bottom row on wide
   screens (left vs right); at narrow widths the role label runs
   long enough to collide with "Scroll", so stack them instead. */
@media (max-width: 640px) {
  .hero-scroll {
    bottom: clamp(1.25rem, 4vw, 1.75rem);
  }
  .hero-role {
    bottom: clamp(3.25rem, 11vw, 4rem);
  }
}

/* ─── AMBIENT SOUND TOGGLE ────────────────────────────────── */
.sound-toggle {
  position: absolute;
  right: calc(var(--px) + 4px);
  bottom: calc(clamp(2rem, 5vw, 3.5rem) + 37px);
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.38);
  opacity: 0;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.sound-toggle:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}
.sound-icon {
  width: 16px;
  height: 16px;
}
.sound-icon--on { display: none; }
.sound-toggle.playing .sound-icon--off { display: none; }
.sound-toggle.playing .sound-icon--on { display: block; }

/* role text runs nearly full-width at narrow widths, so the toggle
   needs to clear it vertically rather than share a row via left/right */
@media (max-width: 640px) {
  .sound-toggle {
    bottom: clamp(5.5rem, 14vw, 6.5rem);
  }
}

/* ─── HERO BADGES ─────────────────────────────────────────── */
.hero-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(12px);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.25s ease, opacity 0.25s ease;
}
.hero-badge:hover { color: var(--white); }

/* Decoy badge: logo mark + text */
.hero-badge--decoy {
  gap: 0.55rem;
}

.hero-badge-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.hero-badge-logo svg {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  display: block;
  transition: transform 0.3s var(--ease-expo);
}
.hero-badge--decoy:hover .hero-badge-logo svg {
  transform: scale(1.1);
}

.hero-badge-text {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.hero-badge-text em {
  font-style: normal;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.06em;
}

/* Icon-only badges (LinkedIn, Malt) */
.hero-badge--icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  opacity: 0.55;
  transition: opacity 0.25s ease;
}
.hero-badge--icon:hover { opacity: 1; }
.hero-badge--icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Divider between Decoy and icons */
.hero-badge-divider {
  display: block;
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

/* ─── AMBIENT PARALLAX BLOBS ──────────────────────────────── */
/* Soft, out-of-focus color fields giving About/Contact their
   own depth instead of one flat --bg slab; driven per-blob by
   GSAP ScrollTrigger scrub in app.js for a parallax drift. */
.blob {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.blob-about-1 {
  top: -12%;
  right: -8%;
  width: 550px;
  height: 550px;
  background: rgba(252, 172, 20, 0.22);
}
.blob-about-2 {
  bottom: -15%;
  left: -10%;
  width: 420px;
  height: 420px;
  background: rgba(240, 68, 33, 0.16);
}
.blob-contact-1 {
  top: -10%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: rgba(94, 149, 235, 0.16);
}
@media (max-width: 640px) {
  .blob { filter: blur(60px); }
  .blob-about-1, .blob-about-2, .blob-contact-1 { width: 300px; height: 300px; }
}

/* ─── ABOUT SECTION ───────────────────────────────────────── */
.section-about {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  background: rgba(10, 10, 10, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
/* Adaptive quality (app.js) drops this on slow/unaccelerated
   devices — backdrop-filter is expensive to composite without GPU
   support, independent of the particle canvas behind it. */
body.low-perf .section-about {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.about-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.about-text {
  font-family: var(--font);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.about-clients {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.about-clients-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.about-clients-list {
  font-family: var(--font);
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.8;
}

.client-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.client-link:hover {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.3);
}
.client-sep {
  color: var(--text-faint);
}

/* ─── CONTACT SECTION ─────────────────────────────────────── */
.section-contact {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: calc(clamp(3rem, 6vw, 5rem) + var(--sab));
  background: rgba(10, 10, 10, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
body.low-perf .section-contact {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.contact-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.contact-title {
  font-family: var(--font);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--white);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.contact-title em {
  font-style: italic;
  font-weight: 300;
}

.contact-email-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--white);
  border-bottom: 1px solid var(--text-faint);
  padding-bottom: 0.3rem;
  transition: border-color 0.3s ease, gap 0.3s var(--ease-expo);
}
.contact-email:hover {
  border-color: var(--white);
  gap: 1.2rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.copy-btn:hover {
  border-color: rgba(255,255,255,0.35);
  color: var(--white);
}
.copy-btn.copied {
  border-color: rgba(255,255,255,0.35);
  color: var(--white);
}
.copy-btn-label {
  font-family: var(--font);
}

.contact-social {
  display: flex;
  gap: 1rem;
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

.social-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.social-link:hover {
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}

.contact-copy {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ─── REVEAL ANIMATIONS ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}

/* ─── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-line-inner { transform: none !important; }
  .hero-tagline { opacity: 1 !important; transform: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
