/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Ovo&display=swap');

@font-face {
  font-family: 'Mergila';
  src: url('fonts/Mergila%20DEMO%20VERSION.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'RosieBrown';
  src: url('fonts/Rosie%20Brown%20Serif%20Demo.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  color: #C1C1C1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== PAGE CONTAINER ===== */
.page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page.active {
  opacity: 1;
  visibility: visible;
}

/* ===== RADIAL CLIP-PATH TEXT REVEAL ===== */
.r-char {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  will-change: clip-path, opacity;
}

/* Block elements (divider, social icons) — animate as whole units */
.r-block {
  opacity: 0;
  clip-path: inset(0 50% 0 50%);
  will-change: clip-path, opacity;
}

/* Hide CSS pseudo-element brackets on split nav links — we use real bracket spans instead */
.nav-link.r-split::before,
.nav-link.r-split::after {
  display: none !important;
}

/* ===== BACKGROUND IMAGES & VIDEO ===== */
.page-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Static image — always present as fallback, sits behind video */
.bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Video — sits on top of image on desktop */
.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

/* If video fails, hide it so image shows through */
.bg-video.hidden {
  display: none;
}

/* Gradient overlay — sits on top of everything */
.page-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 30%,
    rgba(0, 0, 0, 0.3) 60%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
}

/* ===== CONTENT OVERLAY ===== */
.page-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* HOME: vertically centered */
#page-home .page-content {
  justify-content: center;
  padding-left: 72px;
}

/* Inner pages - unified fixed position */
#page-about .page-content,
#page-works .page-content,
#page-strategy .page-content {
  padding: 140px 0 0 140px;
}

/* ===== LOGO ===== */
.logo {
  color: #C1C1C1;
  user-select: none;
  cursor: pointer;
  line-height: 1;
  margin-bottom: 24px;
}

.logo-star {
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* Home: large star above text */
#page-home .logo-star {
  width: 250px;
  height: 250px;
  margin-bottom: 50px;
}

/* Inner pages: small star inline beside text, centered on text */
#page-about .logo,
#page-works .logo,
#page-strategy .logo {
  display: flex;
  align-items: center;
}

#page-about .logo-star,
#page-works .logo-star,
#page-strategy .logo-star {
  width: 42px;
  height: 42px;
  margin-right: 14px;
  flex-shrink: 0;
}

#page-about .logo-title,
#page-works .logo-title,
#page-strategy .logo-title {
  height: 48px;
}

.logo-title {
  height: 48px;
  width: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* ===== TAGLINE (Home only) ===== */
.tagline {
  font-family: 'Ovo', serif;
  font-size: 25px;
  letter-spacing: 5px;
  line-height: 1.5;
  color: rgba(193, 193, 193, 0.85);
  margin-bottom: 24px;
  text-transform: uppercase;
}

/* ===== DIVIDER ===== */
.divider {
  width: 360px;
  height: 1px;
  background: #C1C1C1;
  margin-bottom: 18px;
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
}

.nav-link {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 25px;
  letter-spacing: 3px;
  color: #C1C1C1;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
  text-transform: uppercase;
}

.nav-link:hover { color: #ffffff; }
.nav-link.active {
  color: #d8d8d8;
  text-shadow:
    0 0 4px rgba(220, 215, 205, 0.9),
    0 0 12px rgba(220, 215, 205, 0.7),
    0 0 30px rgba(210, 200, 185, 0.5),
    0 0 60px rgba(200, 190, 175, 0.3),
    0 0 100px rgba(200, 190, 175, 0.15);
}
.nav-link.active::before { content: '['; }
.nav-link.active::after { content: ']'; }

/* ===== BODY TEXT (About) ===== */
.body-text {
  max-width: 600px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.65;
  color: #C1C1C1;
  letter-spacing: 0.2px;
}

.body-text p { margin-bottom: 28px; }
.body-text p:last-child { margin-bottom: 0; }

/* ===== WORKS LIST ===== */
.works-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.works-item {
  display: flex;
  align-items: baseline;
  gap: 40px;
}

.works-type {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 2px;
  color: #C1C1C1;
  text-transform: uppercase;
  width: 300px;
  flex-shrink: 0;
}

.works-name {
  font-family: 'Inter', sans-serif;
  font-weight: 650;
  font-size: 20px;
  letter-spacing: 2px;
  color: #C1C1C1;
  text-transform: uppercase;
  text-shadow:
    0 0 7px rgba(210, 200, 185, 0.6),
    0 0 20px rgba(210, 200, 185, 0.4),
    0 0 40px rgba(200, 190, 175, 0.25),
    0 0 80px rgba(200, 190, 175, 0.15);
}

/* ===== STRATEGY SECTIONS ===== */
.strategy-content { max-width: 600px; }
.strategy-section { margin-bottom: 24px; }
.strategy-section:last-child { margin-bottom: 0; }

.strategy-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 25px;
  letter-spacing: 0.5px;
  color: #C1C1C1;
  margin-bottom: 4px;
}

.strategy-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.6;
  color: #C1C1C1;
  letter-spacing: 0.2px;
}

