/* =========================================================================
   UGC Portfolio — "Content Library" direction
   Premium light-editorial. Fraunces + Hanken Grotesk + Space Mono.
   ========================================================================= */

:root {
  --paper:  #EEEDE7;
  --card:   #F6F5F0;
  --ink:    #141417;
  --accent: #2230C9;
  --accent-press: #1b269e;
  --line:   #DCD9D0;
  --muted:  #6A675E;

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Hanken Grotesk', system-ui, sans-serif;
  --mono:  'Space Mono', 'SFMono-Regular', monospace;

  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type scale ---------- */
.display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.2rem, 11vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
}
.line-mask { display: block; overflow: hidden; }
.line { display: block; }
.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 18ch;
}
.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 52ch;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow--center { text-align: center; }
.mono { font-family: var(--mono); }

/* ---------- sections ---------- */
.section { padding-block: clamp(72px, 13vh, 150px); }
.section--tight { padding-block: clamp(40px, 7vh, 80px); }
.section-head { margin-bottom: clamp(36px, 6vh, 68px); }
.section-head .eyebrow { display: block; margin-bottom: 16px; }

/* hairline rule between consecutive content sections */
#work, #about, #services { border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--sans);
  font-weight: 600; font-size: 0.98rem;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); transform: translateY(-2px); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-lg { padding: 1.05em 2em; font-size: 1.05rem; }
.btn, .cat-pill { will-change: transform; }
.btn:active { transform: scale(.97); }

