/* MacMon site styles. Colors come from the app icon: a blue shield on a deep blue
   square. Change the palette in :root (light) and the two dark-mode blocks below;
   everything else reads the tokens. */

:root {
  --blue: #296bdb;
  --navy: #12296b;
  --green: #2f9e6a;
  --amber: #d98a1c;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #e9edf5;
  --text: #121a2e;
  --text-muted: #556079;
  --border: #d9dfeb;
  --accent: var(--blue);
  --accent-text: #ffffff;
  --link: #1f5bc4;
  --highlight: #1f5bc4;
  --tint: color-mix(in srgb, var(--blue) 10%, var(--surface));
  --tint-text: var(--blue);
  --code-bg: #0f1729;
  --code-text: #dce4f5;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --max: 1120px;
  --narrow: 740px;
  --gutter: clamp(16px, 4vw, 32px);
  --shadow: 0 1px 2px rgb(16 26 50 / 6%), 0 16px 40px rgb(16 26 50 / 10%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1222;
    --surface: #141c31;
    --surface-2: #1b2540;
    --text: #e8ecf5;
    --text-muted: #9aa5bf;
    --border: #26314f;
    --accent: #4d8bf0;
    --accent-text: #ffffff;
    --link: #7fb0ff;
    --highlight: #7fb0ff;
    --tint: color-mix(in srgb, #4d8bf0 16%, var(--surface));
    --tint-text: #8dbaff;
    --code-bg: #080d1a;
    --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 16px 40px rgb(0 0 0 / 35%);
  }
}

:root[data-theme="dark"] {
  --bg: #0c1222;
  --surface: #141c31;
  --surface-2: #1b2540;
  --text: #e8ecf5;
  --text-muted: #9aa5bf;
  --border: #26314f;
  --accent: #4d8bf0;
  --accent-text: #ffffff;
  --link: #7fb0ff;
  --highlight: #7fb0ff;
  --tint: color-mix(in srgb, #4d8bf0 16%, var(--surface));
  --tint-text: #8dbaff;
  --code-bg: #080d1a;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 16px 40px rgb(0 0 0 / 35%);
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Header & footer ---------- */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em;
}
.brand img { border-radius: 8px; }

.site-header nav ul, .site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }

@media (max-width: 420px) {
  .site-header nav ul { gap: 4px 14px; }
  .brand span { display: none; }
}

.site-footer { margin-top: 96px; border-top: 1px solid var(--border); padding: 40px 0 32px; color: var(--text-muted); font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand p { margin: 8px 0 0; }
.site-footer nav a { color: var(--text-muted); }
.site-footer nav a:hover { color: var(--text); }
.footer-legal { margin-top: 28px; font-size: 0.82rem; }

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

.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent;
}
.button-primary { background: var(--accent); color: var(--accent-text); }
.button-primary:hover { filter: brightness(1.08); }
.button-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-2); }
.button.is-disabled { opacity: 0.85; cursor: default; }
.button.is-disabled:hover { filter: none; }

/* ---------- Home: hero ---------- */

.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px); }
.hero-inner { display: grid; grid-template-columns: 0.85fr 1.15fr; align-items: center; gap: clamp(32px, 6vw, 72px); }
/* The macOS icon has its own transparent margin and rounded square, so no radius here. */
.hero-icon { width: 96px; height: 96px; margin: 0 0 20px -10px; filter: drop-shadow(0 8px 16px rgb(16 26 50 / 18%)); }
.hero h1 { margin-bottom: 0.35em; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--text-muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.hero-meta { margin-top: 16px; font-size: 0.9rem; color: var(--text-muted); }

.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art::before {
  content: ""; position: absolute; inset: -6% -4%;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--blue) 26%, transparent), transparent 68%);
  filter: blur(12px);
  z-index: 0;
}

/* A Mac window. Screenshots are plain window captures; the frame is drawn here. */
.window {
  position: relative; z-index: 1;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
}
.window img { width: 100%; }

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: 2; }
}

/* ---------- Home: sections ---------- */

.section { padding: clamp(48px, 8vw, 88px) 0; }
.section-header { max-width: 40em; margin-bottom: 40px; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }
.eyebrow {
  display: inline-block; margin-bottom: 10px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--highlight);
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px;
}
.feature h3 { margin: 14px 0 6px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.98rem; }
.feature-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--tint); color: var(--tint-text);
}

.gallery {
  display: flex; gap: 24px; overflow-x: auto; padding: 8px 4px 24px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.gallery figure { flex: 0 0 auto; width: min(560px, 82vw); margin: 0; scroll-snap-align: start; }
.gallery figcaption { margin-top: 14px; text-align: center; color: var(--text-muted); font-size: 0.95rem; }

.promise {
  background: linear-gradient(160deg, #1a3a8a, var(--navy) 70%); color: #eef2fb; border-radius: calc(var(--radius) + 8px);
  padding: clamp(32px, 6vw, 64px);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start;
}
.promise h2 { color: #fff; }
.promise .eyebrow { color: #9cc2ff; }
.promise p { color: #c9d4ec; }
.promise a { color: #b5d1ff; }
.promise ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.promise li { display: flex; gap: 12px; align-items: flex-start; }
.promise li::before {
  content: ""; flex: 0 0 10px; height: 10px; margin-top: 0.55em; border-radius: 50%; background: #6fd3a0;
}
@media (max-width: 760px) { .promise { grid-template-columns: 1fr; } }

.cta { text-align: center; }
.cta p { color: var(--text-muted); }
.cta .hero-actions { justify-content: center; }

/* ---------- Text pages (Markdown) ---------- */

.page-header { padding: clamp(40px, 7vw, 72px) 0 12px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-header .lede { font-size: 1.2rem; color: var(--text-muted); }
.meta { color: var(--text-muted); font-size: 0.9rem; }

.prose h2 { font-size: 1.55rem; margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 600; }
.prose code { font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
.prose img { border-radius: var(--radius-sm); margin: 1.5em auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.callout {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin: 1.5em 0;
}
.callout > :last-child { margin-bottom: 0; }

.prose details {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  padding: 14px 18px; margin: 0 0 12px;
}
.prose summary { cursor: pointer; font-weight: 600; }
.prose details[open] summary { margin-bottom: 8px; }
.prose details > :last-child { margin-bottom: 0; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 1.5em 0; }
.asset {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; text-decoration: none; color: var(--text); display: grid; gap: 10px; justify-items: center; text-align: center;
}
.asset img { margin: 0; max-height: 160px; width: auto; border-radius: 12px; }
.asset span { font-size: 0.9rem; color: var(--text-muted); }
.asset:hover { border-color: var(--accent); }

/* ---------- Code ---------- */

.prose code, .prose pre { font-family: var(--font-mono); }
.prose pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto;
  font-size: 0.88rem; line-height: 1.55; margin: 0 0 1.2em;
}
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

/* ---------- Home: how it works and limits ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 12px;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 700;
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--text-muted); font-size: 0.98rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col .callout { margin: 0; }
.two-col h3 { margin-bottom: 10px; }
.two-col ul { margin: 0; padding-left: 1.2em; color: var(--text-muted); }
.two-col li { margin-bottom: 0.5em; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Blog ---------- */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 20px 0; border-bottom: 1px solid var(--border); margin: 0; }
.post-list a { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
.post-list .meta { margin: 4px 0 6px; }
.post-list p:last-child { margin-bottom: 0; color: var(--text-muted); }
.page-header .eyebrow a { color: inherit; text-decoration: none; }
