/* ==========================================================================
   MagicGeek, LLC — main stylesheet
   Restrained corporate design: white ground, serif display, hairline rules,
   a single deep-blue accent. No gradients, no decoration for its own sake.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:        #ffffff;
  --bg-soft:   #f6f7f9;

  --ink:       #16181f;
  --body:      #3d434f;
  --muted:     #6e7482;
  --faint:     #9aa0ad;

  --line:        #e5e7ec;
  --line-strong: #d5d8df;

  --accent: #17418e;

  --radius: 6px;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;

  --header-h: 68px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

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

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

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  color: var(--ink);
  line-height: 1.18;
  text-wrap: balance;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3, h4 {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

ul { margin: 0; padding: 0; list-style: none; }

::selection { background: #dbe4f5; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: 88px 0;
  border-top: 1px solid var(--line);
}
.section.no-rule { border-top: 0; }

.sec-label {
  display: block;
  margin-bottom: 40px;
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head { max-width: 660px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(1.65rem, 1.2rem + 1.8vw, 2.3rem);
  margin-bottom: .5em;
}
.section-head p { font-size: 1.04rem; }

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: #fff; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2b2f3a; border-color: #2b2f3a; color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: #e9ebef; border-color: #e9ebef; }

.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-outline-light:hover { border-color: #fff; color: #fff; }

.text-link { font-weight: 600; color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand .brand-mark { width: 26px; height: 26px; flex: none; }
.brand .brand-llc {
  margin-left: 1px;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  transform: translateY(2px);
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  font-size: .93rem;
  font-weight: 500;
  color: var(--body);
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  text-decoration-color: var(--ink);
}

.header-cta { display: flex; align-items: center; gap: 12px; }
.header-cta .btn { padding: 9px 18px; font-size: .88rem; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; stroke: var(--ink); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Hero ---------- */
.hero { padding: 104px 0 88px; }
.hero .kicker,
.page-hero .kicker {
  display: block;
  margin-bottom: 22px;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero h1 {
  max-width: 780px;
  font-size: clamp(2.4rem, 1.5rem + 4vw, 3.9rem);
  margin-bottom: 26px;
}
.hero .lede {
  max-width: 640px;
  font-size: clamp(1.05rem, 1rem + .3vw, 1.18rem);
  line-height: 1.66;
  margin-bottom: 38px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Fact strip ---------- */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
}
.fact {
  padding: 30px 28px;
  border-left: 1px solid var(--line);
}
.fact:first-child { border-left: 0; padding-left: 0; }
.fact .fact-num {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.fact .fact-label {
  display: block;
  margin-top: 2px;
  font-size: .86rem;
  color: var(--muted);
}

/* ---------- Plain editorial items ---------- */
.plain-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
}
.plain-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 40px;
}

.plain-item {
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}
.plain-item .num {
  display: block;
  margin-bottom: 14px;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .12em;
  color: var(--muted);
}
.plain-item h3 { font-size: 1.04rem; margin-bottom: .5em; }
.plain-item p { font-size: .95rem; color: var(--body); }

/* ---------- Product rows (home) ---------- */
.prow {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
.prow:first-of-type { border-top: 1px solid var(--line-strong); }

.prow .prow-num {
  display: block;
  margin-bottom: 18px;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.prow h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem);
  margin-bottom: .5em;
}
.prow .prow-meta {
  margin-top: 22px;
  font-size: .86rem;
  color: var(--muted);
}
.prow .prow-links { margin-top: 26px; }

/* ---------- Feature bullets ---------- */
.feature-list { margin-top: 22px; display: grid; gap: 12px; }
.feature-list li {
  position: relative;
  padding-left: 20px;
  font-size: .96rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .58em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.feature-list strong { color: var(--ink); font-weight: 650; }

.feature-cols {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 32px;
}

/* ---------- Split blocks ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split.reverse .split-copy { order: 2; }
.split h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); }
.split .split-copy > p { font-size: 1.02rem; }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 36px 32px;
  counter-reset: step;
}
.step {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .12em;
  color: var(--muted);
}
.step h3 { font-size: .98rem; margin-bottom: .35em; }
.step p { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  max-width: 760px;
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.2rem);
  margin-bottom: 22px;
}
.page-hero .lede {
  max-width: 640px;
  font-size: 1.1rem;
}
.page-hero .hero-meta {
  margin-top: 26px;
  font-size: .9rem;
  color: var(--muted);
}
.page-hero .hero-actions { margin-top: 34px; }

/* ---------- Product media ---------- */
.media-frame {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.media-4x3 { aspect-ratio: 4 / 3; }
.media-3x2 { aspect-ratio: 3 / 2; }
.media-hero { aspect-ratio: 21 / 9; }

/* Phone frame for app screenshots */
.phone {
  width: min(240px, 100%);
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background: #fff;
}
.phone-screen {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 21px;
}
.phone-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink);
  padding: 88px 0;
  text-align: center;
}
.cta-band h2 {
  color: #fff;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem);
  margin-bottom: .5em;
}
.cta-band p {
  max-width: 520px;
  margin: 0 auto 34px;
  color: #b6bac4;
  font-size: 1.02rem;
}
.cta-band .hero-actions { justify-content: center; }

/* ---------- Timeline (about) ---------- */
.timeline li {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .time {
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.timeline h3 { font-size: 1.02rem; margin-bottom: .3em; }
.timeline p { font-size: .94rem; color: var(--body); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
}
.contact-item {
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}
.contact-item h3 { font-size: 1.04rem; }
.contact-item p { font-size: .94rem; margin-bottom: 16px; }
.contact-item a { font-weight: 600; word-break: break-all; }

.info-note {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}
.info-note strong { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
  font-size: .92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.4fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer-brand p {
  max-width: 300px;
  margin-top: 14px;
  font-size: .9rem;
  color: var(--muted);
}
.footer-col h4 {
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { color: var(--body); }
.footer-col a:hover { color: var(--ink); }
.footer-col li { color: var(--body); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--muted);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- 404 ---------- */
.error-hero {
  min-height: calc(100vh - var(--header-h) - 160px);
  display: flex;
  align-items: center;
  text-align: center;
}
.error-hero .code {
  font-family: var(--serif);
  font-size: clamp(3.6rem, 10vw, 6rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .section { padding: 72px 0; }

  .plain-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .fact { border-left: 0; }
  .fact:nth-child(even) { border-left: 1px solid var(--line); }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .fact:nth-child(3) { padding-left: 0; }

  .steps { grid-template-columns: repeat(2, 1fr); }
  .split, .split.reverse { grid-template-columns: 1fr; gap: 40px; }
  .split.reverse .split-copy { order: 0; }
  .prow { grid-template-columns: 1fr; gap: 36px; padding: 52px 0; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .section { padding: 60px 0; }
  .hero { padding: 68px 0 60px; }
  .page-hero { padding: 60px 0 48px; }

  .plain-grid-3, .plain-grid-2, .contact-grid, .steps, .feature-cols {
    grid-template-columns: 1fr;
  }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }

  .phone-row { flex-wrap: wrap; }

  /* Mobile nav */
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current="page"] { text-decoration: none; }

  .nav-toggle { display: inline-flex; }
  .header-cta .btn { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
