/* =========================================================
   MARLO MEDIA — T11-inspired dark editorial portfolio
========================================================= */

:root {
  --bg: #000000;
  --bg-soft: #0A0A0A;
  --fg: #FFFFFF;
  --fg-soft: #EFEFEF;
  --muted: #6B6B6B;
  --muted-deep: #2A2A2A;
  --line: #1A1A1A;

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Space Grotesk", "SF Mono", monospace;

  --gutter: 32px;
  --max: 1600px;
  --section-pad: clamp(80px, 14vw, 200px);
}

@media (max-width: 768px) {
  :root { --gutter: 20px; }
}

/* ---------- RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: italic; font-weight: inherit; }

::selection { background: var(--fg); color: var(--bg); }

/* ---------- UTILITIES ---------- */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 110px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin-bottom: 64px;
}

.section-title em {
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: lowercase;
  font-style: italic;
  letter-spacing: -0.01em;
}

.dot-sep { color: var(--muted); margin: 0 4px; }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
  margin-top: 80px;
  border-bottom: 1px solid var(--muted-deep);
  padding-bottom: 8px;
  transition: border-color 0.3s ease, gap 0.3s ease;
}
.link-arrow:hover { border-color: var(--fg); gap: 18px; }
.link-arrow span { transition: transform 0.3s ease; }
.link-arrow:hover span { transform: translateX(4px); }

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0ms);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   NAV
========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 24px var(--gutter);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__logo {
  display: flex;
  align-items: center;
  height: 28px;
}
.nav__logo img { height: 100%; filter: invert(1); }

.nav__links {
  display: flex;
  gap: 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.nav__links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--fg);
  transition: width 0.3s ease;
}
.nav__links a:hover::after { width: 100%; }

.nav__status {
  justify-self: end;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

@media (max-width: 768px) {
  .nav { grid-template-columns: 1fr 1fr; }
  .nav__links { display: none; }
  .nav__status { font-size: 10px; }
}

/* =========================================================
   HERO
========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 80px;
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(60px, 14vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.hero__title .line {
  display: block;
  overflow: hidden;
}

.hero__title .line:nth-child(2) {
  padding-left: clamp(40px, 8vw, 140px);
  color: var(--muted);
}

.hero__title .line:nth-child(3) {
  padding-left: clamp(80px, 16vw, 280px);
}

.hero__meta {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.hero__scroll .line-down {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scroll-line 2.5s ease-in-out infinite;
}
@keyframes scroll-line {
  0%, 100% { transform: scaleY(1); transform-origin: top; }
  50% { transform: scaleY(0.4); transform-origin: top; }
}

@media (max-width: 768px) {
  .hero__scroll { display: none; }
  .hero__meta { font-size: 10px; }
}

/* =========================================================
   WORK GRID
========================================================= */
.work {
  padding: var(--section-pad) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.tile--offset { transform: translateY(60px); }

.tile {
  cursor: pointer;
  transition: transform 0.4s ease;
}

.tile__media {
  aspect-ratio: 9 / 16;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  transition: transform 0.5s ease;
}

.tile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-soft);
  transition: transform 0.6s ease, filter 0.4s ease;
}

.tile:hover .tile__video {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* Sound toggle button (shared between tiles + story) */
.tile__sound {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.25s ease, background 0.25s ease, transform 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.tile__sound:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.08);
}
.tile__sound .icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}
/* Default: muted shown, unmuted hidden */
.tile__sound .icon-unmuted { display: none; }
.tile__sound[data-active="true"] {
  background: var(--fg);
  color: var(--bg);
}
.tile__sound[data-active="true"] .icon-muted { display: none; }
.tile__sound[data-active="true"] .icon-unmuted { display: block; }

/* Story video — vertical 9:16 */
.story__video-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 78vh;
  margin-inline: auto;
  background: var(--bg-soft);
  overflow: hidden;
  border-radius: 2px;
}
.story__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story__sound {
  width: 44px;
  height: 44px;
  bottom: 16px;
  right: 16px;
}
.story__sound .icon { width: 20px; height: 20px; }

.tile__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tile__code { color: var(--muted); }
.tile__client { color: var(--fg); text-align: right; }

