/* V8 — BACK TO WORKING BASE, STABLE MARAME GRID */

:root {
  --orange: #f8b42a;
  --deep-orange-glow: rgba(199, 95, 0, .50);
  --deep-orange-cursor: rgba(199, 95, 0, .34);
  --black: #050505;
  --white: #fff;
  --line: rgba(255,255,255,.13);
  --gap: clamp(8px,1.1vw,18px);
  --ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }
html { background: #050505; scroll-behavior: smooth; }

body {
  margin: 0;
  background: #050505;
  color: white;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; cursor: none; }

/* PASSWORD */
.password-page {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, rgba(199,95,0,.32), transparent 22rem), #f8b42a;
  color: #0b0b0b;
  cursor: auto;
}

.password-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.password-card {
  width: min(92vw, 430px);
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(0,0,0,.16);
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(18px);
  box-shadow: 0 34px 100px rgba(0,0,0,.18);
}

.password-card p {
  margin: 0;
  color: rgba(0,0,0,.62);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 900;
}

.password-card h1 {
  margin: 0 0 8px;
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  line-height: .86;
  letter-spacing: -.06em;
  text-transform: uppercase;
}

.password-card label {
  display: grid;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .7rem;
  font-weight: 900;
}

.password-card input {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.62);
  padding: 12px 18px;
  font: inherit;
  color: #0b0b0b;
  outline: none;
}

.password-card input:focus {
  border-color: rgba(0,0,0,.55);
  background: rgba(255,255,255,.78);
}

.password-card button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: #0b0b0b;
  color: white;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
}

.password-card em {
  color: #8b0000;
  font-style: normal;
  font-weight: 800;
}

/* GLOBAL FX */
.progress {
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: white;
  mix-blend-mode: difference;
}

.custom-cursor {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50%;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  mix-blend-mode: difference;
  transition: width .28s var(--ease), height .28s var(--ease), background .28s var(--ease);
}

.custom-cursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.custom-cursor.is-hover {
  width: 54px;
  height: 54px;
  background: rgba(255,255,255,.08);
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at var(--cursorX,50%) var(--cursorY,50%), var(--deep-orange-cursor), transparent 10rem);
  mix-blend-mode: multiply;
  opacity: .85;
}

.orange-wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--orange);
  opacity: var(--orangeOpacity, 1);
  pointer-events: none;
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(15px,2.6vw,42px);
  padding: 0 clamp(18px,4vw,64px);
}

body.is-scrolled .nav {
  background: rgba(5,5,5,.72);
  backdrop-filter: blur(18px);
}

.nav a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .68rem;
  font-weight: 850;
}

/* HERO */
.hero {
  position: relative;
  z-index: 2;
  min-height: 108vh;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx,50%) var(--my,35%), var(--deep-orange-glow), transparent 13rem);
  opacity: var(--orangeOpacity, 1);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  min-height: 92vh;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 96px clamp(18px,6vw,90px) 70px;
}

.hero-logo {
  width: min(72vw, 720px);
  max-height: 220px;
  object-fit: contain;
  opacity: calc(1 - min(var(--scrollY, 0) / 360, .92));
  transform: translate3d(0, calc(var(--scrollY, 0) * .02px), 0) scale(calc(1 - min(var(--scrollY, 0) / 780, .62)));
  transform-origin: center;
  will-change: transform, opacity;
}

.hero-inner p {
  margin: clamp(78px,8vw,128px) 0 clamp(22px,3.6vw,46px);
  max-width: 900px;
  color: #0b0b0b;
  text-transform: uppercase;
  letter-spacing: clamp(.16em,.42vw,.32em);
  font-size: clamp(.86rem,1.18vw,1.15rem);
  line-height: 1.7;
  font-weight: 780;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 10vh;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  gap: 14px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: .82rem;
  color: #0b0b0b;
}

.scroll-cue i {
  display: block;
  width: 1px;
  height: 68px;
  background: linear-gradient(to bottom, #0b0b0b, transparent);
  animation: cue 1.75s var(--ease) infinite;
  transform-origin: top;
}

@keyframes cue {
  0%,100% { transform: scaleY(.25); opacity: .35; }
  50% { transform: scaleY(1); opacity: 1; }
}

main {
  position: relative;
  z-index: 3;
  background: var(--black);
}

/* SECTIONS */
.chapter {
  padding: clamp(58px,8vw,136px) clamp(10px,2.5vw,36px);
  overflow: hidden;
}

.marame-chapter {
  background: #050505;
}

.optima-placeholder {
  background: linear-gradient(180deg, #2c1850 0%, #2c1850 76%, color-mix(in srgb, #2c1850 55%, #243e55) 92%, #243e55 100%);
}

.tp-placeholder {
  background: linear-gradient(180deg, #243e55 0%, #243e55 76%, #050505 100%);
}

.section-head {
  max-width: 1640px;
  margin: 0 auto clamp(22px,4vw,56px);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.section-head p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .72rem;
  font-weight: 850;
  color: rgba(255,255,255,.76);
}

.section-head p span {
  width: 7px;
  height: 7px;
  display: inline-block;
  background: #fff;
  border-radius: 50%;
}

.chapter-intro {
  max-width: 1640px;
  margin: 0 auto clamp(28px,5vw,82px);
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: clamp(24px,4vw,54px);
}

.chapter-meta {
  color: rgba(255,255,255,.56);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 850;
}

.chapter-title {
  margin: 16px 0 0;
  font-size: clamp(1.1rem, 2.35vw, 3.1rem);
  line-height: .98;
  letter-spacing: clamp(.05em,.22vw,.095em);
  font-weight: 930;
  text-transform: uppercase;
}

.chapter-date {
  margin: 0 0 22px;
  color: rgba(255,255,255,.9);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: clamp(.72rem,1vw,.95rem);
  font-weight: 850;
}

.chapter-summary {
  margin: 0;
  max-width: 920px;
  color: rgba(255,255,255,.72);
  font-size: clamp(1.05rem,1.45vw,1.45rem);
  line-height: 1.42;
}

/* WORKING MARAME GRID */
.marame-grid {
  max-width: 1640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(78px, 7vw, 126px);
  gap: var(--gap);
  grid-auto-flow: dense;
}

.media-card {
  position: relative;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255,255,255,.08);
  opacity: 0;
  transform: translateY(34px) scale(.985);
  transition:
    opacity .82s var(--ease),
    transform .82s var(--ease),
    filter .52s var(--ease),
    box-shadow .52s var(--ease),
    border-color .52s var(--ease);
}

.media-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.media-card img,
.media-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.015);
  transition: transform 1.1s var(--ease);
}

.media-card::after {
  display: none;
}

.marame-grid:hover .media-card:not(:hover) {
  filter: brightness(.62) saturate(.85);
}

