:root {
  --bg-start: #1A1A1A;
  --bg-end:   #F2EFE6;
  --fg:       #F2EFE6;
  --accent:   #E8550C;
  --glass-bg: rgba(242,239,230,0.06);
  --glass-bg-hover: rgba(242,239,230,0.10);
  --glass-border: rgba(242,239,230,0.18);
  --glass-highlight: rgba(255,255,255,0.14);
}
html[data-theme="clear"] {
  --bg-start: #FFFFFF;
  --bg-end:   #1A1A1A;
  --fg:       #1A1A1A;
  --glass-bg: rgba(26,26,26,0.05);
  --glass-bg-hover: rgba(26,26,26,0.09);
  --glass-border: rgba(26,26,26,0.16);
  --glass-highlight: rgba(255,255,255,0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg-start); transition: background 0.6s ease; }
body {
  font-family: 'Archivo', sans-serif;
  color: var(--fg);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  background: transparent;
  transition: color 0.6s ease;
}

/* === FIXED BACKGROUND STACK === */
.bg-stack { position: fixed; inset: 0; z-index: -10; overflow: hidden; }
.bg-base    { position: absolute; inset: 0; background: var(--bg-start); z-index: 1; transition: background 0.6s ease; }
.bg-showreel{ position: absolute; inset: 0; z-index: 2; opacity: 0; will-change: opacity; overflow: hidden; }
.bg-showreel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-showreel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.40) 100%);
  pointer-events: none;
}
.bg-end { position: absolute; inset: 0; background: var(--bg-end); opacity: 0; z-index: 3; will-change: opacity; transition: background 0.6s ease; }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === ENCORE LOGO — inline SVG, vector-crisp ===
   The wordmark is rendered as inline SVG <text> with fill="currentColor",
   so the existing --fg interpolation (scroll + theme) drives the colour.
   On load each logo runs a letter-cycling reveal; on hover the letters
   switch to a stroked outline whose dashoffset rewinds in a loop. */
.mirage-logo { position: relative; display: inline-block; color: var(--fg); }
.mirage-logo .logo-base { position: relative; display: block; }
.nav-logo.mirage-logo .logo-base { display: inline-block; }
.mirage-logo .mirage-spot { display: none; }
.mirage-logo .logo-base > img { display: block; width: 100%; height: auto; }
.nav-logo.mirage-logo .logo-base > img { height: 22px; width: auto; }
.mirage-logo .logo-base > img.logo-dark { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

.hero-logo { transform-origin: 50% 50%; will-change: transform, opacity; }

/* === NAVIGATION === */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 24px 48px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.nav-logo { display: inline-block; }
.nav-logo .logo-base { height: 22px; width: auto; }
.nav-logo img { height: 22px; width: auto; }

.nav-right { display: flex; align-items: center; gap: 28px; }

.nav-links {
  display: flex; gap: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
}
.nav-links a {
  color: currentColor; text-decoration: none; opacity: 0.85;
  transition: opacity 0.3s, letter-spacing 0.5s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: currentColor;
  transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
}
.nav-links a:hover, .nav-links a.active { opacity: 1; letter-spacing: 0.24em; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.toggle-group {
  display: inline-flex; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 6px 4px;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  background: var(--glass-bg);
}
.toggle-group button {
  background: transparent; border: 0; color: currentColor;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  padding: 4px 10px; border-radius: 100px;
  cursor: pointer; opacity: 0.55;
  transition: opacity 0.3s, background 0.3s, color 0.3s;
}
.toggle-group button.active {
  opacity: 1; background: var(--fg); color: var(--bg-start);
}

/* === HERO (sticky pin: page freezes while halves converge) === */
.hero { height: 200vh; position: relative; padding: 0; }
.hero-pin {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 0 48px; overflow: hidden;
}
.hero-logo {
  position: relative;
  width: min(80vw, 1100px);
  aspect-ratio: 2628 / 416;
  opacity: 0;
  will-change: opacity;
}
.hero-logo .logo-half {
  position: absolute; top: 0; bottom: 0;
  width: 50%;
  overflow: hidden;
  filter: url(#liquid-lens);
  will-change: transform, filter;
}
.hero-logo .logo-half img {
  position: absolute; top: 0;
  width: 200%; height: auto;
  display: block;
}
.hero-logo .logo-left  { left: 0;  transform-origin: 100% 50%; }
.hero-logo .logo-left  img { left: 0; }
.hero-logo .logo-right { right: 0; transform-origin: 0% 50%; }
.hero-logo .logo-right img { right: 0; }
.hero-logo .logo-half img.logo-dark { opacity: 0; }

.scroll-cue {
  position: absolute; bottom: 48px; left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.35em; text-transform: uppercase;
  opacity: 0.5; animation: drift 2.6s infinite ease-in-out;
  transition: opacity 0.4s;
}
@keyframes drift {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* === SECTIONS === */
section { position: relative; padding: 180px 48px; z-index: 2; }
.section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  opacity: 0.6; margin-bottom: 60px;
}

.liquid-glass {
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  position: relative; overflow: hidden;
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 0 rgba(0,0,0,0.18),
    0 30px 60px -20px rgba(0,0,0,0.35);
}
.liquid-glass::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, var(--glass-highlight) 0%, transparent 100%);
  pointer-events: none; border-radius: 28px 28px 0 0;
}

.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* === DISCIPLINES === */
.disciplines-section { max-width: 1500px; margin: 0 auto; }
.disciplines-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.glass-card {
  padding: 56px 40px 44px;
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; justify-content: space-between;
  text-decoration: none; color: currentColor;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), background 0.4s ease;
}
.glass-card:hover { transform: translateY(-8px); background: var(--glass-bg-hover); }
.card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.3em; opacity: 0.65;
  position: relative; z-index: 2;
}
.card-name {
  font-family: 'Archivo', sans-serif; font-weight: 900;
  font-size: clamp(48px, 6vw, 96px);
  line-height: 0.9; letter-spacing: -0.02em; text-transform: uppercase;
  position: relative; z-index: 2;
}

