/* ==========================================================================
   Cursor with Marquee Effect — premium light theme
   ========================================================================== */

:root {
  --bg: #f4f1ec;
  --bg-soft: #ebe6de;
  --surface: #fffcf8;
  --ink: #1a1814;
  --ink-muted: #6b6560;
  --ink-soft: #9a948c;
  --line: rgba(26, 24, 20, 0.12);
  --line-strong: rgba(26, 24, 20, 0.28);
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background-color: var(--bg);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
}

/* Soft ambient wash — warm light, not flat white */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(255, 236, 210, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(220, 232, 240, 0.45), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(235, 220, 200, 0.35), transparent 55%),
    var(--bg);
  pointer-events: none;
}

/* Subtle paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

/* Hide system cursor — custom marquee cursor takes over */
.body.is--cursor,
.body.is--cursor * {
  cursor: none !important;
}

img {
  max-width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */

.page-header {
  max-width: 80em;
  margin: 0 auto;
  padding: 2.5rem 5vw 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-header__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.page-header__title {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.page-header__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-muted);
}

.page-header__hint {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

@media (hover: hover) and (pointer: fine) {
  .page-header__hint {
    display: inline-flex;
  }
}

/* --------------------------------------------------------------------------
   Demo grid
   -------------------------------------------------------------------------- */

.demo-grid {
  display: flex;
  flex-flow: wrap;
  justify-content: center;
  align-items: flex-start;
  min-height: auto;
  padding: 3rem 5vw 8vw;
}

.demo-grid__list {
  display: flex;
  flex-flow: wrap;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  width: 100%;
  max-width: 80em;
}

/* --------------------------------------------------------------------------
   Premium cards — sharp, bordered, white content panel
   Hover motion is driven by GSAP (see script.js) for buttery easing
   -------------------------------------------------------------------------- */

.demo-grid-card {
  display: flex;
  flex-flow: column;
  width: calc(50% - clamp(0.625rem, 1.25vw, 1rem));
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
  will-change: opacity, border-color;
  transition: border-color 0.7s var(--ease-premium);
}

.demo-grid-card.is-active {
  border-color: var(--line-strong);
  z-index: 1;
}

.demo-grid-card__img {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.7s var(--ease-premium);
}

.demo-grid-card.is-active .demo-grid-card__img {
  border-bottom-color: var(--line-strong);
}

/* Soft light wash on image (GSAP fades this in) */
.demo-grid-card__img-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 248, 0) 40%,
    rgba(26, 24, 20, 0.12) 100%
  );
  opacity: 0;
  will-change: opacity;
}

/* 3:4 aspect */
.demo-grid-card__img-before {
  padding-top: 125%;
}

.demo-grid-card__cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  will-change: transform, filter;
  filter: saturate(0.9) contrast(1.02) brightness(0.98);
  backface-visibility: hidden;
}

.demo-grid-card__content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.15rem 1.2rem;
  background: #fff;
  will-change: transform;
}

.demo-grid-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.demo-grid-card__label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  will-change: color, letter-spacing;
}

.demo-grid-card__text {
  color: currentColor;
  margin: 0;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: clamp(1.4em, 2.8vw, 1.9em);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  will-change: letter-spacing;
}

.demo-grid-card__text.is--price {
  --underline-scale: 0;
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 1;
  color: var(--ink-muted);
  padding: 0 0 0.35rem;
  border-radius: 0;
  background: none;
  border: 0;
  line-height: 1;
  will-change: color;
}

/* Underline scale driven by GSAP via --underline-scale */
.demo-grid-card__text.is--price::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(var(--underline-scale));
  transform-origin: left center;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Custom cursor marquee (dark pill on light bg for contrast)
   -------------------------------------------------------------------------- */

.cursor-marquee {
  z-index: 100;
  pointer-events: none;
  justify-content: center;
  align-items: center;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  will-change: transform;
}

.cursor-marquee__card {
  color: #faf8f5;
  background-color: #1a1814;
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.75, 0, 0.25, 1);
  transform: translateY(0%) rotate(0.001deg);
  clip-path: inset(calc(50% - 0.25em) round 50em);
  will-change: clip-path;
  opacity: 0;
  box-shadow:
    0 4px 16px rgba(26, 24, 20, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

[data-cursor-marquee-status="active"] .cursor-marquee__card {
  clip-path: inset(0 round 50em);
  transform: translateY(-25%) rotate(0.001deg);
}

[data-cursor-marquee-status="not-active"] .cursor-marquee__card,
[data-cursor-marquee-status="active"] .cursor-marquee__card {
  opacity: 1;
}

@keyframes translateXCursor {
  to {
    transform: translateX(-100%);
  }
}

.cursor-marquee__text-span {
  white-space: nowrap;
  transform-origin: 0;
  padding: 0.55em 0.65em;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.15em;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  display: block;
  position: relative;
  animation: translateXCursor 10s linear infinite paused;
  transition: opacity 0.15s ease-in-out 0.25s;
  opacity: 0;
}

[data-cursor-marquee-status="active"] .cursor-marquee__text-span {
  transition: opacity 0.15s ease-in-out 0s;
  opacity: 1;
}

.cursor-marquee__text-span.is--duplicate {
  position: absolute;
  left: 100%;
}

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

@media screen and (max-width: 767px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .demo-grid {
    padding-top: 2rem;
  }

  .demo-grid-card {
    width: 100%;
  }

  .demo-grid-card__text {
    font-size: 1.5em;
  }
}

@media screen and (max-width: 479px) {
  .demo-grid-card__content {
    align-items: flex-start;
  }
}

/* Touch devices: show normal cursor */
@media (hover: none), (pointer: coarse) {
  .body.is--cursor,
  .body.is--cursor * {
    cursor: auto !important;
  }

  .cursor-marquee {
    display: none;
  }
}
