/* Apple-inspired layout & typography (neutral, spacious, system fonts) */

:root {
  --apple-text: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-tertiary: #86868b;
  --apple-bg: #fbfbfd;
  --apple-bg-elevated: #ffffff;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-border: rgba(0, 0, 0, 0.06);
  /* Reading measure & rhythm */
  --apple-measure: 42rem;
  --apple-measure-narrow: 36rem;
  --apple-space-xs: 0.5rem;
  --apple-space-sm: 1rem;
  --apple-space-md: 1.5rem;
  --apple-space-lg: 2.5rem;
  --apple-space-xl: 4rem;
}

.dark {
  --apple-text: #f5f5f7;
  --apple-text-secondary: #a1a1a6;
  --apple-text-tertiary: #86868b;
  --apple-bg: #000000;
  --apple-bg-elevated: #1d1d1f;
  --apple-border: rgba(255, 255, 255, 0.08);
}

.apple-site {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    sans-serif;
  background-color: var(--apple-bg);
  color: var(--apple-text);
  font-feature-settings: "kern" 1, "liga" 1;
}

.apple-antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.apple-content {
  position: relative;
  z-index: 1;
}

/* Navigation — frosted, minimal */
.apple-nav {
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border);
}

.dark .apple-nav {
  background: rgba(0, 0, 0, 0.72);
  border-bottom-color: var(--apple-border);
}

.apple-nav a:not([id="theme-toggle"]):not(button) {
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--apple-text);
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.apple-nav a:not([id="theme-toggle"]):not(button):hover {
  opacity: 0.55;
}

.apple-nav .brand-title {
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.2;
}

/* Nav link row: even horizontal rhythm */
.apple-nav nav > a {
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

/* Hero */
.apple-hero {
  padding-top: 4.5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .apple-hero {
    padding-top: 6rem;
    padding-bottom: 7rem;
  }
}

@media (min-width: 1024px) {
  .apple-hero {
    padding-top: 7.5rem;
    padding-bottom: 8.5rem;
  }
}

.apple-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--apple-text-secondary);
  line-height: 1.4;
}

.apple-headline {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.028em;
  color: var(--apple-text);
  text-wrap: balance;
}

.apple-subhead {
  font-size: clamp(1.125rem, 2.1vw, 1.4375rem);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.006em;
  color: var(--apple-text-secondary);
  max-width: var(--apple-measure-narrow);
}

.apple-hero-visual img {
  border-radius: 1.25rem;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 24px 48px -12px rgba(0, 0, 0, 0.12);
}

.dark .apple-hero-visual img {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 24px 48px -12px rgba(0, 0, 0, 0.5);
}

/* Buttons — pill, Apple-like */
.apple-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.75rem 1.375rem;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.17647;
  letter-spacing: -0.022em;
  color: #fff;
  background: var(--apple-blue);
  border-radius: 980px;
  transition: background 0.15s ease;
}

.apple-btn-primary:hover {
  background: var(--apple-blue-hover);
}

.apple-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.75rem 1.375rem;
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--apple-blue);
  background: transparent;
  border-radius: 980px;
  border: 1px solid var(--apple-blue);
  transition: background 0.15s ease, color 0.15s ease;
}

.apple-btn-secondary:hover {
  background: rgba(0, 113, 227, 0.06);
}

.dark .apple-btn-secondary {
  color: #2997ff;
  border-color: #2997ff;
}

.dark .apple-btn-secondary:hover {
  background: rgba(41, 151, 255, 0.1);
}

/* Sections */
.apple-section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .apple-section {
    padding-top: 6.5rem;
    padding-bottom: 6.5rem;
  }
}

.apple-section-alt {
  background: rgba(0, 0, 0, 0.02);
}

.dark .apple-section-alt {
  background: rgba(255, 255, 255, 0.03);
}

.apple-section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--apple-text);
  text-wrap: balance;
}

.apple-section-lead {
  font-size: 1.125rem;
  line-height: 1.62;
  color: var(--apple-text-secondary);
  max-width: var(--apple-measure);
  margin-left: auto;
  margin-right: auto;
}

.apple-section-footnote {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--apple-text-tertiary);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* Value cards */
.apple-card {
  border-radius: 1.25rem;
  padding: 2.5rem;
  background: var(--apple-bg-elevated);
  border: 1px solid var(--apple-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.apple-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dark .apple-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.apple-card h3 {
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
  color: var(--apple-text);
}

.apple-card .apple-card-kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--apple-text-secondary);
  margin-top: var(--apple-space-xs);
  line-height: 1.35;
}

