/* ============================================================
   MEWS Redesign — Tokens & Base Styles
   Refined dark + orange direction · Light/Dark theme support
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ──────── DEFAULT (DARK) ──────── */
:root,
[data-theme="dark"] {
  --bg:        #0a0a0a;
  --bg-alt:    #111111;
  --bg-elev:   #161616;
  --bg-card:   #131313;

  --fg:        #ffffff;
  --fg-muted:  rgba(255, 255, 255, 0.62);
  --fg-faint:  rgba(255, 255, 255, 0.38);
  --fg-fainter:rgba(255, 255, 255, 0.20);

  --line:      rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --accent:        #f47920;
  --accent-hover:  #ff8a30;
  --accent-tint:   rgba(244, 121, 32, 0.10);
  --accent-tint-strong: rgba(244, 121, 32, 0.20);

  --on-accent: #ffffff;
  --shadow-soft: 0 30px 60px -20px rgba(0,0,0,0.7);
  --grid-overlay: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] {
  --bg:        #fbfaf6;
  --bg-alt:    #ffffff;
  --bg-elev:   #ffffff;
  --bg-card:   #ffffff;

  --fg:        #0a0a0a;
  --fg-muted:  #4a4a4a;
  --fg-faint:  #777;
  --fg-fainter:#b2b2b2;

  --line:      #ece9e0;
  --line-strong: #d8d4c8;

  --accent:        #f47920;
  --accent-hover:  #d96510;
  --accent-tint:   rgba(244, 121, 32, 0.08);
  --accent-tint-strong: rgba(244, 121, 32, 0.18);

  --on-accent: #ffffff;
  --shadow-soft: 0 30px 60px -20px rgba(20, 20, 20, 0.12);
  --grid-overlay: rgba(0, 0, 0, 0.025);
}

/* ──────── TYPE ──────── */
:root {
  --font: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --fs-display: clamp(56px, 8.2vw, 132px);
  --fs-h1:      clamp(40px, 5.2vw, 80px);
  --fs-h2:      clamp(30px, 3.6vw, 56px);
  --fs-h3:      clamp(22px, 1.8vw, 28px);
  --fs-h4:      18px;
  --fs-lead:    clamp(18px, 1.4vw, 22px);
  --fs-body:    16px;
  --fs-sm:      14px;
  --fs-xs:      12px;
  --fs-eyebrow: 12px;

  /* spacing */
  --pad-section:  clamp(80px, 12vw, 180px);
  --pad-section-sm: clamp(56px, 7vw, 110px);
  --pad-x:        clamp(24px, 5vw, 80px);
  --max-w:        1280px;
  --max-w-text:   720px;
}

/* ──────── BASE ──────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  line-height: 1.55;
  font-size: var(--fs-body);
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

/* ──────── TYPOGRAPHY UTILITIES ──────── */
.display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 0.98; letter-spacing: -0.03em; }
.h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.02; letter-spacing: -0.025em; }
.h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.h4 { font-size: var(--fs-h4); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--fg-muted); text-wrap: pretty; }
.body { font-size: var(--fs-body); line-height: 1.7; color: var(--fg-muted); }
.small { font-size: var(--fs-sm); color: var(--fg-muted); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
}
.accent { color: var(--accent); }
.muted { color: var(--fg-muted); }

/* ──────── LAYOUT ──────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  width: 100%;
}
section { padding: var(--pad-section) 0; position: relative; }
section.compact { padding: var(--pad-section-sm) 0; }
section.bg-alt { background: var(--bg-alt); }
section.bg-elev { background: var(--bg-elev); }

.divider { border-top: 1px solid var(--line); }

/* ──────── COMPONENTS ──────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 22px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn.lg { font-size: 14px; padding: 17px 28px; }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--fg);
}
.btn-ghost:hover {
  border-color: var(--fg);
}
.btn-invert {
  background: var(--fg);
  color: var(--bg);
}
.btn-invert:hover { background: var(--accent); color: var(--on-accent); }
.btn .arr {
  transition: transform 0.25s ease;
}
.btn:hover .arr { transform: translateX(3px); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
}
.tag.accent {
  color: var(--accent);
  border-color: var(--accent-tint-strong);
  background: var(--accent-tint);
}
.tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 32px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.card:hover { border-color: var(--line-strong); }

/* link with underline animation */
.link {
  position: relative;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  padding-bottom: 2px;
}
.link::after {
  content: ''; position: absolute;
  left: 0; bottom: 0; height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(1); transform-origin: left;
  transition: transform 0.3s ease;
}
.link:hover::after { transform: scaleX(0); transform-origin: right; }

/* ──────── ANIMATIONS ──────── */
@keyframes mewsFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  opacity: 1;
  transform: none;
  animation: mewsFadeUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.fade-up.d1 { animation-delay: 0.1s; }
.fade-up.d2 { animation-delay: 0.2s; }
.fade-up.d3 { animation-delay: 0.35s; }
.fade-up.d4 { animation-delay: 0.5s; }

/* ──────── MOBILE SIDE-BY-SIDE COMPARE ──────── */
body[data-compare="on"] #app {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: 100vh;
  overflow: hidden;
}
body[data-compare="on"] #app > .desktop-view {
  overflow-y: auto;
  overflow-x: hidden;
}
body[data-compare="on"] #app > .mobile-view {
  border-left: 1px solid var(--line-strong);
  background: var(--bg-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body[data-compare="on"] #app > .mobile-view .frame {
  width: 360px;
  height: calc(100vh - 48px);
  max-height: 780px;
  border-radius: 36px;
  border: 8px solid #1a1a1a;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 40px 60px -20px rgba(0,0,0,0.5);
  position: relative;
}
body[data-compare="on"] #app > .mobile-view .frame iframe {
  width: 100%; height: 100%; border: 0;
}

/* responsive defaults — when mobile-narrow */
@media (max-width: 880px) {
  .hide-mobile { display: none !important; }
}
.hide-desktop { display: none; }
@media (max-width: 880px) {
  .hide-desktop { display: initial; }
}
