/* ================================================================
   My Wealth Media — Megan Lemay
   Quiet luxury editorial. Pure CSS motion + tiny vanilla JS.
   ================================================================ */

:root {
  --ink: #141110;
  --surface: #1C1917;
  --cream: #FFEDD7;
  --rose-gold: #E0A582;
  --muted: #A89B92;
  --hairline: #2E2724;

  --font-display: 'Italiana', Georgia, serif;
  /* Paid upgrade later: Zaslia by suhadidesign */
  --font-body: 'Inter', system-ui, sans-serif;
  --font-label: 'Jost', system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--ink);
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

::selection {
  background: var(--rose-gold);
  color: var(--ink);
}

/* ---------- Film grain overlay ---------- */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ---------- Focus + skip link ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rose-gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--rose-gold);
  color: var(--ink);
  padding: 10px 18px;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Shared type ---------- */
.eyebrow {
  font-family: var(--font-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
@media (min-width: 768px) { .eyebrow { font-size: 12px; } }
.eyebrow--accent { color: var(--rose-gold); }

.body {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
  max-width: var(--measure);
  margin: 0 0 1.6em;
}
@media (min-width: 768px) { .body { font-size: 18px; } }

/* ---------- Layout wrappers ---------- */
.wrap-narrow {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 24px;
}
.wrap-wide {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Fallback gradient (behind every image) ---------- */
.media-fallback,
.mark-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(90% 90% at 80% 12%, rgba(224, 165, 130, 0.10), transparent 55%),
    radial-gradient(130% 130% at 12% 18%, #2a211c 0%, var(--surface) 46%, var(--ink) 100%);
}

.hero-mark img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.mark-fallback { border-radius: 50%; }
.mark-fallback--lg { border-radius: 50%; }

/* ================================================================
   SECTION 1 — HERO
   ================================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 145%;
  object-fit: cover;
  z-index: 1;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to top, rgba(20, 17, 16, 0.92) 0%, rgba(20, 17, 16, 0) 36%),
    radial-gradient(130% 120% at 50% 44%, rgba(20, 17, 16, 0.84) 0%, rgba(20, 17, 16, 0.55) 58%, rgba(20, 17, 16, 0.38) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: 0 24px;
  text-align: center;
}

.hero-mark {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 68px;
}

.eyebrow--accent.eyebrow { margin-bottom: 44px; }

.hero-kicker {
  display: block;
  font-family: var(--font-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 30px;
}
@media (min-width: 768px) { .hero-kicker { font-size: 12px; } }

.hero-title {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 300;
  color: var(--cream);
  font-size: clamp(3.4rem, 8.5vw, 8rem);
  letter-spacing: 0.01em;
  line-height: 1.04;
  margin: 0 0 52px;
}
.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
}
.mask-inner { display: inline-block; }

.hero-sub {
  font-family: var(--font-body);
  color: var(--cream);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.4vw, 1.375rem);
  line-height: 1.6;
  max-width: 30em;
  margin: 0 auto 64px;
}

.btn-hero { letter-spacing: 0.02em; }

.btn-ghost {
  display: inline-block;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 12px;
  color: var(--cream);
  text-decoration: none;
  border: 1px solid var(--rose-gold);
  background: transparent;
  padding: 18px 34px;
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--rose-gold);
  color: var(--ink);
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 1px;
  height: 64px;
  overflow: hidden;
}
.scroll-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 40%;
  background: var(--rose-gold);
}

/* ================================================================
   SECTION 2 — ABOUT
   ================================================================ */
.about {
  padding: clamp(120px, 20vh, 220px) 0;
}
.about .eyebrow--accent { margin-bottom: 56px; }
.about .body { margin-left: auto; margin-right: auto; }

.body--feature {
  position: relative;
  color: var(--cream);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.6;
  margin-top: 56px;
  padding-top: 44px;
}
.body--feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 1px;
  background: var(--rose-gold);
}

/* ================================================================
   EDITORIAL MARQUEE
   ================================================================ */
.marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 26px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0.7;
}

/* ================================================================
   SECTION 3 — WHAT I DO
   ================================================================ */
.work {
  padding: clamp(120px, 20vh, 220px) 0;
}
.work .eyebrow--accent { margin-bottom: 56px; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 28px; }
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  transform-style: preserve-3d;
  transition: border-color 0.3s var(--ease-out);
}

.card-media {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.card-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.55) brightness(0.92);
  transition: filter 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}
.card:hover .card-media img {
  filter: saturate(1) brightness(1);
  transform: scale(1.04);
}

.card-body {
  position: relative;
  padding: 40px 34px 44px;
}
.numeral {
  display: block;
  font-family: var(--font-display);
  font-size: 4.6rem;
  line-height: 1;
  color: var(--rose-gold);
  opacity: 0.22;
  margin-bottom: -6px;
}
.card-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--cream);
  margin: 0 0 20px;
}
.card-body .body { margin-bottom: 0; }

/* ================================================================
   TESTIMONIAL
   ================================================================ */
.testimonial {
  padding: 0 0 clamp(110px, 16vh, 180px);
}
.testimonial-inner {
  margin: 0;
  text-align: center;
}
.testimonial-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 0.5;
  color: var(--rose-gold);
  opacity: 0.55;
  margin-bottom: 18px;
}
.testimonial-rotor {
  min-height: 9.5em;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.testimonial-rotor.is-fading {
  opacity: 0;
  transform: translateY(10px);
}
.testimonial-inner blockquote { margin: 0; }
.quote {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--cream);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  line-height: 1.45;
  margin: 0 auto 30px;
  max-width: 22em;
}
.testimonial-cite { color: var(--muted); }