.apple-card p {
  font-size: 1.0625rem;
  line-height: 1.58;
  color: var(--apple-text-secondary);
  margin-top: var(--apple-space-sm);
}

.apple-card p:last-child {
  margin-bottom: 0;
}

/* Project tiles */
.apple-tile {
  border-radius: 1.125rem;
  padding: 1.75rem;
  background: var(--apple-bg-elevated);
  border: 1px solid var(--apple-border);
  transition: box-shadow 0.2s ease;
}

.apple-tile:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.dark .apple-tile:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.apple-tile-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9375rem;
  background: rgba(0, 0, 0, 0.04);
  color: var(--apple-text);
}

.dark .apple-tile-avatar {
  background: rgba(255, 255, 255, 0.08);
}

.apple-tile h3 {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--apple-text);
}

.apple-tile-body {
  margin-top: 0.5rem;
  flex: 1 1 auto;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--apple-text-secondary);
}

.apple-tile-outcome {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--apple-text-secondary);
  margin-top: var(--apple-space-sm);
  padding-top: var(--apple-space-xs);
  border-top: 1px solid var(--apple-border);
}

/* CTA band */
.apple-cta {
  background: #1d1d1f;
  color: #f5f5f7;
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
}

.apple-cta h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
  text-wrap: balance;
}

.apple-cta p {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: #a1a1a6;
  max-width: var(--apple-measure-narrow);
  margin-left: auto;
  margin-right: auto;
}

.apple-cta .apple-btn-primary {
  background: #f5f5f7;
  color: #1d1d1f;
}

.apple-cta .apple-btn-primary:hover {
  background: #ffffff;
}

/* Footer */
.apple-footer {
  border-top: 1px solid var(--apple-border);
  background: var(--apple-bg);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.apple-footer,
.apple-footer a {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--apple-text-tertiary);
}

.apple-footer .apple-footer-tagline {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--apple-text-secondary);
  max-width: 22rem;
}

.apple-footer a:hover {
  color: var(--apple-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Inner page header */
.apple-page-header {
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--apple-border);
}

.dark .apple-page-header {
  background: rgba(255, 255, 255, 0.03);
}

.apple-page-header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--apple-text);
  text-wrap: balance;
}

.apple-prose {
  max-width: var(--apple-measure);
  margin-left: auto;
  margin-right: auto;
  padding: 2.5rem 1.75rem 4.5rem;
}

.apple-prose .prose {
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.011em;
}

.apple-prose .prose > p:first-of-type {
  font-size: 1.125rem;
  line-height: 1.62;
  color: var(--apple-text-secondary);
}

.apple-prose .prose h2 {
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: var(--apple-space-xl);
  margin-bottom: var(--apple-space-sm);
  scroll-margin-top: 5rem;
}

.apple-prose .prose h2:first-child {
  margin-top: 0;
}

.apple-prose .prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: var(--apple-space-lg);
  margin-bottom: var(--apple-space-xs);
}

.apple-prose .prose ul,
.apple-prose .prose ol {
  margin-top: var(--apple-space-sm);
  margin-bottom: var(--apple-space-md);
  padding-left: 1.25rem;
}

.apple-prose .prose li {
  margin-top: 0.375rem;
  line-height: 1.6;
}

.apple-prose .prose li::marker {
  color: var(--apple-text-tertiary);
}

.apple-prose .prose blockquote {
  margin: var(--apple-space-md) 0;
  padding-left: 1.125rem;
  border-left: 3px solid rgba(0, 113, 227, 0.35);
  font-style: normal;
  color: var(--apple-text-secondary);
}

.dark .apple-prose .prose blockquote {
  border-left-color: rgba(41, 151, 255, 0.45);
}

.apple-prose .prose hr {
  margin: var(--apple-space-xl) 0;
  border-color: var(--apple-border);
}

.apple-prose .prose pre {
  font-size: 0.9375rem;
  line-height: 1.55;
}

.apple-prose .prose a {
  color: var(--apple-blue);
  text-decoration: none;
}

.apple-prose .prose a:hover {
  text-decoration: underline;
}

.dark .apple-prose .prose a {
  color: #2997ff;
}

/* Nav dropdowns — neutral hover (override theme primary pills) */
.apple-nav button:hover,
.apple-nav a:hover {
  text-shadow: none !important;
}

.apple-nav button:hover.bg-primary-600,
.apple-nav .hover\:bg-primary-600:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
}

.dark .apple-nav button:hover.bg-primary-600,
.dark .apple-nav .hover\:bg-primary-600:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
}
