/* Macliys Connect website (connect.macliys.com). Static stylesheet, no build step; served under a CSP without
   inline styles or scripts. Brand colours follow the app's blue theme (release 1.1.0). */

:root {
  --brand-deep: #0a1fbf;
  --brand: #1a3ae8;
  --brand-bright: #2f6bff;
  --cyan: #00d4ff;
  --violet: #3a0ca3;
  --night: #050a2e;

  --bg: #f5f7ff;
  --surface: #ffffff;
  --surface-2: #eef2ff;
  --text: #0b1030;
  --muted: #4a5378;
  --border: #dde3f5;
  --link: #1a3ae8;
  --icon-bg: #e6ebff;
  --icon-fg: #1a3ae8;
  --shadow: 0 1px 2px rgba(11, 16, 48, .06), 0 12px 32px -12px rgba(11, 16, 48, .18);

  --radius: 20px;
  --page: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e1a;
    --surface: #121731;
    --surface-2: #171d3d;
    --text: #e8ecff;
    --muted: #a8b1d8;
    --border: #262d55;
    --link: #93a8ff;
    --icon-bg: #1d2656;
    --icon-fg: #8fb0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .6);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: #fff; color: var(--brand-deep); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 14, 70, .82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand span { white-space: nowrap; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a { color: rgba(255, 255, 255, .82); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .12); }
.nav .btn { margin-left: 6px; }

@media (max-width: 720px) {
  .nav .nav-optional { display: none; }
  .brand span { font-size: 16px; }
}
@media (max-width: 400px) {
  .brand span { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 16px/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-primary { background: linear-gradient(135deg, var(--cyan), var(--brand-bright)); color: #041033; box-shadow: 0 10px 30px -10px rgba(0, 212, 255, .7); }
.btn-primary:hover { box-shadow: 0 14px 34px -10px rgba(0, 212, 255, .85); }
.btn-ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .35); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .6); }
.btn-solid { background: var(--brand); color: #fff; }
.btn-solid:hover { background: var(--brand-deep); }

/* ---------- Hero ---------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background:
    radial-gradient(60% 50% at 85% 20%, rgba(0, 212, 255, .28), transparent 70%),
    radial-gradient(50% 60% at 10% 90%, rgba(58, 12, 163, .55), transparent 70%),
    linear-gradient(160deg, var(--brand-deep) 0%, #07136e 45%, var(--night) 100%);
  margin-top: -68px; padding: calc(68px + clamp(48px, 8vw, 96px)) 0 clamp(56px, 8vw, 104px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("img/pattern-dark.webp") center / 560px auto repeat;
  opacity: .28; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(32px, 5vw, 72px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .92);
}
.eyebrow b { background: var(--cyan); color: #041033; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }

.hero h1 { font-size: clamp(38px, 5.6vw, 64px); font-weight: 750; }
.hero h1 .grad { background: linear-gradient(90deg, #fff, var(--cyan) 60%, #8fb0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin: 22px 0 32px; font-size: clamp(17px, 1.6vw, 20px); color: rgba(255, 255, 255, .82); max-width: 560px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .note { margin-top: 22px; font-size: 14px; color: rgba(255, 255, 255, .66); }

.phones { position: relative; height: clamp(460px, 48vw, 600px); }
.phone {
  position: absolute; width: clamp(210px, 21vw, 270px);
  padding: 9px; border-radius: 42px;
  background: linear-gradient(145deg, #2a3570, #0c1133);
  box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .12) inset;
}
.phone img { border-radius: 34px; width: 100%; }
.phone-front { right: 8%; top: 0; z-index: 2; }
.phone-back { left: 4%; top: 12%; transform: rotate(-7deg); opacity: .96; }
.phone-glow { position: absolute; inset: 20% 10% 0; background: radial-gradient(closest-side, rgba(47, 107, 255, .55), transparent); filter: blur(30px); z-index: 0; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .phones { height: 480px; max-width: 520px; width: 100%; margin: 8px auto 0; }
  .phone { width: 230px; }
  .phone-front { right: 6%; }
  .phone-back { left: 6%; }
}
@media (max-width: 480px) {
  .phones { height: 400px; }
  .phone { width: 188px; border-radius: 34px; padding: 7px; }
  .phone img { border-radius: 28px; }
  .phone-front { right: 0; }
  .phone-back { left: 3%; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--surface-2); }
.section-flush { padding-top: 0; }
.section-head { max-width: 700px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.section-head .kicker { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--link); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 720; }
.section-head p { margin: 16px 0 0; color: var(--muted); font-size: 18px; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1020px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand-bright) 45%, var(--border)); }
.card h3 { font-size: 19px; font-weight: 650; margin: 18px 0 8px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }

.icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--icon-bg); color: var(--icon-fg);
}
.icon svg { width: 24px; height: 24px; }

/* Feature rows with a screenshot */
.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 6vw, 96px); }
.split + .split { margin-top: clamp(64px, 9vw, 120px); }
.split.reverse .split-media { order: 2; }
.split-media { display: grid; place-items: center; position: relative; }
.split-media::before {
  content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-bright) 30%, transparent), transparent);
}
.split-media .phone { position: relative; width: min(290px, 70vw); }
.split-text .kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--link); }
.split-text h2 { font-size: clamp(28px, 3.2vw, 40px); margin: 12px 0 16px; font-weight: 720; }
.split-text > p { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
}

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.checks li svg { width: 28px; height: 28px; color: var(--link); }
.checks strong { display: block; font-weight: 650; }
.checks span { color: var(--muted); font-size: 15.5px; }