@media (max-width: 1024px) {
  .work__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .work__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .tile--offset { transform: none; }
}

/* =========================================================
   MANIFESTO
========================================================= */
.manifesto {
  padding: var(--section-pad) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.manifesto::before,
.manifesto::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 60px;
  background: var(--muted-deep);
}
.manifesto::before { top: 0; }
.manifesto::after { bottom: 0; }

.manifesto__text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 5.5vw, 92px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.manifesto__text .line {
  display: block;
}
.manifesto__text .line:nth-child(2),
.manifesto__text .line:nth-child(4) {
  color: var(--muted);
}
.manifesto__text em {
  font-family: var(--font-mono);
  font-weight: 400;
  font-style: italic;
  text-transform: lowercase;
}

/* =========================================================
   FEATURED CLIENTS — Infinite Logo Carousel
========================================================= */
.clients {
  padding: var(--section-pad) 0;
  max-width: var(--max);
  margin: 0 auto;
}

.clients .section-label {
  padding: 0 var(--gutter);
  margin-bottom: 48px;
}

.clients__carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

.clients__track {
  display: flex;
  align-items: center;
  gap: clamp(48px, 6vw, 96px);
  width: max-content;
  animation: clients-scroll 38s linear infinite;
  will-change: transform;
}
.clients__carousel:hover .clients__track {
  animation-play-state: paused;
}

@keyframes clients-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(70px, 8vw, 96px);
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
  user-select: none;
}
.client-logo:hover {
  opacity: 1;
  transform: scale(1.04);
  background: #fff;
}
.client-logo img {
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Logos that are designed for dark backgrounds (white-on-white) get an inverted card */
.client-logo--dark {
  background: rgba(20, 20, 20, 0.95);
}
.client-logo--dark:hover {
  background: #141414;
}

@media (prefers-reduced-motion: reduce) {
  .clients__track { animation: none; }
}

/* =========================================================
   STORY
========================================================= */
.story {
  padding: var(--section-pad) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 80px;
  align-items: start;
}

.story__media {
  position: sticky;
  top: 120px;
}

.story__text {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-soft);
  max-width: 560px;
}

.story__stats {
  margin-top: 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.story__stats > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

@media (max-width: 900px) {
  .story { grid-template-columns: 1fr; gap: 48px; }
  .story__media { position: static; max-width: 320px; }
}

/* =========================================================
   CONTACT
========================================================= */
.contact {
  padding: var(--section-pad) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  text-align: left;
}

.contact__headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(50px, 11vw, 180px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 80px;
}
.contact__headline .line { display: block; }
.contact__headline .line:nth-child(2) {
  padding-left: clamp(40px, 6vw, 100px);
  color: var(--muted);
}
.contact__headline em {
  font-family: var(--font-mono);
  font-weight: 400;
  font-style: italic;
  text-transform: lowercase;
}

.contact__email {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5.5vw, 80px);
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--muted-deep);
  padding-bottom: 12px;
  transition: border-color 0.3s ease;
  word-break: break-all;
}
.contact__email:hover { border-color: var(--fg); }

.contact__meta {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* =========================================================
   NEWSLETTER
========================================================= */
.newsletter {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.newsletter__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.newsletter__form {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 320px;
}
.newsletter__form input {
  flex: 1;
  padding: 10px 0;
  border-bottom: 1px solid var(--muted-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.3s ease;
}
.newsletter__form input:focus { border-color: var(--fg); }
.newsletter__form input::placeholder { color: var(--muted); }
.newsletter__form button {
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
  padding: 8px 16px;
  border: 1px solid var(--muted-deep);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.newsletter__form button:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* =========================================================
   FOOTER
========================================================= */
.footer {
  padding: 80px var(--gutter) 32px;
  max-width: var(--max);
  margin: 0 auto;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 80px;
}
.footer__cols h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 20px;
  font-weight: 400;
}
.footer__cols ul { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.footer__cols a { transition: color 0.3s ease; }
.footer__cols a:hover { color: var(--muted); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.footer__top:hover { color: var(--fg); }

@media (max-width: 700px) {
  .footer__cols { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .footer__bottom { flex-direction: column; gap: 16px; text-align: center; }
}