/* ================================================================
   SECTION 4 — CONTACT
   ================================================================ */
.contact {
  position: relative;
  background: var(--ink);
  padding: clamp(120px, 18vh, 200px) 0 clamp(120px, 18vh, 200px);
}
.contact-rule {
  width: 100%;
  max-width: 1240px;
  height: 1px;
  background: var(--rose-gold);
  margin: 0 auto clamp(80px, 12vh, 140px);
}
.contact-inner { text-align: center; }
.contact-heading {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.5rem);
  color: var(--cream);
  margin: 0 0 26px;
}
.contact-body {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 44px;
}
.btn-solid {
  display: inline-block;
  font-family: var(--font-label);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 15px;
  background: var(--rose-gold);
  color: var(--ink);
  text-decoration: none;
  padding: 18px 40px;
  transition: transform 0.3s var(--ease-out), filter 0.3s var(--ease-out);
}
.btn-solid:hover,
.btn-solid:focus-visible { filter: brightness(1.06); transform: translateY(-2px); }

.link-quiet {
  display: block;
  width: fit-content;
  margin: 30px auto 0;
  color: var(--muted);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--hairline);
  transition: color 0.3s var(--ease-out), text-decoration-color 0.3s var(--ease-out);
}
.link-quiet:hover,
.link-quiet:focus-visible {
  color: var(--rose-gold);
  text-decoration-color: var(--rose-gold);
}

/* ================================================================
   SECTION 5 — FOOTER
   ================================================================ */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 34px 24px;
}
.footer-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}
.footer-line .dot { opacity: 0.5; }

/* ================================================================
   MOTION — only when the user allows it
   ================================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* Scroll reveal */
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  }
  .reveal.in-view { opacity: 1; transform: none; }
  /* stagger cards 90ms apart */
  .cards .card:nth-child(1) { transition-delay: 0ms; }
  .cards .card:nth-child(2) { transition-delay: 90ms; }
  .cards .card:nth-child(3) { transition-delay: 180ms; }

  /* About: line-by-line rose-gold scroll highlight */
  .about .body:not(.body--feature) {
    --p: 0;
    background-image: linear-gradient(
      to bottom,
      #E3B695 calc(var(--p) * 100% - 6%),
      var(--muted) calc(var(--p) * 100% + 6%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }

  /* Hero on-load: elements */
  .h-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--d, 0s);
  }
  body.loaded .h-reveal { opacity: 1; transform: none; }

  /* Hero on-load: masked title line */
  .mask-inner {
    transform: translateY(110%);
    transition: transform 1.1s var(--ease-out);
    transition-delay: 0.28s;
  }
  body.loaded .mask-inner { transform: translateY(0); }

  /* Hero image entry scale */
  .hero-media {
    transform: scale(1.06);
    transition: transform 1.2s var(--ease-out);
  }
  body.loaded .hero-media { transform: scale(1); }

  /* Scroll cue loop */
  .scroll-line { animation: cueDrift 2.4s var(--ease-out) infinite; }
  @keyframes cueDrift {
    0%   { transform: translateY(-100%); opacity: 0; }
    35%  { opacity: 1; }
    100% { transform: translateY(160%); opacity: 0; }
  }

  /* Marquee */
  .marquee-track { animation: marquee 42s linear infinite; }
  @keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
}

/* Card tilt only for precise pointers + allowed motion */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .card { will-change: transform; }
  .card.tilt { transition: transform 0.2s ease-out, border-color 0.3s var(--ease-out); }

  /* grain shimmer */
  body::after { animation: grainShift 0.9s steps(4) infinite; }
  @keyframes grainShift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-2%, 1.5%); }
    50%  { transform: translate(1.5%, -2%); }
    75%  { transform: translate(-1%, -1%); }
    100% { transform: translate(0, 0); }
  }
}

/* ================================================================
   CUSTOM CURSOR (desktop, fine pointer, JS-enabled only)
   ================================================================ */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor,
  body.has-cursor a,
  body.has-cursor button,
  body.has-cursor .card { cursor: none; }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
  }
  body.cursor-visible .cursor-dot,
  body.cursor-visible .cursor-ring { opacity: 1; }

  .cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--rose-gold);
  }
  .cursor-ring {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1px solid rgba(224, 165, 130, 0.45);
    transition: opacity 0.3s var(--ease-out),
                width 0.35s var(--ease-out), height 0.35s var(--ease-out),
                margin 0.35s var(--ease-out),
                border-color 0.35s var(--ease-out),
                background-color 0.35s var(--ease-out);
  }
  /* softened state over interactive elements */
  body.cursor-soft .cursor-ring {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-color: rgba(224, 165, 130, 0.18);
    background: rgba(224, 165, 130, 0.08);
  }
  body.cursor-soft .cursor-dot { background: var(--cream); }
}

/* ---------- Mobile hero centering ---------- */
@media (max-width: 767px) {
  body { font-size: 17px; }
  .hero-mark { margin-bottom: 44px; }
  .hero .eyebrow--accent { margin-bottom: 30px; }
  .hero-title { margin-bottom: 36px; }
  .hero-sub { margin-bottom: 44px; }
  .hero-content { padding-bottom: 90px; }
}
