/* MagicBPM — magicbpm.com
   Static marketing + legal site. No build step.
   Design language follows Apple Human Interface Guidelines:
   system fonts, generous spacing, translucent materials, rounded geometry,
   light/dark adaptive color. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  /* Light theme (default) */
  --bg: #ffffff;
  --bg-elev: #f5f5f7;
  --bg-elev-2: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --card: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.05);

  /* Brand */
  --accent: #8a2be2;
  --accent-strong: #6a2cff;
  --grad: linear-gradient(120deg, #6a2cff 0%, #a23cff 52%, #ff4d8d 100%);
  --grad-soft: linear-gradient(135deg, rgba(106, 44, 255, 0.12), rgba(255, 77, 141, 0.12));

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elev: #0c0c0e;
    --bg-elev-2: #161618;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --nav-bg: rgba(20, 20, 22, 0.72);
    --card: #161618;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 12px 36px rgba(0, 0, 0, 0.3);
    --grad-soft: linear-gradient(135deg, rgba(106, 44, 255, 0.22), rgba(255, 77, 141, 0.18));
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.narrow { max-width: 760px; }

/* ---------- Typography ---------- */
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent-strong);
  margin: 0 0 14px;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--text-secondary); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px var(--pad);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand span { font-size: 1.05rem; letter-spacing: -0.01em; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
.nav-links a { color: var(--text-secondary); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  background: var(--text); color: var(--bg) !important;
  padding: 7px 16px; border-radius: 980px; font-weight: 600; font-size: 0.9rem;
}
.nav-cta:hover { opacity: 0.85; text-decoration: none; }
@media (max-width: 640px) { .nav-links a.hide-sm { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 1rem; padding: 12px 24px; border-radius: 980px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #5a1ff0; }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn-ghost { color: var(--accent-strong); }

/* App Store badge */
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 9px 18px 9px 16px; border-radius: 12px; line-height: 1;
}
.appstore:hover { text-decoration: none; opacity: 0.88; }
.appstore svg { width: 24px; height: 24px; flex: none; }
.appstore .small { font-size: 0.66rem; opacity: 0.9; display: block; margin-bottom: 2px; }
.appstore .big { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(106,44,255,0.30), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(255,77,141,0.22), transparent 55%),
    #07070a;
  color: #f5f5f7;
  padding: clamp(64px, 11vw, 130px) 0 clamp(48px, 8vw, 90px);
}
.hero h1 { color: #fff; }
.hero .lead { color: rgba(245,245,247,0.82); margin: 20px 0 0; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 32px; }
.hero-note { color: rgba(245,245,247,0.6); font-size: 0.9rem; margin-top: 16px; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-device { margin: 8px auto 0; }
}

/* ---------- Device frame + screenshot placeholders ---------- */
.device {
  width: min(300px, 78vw); margin-inline: auto;
  background: linear-gradient(160deg, #303034, #161618);
  border-radius: 46px; padding: 11px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
}
.device-screen {
  position: relative; aspect-ratio: 1179 / 2556; border-radius: 36px; overflow: hidden;
  background: var(--grad-soft), #0e0e10;
  display: flex; align-items: center; justify-content: center;
}
.device-screen .ph-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 16px; color: var(--text-tertiary);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0; line-height: 1.4;
}
.device-screen img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background: #0e0e10;
}

/* ---------- Sections ---------- */
section { padding: clamp(56px, 9vw, 110px) 0; }
.section-head { max-width: 640px; margin: 0 auto clamp(36px, 5vw, 60px); text-align: center; }
.section-head .lead { margin-top: 14px; }
.alt { background: var(--bg-elev); }

/* Trust strip */
.trust {
  display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center;
  padding: 22px var(--pad); border-bottom: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text-secondary); font-size: 0.92rem; font-weight: 550;
}
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust .dot { color: var(--accent); }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--card-shadow);
}
.card .ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad-soft); margin-bottom: 16px; font-size: 22px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-secondary); margin: 0; font-size: 0.98rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2.5vw, 26px); align-items: start; }
.gallery .device { width: 100%; padding: 8px; border-radius: 34px; }
.gallery .device-screen { border-radius: 27px; }
.gallery figcaption { text-align: center; margin-top: 14px; color: var(--text-secondary); font-size: 0.9rem; font-weight: 550; }
.gallery figure { margin: 0; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* Pro / CTA panel */
.panel {
  background: var(--grad); color: #fff; border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 64px); text-align: center; overflow: hidden;
}
.panel h2 { color: #fff; }
.panel .lead { color: rgba(255,255,255,0.9); margin: 16px auto 0; max-width: 560px; }
.panel .btn-primary { background: #fff; color: var(--accent-strong); margin-top: 28px; }
.panel .btn-primary:hover { background: rgba(255,255,255,0.9); }
.pro-list {
  list-style: none; padding: 0; margin: 24px auto 0; max-width: 460px;
  display: grid; gap: 10px; text-align: left;
}
.pro-list li { display: flex; gap: 10px; align-items: flex-start; }
.pro-list li::before { content: "✓"; font-weight: 700; }

/* ---------- Legal / article pages ---------- */
.page-header { padding: clamp(48px, 8vw, 90px) 0 clamp(20px, 4vw, 40px); border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-header .updated { color: var(--text-tertiary); margin-top: 12px; font-size: 0.95rem; }
.doc { padding: clamp(36px, 6vw, 64px) 0 clamp(56px, 9vw, 100px); }
.doc h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: 24px 0 8px; }
.doc p, .doc li { color: var(--text-secondary); }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc strong { color: var(--text); }
.callout {
  background: var(--bg-elev); border: 1px solid var(--border); border-left: 3px solid var(--accent-strong);
  border-radius: var(--radius-sm); padding: 18px 20px; margin: 0 0 24px; color: var(--text-secondary);
}
.toc { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 36px; }
.toc strong { display: block; margin-bottom: 8px; }
.toc ul { columns: 2; column-gap: 28px; margin: 0; padding-left: 18px; }
@media (max-width: 560px) { .toc ul { columns: 1; } }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-bottom: 1px solid var(--border); padding: 4px 0;
}
.faq summary {
  cursor: pointer; padding: 18px 4px; font-weight: 600; font-size: 1.05rem;
  list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-tertiary); font-weight: 400; font-size: 1.4rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-secondary); margin: 0 4px 18px; }

/* ---------- Contact form (SDK) ---------- */
.form-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--card-shadow);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(106,44,255,0.18);
}
.field textarea { resize: vertical; min-height: 120px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 540px) { .field-row { grid-template-columns: 1fr; } }
.form-note { color: var(--text-tertiary); font-size: 0.85rem; margin-top: 12px; }

.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 640px) { .spec-grid { grid-template-columns: 1fr; } }
.spec {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--card-shadow);
}
.spec h3 { margin-bottom: 6px; }
.spec p { color: var(--text-secondary); margin: 0; font-size: 0.96rem; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-elev); border-top: 1px solid var(--border); padding: 48px 0 40px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 28px 64px; justify-content: space-between; }
.footer .brand { margin-bottom: 12px; }
.footer-tag { color: var(--text-secondary); font-size: 0.92rem; max-width: 280px; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 9px; }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-legal { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-tertiary); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* utilities */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 32px; }