.marame-grid:hover .media-card:hover {
  z-index: 5;
  transform: scale(1.035);
  border-color: rgba(255,255,255,.95);
  box-shadow: 0 38px 90px rgba(0,0,0,.58);
}

.media-card:hover img,
.media-card:hover video {
  transform: scale(1.09);
}

/* This is the stable V5-style layout, just with more slots */
.tile-square {
  grid-column: span 3;
  grid-row: span 3;
}

.tile-portrait {
  grid-column: span 3;
  grid-row: span 5;
}

.tile-landscape {
  grid-column: span 6;
  grid-row: span 3;
}

.missing-media {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.02)), #111;
  color: rgba(255,255,255,.76);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  text-align: center;
  padding: 18px;
}

.missing-media small {
  display: block;
  max-width: 100%;
  color: rgba(255,255,255,.38);
  font-size: .58rem;
  letter-spacing: .08em;
  word-break: break-word;
}

.button-row {
  max-width: 1640px;
  margin: clamp(22px,3vw,46px) auto 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.website-pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.58);
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
  font-weight: 900;
  transition:
    transform .55s var(--ease),
    border-color .55s var(--ease),
    background .55s var(--ease),
    box-shadow .55s var(--ease);
}

.website-pill-button:hover {
  transform: translateY(-4px) scale(1.025);
  border-color: #fff;
  background: rgba(255,255,255,.16);
  box-shadow: 0 18px 50px rgba(0,0,0,.38), 0 0 32px rgba(255,255,255,.12);
}

.about,
.contact {
  max-width: 1640px;
  margin: 0 auto;
  padding: clamp(60px,9vw,140px) clamp(18px,3vw,36px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(34px,8vw,150px);
}

.about h2,
.contact h2 {
  margin: 0;
  font-size: clamp(2.7rem,7vw,8rem);
  line-height: .86;
  letter-spacing: -.06em;
}

.about p,
.contact a {
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: clamp(1.45rem,3vw,4rem);
  line-height: 1;
  letter-spacing: -.04em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact div {
  display: grid;
  gap: 22px;
}

/* TABLET */
@media (max-width: 1050px) {
  .marame-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .tile-square,
  .tile-portrait {
    grid-column: span 4;
  }

  .tile-landscape {
    grid-column: span 8;
  }

  .about,
  .contact {
    grid-template-columns: 1fr;
  }
}

/* MOBILE */
@media (max-width: 640px) {
  body, a {
    cursor: auto;
  }

  .custom-cursor {
    display: none;
  }

  .nav {
    justify-content: center;
    gap: 13px;
    height: 64px;
  }

  .nav a {
    font-size: .56rem;
    letter-spacing: .08em;
  }

  .hero-logo {
    width: 72vw;
    max-height: 150px;
  }

  .hero-inner p {
    font-size: .66rem;
    line-height: 1.8;
  }

  .chapter {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chapter-title {
    font-size: clamp(1.7rem, 8vw, 3rem);
  }

  .marame-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
  }

  .tile-square {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 1 / 1;
  }

  .tile-landscape {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 16 / 9;
  }

  .tile-portrait {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 9 / 16;
  }

  .button-row {
    justify-content: center;
  }
}


/* ===== V10 FIXED OPTIMA + SELECTED CARDS ===== */

/* Force Marame order to work by filename: PHP scanner uses natcasesort. Rename files 01,02,03 etc. */

/* Remove old placeholder/selected weirdness by using independent selectors */
.optima-section {
  background: linear-gradient(180deg, #2c1850 0%, #2c1850 78%, #050505 100%) !important;
}

.optima-grid {
  max-width: 1640px !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  grid-auto-rows: clamp(72px, 6.25vw, 112px) !important;
  gap: var(--gap) !important;
  grid-auto-flow: dense !important;
}

.optima-logo {
  grid-column: span 3 !important;
  grid-row: span 3 !important;
}

.optima-hero-video {
  grid-column: span 9 !important;
  grid-row: span 3 !important;
}

.optima-small-landscape {
  grid-column: span 3 !important;
  grid-row: span 2 !important;
}

.optima-large-landscape {
  grid-column: span 6 !important;
  grid-row: span 3 !important;
}

.optima-grid .media-card img,
.optima-grid .media-card video,
.optima-grid .missing-media {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* SELECTED PROJECTS: actual designed boxes */
.selected-projects {
  background: #050505 !important;
}

.selected-grid {
  max-width: 1640px !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--gap) !important;
}

.selected-card {
  position: relative !important;
  min-height: clamp(340px, 32vw, 520px) !important;
  display: grid !important;
  grid-template-columns: minmax(180px, .82fr) 1.18fr !important;
  gap: clamp(18px, 2.4vw, 38px) !important;
  align-items: stretch !important;
  padding: clamp(16px, 2vw, 28px) !important;
  color: #fff !important;
  text-decoration: none !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background:
    radial-gradient(circle at var(--cardX,50%) var(--cardY,50%), rgba(255,255,255,.08), transparent 18rem),
    rgba(255,255,255,.035) !important;
  transition:
    transform .65s var(--ease),
    border-color .65s var(--ease),
    box-shadow .65s var(--ease),
    filter .65s var(--ease) !important;
}

.selected-card:hover {
  transform: translateY(-8px) scale(1.015) !important;
  box-shadow: 0 34px 92px rgba(0,0,0,.55) !important;
}

.selected-creative {
  border-color: rgba(217,93,115,.55) !important;
}
.selected-creative:hover {
  border-color: #d95d73 !important;
  box-shadow: 0 34px 92px rgba(0,0,0,.55), 0 0 44px rgba(217,93,115,.20) !important;
}

.selected-tp {
  border-color: rgba(53,221,115,.50) !important;
}
.selected-tp:hover {
  border-color: #35dd73 !important;
  box-shadow: 0 34px 92px rgba(0,0,0,.55), 0 0 44px rgba(53,221,115,.22) !important;
}

.selected-conference {
  border-color: rgba(127,214,229,.55) !important;
}
.selected-conference:hover {
  border-color: #7fd6e5 !important;
  box-shadow: 0 34px 92px rgba(0,0,0,.55), 0 0 44px rgba(127,214,229,.22) !important;
}

.selected-spm {
  border-color: rgba(255,255,255,.20) !important;
}
.selected-spm:hover {
  border-color: rgba(255,255,255,.72) !important;
  box-shadow: 0 34px 92px rgba(0,0,0,.55), 0 0 44px rgba(255,255,255,.10) !important;
}

.selected-media {
  position: relative !important;
  overflow: hidden !important;
  background: #101010 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  min-height: 0 !important;
}

.selected-square {
  aspect-ratio: 1 / 1 !important;
  align-self: start !important;
}

.selected-video {
  aspect-ratio: 16 / 10 !important;
  align-self: center !important;
}

.selected-media img,
.selected-media video,
.selected-placeholder {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.selected-placeholder {
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  gap: 10px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.02)), #111 !important;
  color: rgba(255,255,255,.76) !important;
  text-transform: uppercase !important;
  letter-spacing: .16em !important;
  font-size: .72rem !important;
  text-align: center !important;
  padding: 18px !important;
}

.selected-placeholder small {
  color: rgba(255,255,255,.38) !important;
  font-size: .58rem !important;
}

.selected-copy {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 22px !important;
}

.selected-copy span {
  color: rgba(255,255,255,.58) !important;
  text-transform: uppercase !important;
  letter-spacing: .15em !important;
  font-size: .66rem !important;
  font-weight: 900 !important;
}

.selected-copy h3 {
  margin: 0 !important;
  font-size: clamp(2rem, 3.3vw, 4.6rem) !important;
  line-height: .88 !important;
  letter-spacing: -.05em !important;
}

.selected-copy p {
  margin: 0 !important;
  color: rgba(255,255,255,.66) !important;
  font-size: clamp(.98rem, 1.1vw, 1.15rem) !important;
  line-height: 1.42 !important;
  max-width: 560px !important;
}

.selected-copy em {
  font-style: normal !important;
  align-self: flex-start !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 999px !important;
  padding: 12px 16px !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  font-size: .65rem !important;
  font-weight: 900 !important;
}

@media (max-width: 1050px) {
  .optima-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }

  .optima-logo {
    grid-column: span 3 !important;
    grid-row: span 3 !important;
  }

  .optima-hero-video {
    grid-column: span 5 !important;
    grid-row: span 3 !important;
  }

  .optima-small-landscape {
    grid-column: span 4 !important;
  }

  .optima-large-landscape {
    grid-column: span 8 !important;
  }

  .selected-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .optima-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    gap: 14px !important;
  }

  .optima-logo {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 1 / 1 !important;
  }

  .optima-hero-video,
  .optima-small-landscape,
  .optima-large-landscape {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 16 / 9 !important;
  }

  .selected-card {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  .selected-copy h3 {
    font-size: clamp(2rem, 12vw, 3.4rem) !important;
  }
}


/* ===== V11 REFINEMENTS ===== */

/* Hero statement: starts huge/full-width and shrinks away as you scroll */
.hero-statement {
  position: relative !important;
  z-index: 3 !important;
  width: 100vw !important;
  max-width: none !important;
  margin: clamp(64px, 7vw, 110px) 0 clamp(22px,3.6vw,46px) !important;
  color: #0b0b0b !important;
  text-align: center !important;
  white-space: nowrap !important;
  font-size: clamp(2.4rem, 10.5vw, 13rem) !important;
  line-height: .78 !important;
  letter-spacing: -.075em !important;
  text-transform: uppercase !important;
  font-weight: 950 !important;
  transform:
    translate3d(0, calc(80px - min(var(--scrollY, 0) * .42px, 160px)), 0)
    scale(calc(1.14 - min(var(--scrollY, 0) / 900, .58))) !important;
  opacity: calc(min(var(--scrollY, 0) / 180, 1) * (1 - min(max((var(--scrollY, 0) - 420) / 360, 0), 1))) !important;
  will-change: transform, opacity !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  .hero-statement {
    white-space: normal !important;
    font-size: clamp(2.5rem, 18vw, 5.4rem) !important;
    line-height: .82 !important;
    max-width: 94vw !important;
    justify-self: center !important;
    transform:
      translate3d(0, calc(64px - min(var(--scrollY, 0) * .32px, 120px)), 0)
      scale(calc(1.08 - min(var(--scrollY, 0) / 920, .42))) !important;
  }
}

/* Optima: make the first square/logo and hero landscape video taller */
.optima-grid {
  grid-auto-rows: clamp(74px, 6.4vw, 118px) !important;
}

.optima-logo {
  grid-column: span 3 !important;
  grid-row: span 4 !important;
}

.optima-hero-video {
  grid-column: span 9 !important;
  grid-row: span 4 !important;
}

/* Four small landscape blocks remain one row on desktop */
.optima-small-landscape {
  grid-column: span 3 !important;
  grid-row: span 2 !important;
}

/* Four larger landscape pieces: 2 + 2 */
.optima-large-landscape {
  grid-column: span 6 !important;
  grid-row: span 3 !important;
}

/* Bigger SPM Group card */
.selected-spm {
  grid-column: span 2 !important;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr) !important;
  min-height: clamp(420px, 38vw, 680px) !important;
}

