/* ==========================================================
   MOWA — base: tokens, reset, typography, UI primitives,
   loader, nav, hero, marquee
   ========================================================== */

:root {
  --bg: #0b0a0d;
  --bg-2: #141218;
  --bg-3: #1c1922;
  --ink: #f4f1f6;
  --muted: #a49eaa;
  --line: rgba(255, 255, 255, 0.09);
  --purple: #8e55a0;
  --purple-2: #a66fb8;
  --lilac: #cfaedb;
  --ivory: #f3efe9;
  --ivory-2: #e9e3da;
  --ink-dark: #17141b;
  --muted-dark: #6c6472;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-hero: clamp(3.2rem, 1.2rem + 7.2vw, 8.6rem);
  --text-title: clamp(2.4rem, 1.2rem + 4.2vw, 5.4rem);

  --space-section: clamp(6rem, 4rem + 8vw, 12rem);
  --gutter: clamp(1rem, 0.5rem + 3vw, 3rem);
  --radius: 22px;
  --radius-lg: 34px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--purple); color: #fff; }

:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 4px;
  border-radius: 6px;
}

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

/* ---------- Typography ---------- */
em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--lilac);
  letter-spacing: -0.01em;
}
.light em { color: var(--purple); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.light .eyebrow { color: var(--muted-dark); }

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-title);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.section-head { max-width: 900px; margin-bottom: clamp(3rem, 6vw, 5.5rem); }

/* ---------- Buttons ---------- */
.btn {
  --h: 58px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  height: var(--h);
  padding: 0 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s;
  will-change: transform;
}
.btn span, .btn .arrow { position: relative; z-index: 1; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
}
.btn:hover::after { transform: translateY(0); }

.btn--primary { background: var(--purple); color: #fff; box-shadow: 0 10px 40px -10px rgba(142, 85, 160, 0.7); }
.btn--primary::after { background: var(--ink); }
.btn--primary:hover { color: var(--ink-dark); }

.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost::after { background: rgba(255, 255, 255, 0.08); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.3); }

.btn--sm { --h: 44px; padding: 0 1.3rem; font-size: 0.9rem; }
.btn--lg { --h: 72px; padding: 0 2.6rem; font-size: 1.1rem; }
.btn--full { width: 100%; }

.arrow {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.4s var(--ease-out);
}
a:hover > .arrow, .btn:hover .arrow { transform: translateX(4px); }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 2.4rem;
  background: var(--bg);
}
.loader__logo { width: min(64vw, 420px); overflow: visible; }
.loader__logo .wm-o { transform-origin: 247px 75px; transform-box: view-box; }
.loader__bar { width: min(64vw, 420px); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--purple); transform: scaleX(0); transform-origin: left; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; inset: 0 auto auto 0; z-index: 90; pointer-events: none; display: none; opacity: 0; transition: opacity 0.4s; }
.cursor.is-visible { opacity: 1; }
.cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; translate: -50% -50%; }
.cursor__dot { width: 6px; height: 6px; background: var(--lilac); }
.cursor__ring {
  width: 40px; height: 40px;
  border: 1px solid rgba(207, 174, 219, 0.5);
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), background 0.35s, border-color 0.35s;
}
.cursor.is-hover .cursor__ring { width: 72px; height: 72px; background: rgba(142, 85, 160, 0.15); border-color: transparent; }
@media (pointer: fine) {
  .cursor { display: block; }
}

/* ---------- Progress + grain ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--lilac));
  transform: scaleX(0);
  transform-origin: left;
}
.grain {
  position: fixed; inset: -50%; z-index: 80; pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 4%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 7%); }
  80% { transform: translate(6%, -2%); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.1rem var(--gutter);
  transition: transform 0.6s var(--ease-out), background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.nav.is-scrolled {
  background: rgba(11, 10, 13, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { color: var(--purple); }
.wordmark { width: 118px; height: auto; overflow: visible; }
.wordmark__o { transform-origin: center; transform-box: fill-box; transition: transform 0.9s var(--ease-out); }
.nav__logo:hover .wordmark__o { transform: rotate(180deg); }

.nav__links { display: flex; gap: 2rem; margin-left: auto; }
.nav__links a {
  position: relative; font-size: 0.92rem; font-weight: 500; color: var(--muted);
  transition: color 0.3s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--lilac); transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__burger { display: none; width: 44px; height: 44px; position: relative; margin-left: auto; }
.nav__burger span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink);
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 26px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column; justify-content: center; gap: 3rem;
  padding: 6rem var(--gutter) 3rem;
  background: var(--bg-2);
  clip-path: circle(0% at calc(100% - 42px) 40px);
  transition: clip-path 0.8s var(--ease-in-out);
  visibility: hidden;
}
.menu.is-open { clip-path: circle(150% at calc(100% - 42px) 40px); visibility: visible; }
.menu nav { display: flex; flex-direction: column; gap: 0.4rem; }
.menu nav a { font-family: var(--serif); font-size: clamp(2.6rem, 10vw, 4rem); line-height: 1.15; }
.menu__contact { color: var(--muted); font-size: 0.95rem; }

@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 1.6rem 0;
  background: var(--purple);
  transform: rotate(-1.4deg) scale(1.03);
  box-shadow: 0 30px 80px -30px rgba(142, 85, 160, 0.8);
}
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 2.4rem; padding-right: 2.4rem; }
.marquee__group span { font-family: var(--serif); font-size: clamp(1.6rem, 1rem + 2vw, 2.8rem); white-space: nowrap; color: #fff; }
.marquee__group span:nth-child(4n + 3) { font-style: italic; }
.marquee__group i { width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: 0.7; flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Generic reveal (JS sets initial state) ---------- */
.no-js [data-reveal] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .grain { display: none; }
}
