/* Narciso docs — mobile-first, responsive (light mode) */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e1e4e8;
  --text: #1f2328;
  --text-muted: #656d76;
  --accent: #b45309;
  --accent-hover: #953c06;
  --accent-text: #ffffff;
  --code-bg: #f0f2f5;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --nav-height: 3.5rem;
  --content-max: 52rem;
  --radius: 6px;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: calc(100vh - env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(180, 83, 9, 0.15);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 1rem;
}

/* Desktop: links are body siblings, position in top-right so they align with nav bar */
@media (min-width: 641px) {
  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: var(--nav-height);
    background: transparent;
    box-shadow: none;
    border: none;
    width: auto;
    max-width: none;
    flex-direction: row;
    overflow: visible;
    transform: none;
  }

  .nav__links a {
    display: inline-flex;
    padding: 0.5rem 0.75rem;
    min-height: 0;
    border-bottom: none;
    font-size: 0.9375rem;
  }

  .nav__links a:last-child {
    border-bottom: none;
  }
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav__logo {
  flex-shrink: 0;
  color: var(--accent);
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: color 0.15s, background 0.15s;
}

.nav__links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav__links a.nav__github {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav__links a.nav__github:hover {
  color: var(--accent-hover);
  background: rgba(180, 83, 9, 0.1);
}

/* Mobile menu toggle — hamburger icon */
.nav__toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav__toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav__toggle--open .nav__toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle--open .nav__toggle-line:nth-child(2) {
  opacity: 0;
}

.nav__toggle--open .nav__toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay (mobile only) */
.nav__overlay {
  display: none;
}

/* Mobile: left sidebar + overlay + hamburger → X */
@media (max-width: 640px) {
  .nav {
    position: sticky;
    top: 0;
    z-index: 10003;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    min-height: 56px;
    height: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__brand {
    position: relative;
  }

  .nav__overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .nav__overlay.nav__overlay--open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    max-width: 280px;
    flex-direction: column;
    background: var(--surface);
    padding: 0;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    gap: 0;
    z-index: 10002;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav__links.is-open {
    transform: translateX(0);
  }

  .nav__links a {
    display: flex;
    align-items: center;
    padding: 1rem;
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav__links a:last-child {
    border-bottom: none;
  }

  .container-fluid {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .hero {
    margin-left: calc(-1 * max(1.25rem, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(1.25rem, env(safe-area-inset-right)));
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .hero__logo {
    width: 56px;
    height: 56px;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__tagline {
    font-size: 1rem;
    max-width: none;
  }

  .hero__ctas {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero__ctas .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border-radius: 8px;
  }

  .features {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    gap: 1rem;
  }

  .feature-card {
    padding: 1.25rem;
    min-height: 0;
    border-radius: 8px;
  }

  .feature-card h3 {
    font-size: 1.0625rem;
  }

  .feature-card p {
    font-size: 0.9375rem;
    line-height: 1.55;
  }

  .install-card {
    margin: 1.5rem 0;
    max-width: none;
    padding: 1.25rem;
    border-radius: 8px;
  }

  .install-card__pre {
    padding: 1rem;
    padding-right: 4rem;
    font-size: 0.9375rem;
    min-height: 52px;
    display: flex;
    align-items: center;
    -webkit-overflow-scrolling: touch;
  }

  .install-card__copy {
    min-width: 48px;
    min-height: 48px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    top: 0.5rem;
    right: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .footer__inner {
    gap: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .footer__links a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    min-height: 44px;
  }

  .footer__bottom {
    padding: 1rem 0;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  pre {
    padding: 1rem;
    font-size: 0.8125rem;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }

  pre code {
    font-size: inherit;
  }

  .doc-sidebar nav a {
    padding: 0.5rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Container fluid — full width on all pages */
.container-fluid {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .container-fluid {
    padding: 3rem 1.5rem 5rem;
  }
}

/* Home: hero flush with header, no bottom padding so footer sticks to bottom */
.page--home.container-fluid {
  padding-top: 0;
  padding-bottom: 0;
}

/* Documentation: no bottom padding on main so footer sits flush at bottom */
.main.page--doc,
.main.page--doc.container-fluid {
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .main.page--doc,
  .main.page--doc.container-fluid {
    padding-bottom: 0;
  }
}

/* Main content (legacy / when used without container-fluid) */
.main {
  position: relative;
  z-index: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .main {
    padding: 3rem 1.5rem 5rem;
  }
}

/* Documentation layout: sidebar + content */
.doc-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.doc-sidebar {
  flex-shrink: 0;
  width: 14rem;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  padding: 1rem 1.5rem 2rem 0;
  border-right: 1px solid var(--border);
  margin-right: 1.5rem;
}

.doc-sidebar__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
  padding: 0;
}

.doc-sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-sidebar nav li {
  margin: 0 0 0.25rem 0;
}

.doc-sidebar nav a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.doc-sidebar nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.doc-sidebar nav a.active {
  color: var(--accent);
  font-weight: 500;
}

.doc-content {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.doc-content > * {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .doc-layout {
    flex-direction: column;
    gap: 0;
  }

  .doc-sidebar {
    position: static;
    width: 100%;
    padding: 0 0 1.5rem 0;
    margin: 0 0 1.5rem 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-left: 0;
    padding-right: 0;
  }

  .doc-sidebar__title {
    margin-bottom: 0.5rem;
  }

  .doc-sidebar nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .doc-sidebar nav li {
    margin: 0;
    flex-shrink: 0;
  }

  .doc-sidebar nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 8px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .doc-sidebar nav a:hover {
    background: var(--surface);
    border-color: var(--accent);
  }

  .doc-content {
    padding-right: 0;
    padding-left: 0;
    overflow-x: hidden;
  }

  .doc-content > h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .doc-content > p:first-of-type {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .doc-section {
    margin-bottom: 2rem;
    padding-bottom: 0;
  }

  .doc-section > h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    scroll-margin-top: 5rem;
  }

  .doc-section > h3 {
    font-size: 1.0625rem;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
  }

  .doc-section > h4 {
    font-size: 1rem;
  }

  .doc-section p,
  .doc-section ul,
  .doc-section ol {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .doc-section ul,
  .doc-section ol {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
    max-width: 100%;
  }

  .doc-section li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .doc-section li:last-child {
    margin-bottom: 0;
  }

  .doc-section li code {
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 0.875em;
  }

  .doc-section pre {
    margin: 0.75rem 0;
    padding: 1rem;
    font-size: 0.8125rem;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    max-width: 100%;
  }

  .doc-section .install-card__code {
    margin: 0.5rem 0;
  }

  .doc-section .note {
    padding: 1rem;
    font-size: 0.9375rem;
    margin: 0.75rem 0;
    border-radius: 8px;
  }

  .doc-section code {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Fit to viewport: prevent any doc content from overflowing */
  .doc-content {
    width: 100%;
  }

  .doc-section {
    min-width: 0;
  }

  .doc-section pre {
    width: 100%;
    box-sizing: border-box;
  }
}

/* Extra small devices: tighter doc padding */
@media (max-width: 380px) {
  .main.container-fluid {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .doc-content > h1 {
    font-size: 1.35rem;
  }

  .doc-section > h2 {
    font-size: 1.15rem;
  }

  pre {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.4rem; }

p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Code */
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}

pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
  min-width: 0;
}

/* Highlight.js: use project mono font and keep theme colors */
pre.hljs,
pre code.hljs {
  font-family: var(--font-mono);
  padding: 0;
  background: transparent;
  border: none;
}

/* Terminal / bash blocks: light mode with accent colors */
pre.language-bash,
.code-block pre.language-bash {
  background: #f0f2f5;
  border-color: #d4d8de;
}

pre.language-bash code,
pre.language-bash .hljs,
.code-block pre.language-bash code,
.code-block pre.language-bash .hljs {
  background: transparent !important;
  color: #24292f;
}

pre.language-bash .hljs-comment,
pre.language-bash .hljs-quote {
  color: #57606a;
  font-style: italic;
}

pre.language-bash .hljs-keyword,
pre.language-bash .hljs-selector-tag,
pre.language-bash .hljs-addition {
  color: #0550ae;
}

pre.language-bash .hljs-built_in,
pre.language-bash .hljs-number,
pre.language-bash .hljs-string {
  color: #0a3069;
}

pre.language-bash .hljs-meta,
pre.language-bash .hljs-meta .hljs-meta-string {
  color: #953800;
}

pre.language-bash .hljs-attr,
pre.language-bash .hljs-variable,
pre.language-bash .hljs-template-variable {
  color: #cf222e;
}

pre.language-bash .hljs-symbol {
  color: #8250df;
}

/* Install card bash (one-liner) gets terminal style too */
.install-card__code pre.language-bash,
.install-card__pre.language-bash {
  background: #f0f2f5;
  border-color: #d4d8de;
}

.install-card__code pre.language-bash code,
.install-card__code .install-card__pre.language-bash code {
  color: #0a3069;
}

/* Sections in docs */
.doc-section {
  margin-bottom: 2.5rem;
}

.doc-section > h2 {
  margin-top: 2rem;
}

.doc-section > h2:first-child {
  margin-top: 0;
}

/* Hero (home) */
.hero {
  text-align: left;
  padding: 3rem 1.25rem 2rem;
  margin: 0 -1.25rem;
  background: #b45309;
}

@media (min-width: 640px) {
  .hero {
    padding: 3rem 1.5rem 2rem;
    margin: 0 -1.5rem;
  }
}

.hero__logo {
  display: block;
  margin: 0 0 1rem;
  width: 64px;
  height: 64px;
  filter: brightness(0) invert(1);
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
  color: #fff;
}

.hero__tagline {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 28rem;
  margin: 0 0 2rem;
  line-height: 1.65;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
}

.hero .btn--primary {
  background: #fff;
  color: #b45309;
  border-color: #fff;
}

.hero .btn--primary:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #953c06;
  text-decoration: none;
}

.hero .btn--secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
}

.hero .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  text-decoration: none;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover {
  background: var(--border);
  color: var(--text);
  text-decoration: none;
}

/* Feature grid (home) */
.features {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.feature-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Install card (home page) */
.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  max-width: 32rem;
}

.install-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
  padding: 0;
  border: none;
}

.install-card__code {
  position: relative;
  max-width: 100%;
  min-width: 0;
}

.install-card__pre {
  margin: 0;
  padding: 1rem 3.5rem 1rem 1.25rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  font-size: 0.9375rem;
  -webkit-overflow-scrolling: touch;
}

.install-card__pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
}

.install-card__copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.install-card__copy:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(180, 83, 9, 0.06);
}

/* Wrapper for any code block that gets a copy button (added by JS) */
.code-block {
  position: relative;
  max-width: 100%;
  min-width: 0;
}

.code-block pre {
  padding-right: 4.5rem;
}

.code-block__copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.code-block__copy:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(180, 83, 9, 0.06);
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 2.5rem 1.25rem 1.5rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: var(--surface);
}

.footer__inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  padding-bottom: 2rem;
}

@media (min-width: 640px) {
  .footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 2.5rem;
  }
}

.footer__brand {
  max-width: 20rem;
}

.footer__logo {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.footer__name {
  display: block;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.footer__tagline {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.footer__heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
  padding: 0;
  border: none;
}

.footer__links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__links li {
  margin: 0 0 0.5rem 0;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__bottom {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__copyright {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__copyright a {
  color: var(--text-muted);
}

.footer__copyright a:hover {
  color: var(--accent);
}


/* Lists */
ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.35rem;
}

/* Small text */
small, .muted {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Required PHP version / note blocks */
.note {
  padding: 1rem 1.25rem;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.note strong {
  color: var(--accent);
}

/* Scroll-to-top button — visible when at bottom, always on top of content */
.scroll-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: calc(1rem + 10px + env(safe-area-inset-bottom, 0px));
  right: calc(1rem + env(safe-area-inset-right, 0px));
  z-index: 2147483647 !important;
  transform: translateZ(0);
  isolation: isolate;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s ease;
}

.scroll-top.scroll-top--visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.scroll-top:hover,
.scroll-top:focus-visible {
  background: var(--accent-hover);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