.selected-spm .selected-video {
  aspect-ratio: 16 / 9 !important;
  align-self: stretch !important;
}

.selected-spm .selected-copy {
  justify-content: center !important;
}

/* Bring back background cursor glow, but keep it off media/cards */
.page-glow {
  opacity: .9 !important;
  background: radial-gradient(circle at var(--cursorX,50%) var(--cursorY,50%), rgba(199,95,0,.34), transparent 10rem) !important;
  mix-blend-mode: multiply !important;
}

body.media-hover .page-glow {
  opacity: 0 !important;
}

/* Make sure media itself doesn't get the pale circular glow */
.media-card::after,
.selected-card::after,
.selected-media::after {
  display: none !important;
}

/* Orange hover polish back on links/buttons */
.contact a,
.about a,
.nav a,
.website-pill-button,
.selected-copy em,
.password-card button {
  transition:
    color .45s var(--ease),
    border-color .45s var(--ease),
    background .45s var(--ease),
    box-shadow .45s var(--ease),
    transform .45s var(--ease) !important;
}

.contact a:hover,
.about a:hover,
.nav a:hover {
  color: #f8b42a !important;
  text-shadow: 0 0 28px rgba(248,180,42,.34) !important;
}

.website-pill-button:hover,
.selected-card:hover .selected-copy em,
.password-card button:hover {
  border-color: #f8b42a !important;
  box-shadow: 0 20px 54px rgba(0,0,0,.42), 0 0 36px rgba(248,180,42,.18) !important;
}

