/* ==========================================================================
   MarketGrowth.io - studio stylesheet
   Layout language from the Sumi exploration: full-bleed hero, glass surfaces,
   pill controls, rem grid that scales with the viewport.
   Type and color stay on the MarketGrowth brand: Funnel Display, IBM Plex Sans,
   deep green and teal.
   ========================================================================== */

:root {
  --font-head: "Funnel Display", "Arial Black", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --duration-fast: 150ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --site: 1440px;   /* the whole site: hero, header, main, footer */
  --wrap: 1280px;   /* content column inside it */
}

/* ---------- Theme tokens ---------- */
:root, [data-theme="dark"] {
  --base: #06080e;
  --heading: #eef0f6;
  --muted: #b3bac9;
  --on-media: #ffffff;
  --glass-fill: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-hi: rgba(255, 255, 255, 0.32);
  --action-bg: #ffffff;
  --action-fg: #16181f;
  --action-bg-hover: rgba(255, 255, 255, 0.86);
  --scrim-strong: rgba(6, 8, 14, 0.78);
  --scrim: rgba(6, 8, 14, 0.56);
  --scrim-soft: rgba(6, 8, 14, 0.12);
  --logo-filter: none;
  --glow-a: #40C1AC;
  --glow-b: #753BBD;
  color-scheme: dark;
}

[data-theme="light"] {
  --base: #f4f4f0;
  --heading: #16211d;
  --muted: rgba(22, 33, 29, 0.68);
  --on-media: #16211d;
  --glass-fill: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(22, 33, 29, 0.12);
  --glass-border-hi: rgba(22, 33, 29, 0.28);
  --action-bg: #1D3C34;
  --action-fg: #F5F5F5;
  --action-bg-hover: #16302a;
  --scrim-strong: rgba(244, 244, 240, 0.78);
  --scrim: rgba(244, 244, 240, 0.56);
  --scrim-soft: rgba(244, 244, 240, 0.08);
  --logo-filter: brightness(0) saturate(100%) invert(18%) sepia(14%) saturate(1200%) hue-rotate(120deg) brightness(95%);
  --glow-a: #40C1AC;
  --glow-b: #FCC89B;
  color-scheme: light;
}

/* ---------- Adaptive rem grid ---------- */
html { font-size: 16px; scroll-behavior: smooth; }
@media (max-width: 1920px) { html { font-size: 0.833333vw; } }
@media (max-width: 1440px) { html { font-size: 1.111111vw; } }
@media (max-width: 1024px) { html { font-size: 1.5625vw; } }
@media (max-width: 640px)  { html { font-size: 4.444444vw; } }

* { margin: 0; box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; border: none; background: none; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

body {
  background: var(--base);
  color: var(--heading);
  font-family: var(--font-body);
  font-weight: 400;
  overflow-x: hidden;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

/* ---------- Site box ---------- */
.hero, main, .site-footer { max-width: var(--site); margin-inline: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100lvh;
  width: 100%;
  overflow: hidden;
  background: var(--base);
  text-align: center;
  padding: 7rem 1.25rem 5rem;
}
.hero.hero-sm { min-height: 62lvh; padding: 10.5rem 1.25rem 4.5rem; }

.hero > canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero > canvas[hidden] { display: none; }

.scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(115% 95% at 50% 46%,
    var(--scrim-strong) 0%, var(--scrim-strong) 24%, var(--scrim) 52%, var(--scrim-soft) 100%);
}

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset-inline: 0; top: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 1.1rem 1.25rem;
}
.header-row { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; color: var(--on-media); letter-spacing: -0.01em; }
.brand img { height: 1.05rem; width: auto; filter: var(--logo-filter); }

.nav-links {
  display: flex; align-items: center; gap: 1.25rem;
  height: 2.6rem; border-radius: 9999px;
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  padding: 0 1.25rem;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav-links a { font-size: 0.9rem; color: var(--muted); white-space: nowrap; transition: color var(--duration-fast) var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--heading); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.5rem; border-radius: 9999px;
  background: var(--action-bg); padding: 0 1.125rem;
  font-size: 0.85rem; font-weight: 500; color: var(--action-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background var(--duration-fast) var(--ease);
}
.pill:hover { background: var(--action-bg-hover); }
.pill:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--glass-border-hi); }

