@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cormorant-400.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/cormorant-italic-300.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/inter-300.woff2") format("woff2");
}

:root {
  --bg: #ede7dc;
  --ink: #14120f;
  --muted: #6b6459;
  --rule: rgba(20, 18, 15, 0.14);

  --footer-bg: #14120f;
  --footer-ink: #ede7dc;
  --footer-muted: #a49d90;
  --footer-rule: rgba(237, 231, 220, 0.14);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  --hero-height: 260vh;

  --fade-dur: 6s;
  --parallax-dur: 0.05s; /* near-instant, driven by scroll */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  /* Explicit blend group so the fixed mark's difference blend always
     composites against every frame + the body background, regardless
     of frame layer promotion from transforms. */
  isolation: isolate;
}

/* --- MARK (fixed logo with difference blend) ---------------------------- */
.mark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(560px, 60vw);
  pointer-events: none;
  mix-blend-mode: difference;
  transition: opacity 0.6s ease-out;
}

.mark img {
  display: block;
  width: 100%;
  height: auto;
}

.mark.is-hidden {
  opacity: 0;
}

/* --- HERO (tall canvas, scrolls behind the fixed mark) ------------------ */
.hero {
  position: relative;
  height: var(--hero-height);
  overflow: hidden;
}

.canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* --- FRAMES ------------------------------------------------------------- */
.frame {
  position: absolute;
  opacity: 0;
  filter: blur(6px);
  mix-blend-mode: multiply;
  transition: opacity var(--fade-dur) ease-in-out,
              filter var(--fade-dur) ease-in-out;
  transform: translate3d(0, var(--offset-y, 0px), 0);
}

.frame.is-visible {
  opacity: 0.85;
  filter: blur(0);
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame.empty {
  background: repeating-linear-gradient(
    45deg,
    rgba(20, 18, 15, 0.04),
    rgba(20, 18, 15, 0.04) 8px,
    rgba(20, 18, 15, 0.08) 8px,
    rgba(20, 18, 15, 0.08) 16px
  );
}
.frame.empty img { visibility: hidden; }

.selection-rect {
  position: absolute;
  border: 1px dashed rgba(20, 18, 15, 0.5);
  background: rgba(20, 18, 15, 0.06);
  pointer-events: none;
  z-index: 15;
}

/* Size buckets — as fractions of the viewport
   large  ≈ 1/2 area  →  70vw × 70vh
   medium ≈ 1/4 area  →  50vw × 50vh
   small  ≈ 1/8 area  →  35vw × 35vh */
.size-l { width: 70vw; height: 70vh; }
.size-m { width: 50vw; height: 50vh; }
.size-s { width: 35vw; height: 35vh; }

/* Large positions — scattered vertically through the hero, biased toward
   the horizontal center so they routinely overlap the fixed logo. */
.pos-l1 { top:  10vh; left: 15vw; }
.pos-l2 { top:  70vh; right: 12vw; }
.pos-l3 { top: 130vh; left: 18vw; }
.pos-l4 { top: 175vh; right: 10vw; }
.pos-l5 { top:  40vh; left: 22vw; }
.pos-l6 { top: 100vh; left:  8vw; }
.pos-l7 { top: 210vh; right: 15vw; }

/* Medium — off-center, mid parallax */
.pos-m1 { top:  25vh; right: 6vw; }
.pos-m2 { top: 100vh; left:  4vw; }
.pos-m3 { top: 155vh; right: 6vw; }
.pos-m4 { top: 210vh; left:  8vw; }
.pos-m5 { top:  55vh; left:  2vw; }
.pos-m6 { top: 130vh; right: 4vw; }
.pos-m7 { top: 180vh; left: 10vw; }

/* Small — corners and edges, high parallax */
.pos-s1 { top:  15vh; right: 3vw; }
.pos-s2 { top:  85vh; left:  6vw; }
.pos-s3 { top: 125vh; right: 4vw; }
.pos-s4 { top: 175vh; left:  4vw; }
.pos-s5 { top: 225vh; right: 12vw; }

/* --- FOOTER (inverted) --------------------------------------------------- */
.footer {
  position: relative;
  z-index: 5;
  background: var(--footer-bg);
  color: var(--footer-muted);
  border-top: 1px solid var(--footer-rule);
  padding: 5rem 2rem 2rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.col h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--footer-ink);
  margin: 0 0 1rem;
}

.col p { margin: 0; max-width: 34ch; }

.col a {
  color: var(--footer-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--footer-rule);
  transition: border-color 0.2s ease;
}
.col a:hover { border-color: var(--footer-ink); }

.footer-base {
  max-width: 1080px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--footer-rule);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--footer-muted);
}

.footer-base a {
  color: var(--footer-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--footer-rule);
}

/* --- LEGAL PAGES (privacy, terms) --------------------------------------- */
body.legal {
  background: var(--bg);
  color: var(--ink);
  isolation: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  padding: 3rem 2rem 2rem;
  display: flex;
  justify-content: center;
}

.legal-header img {
  width: min(280px, 45vw);
  height: auto;
  display: block;
}

.legal-main {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  font-size: 1rem;
  line-height: 1.7;
}

.legal-main h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.25rem;
  letter-spacing: 0.01em;
  margin: 0 0 2rem;
}

.legal-main h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
}

.legal-main p {
  margin: 0 0 1rem;
  color: var(--ink);
}

.legal-main a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}

.legal-main a:hover {
  border-color: var(--ink);
}

.legal-meta {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.legal-footer a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

/* --- RESPONSIVE ---------------------------------------------------------- */
@media (max-width: 720px) {
  :root { --hero-height: 220vh; }

  .mark { width: min(320px, 78vw); }

  /* Enlarge slightly on small screens so proportions read the same. */
  .size-l { width: 90vw; height: 60vh; }
  .size-m { width: 70vw; height: 45vh; }
  .size-s { width: 50vw; height: 30vh; }

  .pos-l1 { top:  8vh; left:  5vw; }
  .pos-l2 { top: 60vh; right: 5vw; }
  .pos-l3 { top: 115vh; left: 5vw; }
  .pos-l4 { top: 155vh; right: 5vw; }
  .pos-l5, .pos-l6, .pos-l7 { display: none; }

  .pos-m1 { top:  25vh; right: 3vw; }
  .pos-m2 { top:  85vh; left:  3vw; }
  .pos-m3 { top: 140vh; right: 3vw; }
  .pos-m4, .pos-m5, .pos-m6, .pos-m7 { display: none; }

  .pos-s1 { top:  10vh; right: 3vw; }
  .pos-s2 { top:  75vh; left:  3vw; }
  .pos-s3, .pos-s4, .pos-s5 { display: none; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-base { flex-direction: column; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .frame {
    transition: opacity 1s linear;
    filter: none;
    transform: none !important;
  }
  .mark { transition: opacity 0.3s linear; }
}