/* Tablet/mobile fixes for taller Optima and bigger SPM */
@media (max-width: 1050px) {
  .optima-logo {
    grid-column: span 3 !important;
    grid-row: span 4 !important;
  }

  .optima-hero-video {
    grid-column: span 5 !important;
    grid-row: span 4 !important;
  }

  .selected-spm {
    grid-column: span 1 !important;
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .optima-logo {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 1 / 1 !important;
  }

  .optima-hero-video,
  .optima-small-landscape,
  .optima-large-landscape {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 16 / 9 !important;
  }

  .selected-spm {
    min-height: auto !important;
  }
}


/* ===== V12 LAYOUT FIXES ===== */

/* HERO: centre logo and animated statement properly */
.hero-inner {
  place-items: center !important;
  justify-items: center !important;
  text-align: center !important;
}

.hero-logo {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  justify-self: center !important;
}

.hero-statement {
  left: 50% !important;
  right: auto !important;
  transform-origin: center center !important;
  justify-self: center !important;
  text-align: center !important;
  width: 100vw !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  font-size: clamp(2.2rem, 9.25vw, 11.4rem) !important;
  line-height: .96 !important;
  letter-spacing: .015em !important;
  word-spacing: .12em !important;
  transform:
    translate3d(-50%, calc(70px - min(var(--scrollY, 0) * .36px, 150px)), 0)
    scale(calc(1.08 - min(var(--scrollY, 0) / 980, .52))) !important;
}

/* Keep the scroll cue centred */
.scroll-cue {
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* Restore a visible darker orange background cursor glow */
.page-glow {
  opacity: .95 !important;
  background: radial-gradient(circle at var(--cursorX,50%) var(--cursorY,50%), rgba(199,95,0,.42), transparent 13rem) !important;
  mix-blend-mode: screen !important;
  z-index: 2 !important;
}

body.media-hover .page-glow {
  opacity: 0 !important;
}

/* Ensure actual media/card surfaces do not show the pale overlay glow */
.media-card::after,
.selected-card::after,
.selected-media::after {
  display: none !important;
  content: none !important;
}

/* SELECTED PROJECTS: tighten cards so text height matches media better */
.selected-card {
  min-height: clamp(250px, 22vw, 360px) !important;
  grid-template-columns: minmax(150px, .72fr) 1.28fr !important;
  align-items: stretch !important;
}

.selected-copy {
  gap: 12px !important;
  justify-content: center !important;
}

.selected-copy span {
  font-size: .56rem !important;
  letter-spacing: .15em !important;
}

.selected-copy h3 {
  font-size: clamp(1.45rem, 2.3vw, 3rem) !important;
  line-height: .92 !important;
  letter-spacing: -.045em !important;
}

.selected-copy p {
  font-size: clamp(.82rem, .9vw, 1rem) !important;
  line-height: 1.38 !important;
}

.selected-copy em {
  font-size: .56rem !important;
  padding: 10px 14px !important;
  margin-top: 6px !important;
}

/* Card-specific button outlines should match their card colour, not orange */
.selected-creative {
  --card-accent: #d95d73;
}

.selected-tp {
  --card-accent: #35dd73;
}

.selected-conference {
  --card-accent: #7fd6e5;
}

.selected-spm {
  --card-accent: rgba(255,255,255,.72);
}

.selected-card:hover .selected-copy em {
  border-color: var(--card-accent) !important;
  color: #fff !important;
  box-shadow: 0 0 28px color-mix(in srgb, var(--card-accent) 24%, transparent) !important;
}

/* SPM: video on top, text underneath, no overlay/clash */
.selected-spm {
  grid-column: span 2 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto !important;
  min-height: auto !important;
  gap: clamp(18px, 2vw, 30px) !important;
}

.selected-spm .selected-video {
  width: 100% !important;
  aspect-ratio: 16 / 8.2 !important;
  align-self: stretch !important;
}

.selected-spm .selected-copy {
  width: min(920px, 100%) !important;
  justify-content: start !important;
  padding-bottom: 4px !important;
}

.selected-spm .selected-copy h3 {
  font-size: clamp(1.8rem, 3vw, 4rem) !important;
}

/* Bring orange link hover back generally, but selected-card buttons keep their own colours */
.contact a:hover,
.about a:hover,
.nav a:hover {
  color: #f8b42a !important;
  text-shadow: 0 0 30px rgba(248,180,42,.36) !important;
}

.website-pill-button:hover,
.password-card button:hover {
  border-color: #f8b42a !important;
  box-shadow: 0 20px 54px rgba(0,0,0,.42), 0 0 36px rgba(248,180,42,.18) !important;
}

/* Mobile refinements */
@media (max-width: 640px) {
  .hero-statement {
    left: auto !important;
    width: 94vw !important;
    white-space: normal !important;
    font-size: clamp(2.15rem, 14.8vw, 4.9rem) !important;
    line-height: 1.02 !important;
    letter-spacing: .01em !important;
    word-spacing: .08em !important;
    transform:
      translate3d(0, calc(56px - min(var(--scrollY, 0) * .28px, 112px)), 0)
      scale(calc(1.04 - min(var(--scrollY, 0) / 980, .36))) !important;
  }

  .selected-card {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  .selected-copy h3 {
    font-size: clamp(1.8rem, 10vw, 3rem) !important;
  }

  .selected-spm {
    grid-column: span 1 !important;
  }

  .selected-spm .selected-video {
    aspect-ratio: 16 / 9 !important;
  }
}


/* ===== V13 MOBILE GRID + MEDIA LIGHTBOX ===== */

/* Lightbox shared across mobile and desktop */
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 44px);
  background: rgba(0,0,0,.86);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s var(--ease);
}

.media-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  width: min(94vw, 1400px);
  height: min(88vh, 900px);
  display: grid;
  place-items: center;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 40px 140px rgba(0,0,0,.72);
  background: #050505;
}

.lightbox-close {
  position: fixed;
  z-index: 20001;
  top: clamp(14px, 4vw, 30px);
  right: clamp(14px, 4vw, 30px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(0,0,0,.42);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .28s var(--ease), border-color .28s var(--ease), background .28s var(--ease);
}

.lightbox-close:hover {
  transform: scale(1.08);
  border-color: #fff;
  background: rgba(255,255,255,.12);
}

body.lightbox-open {
  overflow: hidden;
}

/* Make portfolio media tappable */
.marame-grid .media-card,
.optima-grid .media-card {
  cursor: pointer;
}

/* Mobile: keep Marame as a designed compact grid, not huge stacked items */
@media (max-width: 640px) {
  .marame-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: clamp(72px, 22vw, 112px) !important;
    gap: 10px !important;
    grid-auto-flow: dense !important;
  }

  .marame-grid .media-card {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
    aspect-ratio: auto !important;
  }

  .marame-grid .tile-square {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
  }

  .marame-grid .tile-portrait {
    grid-column: span 2 !important;
    grid-row: span 4 !important;
  }

  .marame-grid .tile-landscape {
    grid-column: span 4 !important;
    grid-row: span 2 !important;
  }

  .marame-grid .media-card img,
  .marame-grid .media-card video,
  .marame-grid .missing-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Mobile: Optima also stays a tidy grid */
  .optima-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: clamp(70px, 21vw, 108px) !important;
    gap: 10px !important;
    grid-auto-flow: dense !important;
  }

  .optima-logo {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
    aspect-ratio: auto !important;
  }

  .optima-hero-video {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
    aspect-ratio: auto !important;
  }

  .optima-small-landscape {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
    aspect-ratio: auto !important;
  }

  .optima-large-landscape {
    grid-column: span 4 !important;
    grid-row: span 2 !important;
    aspect-ratio: auto !important;
  }

  .optima-grid .media-card img,
  .optima-grid .media-card video,
  .optima-grid .missing-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .lightbox-stage {
    width: 94vw;
    height: 84vh;
  }

  .lightbox-close {
    width: 42px;
    height: 42px;
    font-size: 28px;
  }
}