.ghost-pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.5rem; border-radius: 9999px; padding: 0 1.125rem;
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  font-size: 0.85rem; font-weight: 500; color: var(--heading);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color var(--duration-fast) var(--ease);
}
.ghost-pill:hover { border-color: var(--glass-border-hi); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  color: var(--heading); font-size: 0.95rem; line-height: 1;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color var(--duration-fast) var(--ease);
}
.theme-toggle:hover { border-color: var(--glass-border-hi); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero center column ---------- */
.center { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 22rem; }
.badge {
  display: inline-flex; align-items: center; border-radius: 9999px;
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  padding: 0.4rem 0.875rem; font-size: 0.72rem; color: var(--muted);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.center h1 { margin-top: 1.25rem; max-width: 20rem; font-size: 2.1rem; color: var(--heading); }
.center .sub { margin-top: 1rem; max-width: 20rem; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.hero-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.hero-note { position: absolute; inset-inline: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 1.25rem; font-size: 0.72rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { position: relative; padding: 5.5rem 1.25rem; overflow: hidden; background: var(--base); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; position: relative; z-index: 1; }
.glow { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.13; pointer-events: none; z-index: 0; }
[data-theme="light"] .glow { opacity: 0.22; }

.eyebrow {
  display: inline-flex; align-items: center; border-radius: 9999px;
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  padding: 0.4rem 0.875rem; font-size: 0.72rem; color: var(--muted);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.section h2 { margin-top: 1.25rem; font-size: 1.9rem; color: var(--heading); }
.section .lead { margin-top: 1rem; max-width: 36rem; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.section-head { text-align: center; display: flex; flex-direction: column; align-items: center; }
.section-head .lead { text-align: center; }

.grid3 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 3rem; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 3rem; }

.card {
  position: relative;
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 1.5rem; padding: 2rem; text-align: left;
  transition: border-color var(--duration-fast) var(--ease), transform 300ms var(--ease), background var(--duration-fast) var(--ease);
}
.card:hover { border-color: var(--glass-border-hi); transform: translateY(-4px); }
.card h3 { font-size: 1.2rem; color: var(--heading); }
.card p { margin-top: 0.75rem; font-size: 0.95rem; line-height: 1.55; color: var(--muted); }
.card .more { display: inline-block; margin-top: 1.25rem; font-size: 0.85rem; font-weight: 500; color: var(--heading); }
.card .more span { display: inline-block; transition: transform var(--duration-fast) var(--ease); }
.card:hover .more span { transform: translateX(4px); }
.stepnum { position: absolute; top: 1.5rem; right: 1.75rem; font-size: 0.8rem; color: var(--muted); opacity: 0.7; }
.kicker { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.faq details {
  border: 1px solid var(--glass-border); background: var(--glass-fill);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 1.1rem; padding: 1.1rem 1.4rem; text-align: left;
}
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; align-items: center; font-family: var(--font-head); font-weight: 500; font-size: 1rem; color: var(--heading); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin-top: 0.8rem; font-size: 0.95rem; line-height: 1.55; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--glass-border); background: var(--base); padding: 4rem 1.25rem 2.5rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 1.5rem; text-align: left; }
.site-footer .fbrand { grid-column: 1 / -1; }
.site-footer .fbrand p { margin-top: 0.9rem; max-width: 18rem; font-size: 0.85rem; line-height: 1.5; color: var(--muted); }
.site-footer h4 { font-family: var(--font-body); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); opacity: 0.8; }
.site-footer ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.site-footer li { padding: 0.28rem 0; }
.site-footer li a { font-size: 0.88rem; color: var(--muted); transition: color var(--duration-fast) var(--ease); }
.site-footer li a:hover { color: var(--heading); }
.site-footer .legal {
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 0.5rem; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--muted);
}

/* ---------- Contact modal ---------- */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  background: var(--scrim-strong);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  position: relative; width: 100%; max-width: 26rem; border-radius: 1.5rem;
  border: 1px solid var(--glass-border); background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  padding: 2.25rem 2rem 2rem; text-align: left;
  transform: translateY(1rem) scale(0.98); transition: transform 300ms var(--ease);
}
[data-theme="dark"] .modal { background: rgba(13, 15, 26, 0.94); }
[data-theme="light"] .modal { background: rgba(255, 255, 255, 0.96); }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal h3 { font-size: 1.35rem; color: var(--heading); }
.modal-sub { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }
.modal form { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.modal input[type="text"], .modal input[type="email"], .modal textarea {
  width: 100%; border-radius: 0.9rem; border: 1px solid var(--glass-border);
  background: var(--glass-fill); color: var(--heading); font-size: 0.95rem;
  padding: 0.7rem 0.9rem; outline: none; resize: vertical;
  transition: border-color var(--duration-fast) var(--ease);
}
.modal input:focus, .modal textarea:focus { border-color: var(--glass-border-hi); }
.modal .pill { width: 100%; margin-top: 0.25rem; }
.modal .pill[disabled] { opacity: 0.6; cursor: default; }
.modal-x {
  position: absolute; top: 1rem; right: 1.1rem; width: 2rem; height: 2rem;
  border-radius: 9999px; color: var(--muted); font-size: 1.25rem; line-height: 1;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
.modal-x:hover { color: var(--heading); background: var(--glass-fill); }
.modal-err { font-size: 0.82rem; color: #e06a86; }
.modal-done { text-align: center; padding: 1rem 0 0.25rem; }
.modal-done .ghost-pill { margin-top: 1.5rem; }
body.modal-locked { overflow: hidden; }

/* ---------- Reveals ---------- */
.sr { opacity: 0; transform: translateY(1.5rem); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.sr.in { opacity: 1; transform: translateY(0); }
.reveal { opacity: 0; transform: translateY(1.25rem); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.site-header.reveal { transform: translateY(-0.75rem); }
body.in .reveal { opacity: 1; transform: translateY(0); }
.w { display: inline-block; opacity: 0; will-change: transform, opacity; }
body.in .w { opacity: 1; transform: translateY(0) !important; }
@media (prefers-reduced-motion: reduce) {
  .sr, .reveal, .w { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- >= 640px ---------- */
@media (min-width: 640px) {
  .hero { padding: 0 2.5rem; }
  .hero.hero-sm { min-height: 58lvh; padding: 9rem 2.5rem 5rem; }
  .site-header { flex-direction: row; justify-content: space-between; padding: 1.6rem 2.5rem; gap: 1rem; }
  .header-row { width: 100%; }
  .brand { font-size: 1.3rem; }
  .brand img { height: 1.25rem; }
  .nav-links { position: absolute; left: 50%; transform: translateX(-50%); height: 3rem; gap: 2rem; padding: 0 1.75rem; }
  .nav-links a { font-size: 0.95rem; }
  .pill, .ghost-pill { height: 2.75rem; padding: 0 1.375rem; font-size: 0.95rem; }
  .theme-toggle { width: 2.75rem; height: 2.75rem; }
  .center { max-width: 40rem; }
  .badge { font-size: 0.8rem; }
  .center h1 { margin-top: 1.75rem; max-width: 34rem; font-size: 3.4rem; }
  .center .sub { margin-top: 1.25rem; max-width: 34rem; font-size: 1.1rem; }
  .hero-actions { margin-top: 2.5rem; }
  .hero-note { padding: 1.5rem 2.5rem; font-size: 0.8rem; }
  .section { padding: 7.5rem 2.5rem; }
  .section h2 { font-size: 2.6rem; margin-top: 1.5rem; }
  .section .lead { font-size: 1.1rem; }
  .grid3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3.5rem; }
  .grid2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 3.5rem; }
  .site-footer { padding: 5rem 2.5rem 2.5rem; }
  .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .site-footer .fbrand { grid-column: auto; }
  .site-footer .legal { flex-direction: row; }
}

/* ---------- >= 1024px ---------- */
@media (min-width: 1024px) {
  .center { max-width: 52rem; }
  .center h1 { max-width: 46rem; font-size: 4.6rem; }
  .center .sub { max-width: 40rem; font-size: 1.2rem; }
}

/* ---------- Prose, lists and portraits ---------- */
.prose p { color: var(--muted); font-size: 1rem; line-height: 1.62; }
.prose p + p { margin-top: 1rem; }
.prose h2 + p { margin-top: 1rem; }
.checklist { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.checklist li { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.95rem; color: var(--muted); line-height: 1.55; padding: 0.35rem 0; }
.checklist li::before { content: "\2713"; color: var(--heading); font-size: 0.8rem; }
.portrait { border-radius: 1.5rem; border: 1px solid var(--glass-border); overflow: hidden; background: var(--glass-fill); }
.portrait img { width: 100%; display: block; }
.figcap { margin-top: 0.8rem; font-size: 0.8rem; color: var(--muted); }
.align-start { align-items: start; }
@media (min-width: 640px) { .prose p { font-size: 1.05rem; } }

/* ---------- Legal and prose pages ---------- */
.center .lede { margin-top: 1rem; max-width: 34rem; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.section .wrap.prose { max-width: 48rem; }
.section-head .lead { max-width: 40rem; }
.prose h2 { margin-top: 2.5rem; font-size: 1.45rem; color: var(--heading); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; font-size: 1.1rem; color: var(--heading); }
.prose ul, .prose ol { margin: 1rem 0 0 1.1rem; color: var(--muted); font-size: 0.98rem; line-height: 1.6; }
.prose li { padding: 0.2rem 0; }
.prose strong { color: var(--heading); font-weight: 500; }
.prose a { color: var(--heading); text-decoration: underline; text-underline-offset: 3px; }
.prose figure { margin: 0 0 2rem; }
.prose figure img { border-radius: 1.25rem; }
.prose .figure-caption { margin-top: 0.8rem; font-size: 0.8rem; color: var(--muted); }
@media (min-width: 640px) { .center .lede { font-size: 1.05rem; } }

/* ---------- Standalone form card ---------- */
form.modal-like { display: flex; flex-direction: column; gap: 1rem; }
form.modal-like label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
form.modal-like input[type="text"], form.modal-like input[type="email"], form.modal-like textarea {
  width: 100%; border-radius: 0.9rem; border: 1px solid var(--glass-border);
  background: var(--glass-fill); color: var(--heading); font-size: 0.95rem;
  padding: 0.7rem 0.9rem; outline: none; resize: vertical;
  transition: border-color var(--duration-fast) var(--ease);
}
form.modal-like input:focus, form.modal-like textarea:focus { border-color: var(--glass-border-hi); }
form.modal-like .pill { width: 100%; margin-top: 0.25rem; }
