/* Pip MDM website.
   Apple-inspired design: refined typography, translucent materials,
   delicate borders, subtle depth, and tactile interactive elements. */
:root {
  --night: #0b1422;
  --night-surface: #101c2e;
  --night-elevated: #16263e;
  --night-line: rgba(255, 255, 255, 0.08);

  /* Apple-tuned palette */
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-active: #006edb;
  --apple-blue-dark: #2997ff;
  --apple-blue-dark-hover: #47a6ff;

  --seed: #0071e3;
  --link: #0066cc;
  --button: #0071e3;
  --button-hover: #0077ed;
  --seed-light: #6cb8ff;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-secondary: #fbfbfd;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.09), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-hero: 0 30px 60px -12px rgba(0, 0, 0, 0.45), 0 18px 36px -18px rgba(0, 0, 0, 0.35);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #161617;
    --surface-secondary: #1c1c1e;
    --text: #f5f5f7;
    --muted: #86868b;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.2);
    --link: #2997ff;
    --button: #2997ff;
    --button-hover: #47a6ff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.52947 var(--font);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; min-width: 0; }
img { max-width: 100%; height: auto; display: block; }

/* Inline links */
a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--apple-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.1;
  text-wrap: balance;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-top: 0;
}
h1 {
  font-weight: 700;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  max-width: 24ch;
}
h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0 0 8px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right));
}
.wrap.narrow { max-width: 740px; }
.fine {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: -0.01em;
}

/* Header (Apple-style frosted navigation) */
.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 20, 34, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f5f5f7;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.015em;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.brand:hover {
  text-decoration: none;
  opacity: 0.88;
}
.brand img {
  border-radius: 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-header nav a {
  color: #d1d9e2;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-header nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.site-header nav a[aria-current] {
  color: #ffffff;
  font-weight: 550;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 600px) {
  .header-row {
    height: auto;
    padding-block: 8px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .site-header nav {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
  }
  .site-header nav a {
    padding: 6px 8px;
    font-size: 13.5px;
  }
}

/* Apple-style Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--button);
  color: #ffffff;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.016em;
  text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.button:hover {
  background: var(--button-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}
.button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.button:focus-visible {
  outline: 2px solid var(--apple-blue-dark);
  outline-offset: 3px;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}
.button.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Secondary subtle button for light surfaces */
.button.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: none;
}
@media (prefers-color-scheme: dark) {
  .button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.12);
  }
}
.button.secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  color: var(--text);
  text-decoration: none;
}

/* Hero Section */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 900px 500px at 70% 15%, rgba(41, 151, 255, 0.24), transparent 70%),
    radial-gradient(ellipse 600px 400px at 20% 40%, rgba(58, 134, 230, 0.15), transparent 70%),
    linear-gradient(180deg, #13233a 0%, var(--night) 100%);
  color: #e6edf5;
  padding-block: clamp(56px, 8vw, 100px) clamp(68px, 10vw, 110px);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 700;
  line-height: 1.06;
  margin: 0 0 20px;
  color: #ffffff;
  letter-spacing: -0.038em;
}
.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.48;
  color: #a7b7cc;
  max-width: 48ch;
  margin: 0 0 32px;
  letter-spacing: -0.015em;
}
.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-art {
  position: relative;
  perspective: 1000px;
}
.shot {
  border-radius: var(--radius);
  box-shadow: var(--shadow-hero), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: block;
}
.hero-art .console {
  width: 100%;
  transition: transform 0.4s var(--ease);
}
.hero-art .mac {
  position: absolute;
  width: 52%;
  right: -6%;
  bottom: -14%;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
  transition: transform 0.4s var(--ease);
}
.hero-art:hover .console {
  transform: translateY(-2px);
}
.hero-art:hover .mac {
  transform: translateY(-5px);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { margin-top: 16px; margin-bottom: 40px; }
  .hero-art .mac { right: 0; bottom: -8%; }
}

/* Sections & Bands */
.band {
  padding-block: clamp(64px, 9vw, 100px);
}
.band.alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.split {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: clamp(36px, 5vw, 56px);
  align-items: center;
}
.split h2 {
  font-size: clamp(28px, 3.8vw, 38px);
}
.split p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 14px;
}
.split p:last-child { margin-bottom: 0; }

.product-figure {
  margin: 0;
  min-width: 0;
}
.product-figure .shot {
  box-shadow: var(--shadow-card), 0 0 0 1px var(--line);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.product-figure .shot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--line-strong);
}
.product-figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  letter-spacing: -0.01em;
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

/* Apple-style Interactive Link Cards (.page-links) */
.page-links {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block: 24px;
}
.prose .page-links {
  margin-block: 32px;
}
.prose .page-links:last-child {
  margin-bottom: 0;
}