/* Security band */
.security { background: linear-gradient(160deg, #081461, var(--night)); color: #fff; }
.security .section-head .kicker { color: var(--cyan); }
.security .section-head p { color: rgba(255, 255, 255, .72); }
.security .card { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); box-shadow: none; }
.security .card:hover { border-color: rgba(0, 212, 255, .45); }
.security .card p { color: rgba(255, 255, 255, .7); }
.security .icon { background: rgba(0, 212, 255, .12); color: var(--cyan); }
.security .grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1020px) { .security .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .security .grid { grid-template-columns: 1fr; } }
.security .more { text-align: center; margin-top: 36px; }
.security .more a { color: var(--cyan); font-weight: 600; }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps .card { position: relative; padding-top: 30px; }
.steps .card::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand-deep)); color: #fff; font-weight: 700; font-size: 18px;
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Download */
.download {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 32px; color: #fff;
  padding: clamp(36px, 6vw, 72px); text-align: center;
  background:
    radial-gradient(50% 80% at 100% 0%, rgba(0, 212, 255, .35), transparent 70%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 50%, var(--violet) 100%);
}
.download::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("img/pattern-dark.webp") center / 480px auto repeat; opacity: .22; mix-blend-mode: screen;
}
.download img { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 22px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); }
.download h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 720; }
.download p { margin: 14px auto 28px; max-width: 560px; color: rgba(255, 255, 255, .82); font-size: 18px; }
.download .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.download .fine { margin: 20px auto 0; font-size: 14px; color: rgba(255, 255, 255, .7); }
.download .fine a { color: #fff; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 40px 0 48px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between; }
.site-footer .brand { color: var(--text); font-size: 16px; }
.site-footer .brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }
.site-footer .copy { width: 100%; margin: 0; font-size: 14px; }

/* ---------- Legal page ---------- */

.page-hero {
  color: #fff; margin-top: -68px; padding: calc(68px + clamp(40px, 6vw, 72px)) 0 clamp(40px, 6vw, 64px);
  background:
    radial-gradient(50% 80% at 90% 0%, rgba(0, 212, 255, .25), transparent 70%),
    linear-gradient(160deg, var(--brand-deep), #07136e 60%, var(--night));
}
.page-hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 750; }
.page-hero p { margin: 14px 0 0; color: rgba(255, 255, 255, .78); font-size: 18px; max-width: 720px; }
.page-hero .meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.page-hero .meta span { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }

.legal { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); padding-top: clamp(32px, 6vw, 72px); padding-bottom: clamp(64px, 8vw, 96px); }
.toc { position: sticky; top: 96px; align-self: start; font-size: 14.5px; }
.toc-desktop, .toc details { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 6px 8px; }
.toc-title, .toc summary { font-weight: 650; padding: 10px 12px; margin: 0; }
.toc summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
.toc details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.toc ol { list-style: none; margin: 0; padding: 0 0 8px; }
.toc a { display: block; padding: 6px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc details { display: none; }
@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc-desktop { display: none; }
  .toc details { display: block; }
}

.prose { max-width: 780px; }
.prose h2 { font-size: clamp(24px, 2.6vw, 30px); margin: 56px 0 16px; padding-top: 8px; font-weight: 700; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; font-weight: 650; }
.prose p, .prose li { color: var(--text); }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--brand-bright); }
.prose .muted { color: var(--muted); }

.prose .summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 0 0 16px; padding: 0; list-style: none; }
.summary li { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 18px 54px; position: relative; font-size: 15.5px; line-height: 1.5; }
.summary li svg { position: absolute; left: 18px; top: 18px; width: 24px; height: 24px; color: var(--link); }
@media (max-width: 640px) { .prose .summary { grid-template-columns: minmax(0, 1fr); } }

.callout { border-radius: 16px; padding: 18px 20px; margin: 0 0 20px; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--brand-bright); }
.callout p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 560px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 650; background: var(--surface-2); }
.prose tr:last-child td { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
  .btn:hover, .card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .toc, .skip { display: none; }
  .page-hero { background: none; color: #000; margin-top: 0; padding: 0 0 16px; }
  .page-hero p, .page-hero .meta span { color: #000; background: none; border: 0; }
  .legal { display: block; padding: 0; }
  body { background: #fff; color: #000; }
}