/* Small tablets: keep grids under control */
@media (min-width: 641px) and (max-width: 900px) {
  .marame-grid,
  .optima-grid {
    gap: 12px !important;
  }
}


/* ===== V14 HERO + SELECTED CLEANUP ===== */

/* Hide the unnecessary Selected Projects eyebrow/header line text */
.selected-clean-head {
  margin-bottom: clamp(14px, 2.5vw, 34px) !important;
}

.selected-clean-head p,
.selected-clean-head small {
  visibility: hidden !important;
}

/* Hard-centre hero content on desktop */
.hero-inner {
  width: 100% !important;
  place-items: center !important;
  justify-items: center !important;
  text-align: center !important;
}

.hero-logo {
  position: relative !important;
  left: 50% !important;
  margin: 0 !important;
  justify-self: start !important;
  transform:
    translate3d(-50%, calc(var(--scrollY, 0) * .02px), 0)
    scale(calc(1 - min(var(--scrollY, 0) / 780, .62))) !important;
  transform-origin: center center !important;
}

/* Desktop statement centred from true viewport middle */
.hero-statement {
  position: relative !important;
  left: 50% !important;
  width: 100vw !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  text-align: center !important;
  transform-origin: center center !important;
  font-size: clamp(2.2rem, 8.8vw, 10.8rem) !important;
  line-height: 1.02 !important;
  letter-spacing: .018em !important;
  word-spacing: .14em !important;
  transform:
    translate3d(-50%, calc(78px - min(var(--scrollY, 0) * .36px, 150px)), 0)
    scale(calc(1.1 - min(var(--scrollY, 0) / 980, .52))) !important;
}

/* Scroll cue disappears once statement starts coming through */
body.is-scrolled .scroll-cue {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(14px) !important;
  pointer-events: none !important;
}

/* Make the orange cursor/background glow visible on backgrounds */
.page-glow {
  opacity: .96 !important;
  background: radial-gradient(circle at var(--cursorX,50%) var(--cursorY,50%), rgba(199,95,0,.46), transparent 13.5rem) !important;
  mix-blend-mode: screen !important;
  z-index: 2 !important;
}

body.media-hover .page-glow,
body.lightbox-open .page-glow {
  opacity: 0 !important;
}

/* Mobile: statement starts oversized and comes from lower down into centre */
@media (max-width: 640px) {
  .hero-inner {
    min-height: 96vh !important;
    align-content: center !important;
  }

  .hero-logo {
    left: 50% !important;
    width: 72vw !important;
    max-height: 150px !important;
    transform:
      translate3d(-50%, calc(var(--scrollY, 0) * .02px), 0)
      scale(calc(1 - min(var(--scrollY, 0) / 780, .52))) !important;
  }

  .hero-statement {
    position: relative !important;
    left: 50% !important;
    width: 150vw !important;
    max-width: none !important;
    white-space: normal !important;
    font-size: clamp(3.8rem, 22vw, 9rem) !important;
    line-height: 1.08 !important;
    letter-spacing: .025em !important;
    word-spacing: .16em !important;
    transform:
      translate3d(-50%, calc(150px - min(var(--scrollY, 0) * .55px, 210px)), 0)
      scale(calc(1.24 - min(var(--scrollY, 0) / 760, .46))) !important;
    opacity: calc(min(var(--scrollY, 0) / 145, 1) * (1 - min(max((var(--scrollY, 0) - 520) / 340, 0), 1))) !important;
  }

  .scroll-cue {
    transition: opacity .35s var(--ease), transform .35s var(--ease) !important;
  }

  body.is-scrolled .scroll-cue {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(18px) !important;
  }
}


/* ===== V15 LANDING PAGE CENTRE FIX ===== */

/* Reset the hero to a simple centred structure */
.hero {
  position: relative !important;
  min-height: 108vh !important;
  overflow: hidden !important;
}

.hero-inner {
  position: relative !important;
  z-index: 3 !important;
  width: 100% !important;
  min-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 96px clamp(18px,6vw,90px) 70px !important;
}

/* Logo is now genuinely centred. No left:50 hacks. */
.hero-logo {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  display: block !important;
  width: min(72vw, 720px) !important;
  max-height: 220px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  justify-self: center !important;
  align-self: center !important;
  opacity: calc(1 - min(var(--scrollY, 0) / 360, .92)) !important;
  transform:
    translate3d(0, calc(var(--scrollY, 0) * .02px), 0)
    scale(calc(1 - min(var(--scrollY, 0) / 780, .62))) !important;
  transform-origin: center center !important;
}

/* Big scroll statement is positioned from exact viewport centre */
.hero-statement {
  position: absolute !important;
  z-index: 2 !important;
  left: 50% !important;
  top: 63% !important;
  width: 120vw !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #0b0b0b !important;
  text-align: center !important;
  white-space: nowrap !important;
  text-transform: uppercase !important;
  font-weight: 950 !important;
  font-size: clamp(2.2rem, 8.9vw, 10.8rem) !important;
  line-height: 1.02 !important;
  letter-spacing: .018em !important;
  word-spacing: .14em !important;
  transform-origin: center center !important;
  transform:
    translate3d(-50%, calc(90px - min(var(--scrollY, 0) * .36px, 165px)), 0)
    scale(calc(1.1 - min(var(--scrollY, 0) / 980, .52))) !important;
  opacity: calc(min(var(--scrollY, 0) / 180, 1) * (1 - min(max((var(--scrollY, 0) - 510) / 360, 0), 1))) !important;
  will-change: transform, opacity !important;
  pointer-events: none !important;
}

/* Scroll cue stays properly centred */
.scroll-cue {
  left: 50% !important;
  bottom: 10vh !important;
  transform: translateX(-50%) !important;
  transition: opacity .35s var(--ease), transform .35s var(--ease) !important;
}

body.is-scrolled .scroll-cue {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(16px) !important;
}