.page-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
}
.page-links a::after {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-right: 2px;
  border: solid var(--link);
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}
.page-links a:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--link);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
  text-decoration: none;
}
.page-links a:hover::after {
  transform: translateX(3px) rotate(-45deg);
}
.page-links a:active {
  transform: translateY(0);
}
.page-links a:focus-visible {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
}

/* In .band.alt where background is surface, elevate page-links cards with secondary bg or clear border */
.band.alt .page-links a {
  background: var(--surface-secondary);
}
.band.alt .page-links a:hover {
  background: var(--surface);
}

/* Section links pills on Features / documentation */
.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 16px;
  margin-bottom: 24px;
  border-block: 1px solid var(--line);
}
.section-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}
.section-links a:hover {
  border-color: var(--link);
  color: var(--link);
  text-decoration: none;
  transform: translateY(-1px);
}
.section-links a:focus-visible {
  outline: 2px solid var(--apple-blue);
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
}
.breadcrumb a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a::before {
  content: "‹";
  font-size: 16px;
  line-height: 1;
}
.breadcrumb a:hover {
  color: var(--link);
}

/* Callout Box */
.callout {
  padding: 18px 22px;
  margin-block: 28px;
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-left: 4px solid var(--apple-blue);
  border-radius: var(--radius);
  background: rgba(0, 113, 227, 0.04);
  box-shadow: var(--shadow-sm);
}
@media (prefers-color-scheme: dark) {
  .callout {
    background: rgba(41, 151, 255, 0.08);
    border-color: rgba(41, 151, 255, 0.3);
    border-left-color: var(--apple-blue-dark);
  }
}
.callout p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

/* FAQ (Collapsible accordion Apple-style) */
.faq {
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
  padding-block: 18px;
  transition: background-color 0.15s ease;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.016em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--link);
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.15s ease;
}
.faq details[open] summary::after {
  content: "×";
  transform: rotate(90deg);
}
.faq p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 12px 0 4px;
  max-width: 66ch;
}

/* Reading / Prose Pages */
.prose-page {
  max-width: 740px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 84px) max(22px, env(safe-area-inset-right)) 96px max(22px, env(safe-area-inset-left));
  overflow-wrap: break-word;
}
.page-head h1, .prose h1 {
  font-size: clamp(38px, 5.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 16px;
}
.intro, .prose > h1 + p {
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.45;
  color: var(--muted);
  max-width: 58ch;
  letter-spacing: -0.015em;
  margin-bottom: 36px;
}
.prose h2 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 48px 0 16px;
  max-width: none;
}
.prose p {
  margin: 0 0 18px;
  line-height: 1.6;
}
.prose ul, .prose ol {
  padding-left: 24px;
  margin: 0 0 24px;
}
.prose li {
  margin-bottom: 10px;
  line-height: 1.55;
}
.prose li > strong {
  color: var(--text);
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

/* Guide index and lists */
.guide-index {
  padding-block: clamp(48px, 8vw, 84px) 96px;
}
.guide-index .page-head {
  margin-bottom: clamp(36px, 6vw, 60px);
}
.guide-group {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.6fr);
  gap: 36px;
  margin-top: 48px;
}
.guide-group h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 650;
}
.guide-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.guide-list li {
  border-bottom: 1px solid var(--line);
}
.guide-list a {
  display: block;
  padding: 18px 8px;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.guide-list a h3 {
  color: var(--text);
  transition: color 0.15s ease;
}
.guide-list a:hover {
  text-decoration: none;
  background: rgba(0, 113, 227, 0.04);
}
.guide-list a:hover h3 {
  color: var(--link);
}
.guide-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
ol.guide-list { counter-reset: guide; }
ol.guide-list a {
  position: relative;
  padding-left: 42px;
  counter-increment: guide;
}
ol.guide-list a::before {
  content: counter(guide);
  position: absolute;
  left: 8px;
  top: 18px;
  color: var(--link);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}
@media (max-width: 660px) {
  .guide-group { grid-template-columns: 1fr; gap: 16px; }
  .guide-list a { padding-inline: 0; }
  ol.guide-list a { padding-left: 32px; }
  ol.guide-list a::before { left: 0; }
}

/* Footer (Apple clean dark style) */
.site-footer {
  background: var(--night);
  color: #8fa3b8;
  padding-block: 56px 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.site-footer .brand span { color: #f5f5f7; }
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.site-footer nav {
  display: flex;
  gap: 14px 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.site-footer a {
  color: #b5c4d4;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}
.site-footer .fine {
  color: #6c7e92;
  font-size: 12.5px;
  line-height: 1.5;
}
.site-footer .fine a {
  color: #8fa3b8;
  font-size: 12.5px;
}

