:root {
  --bg: #0f1115;
  --surface: #161922;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #6ea8ff;
  --border: #232734;
  --radius: 14px;
  --max-width: 720px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --text: #111418;
    --muted: #555c6a;
    --accent: #2563eb;
    --border: #e5e7eb;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Smooth in-page anchor scrolling, offset for the sticky header */
html {
  scroll-behavior: smooth;
  scroll-padding-block-start: 80px;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ----------------------------------------------------------------------------
   Sticky top bar (full-bleed blur, breadcrumb + section nav)
---------------------------------------------------------------------------- */
header.site {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  border-block-end: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* Inner wrapper keeps content aligned with <main> while blur spans the page */
header.site > .bar {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* Breadcrumb: dfamaya  ›  <App> */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 1rem;
}

.crumbs .brand {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}

.crumbs .brand:hover { color: var(--accent); }

.crumbs .sep {
  color: var(--muted);
  user-select: none;
}

.crumbs .section {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s var(--ease);
}

.crumbs .section:hover { color: var(--text); }

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

nav a:hover { color: var(--text); }

/* Active section pill */
nav a[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Animated underline grows from center on hover (skip the active pill) */
nav a:not([aria-current="page"])::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  inset-block-end: 2px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.2s var(--ease);
}

nav a:not([aria-current="page"]):hover::after { transform: scaleX(1); }

/* Border + shadow strengthen once the page is scrolled (progressive) */
@supports (animation-timeline: scroll()) {
  header.site {
    animation: header-elevate steps(1) both;
    animation-timeline: scroll(root block);
    animation-range: 8px 48px;
  }
  @keyframes header-elevate {
    to {
      border-block-end-color: var(--border);
      box-shadow: 0 6px 24px color-mix(in srgb, #000 16%, transparent);
    }
  }
}

/* Fallback for browsers without scroll-driven animations: a subtle static line */
@supports not (animation-timeline: scroll()) {
  header.site { border-block-end-color: var(--border); }
}

/* ----------------------------------------------------------------------------
   Typography
---------------------------------------------------------------------------- */
h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.2rem;
  margin: 32px 0 8px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
  letter-spacing: -0.01em;
}

p, li { color: var(--text); }

.muted { color: var(--muted); }

.tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 0;
}

a { color: var(--accent); }

ul { padding-left: 20px; }

/* ----------------------------------------------------------------------------
   Cards
---------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.card h2:first-child { margin-top: 0; }
.card h3:first-child { margin-top: 0; }

/* Lift only app cards (those holding a link row), not long text cards */
.card:has(.links):hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 10px 30px color-mix(in srgb, #000 14%, transparent);
}

.card table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.95rem;
}

.card thead th { background: var(--bg); }

.card th,
.card td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ----------------------------------------------------------------------------
   In-content link buttons
---------------------------------------------------------------------------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.links a {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ----------------------------------------------------------------------------
   Soft entrance animation (disabled when the user prefers reduced motion)
---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  main > * {
    animation: rise 0.55s var(--ease) both;
  }
  main > *:nth-child(1) { animation-delay: 0.02s; }
  main > *:nth-child(2) { animation-delay: 0.08s; }
  main > *:nth-child(3) { animation-delay: 0.14s; }
  main > *:nth-child(4) { animation-delay: 0.20s; }
  main > *:nth-child(n + 5) { animation-delay: 0.24s; }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}