/* ===== CONTACT / FOOTER ===== */
.contact { margin-top: 28px; }
#page-about .contact { margin-top: 50px; }
#page-strategy .contact { margin-top: 30px; }

.contact-label {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 25px;
  letter-spacing: 0.5px;
  color: #C1C1C1;
  margin-bottom: 14px;
}

/* ===== SOCIAL ICONS ===== */
.social-icons {
  display: flex;
  gap: 14px;
}

.social-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  text-decoration: none;
  background: #C1C1C1;
  box-shadow:
    0 0 4px rgba(220, 215, 205, 0.54),
    0 0 12px rgba(220, 215, 205, 0.42),
    0 0 30px rgba(210, 200, 185, 0.3),
    0 0 60px rgba(200, 190, 175, 0.18);
}

.social-btn:hover {
  box-shadow:
    0 0 6px rgba(220, 215, 205, 0.6),
    0 0 16px rgba(220, 215, 205, 0.51),
    0 0 40px rgba(210, 200, 185, 0.36),
    0 0 80px rgba(200, 190, 175, 0.24);
}

.social-btn svg {
  width: 22px;
  height: 22px;
  fill: #0a0a0a;
}

/* ===== AUDIO TOGGLE ===== */
.audio-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: #C1C1C1;
  box-shadow:
    0 0 4px rgba(220, 215, 205, 0.54),
    0 0 12px rgba(220, 215, 205, 0.42),
    0 0 30px rgba(210, 200, 185, 0.3),
    0 0 60px rgba(200, 190, 175, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.audio-toggle:hover {
  box-shadow:
    0 0 6px rgba(220, 215, 205, 0.6),
    0 0 16px rgba(220, 215, 205, 0.51),
    0 0 40px rgba(210, 200, 185, 0.36),
    0 0 80px rgba(200, 190, 175, 0.24);
}

.audio-toggle svg {
  width: 22px;
  height: 22px;
  fill: #0a0a0a;
}

/* Show muted icon by default, hide playing */
.audio-toggle .icon-playing { display: none; }
.audio-toggle .icon-muted { display: block; }

/* When playing, swap icons */
.audio-toggle.playing .icon-playing { display: block; }
.audio-toggle.playing .icon-muted { display: none; }

/* ===== STAR TRANSITION CLONE ===== */
.star-clone {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  object-fit: contain;
  will-change: transform;
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
              width 1.6s cubic-bezier(0.16, 1, 0.3, 1),
              height 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== MOBILE-ONLY ELEMENTS (hidden on desktop) ===== */
.scroll-down,
.section-title,
.email-cta,
.mobile-sticky-logo,
.mobile-sticky-socials,
.mobile-fixed-bg {
  display: none;
}


/* ============================================================
   MOBILE LAYOUT — max-width 900px
   ============================================================ */
@media (max-width: 900px) {

  /* ----- Base overrides ----- */
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
  }

  body {
    transform: none !important;
    width: 100% !important;
    height: auto !important;
  }

  /* ----- All pages visible, stacked vertically ----- */
  .page {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    transition: none;
  }

  /* ----- Hide all per-page backgrounds on mobile ----- */
  .page-bg {
    display: none !important;
  }

  /* ===== FIXED BACKGROUND SYSTEM ===== */
  .mobile-fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
  }

  .mobile-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.05s;
  }

  .mobile-bg-layer.active {
    opacity: 1;
  }

  .mobile-bg-layer[data-page="page-home"] {
    background-image: url('img/imageOne.png');
    background-position: 65% center;
  }

  .mobile-bg-layer[data-page="page-about"] {
    background-image: url('img/imageTwo.png');
    background-position: 65% center;
  }

  .mobile-bg-layer[data-page="page-works"] {
    background-image: url('img/imageThree.png');
  }

  .mobile-bg-layer[data-page="page-strategy"] {
    background-image: url('img/imageFour.png');
  }

  /* Gradient overlay */
  .mobile-fixed-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.6) 30%,
      rgba(0, 0, 0, 0.3) 60%,
      rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
  }

  /* Glitch transition */
  @keyframes bgGlitch {
    0%   { transform: translate(0); filter: none; }
    10%  { transform: translate(-4px, 2px); filter: hue-rotate(90deg) saturate(2); }
    20%  { transform: translate(3px, -3px); filter: brightness(1.5) contrast(1.3); }
    30%  { transform: translate(-2px, 1px); filter: hue-rotate(-60deg) saturate(1.5); }
    40%  { transform: translate(4px, -1px); filter: invert(0.15) brightness(1.3); }
    50%  { transform: translate(-3px, 3px); filter: hue-rotate(45deg) contrast(1.4); }
    60%  { transform: translate(2px, -2px); filter: brightness(0.8) saturate(2); }
    70%  { transform: translate(-1px, 2px); filter: hue-rotate(-30deg); }
    80%  { transform: translate(3px, -1px); filter: contrast(1.2) brightness(1.1); }
    90%  { transform: translate(-2px, 0); filter: hue-rotate(20deg); }
    100% { transform: translate(0); filter: none; }
  }

  .mobile-fixed-bg.glitching .mobile-bg-layer {
    animation: bgGlitch 0.3s steps(4) both;
  }

  /* Pages transparent so fixed bg shows through */
  .page {
    background: transparent !important;
  }

  .page-content {
    position: relative;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 1;
  }

  /* ----- Hide desktop-only elements ----- */
  .nav,
  .divider,
  .contact-label {
    display: none !important;
  }

  /* ----- Show mobile-only elements ----- */
  .scroll-down,
  .section-title,
  .email-cta,
  .mobile-fixed-bg {
    display: block;
  }

  /* ----- Mobile reveal: CSS transitions on whole elements ----- */
  .m-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
  }

  .m-reveal.m-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Home content — visible immediately (not scroll-revealed) */
  #page-home .page-content * {
    opacity: 1 !important;
    transform: none !important;
  }

  /* ===== STICKY LOGO ===== */
  .mobile-sticky-logo {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 48px;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.6) 60%, transparent 100%);
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    cursor: pointer;
    line-height: 1;
  }

  .mobile-sticky-logo.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile-sticky-logo .logo-title {
    height: 28px;
  }

  /* ===== FIX 4: STICKY SOCIAL ICONS (one set, fixed bottom-right) ===== */
  .mobile-sticky-socials {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 100;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
  }

  .mobile-sticky-socials.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }

  .mobile-sticky-socials .social-btn {
    width: 44px;
    height: 44px;
    background: #C1C1C1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-sticky-socials .social-btn svg {
    width: 24px;
    height: 24px;
    fill: #0a0a0a;
  }

  /* Hide all per-section contacts on mobile — sticky socials replace them */
  .page .contact {
    display: none !important;
  }

  /* ==================== HOME (mobile) ==================== */
  #page-home .page-content {
    justify-content: flex-end;
    padding: 0 0 28vh 48px;
  }

  #page-home .logo {
    margin-bottom: 16px;
  }

  #page-home .logo-title {
    height: 38px;
  }

  .logo-star {
    display: none !important;
  }

  #page-home .tagline {
    font-size: 16px;
    letter-spacing: 3px;
    margin-bottom: 28px;
  }

  .scroll-down {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 14px;
    font-style: italic;
    color: #C1C1C1;
    letter-spacing: 0.5px;
  }

  /* ==================== INNER PAGES shared (mobile) ==================== */
  #page-about .page-content,
  #page-works .page-content,
  #page-strategy .page-content {
    padding: 40px 40px 100px 48px;
    justify-content: flex-start;
  }

  /* Hide inner page logos — sticky logo replaces */
  #page-about .logo,
  #page-works .logo,
  #page-strategy .logo {
    display: none;
  }

  /* Section titles — glow */
  .section-title {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 22px;
    letter-spacing: 2px;
    color: #d8d8d8;
    text-shadow:
      0 0 4px rgba(220, 215, 205, 0.9),
      0 0 12px rgba(220, 215, 205, 0.7),
      0 0 30px rgba(210, 200, 185, 0.5),
      0 0 60px rgba(200, 190, 175, 0.3);
    margin-bottom: 24px;
  }

  /* ==================== ABOUT (mobile) ==================== */
  #page-about .section-title {
    margin-top: auto;
  }

  #page-about .body-text {
    max-width: 85%;
    font-size: 16px;
    line-height: 1.6;
    flex-shrink: 0;
  }

  #page-about .body-text p {
    margin-bottom: 20px;
  }

  .email-cta {
    margin-top: 4px;
  }

  #page-about,
  #page-about .page-content {
    min-height: 120vh;
    min-height: 120dvh;
  }

  /* ==================== WORKS (mobile) ==================== */
  #page-works .section-title {
    margin-top: auto;
    text-align: center;
    align-self: center;
    margin-bottom: 20px;
  }

  #page-works .works-list {
    gap: 6px;
    align-self: center;
  }

  .works-item {
    gap: 24px;
    justify-content: center;
  }

  .works-type {
    font-size: 13px;
    letter-spacing: 1.5px;
    width: auto;
    min-width: 160px;
    text-align: right;
  }

  .works-name {
    font-size: 14px;
    letter-spacing: 1.5px;
    min-width: 170px;
  }

  #page-works,
  #page-works .page-content {
    min-height: 115vh;
    min-height: 115dvh;
  }

  #page-works .page-content {
    padding-bottom: 120px;
  }

  /* ==================== STRATEGY (mobile) ==================== */
  #page-strategy .section-title {
    margin-top: 30px;
    margin-bottom: 20px;
  }

  #page-strategy .strategy-content {
    max-width: 85%;
  }

  .strategy-label {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .strategy-desc {
    font-size: 15px;
    line-height: 1.55;
  }

  .strategy-section {
    margin-bottom: 20px;
  }

  /* Audio toggle inside sticky socials — match social button sizing */
  .mobile-sticky-socials .audio-toggle {
    position: static;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #C1C1C1;
  }

  .mobile-sticky-socials .audio-toggle svg {
    width: 24px;
    height: 24px;
    fill: #0a0a0a;
  }
}


/* ============================================================
   SMALL MOBILE — max-width 480px
   ============================================================ */
@media (max-width: 480px) {

  #page-home .page-content { padding: 0 0 28vh 32px; }
  #page-home .logo-title { height: 32px; }
  #page-home .tagline { font-size: 14px; letter-spacing: 2.5px; }

  .mobile-sticky-logo { padding: 16px 32px; }
  .mobile-sticky-logo .logo-title { height: 22px; }

  .mobile-sticky-socials { right: 24px; bottom: 30px; }

  #page-about .page-content,
  #page-works .page-content,
  #page-strategy .page-content {
    padding: 32px 24px 90px 32px;
  }

  .section-title { font-size: 18px; }
  #page-about .body-text { max-width: 90%; font-size: 15px; }

  .works-item {
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
  }

  .works-type { font-size: 11px; min-width: unset; text-align: center; }
  .works-name { font-size: 13px; min-width: unset; }
  #page-works .works-list { gap: 12px; }

  .strategy-desc { font-size: 14px; }
  .strategy-label { font-size: 16px; }
}