/* Keep nav centred on mobile */
@media (max-width: 640px) {
  .hero-inner {
    min-height: 96vh !important;
    padding: 92px 18px 70px !important;
  }

  .hero-logo {
    width: 76vw !important;
    max-height: 155px !important;
    margin: 0 auto !important;
    transform:
      translate3d(0, calc(var(--scrollY, 0) * .02px), 0)
      scale(calc(1 - min(var(--scrollY, 0) / 780, .52))) !important;
  }

  .hero-statement {
    left: 50% !important;
    top: 58% !important;
    width: 165vw !important;
    white-space: normal !important;
    font-size: clamp(3.8rem, 22vw, 9rem) !important;
    line-height: 1.08 !important;
    letter-spacing: .025em !important;
    word-spacing: .16em !important;
    transform:
      translate3d(-50%, calc(190px - min(var(--scrollY, 0) * .58px, 250px)), 0)
      scale(calc(1.26 - min(var(--scrollY, 0) / 780, .48))) !important;
    opacity: calc(min(var(--scrollY, 0) / 145, 1) * (1 - min(max((var(--scrollY, 0) - 550) / 340, 0), 1))) !important;
  }

  .scroll-cue {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* Make background cursor glow visible again without affecting media */
.page-glow {
  opacity: .96 !important;
  background: radial-gradient(circle at var(--cursorX,50%) var(--cursorY,50%), rgba(199,95,0,.46), transparent 13.5rem) !important;
  mix-blend-mode: screen !important;
}

body.media-hover .page-glow,
body.lightbox-open .page-glow {
  opacity: 0 !important;
}


/* ===== V16 MOBILE HERO READABILITY FIX ===== */

@media (max-width: 640px) {
  .hero {
    min-height: 142vh !important;
  }

  .hero-inner {
    min-height: 118vh !important;
    justify-content: flex-start !important;
    padding-top: 24vh !important;
  }

  .hero-logo {
    width: 72vw !important;
    max-height: 150px !important;
    margin: 0 auto !important;
    transform:
      translate3d(0, calc(var(--scrollY, 0) * .015px), 0)
      scale(calc(1 - min(var(--scrollY, 0) / 900, .45))) !important;
  }

  .hero-statement {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    width: 96vw !important;
    max-width: 96vw !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: clamp(2.35rem, 13.6vw, 5.25rem) !important;
    line-height: 1.08 !important;
    letter-spacing: .018em !important;
    word-spacing: .08em !important;
    transform-origin: center center !important;
    transform:
      translate3d(-50%, calc(175px - min(var(--scrollY, 0) * .43px, 230px)), 0)
      scale(calc(1.85 - min(var(--scrollY, 0) / 460, .85))) !important;
    opacity: calc(min(var(--scrollY, 0) / 110, 1) * (1 - min(max((var(--scrollY, 0) - 760) / 260, 0), 1))) !important;
    will-change: transform, opacity !important;
    pointer-events: none !important;
  }

  .orange-wash {
    opacity: var(--orangeOpacityMobile, var(--orangeOpacity, 1)) !important;
  }

  body.is-scrolled .scroll-cue {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(18px) !important;
  }
}


/* ===== V17 MOBILE SCROLL HERO + DESKTOP LOGO ORB ===== */

/* Logo wrapper lets us fake the moving inner logo circle on desktop */
.hero-logo-wrap {
  position: relative !important;
  display: inline-block !important;
  width: min(72vw, 720px) !important;
  max-width: 720px !important;
  margin: 0 auto !important;
  line-height: 0 !important;
  transform:
    translate3d(0, calc(var(--scrollY, 0) * .02px), 0)
    scale(calc(1 - min(var(--scrollY, 0) / 780, .62))) !important;
  transform-origin: center center !important;
  opacity: calc(1 - min(var(--scrollY, 0) / 360, .92)) !important;
}

.hero-logo-wrap .hero-logo {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  display: block !important;
  width: 100% !important;
  max-height: 220px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  opacity: 1 !important;
  transform: none !important;
}

/*
  This is a fake "moving centre" for the O mark.
  It works with the current raster logo. A real SVG would be cleaner.
*/
.logo-orb {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .logo-orb {
    display: block;
    position: absolute;
    left: 13.85%;
    top: 50%;
    width: 13.8%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: #f8b42a;
    transform:
      translate3d(
        calc(-50% + var(--logoOrbX, 0px)),
        calc(-50% + var(--logoOrbY, 0px)),
        0
      )
      scaleX(calc(1 + var(--logoOrbSquashX, 0)))
      scaleY(calc(1 + var(--logoOrbSquashY, 0)));
    transform-origin: center;
    pointer-events: none;
    transition: transform .18s cubic-bezier(.16,1,.3,1);
    mix-blend-mode: normal;
  }
}

/* Mobile hero text should scroll like part of the page, not sit fixed then vanish */
@media (max-width: 640px) {
  .hero {
    min-height: 156vh !important;
  }

  .hero-inner {
    position: relative !important;
    min-height: 134vh !important;
    justify-content: flex-start !important;
    padding-top: 22vh !important;
  }

  .hero-logo-wrap {
    width: 76vw !important;
    max-height: 155px !important;
    transform:
      translate3d(0, calc(var(--scrollY, 0) * .015px), 0)
      scale(calc(1 - min(var(--scrollY, 0) / 900, .45))) !important;
  }

  .hero-logo-wrap .hero-logo {
    max-height: 155px !important;
  }

  .hero-statement {
    position: absolute !important;
    left: 50% !important;
    top: 62vh !important;
    width: 96vw !important;
    max-width: 96vw !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: clamp(2.45rem, 13.2vw, 5.15rem) !important;
    line-height: 1.08 !important;
    letter-spacing: .016em !important;
    word-spacing: .08em !important;
    transform-origin: center center !important;
    /*
      Starts huge and lower, then scrolls upward naturally with the page.
      By the time it hits the middle, it is readable.
    */
    transform:
      translate3d(-50%, calc(150px - min(var(--scrollY, 0) * .58px, 260px)), 0)
      scale(calc(1.68 - min(var(--scrollY, 0) / 520, .68))) !important;
    opacity: calc(min(var(--scrollY, 0) / 120, 1) * (1 - min(max((var(--scrollY, 0) - 890) / 320, 0), 1))) !important;
    will-change: transform, opacity !important;
    pointer-events: none !important;
  }

  .orange-wash {
    opacity: var(--orangeOpacityMobile, var(--orangeOpacity, 1)) !important;
  }
}

/* Desktop centring remains simple and robust */
@media (min-width: 641px) {
  .hero-logo-wrap {
    align-self: center !important;
    justify-self: center !important;
  }

  .hero-statement {
    left: 50% !important;
    text-align: center !important;
  }
}


/* ===== V18 CODE FIX: CLEAN LOGO + MOVING CENTRE ORB ===== */

/*
  Uses assets/logos/oliver-logo-no-centre.png.
  The orange orb now becomes the centre of the O, rather than sitting over an existing centre.
*/

.hero-logo-wrap {
  position: relative !important;
  display: inline-block !important;
  width: min(72vw, 720px) !important;
  max-width: 720px !important;
  margin: 0 auto !important;
  line-height: 0 !important;
  transform:
    translate3d(0, calc(var(--scrollY, 0) * .02px), 0)
    scale(calc(1 - min(var(--scrollY, 0) / 780, .62))) !important;
  transform-origin: center center !important;
  opacity: calc(1 - min(var(--scrollY, 0) / 360, .92)) !important;
}

.hero-logo-wrap .hero-logo {
  display: block !important;
  width: 100% !important;
  max-height: 220px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Desktop-only moving centre */
.logo-orb {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .logo-orb {
    display: block !important;
    position: absolute !important;

    /*
      These values are tuned for the clean wide logo image.
      If you swap the logo file again, only adjust these four values.
    */
    left: 13.9% !important;
    top: 50% !important;
    width: 13.2% !important;
    aspect-ratio: 1 / 1 !important;

    border-radius: 50% !important;
    background: #f8b42a !important;

    transform:
      translate3d(
        calc(-50% + var(--logoOrbX, 0px)),
        calc(-50% + var(--logoOrbY, 0px)),
        0
      )
      scaleX(calc(1 + var(--logoOrbSquashX, 0)))
      scaleY(calc(1 + var(--logoOrbSquashY, 0))) !important;

    transform-origin: center center !important;
    pointer-events: none !important;
    transition: transform .12s cubic-bezier(.16,1,.3,1) !important;
    will-change: transform !important;
  }
}

/* Mobile keeps the logo static and clean */
@media (max-width: 640px) {
  .hero-logo-wrap {
    width: 76vw !important;
    max-height: 155px !important;
  }

  .logo-orb {
    display: none !important;
  }
}


/* ===== V19 LOGO + LOGIN REFINEMENT ===== */

/* Cleaner small login */
.password-page {
  background: #f8b42a !important;
  color: #0b0b0b !important;
}

.password-wrap {
  min-height: 100vh !important;
  display: grid !important;
  place-items: center !important;
  padding: 24px !important;
}

.password-card {
  width: min(88vw, 340px) !important;
  gap: 12px !important;
  padding: 24px !important;
  border: 1px solid rgba(0,0,0,.14) !important;
  background: rgba(255,255,255,.10) !important;
  box-shadow: none !important;
  backdrop-filter: blur(10px) !important;
}

.password-card p {
  font-size: .58rem !important;
  letter-spacing: .16em !important;
  color: rgba(0,0,0,.55) !important;
}

.password-card h1 {
  font-size: clamp(1.75rem, 5vw, 2.7rem) !important;
  line-height: .9 !important;
  letter-spacing: -.04em !important;
  margin: 0 0 10px !important;
}

.password-card label {
  gap: 7px !important;
  font-size: .56rem !important;
  letter-spacing: .13em !important;
}

.password-card input {
  min-height: 44px !important;
  border-radius: 999px !important;
  padding: 10px 15px !important;
  font-size: .9rem !important;
  background: rgba(255,255,255,.42) !important;
}

.password-card button {
  min-height: 44px !important;
  font-size: .62rem !important;
  letter-spacing: .14em !important;
}

.password-card em {
  font-size: .72rem !important;
}

/* Mobile uses the static full logo with the normal centre already inside */
.hero-logo-mobile-static {
  display: none;
}

/* Desktop animated orb: a tiny bit bigger + more blobby */
@media (hover: hover) and (pointer: fine) {
  .logo-orb {
    width: 14.65% !important;
    left: 13.9% !important;
    top: 50% !important;
    border-radius: 48% 52% 50% 50% / 51% 47% 53% 49% !important;
    filter: saturate(1.05) !important;
    transition: transform .10s cubic-bezier(.16,1,.3,1), border-radius .16s cubic-bezier(.16,1,.3,1) !important;
  }
}

/* On mobile hide animated no-centre logo and show supplied full logo */
@media (max-width: 640px), (hover: none), (pointer: coarse) {
  .hero-logo-wrap .hero-logo {
    display: none !important;
  }

  .hero-logo-mobile-static {
    display: block !important;
    width: 100% !important;
    max-height: 155px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }

  .logo-orb {
    display: none !important;
  }
}


/* ===== V20 MARAME TILE + SCROLL CUE FIX ===== */

@media (min-width: 641px) {
  .scroll-cue {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 50 !important;
    left: 50% !important;
    bottom: 10vh !important;
    transform: translateX(-50%) !important;
    color: #0b0b0b !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: .26em !important;
    font-size: .78rem !important;
    font-weight: 800 !important;
    place-items: center !important;
    gap: 16px !important;
    pointer-events: auto !important;
  }

  .scroll-cue i {
    display: block !important;
    width: 1px !important;
    height: 76px !important;
    background: linear-gradient(to bottom, #0b0b0b, transparent) !important;
    opacity: 1 !important;
    animation: cue 1.75s var(--ease) infinite !important;
  }

  body.is-scrolled .scroll-cue {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(16px) !important;
    pointer-events: none !important;
  }
}

/* Mobile: final Marame landscape tile is smaller */
@media (max-width: 640px) {
  .marame-grid .media-card:nth-child(11) {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
    aspect-ratio: auto !important;
  }
}


/* ===== V21 TEXT + SPM VIDEO FIX ===== */

.selected-spm-video-wrap video,
.selected-spm .selected-media video,
.selected-spm video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: #111 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.selected-spm-video-wrap {
  background: #111 !important;
  cursor: pointer !important;
}

/* If browser blocks autoplay, the user can tap/click the video area */
.selected-spm-video-wrap::after {
  content: "Tap to play";
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  background: rgba(0,0,0,.34);
  color: rgba(255,255,255,.78);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .58rem;
  font-weight: 900;
  opacity: .55;
  pointer-events: none;
}

.selected-spm-video-wrap.is-playing::after {
  opacity: 0;
}


/* ===== V22 MOBILE SCROLL CUE + ABOUT + SPM FIX ===== */

/* About now has two proper paragraphs */
.about .about-copy {
  display: grid !important;
  gap: clamp(18px, 2vw, 28px) !important;
}

.about .about-copy p {
  margin: 0 !important;
}

/* Restore mobile Scroll word and animated line */
@media (max-width: 640px) {
  .scroll-cue {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 80 !important;
    left: 50% !important;
    bottom: 8.5vh !important;
    transform: translateX(-50%) !important;
    color: #0b0b0b !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: .24em !important;
    font-size: .72rem !important;
    font-weight: 850 !important;
    place-items: center !important;
    gap: 14px !important;
    pointer-events: auto !important;
    transition: opacity .38s var(--ease), transform .38s var(--ease) !important;
  }

  .scroll-cue i {
    display: block !important;
    width: 1px !important;
    height: 62px !important;
    background: linear-gradient(to bottom, #0b0b0b, transparent) !important;
    opacity: 1 !important;
    animation: cue 1.75s var(--ease) infinite !important;
  }

  body.is-scrolled .scroll-cue {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(16px) !important;
    pointer-events: none !important;
  }

  /* Mobile hero text stays readable longer, then scrolls up */
  .hero {
    min-height: 170vh !important;
  }

  .hero-inner {
    min-height: 145vh !important;
    justify-content: flex-start !important;
    padding-top: 22vh !important;
  }

  .hero-statement {
    position: absolute !important;
    left: 50% !important;
    top: 68vh !important;
    width: 94vw !important;
    max-width: 94vw !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: clamp(2.25rem, 12.2vw, 4.75rem) !important;
    line-height: 1.1 !important;
    letter-spacing: .014em !important;
    word-spacing: .08em !important;
    transform-origin: center center !important;
    transform:
      translate3d(-50%, calc(180px - min(var(--scrollY, 0) * .44px, 235px)), 0)
      scale(calc(1.72 - min(var(--scrollY, 0) / 560, .72))) !important;
    opacity: calc(min(var(--scrollY, 0) / 120, 1) * (1 - min(max((var(--scrollY, 0) - 980) / 420, 0), 1))) !important;
    will-change: transform, opacity !important;
    pointer-events: none !important;
  }
}

/* SPM video visibility/playback hardening */
.selected-spm-video-wrap {
  position: relative !important;
  background: #111 !important;
  min-height: 220px !important;
}

.selected-spm-video-wrap video,
.selected-spm .selected-media video,
.selected-spm video {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 220px !important;
  object-fit: cover !important;
  background: #111 !important;
}

.selected-spm-video-wrap.has-video::after {
  content: "" !important;
  display: none !important;
}

.selected-spm-video-wrap:not(.has-video)::after {
  content: "Upload video";
}


/* ===== V23 FINAL MOBILE SCROLL + SPM VIDEO FIX ===== */

/* Mobile scroll cue must be visible on the yellow landing screen */
@media (max-width: 640px) {
  .scroll-cue,
  .hero .scroll-cue {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 999 !important;
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    bottom: 7.5vh !important;
    transform: translateX(-50%) !important;
    color: #0b0b0b !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: .24em !important;
    font-size: .74rem !important;
    font-weight: 900 !important;
    place-items: center !important;
    gap: 14px !important;
    pointer-events: auto !important;
  }

  .scroll-cue span {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .scroll-cue i {
    display: block !important;
    width: 1px !important;
    height: 68px !important;
    background: linear-gradient(to bottom, #0b0b0b, transparent) !important;
    opacity: 1 !important;
    animation: cue 1.75s var(--ease) infinite !important;
  }

  body.is-scrolled .scroll-cue {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(18px) !important;
    pointer-events: none !important;
  }

  /*
    Make the mobile statement:
    1. come in big
    2. land readable in the centre
    3. hold longer
    4. then scroll/fade up
  */
  .hero {
    min-height: 185vh !important;
  }

  .hero-inner {
    min-height: 158vh !important;
    justify-content: flex-start !important;
    padding-top: 22vh !important;
  }

  .hero-statement {
    position: absolute !important;
    left: 50% !important;
    top: 72vh !important;
    width: 94vw !important;
    max-width: 94vw !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: clamp(2.15rem, 11.5vw, 4.35rem) !important;
    line-height: 1.12 !important;
    letter-spacing: .012em !important;
    word-spacing: .07em !important;
    transform-origin: center center !important;
    transform:
      translate3d(-50%, calc(190px - min(var(--scrollY, 0) * .38px, 250px)), 0)
      scale(calc(1.72 - min(var(--scrollY, 0) / 620, .72))) !important;
    opacity: calc(min(var(--scrollY, 0) / 115, 1) * (1 - min(max((var(--scrollY, 0) - 1160) / 420, 0), 1))) !important;
    pointer-events: none !important;
  }

  .orange-wash {
    opacity: var(--orangeOpacityMobile, var(--orangeOpacity, 1)) !important;
  }
}

/* SPM direct video hardening */
.selected-spm-video-wrap {
  position: relative !important;
  width: 100% !important;
  min-height: 240px !important;
  background: #111 !important;
  overflow: hidden !important;
}

.selected-spm-video-wrap video,
.spm-direct-video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 240px !important;
  object-fit: cover !important;
  background: #111 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.selected-spm-video-wrap::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 640px) {
  .selected-spm-video-wrap,
  .selected-spm-video-wrap video,
  .spm-direct-video {
    min-height: 210px !important;
    aspect-ratio: 16 / 9 !important;
  }
}


/* ===== V24 FINAL FIX: MOBILE SCROLL CUE + SPM VIDEO ===== */

/* Mobile scroll cue: force it visible before scrolling as a fixed landing overlay */
@media (max-width: 640px) {
  body:not(.is-scrolled) .scroll-cue,
  body:not(.is-scrolled) .hero .scroll-cue {
    position: fixed !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 99999 !important;
    left: 50% !important;
    right: auto !important;
    bottom: 7.5vh !important;
    transform: translateX(-50%) !important;
    color: #0b0b0b !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: .24em !important;
    font-size: .74rem !important;
    font-weight: 900 !important;
    place-items: center !important;
    gap: 14px !important;
    pointer-events: auto !important;
  }

  body:not(.is-scrolled) .scroll-cue span {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body:not(.is-scrolled) .scroll-cue i {
    display: block !important;
    width: 1px !important;
    height: 72px !important;
    background: linear-gradient(to bottom, #0b0b0b, transparent) !important;
    opacity: 1 !important;
    animation: cue 1.75s var(--ease) infinite !important;
  }

  body.is-scrolled .scroll-cue {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(18px) !important;
    pointer-events: none !important;
  }

  /* Hold the text readable for longer before it leaves */
  .hero {
    min-height: 195vh !important;
  }

  .hero-inner {
    min-height: 168vh !important;
  }

  .hero-statement {
    top: 72vh !important;
    transform:
      translate3d(-50%, calc(190px - min(var(--scrollY, 0) * .32px, 245px)), 0)
      scale(calc(1.68 - min(var(--scrollY, 0) / 720, .68))) !important;
    opacity: calc(min(var(--scrollY, 0) / 115, 1) * (1 - min(max((var(--scrollY, 0) - 1320) / 420, 0), 1))) !important;
  }
}

/* SPM video: hide broken native control icon and rely on autoplay/tap/open fallback */
.selected-spm-video-wrap {
  position: relative !important;
  background: #111 !important;
  overflow: hidden !important;
}

.selected-spm-video-wrap video,
.spm-direct-video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 240px !important;
  object-fit: cover !important;
  background: #111 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.spm-video-fallback {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.48);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .56rem;
  font-weight: 900;
}

.selected-spm-video-wrap.is-playing .spm-video-fallback {
  display: none !important;
}

@media (max-width: 640px) {
  .selected-spm-video-wrap video,
  .spm-direct-video {
    min-height: 210px !important;
  }
}