/* ---------- tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.4em 0.9em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

/* ---------- the 9:16 frame (signature device) ---------- */
.frame {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, #f4f2ec 0%, #e7e3d8 60%, #ded9cc 100%);
  overflow: hidden;
  isolation: isolate;
}
/* faint corner ticks — "frame" registration marks */
.frame::before,
.frame::after {
  content: ""; position: absolute; width: 14px; height: 14px; z-index: 2;
  border: 1.5px solid var(--accent); opacity: .55;
}
.frame::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.frame::after  { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.frame-play {
  position: absolute; inset: 0; margin: auto;
  width: 58px; height: 58px;
  display: grid; place-items: center;
  color: var(--ink);
  background: rgba(255,255,255,.78);
  border-radius: 50%;
  backdrop-filter: blur(2px);
  z-index: 3;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.frame--tile .frame-play { width: 48px; height: 48px; }

.frame-tag {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(238,237,231,.85);
  padding: 0.3em 0.6em; border-radius: 6px;
}
.frame-meta {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; color: var(--ink);
}
.frame-meta > span { background: rgba(238,237,231,.85); padding: 0.25em 0.5em; border-radius: 6px; }
.rec { display: inline-flex; align-items: center; gap: 0.45em; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.frame-photo {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 50%;
}
.frame-label {
  position: absolute; left: 0; right: 0; bottom: 40px; z-index: 3;
  text-align: center;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase;
}

/* ---------- reveal (JS-driven; visible without JS) ---------- */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
html:not(.js) .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================================
   HEADER
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; display: inline-flex; align-items: baseline; }
.wordmark-dot { color: var(--accent); font-size: 0.7em; margin-left: 2px; }
.nav { display: flex; gap: 30px; }
.nav a { font-size: 0.95rem; color: var(--muted); position: relative; transition: color .2s ease; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1.5px; background: var(--accent); transition: width .25s ease; }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero-section { padding-top: clamp(40px, 7vh, 88px); }
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.hero-copy > * + * { margin-top: clamp(18px, 2.4vh, 28px); }
.hero-tagline { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.18; max-width: 20ch; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-reel { max-width: 320px; width: 100%; justify-self: end; }
.frame--hero { box-shadow: 0 30px 60px -28px rgba(20,20,23,.35); }

/* =========================================================================
   WORK
   ========================================================================= */
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.work-controls { display: flex; gap: 10px; flex-shrink: 0; }
.carousel-btn {
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 1.5rem; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s ease, color .2s ease, opacity .2s ease, transform .15s ease;
}
.carousel-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.carousel-btn:disabled { opacity: .28; cursor: default; }

.work-carousel { --wgap: clamp(16px, 2.4vw, 30px); overflow: hidden; }
.work-track { display: flex; gap: var(--wgap); transition: transform .55s cubic-bezier(.45,0,.18,1); }
.work-tile { flex: 0 0 auto; display: block; }   /* per-view width set in main.js */
@media (prefers-reduced-motion: reduce) { .work-track { transition: none; } }
.frame--tile { box-shadow: 0 14px 34px -24px rgba(20,20,23,.25); transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, border-color .3s ease; }
.work-tile:hover .frame--tile { transform: translateY(-6px) scale(1.02); box-shadow: 0 30px 60px -26px rgba(20,20,23,.4); border-color: var(--accent); }
.work-tile:hover .frame-play { background: var(--accent); color: #fff; transform: scale(1.08); }
.tile-info { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; }
.tile-title { font-weight: 600; font-size: 1.02rem; }
.tile-cat { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-align: right; }
/* poster sits above the video (DOM order, no z-index) and fades out on preview */
.tile-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .35s ease;
}
.is-previewing .tile-poster,
.is-playing .tile-poster { opacity: 0; }

/* mono duration stamp, appears once metadata is known during preview */
.frame-stamp {
  position: absolute; right: 12px; bottom: 12px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .04em;
  background: rgba(238,237,231,.92); color: var(--ink);
  padding: 3px 8px; border-radius: 6px;
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.is-previewing .frame-stamp { opacity: 1; }
.is-playing .frame-stamp { opacity: 0; }
.tile-video { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
/* play button is subtle over an autoplaying loop, brightens on hover */
.frame-play--sound { opacity: .6; }
.work-tile:hover .frame-play--sound,
.frame--hero:hover .frame-play--sound { opacity: 1; }
.frame--hero { cursor: pointer; }
.frame--hero:hover .frame-play { background: var(--accent); color: #fff; transform: scale(1.06); }
.frame--hero:hover { box-shadow: 0 36px 70px -28px rgba(20,20,23,.45); }

/* inline playback: when a tile is clicked it plays in place with native
   controls — lift the video above the decorative overlays and hide them so
   the controls are usable, and stop the hover lift from fighting the controls. */
.is-playing .tile-video { z-index: 2; }
.is-playing .frame-play,
.is-playing .frame-tag { opacity: 0; pointer-events: none; }
.work-tile.is-playing:hover .frame--tile { transform: none; }

/* ---------- browse by category ---------- */
.cat-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
  margin-top: clamp(48px, 7vh, 88px);
  padding-top: clamp(28px, 4vh, 44px);
  border-top: 1px solid var(--line);
}
.cat-head .eyebrow { margin-bottom: 0; flex-shrink: 0; }
.cat-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-pill {
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500;
  padding: 0.5em 1.1em; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.cat-pill:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.cat-pill:active { transform: scale(.96); }
.cat-pill.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.4vw, 30px);
  margin-top: clamp(28px, 4vh, 40px);
}
.cat-item.is-hidden { display: none; }
@media (max-width: 880px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================================
   BRANDS MARQUEE
   ========================================================================= */
.section--tight .eyebrow--center { margin-bottom: 28px; }
.marquee {
  display: flex; width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
/* two identical tracks; each trailing brand carries the gap, so a flat
   translateX(-100%) hands off seamlessly with no jump. */
.marquee-track {
  display: flex; align-items: center; flex-shrink: 0;
  animation: marquee 55s linear infinite;
  animation-direction: reverse;   /* drift left -> right, slow + smooth */
}
@keyframes marquee { to { transform: translateX(-100%); } }
.brand {
  display: flex; align-items: center; height: 40px;
  margin-right: 60px; color: var(--ink); opacity: .62;
  transition: opacity .3s ease;
}
.brand:hover { opacity: 1; }
.brand img { height: 33px; width: auto; display: block; }
.brand-word { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; letter-spacing: -0.01em; white-space: nowrap; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* =========================================================================
   ABOUT
   ========================================================================= */
.about { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.about-portrait { max-width: 380px; width: 100%; }
.frame--portrait { aspect-ratio: 4 / 5; }
.about-copy > * + * { margin-top: 20px; }
.about-copy .eyebrow { display: block; }
.about-body { color: var(--muted); max-width: 50ch; }
.stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 56px); margin-top: 30px; }
.stat strong { font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 3.4vw, 2.6rem); display: block; line-height: 1; }
.stat span { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.about-body strong { color: var(--ink); font-weight: 600; }
.proof { margin-top: 26px; }
.proof-label { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.proof-links { display: flex; flex-wrap: wrap; gap: 18px; }
.proof-links a { font-family: var(--mono); font-size: 0.86rem; color: var(--accent); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .2s ease; }
.proof-links a:hover { border-bottom-color: var(--accent); }

/* =========================================================================
   SERVICES
   ========================================================================= */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); align-items: start; }
.card { border: 1px solid var(--line); border-radius: 20px; background: var(--card); padding: clamp(24px, 3vw, 36px); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.package { display: flex; flex-direction: column; position: relative; }
.package:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(20,20,23,.3); }
.package-badge { color: var(--accent); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; }
.package-name { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; }
.package-price { font-size: 1.15rem; margin-top: 6px; color: var(--ink); }
.package-price .mono { font-size: 0.8rem; color: var(--muted); margin-right: 4px; }
.package-quote { font-size: 0.92rem; color: var(--muted); letter-spacing: 0.04em; margin-top: 8px; }
.package ul { margin: 22px 0 28px; display: grid; gap: 12px; }
.package li { position: relative; padding-left: 1.6em; color: var(--muted); font-size: 0.96rem; }
.package li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.package .btn { margin-top: auto; justify-content: center; }
.package.is-featured { border-color: var(--accent); background: #fff; box-shadow: 0 24px 56px -30px rgba(34,48,201,.4); }

/* =========================================================================
   CONTACT + FOOTER
   ========================================================================= */
.contact .container { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact .eyebrow { margin-bottom: 22px; }
.contact-title { margin-bottom: 24px; }
.contact-lead { margin-bottom: 36px; }
.socials { display: inline-flex; gap: 16px; margin-top: 44px; }
.socials a { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); transition: transform .2s ease, border-color .2s ease, color .2s ease; }
.socials a:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.footer-socials { display: flex; gap: 22px; }
.footer-socials a { font-size: 0.92rem; transition: color .2s ease; }
.footer-socials a:hover { color: var(--ink); }
.footer-copy { font-size: 0.8rem; }

/* anchor offset under sticky header */
#work, #about, #services, #contact, #top { scroll-margin-top: 88px; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-reel { justify-self: start; max-width: 280px; order: -1; }
  .about { grid-template-columns: 1fr; }
  .about-portrait { max-width: 320px; }
  .services-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .nav { display: none; }
}

@media (max-width: 520px) {
  .header-cta { display: none; }
  .work-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .tile-info { margin-top: 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}
