/* Flipside Creative Engine */

:root {
  --fce-bg: #ffffff;
  --fce-surface: #f7f9ff;
  --fce-ink: #0d0d0d;
  --fce-muted: #5a5a66;
  --fce-accent: #124bf1;
  --fce-soft: #1278f1;
  --fce-deep: #072174;
  --fce-dark: #010326;
  --fce-radius: 10px;
}

.fce-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--fce-radius);
  font-family: Lato, sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.fce-btn--primary {
  background: var(--fce-accent);
  color: #fff;
  border: 1px solid var(--fce-accent);
}

.fce-btn--primary:hover {
  background: var(--fce-deep);
  border-color: var(--fce-deep);
  color: #fff;
  transform: translateY(-2px);
}

.fce-btn--light {
  background: #fff;
  color: var(--fce-ink);
  border: 1px solid #fff;
}

.fce-btn--light:hover {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ---------- Mosaic Hero ---------- */

.fce-mosaic-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--fce-bg);
  color: var(--fce-ink);
}

.fce-mosaic-hero__stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fce-mosaic-hero__media {
  position: absolute;
  inset: -8% -6%;
  overflow: hidden;
}

.fce-mosaic-hero__mosaic,
.fce-mosaic-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.fce-mosaic-hero__video {
  z-index: 1;
  background: #f7f9ff;
}

.fce-mosaic-hero__video--vimeo {
  border: 0;
  width: 140%;
  height: 140%;
  left: -20%;
  top: -20%;
}

.fce-mosaic-hero__mosaic {
  z-index: 2;
  mix-blend-mode: multiply;
  opacity: 0.92;
  will-change: transform, filter, opacity;
}

/* Video mode: loop is the hero stage; mosaic is poster only */
.fce-mosaic-hero[data-has-video="1"] .fce-mosaic-hero__mosaic {
  mix-blend-mode: normal;
  opacity: 1;
  transition: opacity 0.9s ease;
}

.fce-mosaic-hero[data-has-video="1"].is-video-ready .fce-mosaic-hero__mosaic {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.fce-mosaic-hero[data-has-video="1"] .fce-mosaic-hero__veil {
  /* Left readability scrim — video stays visible across most of the frame */
  background:
    linear-gradient(
      90deg,
      rgba(1, 3, 38, 0.72) 0%,
      rgba(1, 3, 38, 0.4) 34%,
      rgba(1, 3, 38, 0.1) 58%,
      rgba(1, 3, 38, 0) 78%
    ),
    linear-gradient(
      180deg,
      rgba(1, 3, 38, 0.22) 0%,
      transparent 30%,
      transparent 70%,
      rgba(1, 3, 38, 0.28) 100%
    );
}
.fce-mosaic-hero[data-has-video="1"] .fce-mosaic-hero__content {
  z-index: 5;
}

.fce-mosaic-hero[data-has-video="1"] .fce-mosaic-hero__grain {
  opacity: 0.02;
}

.fce-mosaic-hero[data-has-video="1"] .fce-mosaic-hero__draw {
  opacity: 0.28;
}

.fce-mosaic-hero__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.08;
  background-image: radial-gradient(rgba(1, 3, 38, 0.35) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}

.fce-mosaic-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.35) 38%, rgba(255, 255, 255, 0.88) 100%),
    radial-gradient(ellipse at 78% 28%, rgba(18, 75, 241, 0.12), transparent 55%);
}

.fce-mosaic-hero__draw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.fce-draw-path {
  fill: none;
  stroke: var(--fce-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.35;
}

.fce-mosaic-hero__content {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 120px 0 72px;
  display: grid;
  gap: 22px;
  max-width: 760px;
  justify-self: start;
  margin-left: max(24px, calc((100% - 1280px) / 2 + 24px));
}

.fce-mosaic-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: Lato, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fce-accent);
}

.fce-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fce-accent);
  box-shadow: 0 0 0 0 rgba(18, 75, 241, 0.45);
  animation: fce-pulse 2.4s ease-out infinite;
}

@keyframes fce-pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 75, 241, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(18, 75, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 75, 241, 0); }
}

.fce-mosaic-hero__title {
  margin: 0;
  font-family: Grift, sans-serif;
  font-weight: 600;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--fce-ink);
}

