:root {
  /* Surface */
  --mv-bg-page: #f1f4f8;
  --mv-bg-surface: #f7f9fc;
  --mv-bg-elevated: #fcfdff;

  /* Content */
  --mv-text: #2f3f55;
  --mv-text-muted: #5e6b7f;
  --mv-border: rgba(15, 23, 42, 0.075);
  --mv-border-strong: rgba(15, 23, 42, 0.14);

  /* Shape + elevation */
  --mv-radius: 12px;
  --mv-radius-pill: 9999px;
  --mv-shadow: 0 1px 2px rgba(15, 23, 42, 0.06),
    0 12px 32px rgba(15, 23, 42, 0.06);
  --mv-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
  --mv-shadow-lift: 0 14px 32px rgba(15, 23, 42, 0.12);

  /* Brand accents */
  --mv-accent-violet: #a855f7;
  --mv-accent-cyan: #06b6d4;
  --mv-accent-violet-soft: #7c62d6;
  --mv-accent-cyan-soft: #0e9bb0;

  /* Interactive */
  --mv-interactive-bg: rgba(246, 249, 252, 0.26);
  --mv-interactive-bg-hover: rgba(236, 244, 255, 0.78);
  --mv-interactive-border: rgba(15, 23, 42, 0.1);
  --mv-interactive-border-hover: rgba(124, 98, 214, 0.24);
  --mv-interactive-text: var(--mv-text);
  --mv-interactive-text-hover: rgba(83, 63, 165, 0.92);

  /* Semantic component states */
  --mv-header-bg: rgba(247, 249, 252, 0.9);
  --mv-header-border: var(--mv-border);
  --mv-header-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 4px 24px rgba(15, 23, 42, 0.045);
  --mv-state-active-bg: rgba(124, 98, 214, 0.1);
  --mv-state-active-text: rgba(83, 63, 165, 0.9);
  --mv-state-active-border: rgba(124, 98, 214, 0.22);
  --mv-state-active-shadow: 0 1px 2px rgba(124, 98, 214, 0.1);
  --mv-hero-radial-1: rgba(148, 163, 184, 0.18);
  --mv-hero-radial-2: transparent;
  --mv-link-color: rgba(37, 129, 219, 0.9);
  --mv-link-hover: rgba(124, 98, 214, 0.94);
  --mv-card-grad-start: rgba(255, 255, 255, 0.72);
  --mv-card-grad-end: rgba(255, 255, 255, 0.58);

  /* Effects + accessibility */
  --mv-glow-soft: 0 0 10px rgba(124, 98, 214, 0.18),
    0 0 14px rgba(14, 155, 176, 0.13);
  --mv-focus-ring: rgba(124, 98, 214, 0.9);
  --mv-motion-fast: 0.2s ease;
  --mv-motion-normal: 0.28s ease;

  /* Typography */
  --mv-font: "Roboto Flex", system-ui, sans-serif;
  --mv-text-body: 1.125rem;
  --mv-line-body: 1.55;
  /* Page title (single h1) */
  --mv-page-h1: clamp(1.5rem, 3.2vw, 2rem);
  /* Section subtitles (h2) */
  --mv-page-h2: clamp(1.2rem, 2.2vw, 1.5rem);
  /* Home hero */
  --mv-hero-name: clamp(1.65rem, 4vw, 2.35rem);
  --mv-hero-tagline: clamp(1.05rem, 2.4vw, 1.35rem);
  --mv-hero-cta: clamp(1rem, 2vw, 1.2rem);
}

body {
  font-family: var(--mv-font);
  background: var(--mv-bg-page);
  color: var(--mv-text);
}

a {
  transition: color var(--mv-motion-fast), text-shadow var(--mv-motion-fast),
    text-decoration-color var(--mv-motion-fast);
}

/* Avoid inline `style="display: contents"` wrappers. */
.mv-contents {
  display: contents;
}