/* === WORKS === */
.works-section { max-width: 1500px; margin: 0 auto; }
.work-list { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.work {
  border-radius: 24px;
  text-decoration: none; color: currentColor;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
  cursor: pointer;
  display: block;
}
.work:hover { transform: translateY(-8px); }
.work-visual {
  aspect-ratio: 4 / 3; width: 100%;
  background:
    radial-gradient(circle at 35% 35%, rgba(232,85,12,0.22) 0%, transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(255,255,255,0.06) 0%, transparent 50%);
  position: relative;
}
.work-info {
  padding: 26px 30px 30px; position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.work-title {
  font-family: 'Archivo', sans-serif; font-weight: 800;
  font-size: 26px; line-height: 1.05; letter-spacing: -0.01em; text-transform: uppercase;
}
.work-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0.65; text-align: right; line-height: 1.8; white-space: nowrap;
}

/* === CONTACT (home tail) === */
.contact-section { text-align: center; padding: 200px 48px 120px; }
.contact-cta-wrap { margin-bottom: 80px; }
.contact-mark { width: min(70vw, 900px); margin: 0 auto; display: block; }

.contact-button {
  display: inline-block; padding: 22px 52px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.35em; text-transform: uppercase;
  color: currentColor; text-decoration: none;
  position: relative;
  transition: background 0.4s, transform 0.25s cubic-bezier(0.16,1,0.3,1);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 0 rgba(0,0,0,0.18);
  will-change: transform;
}
.contact-button::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, var(--glass-highlight) 0%, transparent 100%);
  pointer-events: none; border-radius: 100px 100px 0 0;
}
.contact-button:hover { background: var(--glass-bg-hover); }

/* === FOOTER === */
footer {
  padding: 48px 48px 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  opacity: 0.5; position: relative; z-index: 2;
}
footer a { color: currentColor; text-decoration: none; opacity: 0.9; }
footer a:hover { opacity: 0.5; }
footer .socials { display: flex; gap: 24px; }

/* === SUB-PAGE LAYOUT === */
.page-hero {
  padding: 200px 48px 80px;
  max-width: 1500px; margin: 0 auto;
  position: relative; z-index: 2;
}
.page-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  opacity: 0.6; margin-bottom: 24px;
}
.page-title {
  font-family: 'Archivo', sans-serif; font-weight: 900;
  font-size: clamp(64px, 11vw, 200px);
  line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase;
  margin-bottom: 40px;
}
.page-intro {
  max-width: 720px;
  font-size: 20px; line-height: 1.55; opacity: 0.85;
  margin-bottom: 80px;
}
.page-content { max-width: 1500px; margin: 0 auto; padding: 0 48px 180px; position: relative; z-index: 2; }
.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 80px; }
.media-tile {
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 40%, rgba(232,85,12,0.25) 0%, transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(120,80,255,0.18) 0%, transparent 55%);
  border: 1px solid var(--glass-border);
  position: relative; overflow: hidden;
}
.media-tile.tall { aspect-ratio: 3 / 4; }
.media-tile.wide { aspect-ratio: 16 / 9; grid-column: 1 / -1; }

.back-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
  color: currentColor; text-decoration: none; opacity: 0.7;
  transition: opacity 0.3s, gap 0.4s cubic-bezier(0.16,1,0.3,1);
  margin-bottom: 60px;
}
.back-link:hover { opacity: 1; gap: 18px; }

/* === CONTACT FORM === */
.form-section { max-width: 720px; margin: 0 auto; padding: 0 48px 180px; position: relative; z-index: 2; }
.contact-form { display: grid; gap: 24px; }
.field {
  display: flex; flex-direction: column; gap: 8px;
}
.field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  opacity: 0.7;
}
.field input, .field textarea {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 18px;
  color: currentColor;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.field input::placeholder, .field textarea::placeholder {
  color: currentColor; opacity: 0.4;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  background: var(--glass-bg-hover);
}
.field textarea { min-height: 140px; resize: vertical; font-family: 'Archivo', sans-serif; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field-required::after { content: ' *'; color: var(--accent); }

.form-submit {
  justify-self: start;
  padding: 20px 44px;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  background: var(--glass-bg);
  color: currentColor;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.35em; text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), background 0.4s;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 0 rgba(0,0,0,0.18);
}
.form-submit:hover { background: var(--glass-bg-hover); transform: scale(1.04); }
.form-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0.5; margin-top: 12px;
}

@media (max-width: 900px) {
  nav { padding: 16px 20px; gap: 12px; flex-wrap: wrap; }
  .nav-right { gap: 14px; }
  .nav-links { gap: 16px; }
  section { padding: 100px 24px; }
  .hero { padding: 0; }
  .hero-pin { padding: 0 24px; }
  .disciplines-grid { grid-template-columns: 1fr; }
  .work-list { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .page-hero, .page-content, .form-section { padding-left: 24px; padding-right: 24px; }
  footer { flex-direction: column; gap: 16px; padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .mirage-spot { display: none !important; }
  .hero-logo { opacity: 1 !important; }
  .hero-logo .logo-half { filter: none !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