.fce-mosaic-hero__title .fce-line {
  display: block;
  overflow: hidden;
}

.fce-mosaic-hero__title .fce-char {
  display: inline-block;
  will-change: transform, opacity;
}

.fce-mosaic-hero__sub {
  margin: 0;
  max-width: 40ch;
  font-family: Lato, sans-serif;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--fce-muted);
}

.fce-mosaic-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  margin-top: 8px;
}

.fce-mosaic-hero__signal {
  margin: 0;
  max-width: 22ch;
  font-family: Lato, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--fce-ink);
}

/* ---------- Work Reel ---------- */

.fce-work-reel {
  background: var(--fce-surface);
  color: var(--fce-ink);
  padding: 96px 24px 40px;
}

.fce-work-reel__head {
  width: min(1280px, 100%);
  margin: 0 auto 48px;
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.fce-work-reel__heading {
  margin: 0;
  font-family: Grift, sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.fce-work-reel__intro {
  margin: 0;
  font-family: Lato, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--fce-muted);
}

.fce-work-reel__list {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.fce-work-item {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  min-height: min(72vh, 620px);
  will-change: transform, opacity;
}

.fce-work-item__link {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  min-height: inherit;
  text-decoration: none;
  color: inherit;
}

.fce-work-item__media {
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.fce-work-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}

.fce-work-item__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 55%, rgba(255, 255, 255, 0.15));
  pointer-events: none;
}

.fce-work-item__meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 32px;
  background: #fff;
}

.fce-work-item__index {
  font-family: Grift, sans-serif;
  font-size: 48px;
  line-height: 1;
  color: var(--fce-accent);
  letter-spacing: -0.03em;
}

.fce-work-item__tag {
  margin: 0 0 8px;
  font-family: Lato, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fce-accent);
}

.fce-work-item__title {
  margin: 0 0 12px;
  font-family: Grift, sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.fce-work-item__summary {
  margin: 0 0 24px;
  font-family: Lato, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fce-muted);
}

.fce-work-item__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Lato, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--fce-ink);
}

.fce-work-item__cta::after {
  content: "→";
  color: var(--fce-accent);
  transition: transform 0.25s ease;
}

.fce-work-item:hover .fce-work-item__cta::after {
  transform: translateX(4px);
}

.fce-work-item:hover .fce-work-item__media img {
  transform: scale(1.14);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Manifesto ---------- */

.fce-manifesto {
  position: relative;
  overflow: hidden;
  background: var(--fce-dark);
  color: #fff;
  padding: 120px 24px;
}

.fce-manifesto__inner {
  position: relative;
  z-index: 2;
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 48px;
  align-items: end;
}

.fce-manifesto__line {
  margin: 0;
  font-family: Grift, sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  overflow: hidden;
}

.fce-manifesto__line--accent {
  color: var(--fce-soft);
}

.fce-manifesto__side {
  display: grid;
  gap: 28px;
  padding-bottom: 8px;
}

.fce-manifesto__body {
  margin: 0;
  font-family: Lato, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.fce-manifesto__mosaic {
  position: absolute;
  width: 55%;
  height: 120%;
  right: -8%;
  top: -10%;
  background:
    radial-gradient(circle at 30% 40%, rgba(18, 75, 241, 0.35), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(18, 120, 241, 0.25), transparent 40%);
  filter: blur(8px);
  opacity: 0.9;
  pointer-events: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .fce-dot { animation: none; }
  .fce-mosaic-hero__title .fce-char,
  .fce-mosaic-hero__mosaic,
  .fce-work-item,
  .fce-work-item__media img {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .fce-mosaic-hero__content {
    margin-left: 24px;
    margin-right: 24px;
    width: auto;
    padding-top: 140px;
  }

  .fce-work-item__link {
    grid-template-columns: 1fr;
  }

  .fce-work-item {
    min-height: 0;
  }

  .fce-work-item__media {
    min-height: 260px;
    aspect-ratio: 16 / 10;
  }

  .fce-manifesto__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .fce-mosaic-hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .fce-work-reel {
    padding-top: 72px;
  }

  .fce-manifesto {
    padding: 88px 20px;
  }
}