/* Global readable body scale (Tailwind preflight keeps a very neutral base). */
body {
  font-size: var(--mv-text-body);
  line-height: var(--mv-line-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Align background with legacy Tailwind builds (.main { background: #f5f5f5 }) */
.main.svelte-11vc81p,
.main.svelte-1u5bxoy {
  background: var(--mv-bg-page) !important;
}

.main.svelte-17c8q1l {
  background: transparent !important;
}

/* Header */
.site-header.navbar,
.navbar.site-header {
  background-color: var(--mv-header-bg) !important;
  -webkit-backdrop-filter: saturate(1.15) blur(14px);
  backdrop-filter: saturate(1.15) blur(14px);
  border-bottom: 1px solid var(--mv-header-border);
  box-shadow: var(--mv-header-shadow);
}

/* Matches the content column (max-w-4xl), aligned to the right */
.site-header__shell {
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.75rem clamp(1rem, 4vw, 1.25rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.site-header__nav {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

.site-header__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.site-header__list li {
  margin: 0;
}

.site-header__link {
  font-family: var(--mv-font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--mv-radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--mv-interactive-text);
  text-decoration: none;
  border: 1px solid var(--mv-interactive-border);
  background-color: var(--mv-interactive-bg);
  box-shadow: var(--mv-shadow-soft);
  -webkit-backdrop-filter: saturate(1.15) blur(14px);
  backdrop-filter: saturate(1.15) blur(14px);
  transition: background var(--mv-motion-fast), color var(--mv-motion-fast),
    border-color var(--mv-motion-fast), box-shadow var(--mv-motion-fast),
    transform var(--mv-motion-fast);
}

.site-header__link:hover {
  background: var(--mv-interactive-bg-hover);
  color: var(--mv-interactive-text-hover);
  border-color: var(--mv-interactive-border-hover);
  box-shadow: var(--mv-shadow-lift), var(--mv-glow-soft);
  transform: translateY(-1px);
}

.site-header__link[aria-current="page"] {
  background: var(--mv-state-active-bg);
  color: var(--mv-state-active-text);
  border-color: var(--mv-state-active-border);
  box-shadow: var(--mv-state-active-shadow);
}

.site-header__link:focus-visible {
  outline: 2px solid var(--mv-focus-ring);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .site-header__list {
    justify-content: flex-end;
  }

  .site-header__link {
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
  }
}

/* Home: hero height with sticky header offset */
.site-header ~ .hero.main.svelte-13ia1v2 {
  min-height: calc(100svh - 4.25rem) !important;
  height: auto !important;
}

/* Home: prominent CTA buttons in header style */
.hero .mylink.svelte-13ia1v2 {
  background-image: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: var(--mv-radius-pill);
  background-color: var(--mv-interactive-bg);
  border: 1px solid var(--mv-interactive-border);
  box-shadow: var(--mv-shadow-soft);
  -webkit-backdrop-filter: saturate(1.15) blur(14px);
  backdrop-filter: saturate(1.15) blur(14px);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: background var(--mv-motion-fast), color var(--mv-motion-fast),
    border-color var(--mv-motion-fast), box-shadow var(--mv-motion-fast),
    transform var(--mv-motion-fast);
}

.hero .mylink.svelte-13ia1v2:hover {
  background-color: var(--mv-interactive-bg-hover);
  color: var(--mv-interactive-text-hover);
  border-color: var(--mv-interactive-border-hover);
  box-shadow: var(--mv-shadow-lift), var(--mv-glow-soft);
  transform: translateY(-1px);
}

.hero .mylink.svelte-13ia1v2:focus-visible {
  outline: 2px solid var(--mv-focus-ring);
  outline-offset: 3px;
}

/* Home: subtle background behind hero */
.hero.main,
.hero.main.svelte-13ia1v2 {
  background: radial-gradient(
      120% 85% at 50% 0%,
      var(--mv-hero-radial-1),
      var(--mv-hero-radial-2) 58%
    ),
    var(--mv-bg-page);
}

/* Content columns (offer, services) */
body .main .max-w-4xl {
  background: var(--mv-bg-elevated);
  border-radius: var(--mv-radius);
  box-shadow: var(--mv-shadow);
  border: 1px solid var(--mv-border);
  padding-top: 1rem;
  padding-bottom: 1.1rem;
}

/* Text pages: consistent spacing for long-form reading (about/projects). */
body .main .max-w-4xl p {
  margin: 0.85rem 0;
  max-width: 72ch;
}

/* Generic card container for long-form blocks (used on /about, /projects). */
.mv-card {
  background: linear-gradient(
      165deg,
      var(--mv-card-grad-start),
      var(--mv-card-grad-end)
    ),
    var(--mv-bg-elevated);
  border: 1px solid var(--mv-border);
  border-radius: var(--mv-radius);
  box-shadow: var(--mv-shadow-soft);
  padding: 1.1rem 1.15rem;
  transition: border-color var(--mv-motion-fast), box-shadow var(--mv-motion-fast),
    transform var(--mv-motion-fast);
}

@media (hover: hover) {
  .mv-card:hover {
    border-color: var(--mv-interactive-border-hover);
    box-shadow: var(--mv-shadow-lift);
    transform: translateY(-1px);
  }
}

.mv-card p:first-child {
  margin-top: 0;
}

.mv-card p:last-child {
  margin-bottom: 0;
}

.mv-card + .mv-card {
  margin-top: 1rem;
}

/* Headings as section separators (avoid manually placed <hr>). */
body .main .max-w-4xl .mv-legal-h2,
body .main .max-w-4xl .mv-page-h2 {
  border-top: 1px solid var(--mv-border);
  padding-top: 0.65rem;
}

body .main .max-w-4xl .mv-legal-h2 {
  padding-top: 1.1rem;
}

/* First section after TOC should start without divider. */
body .main .max-w-4xl .mv-toc + .mv-legal-h2 {
  border-top: 0;
  padding-top: 0;
}

/* If a page starts with an h2, don't show a divider above it. */
body .main .max-w-4xl > h2.mv-page-h2:first-child,
body .main .max-w-4xl > h2.mv-legal-h2:first-child,
body .main .max-w-4xl > .mv-page-h2:first-child,
body .main .max-w-4xl > .mv-legal-h2:first-child {
  border-top: 0;
  padding-top: 0;
}

body .main .max-w-4xl h1 + p,
body .main .max-w-4xl h2 + p,
body .main .max-w-4xl .mv-legal-h2 + p,
body .main .max-w-4xl .mv-page-h2 + p {
  margin-top: 0.65rem;
}

body .main .max-w-4xl p + h2,
body .main .max-w-4xl p + .mv-legal-h2,
body .main .max-w-4xl p + .mv-page-h2 {
  margin-top: 1.35rem;
}

/* Normalize Tailwind-like text sizing to site scale. */
body .main .max-w-4xl .text-xl {
  font-size: var(--mv-text-body) !important;
  line-height: var(--mv-line-body) !important;
}

/* Consistent separators (replace legacy Tailwind `divider bg-black`). */
hr.mv-divider {
  border: 0;
  height: 1px;
  background: var(--mv-border);
  margin: 1.25rem 0;
}

.mv-section-sep {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mv-border);
}

/* Long-form lists (replace "- item<br>" patterns). */
ul.mv-bullets {
  margin: 0.65rem 0 0.25rem 1.15rem;
  padding: 0;
  list-style: disc;
}

ul.mv-bullets li {
  margin: 0.35rem 0;
}

/* Small layout utilities (replace inline styles). */
.mv-block {
  display: block;
}

.mv-mt-xs {
  margin-top: 0.4rem;
}

.mv-mt-sm {
  margin-top: 0.85rem;
}

.mv-mb-xs {
  margin-bottom: 0.25rem;
}

/* Page heading: one h1, no oversized utility classes */
.mv-page-h1,
h1.mv-page-h1 {
  font-size: var(--mv-page-h1);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

.mv-page-h2,
h2.mv-page-h2 {
  font-size: var(--mv-page-h2);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 1.1rem 0 0.55rem;
}

/* Sections inside the agreement (legal text) */
.mv-legal-h2 {
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--mv-text);
  margin: 0.56rem 0 1.1rem;
}

/* About page rhythm: tighten gap between cards and next legal heading. */
.mv-card + .mv-legal-h2 {
  margin-top: 1.1rem;
}

.mv-toc + .mv-legal-h2 {
  margin-top: 0.75rem;
}

.mv-legal-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 1.25rem 0 0.5rem;
  color: var(--mv-text);
}

/* Table of contents for long page */
.mv-toc {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(
      165deg,
      var(--mv-card-grad-start),
      var(--mv-card-grad-end)
    ),
    var(--mv-bg-elevated);
  border: 1px solid var(--mv-border);
  border-radius: var(--mv-radius);
  box-shadow: var(--mv-shadow-soft);
}

.mv-toc-heading {
  margin: 0 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mv-text);
}

.mv-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mv-toc a {
  font-size: 0.9375rem;
  color: var(--mv-link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--mv-motion-fast), text-shadow var(--mv-motion-fast);
}

.mv-toc a:hover {
  color: var(--mv-link-hover);
  text-shadow: var(--mv-glow-soft);
}

.mv-toc a:focus-visible,
.main a.text-blue-400:focus-visible {
  outline: 2px solid var(--mv-focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Home: hero */
.mv-hero-title {
  font-size: var(--mv-hero-name);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0;
}

.mv-hero-subtitle {
  font-size: var(--mv-hero-tagline);
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0;
}

.mv-hero-cta {
  font-size: var(--mv-hero-cta);
}

/* Softly constrain legacy Tailwind h1 classes */
h1.text-5xl,
h1.text-6xl {
  font-size: var(--mv-page-h1);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Footer: links in the "Information" section */
a.footer-info-link {
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a.footer-info-link:hover,
a.footer-info-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--mv-accent-cyan-soft);
  text-shadow: var(--mv-glow-soft);
}

a.footer-info-link:focus-visible {
  outline: 2px solid var(--mv-focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Payment logos strip: keep source images, handle hover in CSS */
.footer-pay-strip {
  align-items: center;
}

.footer-pay-strip img.footer-pay-logo {
  height: auto;
  display: block;
  opacity: 0.72;
  filter: saturate(0.65) brightness(0.84) contrast(0.92);
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .footer-pay-strip img.footer-pay-logo {
    transition: none;
  }
}

@media (max-width: 640px) {
  :root {
    --mv-text-body: 1.05rem;
    --mv-line-body: 1.62;
  }

  body .main .max-w-4xl p {
    max-width: 100%;
  }
}

.footer-pay-strip img.footer-pay-logo:hover {
  transform: scale(1.14);
  opacity: 0.98;
  filter: saturate(1.35) brightness(1.12) contrast(1.08)
    drop-shadow(0 0 9px rgba(168, 85, 247, 0.56))
    drop-shadow(0 0 12px rgba(6, 182, 212, 0.44));
}

.main a.text-blue-400 {
  color: var(--mv-link-color);
  transition: color var(--mv-motion-fast), text-shadow var(--mv-motion-fast);
}

.main a.text-blue-400:hover {
  color: var(--mv-link-hover);
  text-shadow: var(--mv-glow-soft);
}

@media (prefers-reduced-motion: reduce) {
  .site-header__link,
  .hero .mylink.svelte-13ia1v2,
  .mv-card,
  .mv-toc a,
  .main a.text-blue-400,
  a.footer-info-link {
    transition: none !important;
    transform: none !important;
    text-shadow: none !important;
  }
}

html[data-theme="light"] .footer-pay-strip img.footer-pay-logo {
  opacity: 0.7;
  filter: saturate(0.62) brightness(0.82) contrast(0.9);
}

html[data-theme="light"] .footer-pay-strip img.footer-pay-logo:hover {
  filter: saturate(1.26) brightness(1.08) contrast(1.04)
    drop-shadow(0 0 8px rgba(124, 98, 214, 0.48))
    drop-shadow(0 0 10px rgba(14, 155, 176, 0.38));
}

html[data-theme="dark"] .footer-pay-strip img.footer-pay-logo {
  opacity: 0.74;
  filter: saturate(0.66) brightness(0.88) contrast(0.92);
}

html[data-theme="dark"] .footer-pay-strip img.footer-pay-logo:hover {
  filter: saturate(1.42) brightness(1.14) contrast(1.1)
    drop-shadow(0 0 10px rgba(168, 85, 247, 0.6))
    drop-shadow(0 0 13px rgba(6, 182, 212, 0.48));
}
