/*
 * Software by Design — Nextcloud Apps website
 * Design tokens, layout, and component styles.
 * License: AGPL-3.0-or-later
 *
 * Design goals
 *  - WCAG 2.1 AA: contrast, focus, motion, keyboard, semantics
 *  - Responsive from 320 px upwards (mobile-first)
 *  - No external assets, no tracking, no third-party fonts
 *  - Light + dark theme via prefers-color-scheme
 */

/* ---------------------------------------------------------------------------
 * Design tokens
 * ------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-primary: #1d4ed8;     /* blue-700 */
  --brand-primary-hover: #1e40af;
  --brand-primary-soft: #dbeafe;
  --brand-accent: #0ea5e9;      /* sky-500 */
  --brand-gradient: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);

  /* Surfaces */
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;       /* slate-50 */
  --color-bg-elevated: #ffffff;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;

  /* Text */
  --color-text: #0f172a;         /* slate-900 — AAA on white */
  --color-text-muted: #475569;   /* slate-600 — AA on white */
  --color-text-subtle: #64748b;  /* slate-500 */
  --color-text-on-brand: #ffffff;

  /* Borders */
  --color-border: #e2e8f0;       /* slate-200 */
  --color-border-strong: #cbd5e1;
  --color-focus-ring: #2563eb;

  /* Semantic */
  --color-success: #15803d;
  --color-warning: #b45309;
  --color-danger: #b91c1c;

  /* Layout */
  --container-max: 1200px;
  --container-padding: clamp(1rem, 4vw, 2rem);
  --section-gap: clamp(3rem, 8vw, 6rem);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, .18);

  /* Typography */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --leading: 1.6;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1220;
    --color-bg-alt: #111a2c;
    --color-bg-elevated: #0f1828;
    --color-surface: #0f1828;
    --color-surface-hover: #16223a;

    --color-text: #f1f5f9;
    --color-text-muted: #cbd5e1;
    --color-text-subtle: #94a3b8;

    --color-border: #1e293b;
    --color-border-strong: #334155;
    --color-focus-ring: #93c5fd;

    --brand-primary: #60a5fa;
    --brand-primary-hover: #93c5fd;
    --brand-primary-soft: #1e293b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .55);
  }
}

/* Allow user to force a theme via [data-theme="light|dark"] on <html>. */
html[data-theme="light"] {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-elevated: #ffffff;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-focus-ring: #2563eb;
  --brand-primary: #1d4ed8;
  --brand-primary-hover: #1e40af;
  --brand-primary-soft: #dbeafe;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0b1220;
  --color-bg-alt: #111a2c;
  --color-bg-elevated: #0f1828;
  --color-surface: #0f1828;
  --color-surface-hover: #16223a;
  --color-text: #f1f5f9;
  --color-text-muted: #cbd5e1;
  --color-text-subtle: #94a3b8;
  --color-border: #1e293b;
  --color-border-strong: #334155;
  --color-focus-ring: #93c5fd;
  --brand-primary: #60a5fa;
  --brand-primary-hover: #93c5fd;
  --brand-primary-soft: #1e293b;
}

/* ---------------------------------------------------------------------------
 * Reset & base
 * ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  color-scheme: light dark;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
img { background: var(--color-bg-alt); }

a {
  color: var(--brand-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--brand-primary-hover); }

:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 1.6rem + 2.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .8vw, 1.5rem); }
h4 { font-size: 1.125rem; }

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

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: .9375em;
}

pre {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.45;
}

p code, li code {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: .1em .35em;
  border-radius: 4px;
}

ul, ol { padding-left: 1.25rem; margin: 0 0 1em; }
li + li { margin-top: .35em; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* ---------------------------------------------------------------------------
 * Skip link & utilities
 * ------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 1000;
  background: var(--brand-primary);
  color: var(--color-text-on-brand);
  padding: .75rem 1rem;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

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

.section { padding-block: var(--section-gap); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--alt {
  background: var(--color-bg-alt);
  border-top: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
}

.eyebrow {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: .75rem;
}

.muted { color: var(--color-text-muted); }
.lead {
  font-size: clamp(1.0625rem, .98rem + .5vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ---------------------------------------------------------------------------
 * Header / Navigation
 * ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  padding: .25rem 0;
  flex: 0 0 auto;
}
.brand:hover { color: var(--color-text); }
.brand__mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand__name { font-size: 1.0625rem; }
.brand__name small {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--color-text-subtle);
  letter-spacing: .03em;
}

.site-footer .brand--footer {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: .625rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Reset prose list spacing — global li + li { margin-top } staggers items in a row */
.site-nav__list > li {
  margin: 0;
}
.site-nav__list > li + li {
  margin-top: 0;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  padding: .55rem .85rem;
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: .9375rem;
  white-space: nowrap;
}
.site-nav__link:hover { background: var(--color-surface-hover); color: var(--color-text); }
.site-nav__link[aria-current="page"] {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-hover);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-left: .5rem;
  padding: .25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}
.lang-switch a {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .8125rem;
}
.lang-switch a:hover { color: var(--color-text); background: var(--color-surface-hover); }
.lang-switch a[aria-current="true"] {
  background: var(--brand-primary);
  color: var(--color-text-on-brand);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  appearance: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: .55rem .65rem;
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle:hover { background: var(--color-surface-hover); }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle:not([aria-expanded="true"]) .icon-close { display: none; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    position: absolute;
    inset: 4rem 0 auto 0;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem var(--container-padding) 1.25rem;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s var(--dur);
    box-shadow: var(--shadow-md);
  }
  .site-nav[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
  }
  .site-nav__link {
    width: 100%;
    padding: .75rem 1rem;
  }
  .lang-switch {
    margin-left: 0;
    align-self: flex-start;
  }
}

/* ---------------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60vw;
  max-width: 720px;
  aspect-ratio: 1/1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-accent) 22%, transparent), transparent 70%);
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 30% auto auto -10%;
  width: 50vw;
  max-width: 520px;
  aspect-ratio: 1/1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-primary) 18%, transparent), transparent 70%);
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }

.hero__title {
  max-width: 22ch;
  margin-bottom: 1rem;
}
.hero__lede {
  max-width: 60ch;
  font-size: clamp(1.0625rem, 1rem + .6vw, 1.3125rem);
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
}

.hero__commission {
  margin: 1.5rem 0 0;
  max-width: 42rem;
  font-size: .9375rem;
  color: var(--color-text-muted);
}
.hero__commission a {
  font-weight: 600;
  color: var(--brand-primary);
}
.hero__commission a:hover,
.hero__commission a:focus-visible {
  text-decoration: underline;
}

.hero__badges {
  margin-top: 2rem;
  margin-bottom: 0;
  margin-left: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--brand-primary);
  color: var(--color-text-on-brand);
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand-primary) 60%, transparent);
}
.btn--primary:hover { background: var(--brand-primary-hover); color: var(--color-text-on-brand); border-color: var(--brand-primary-hover); }

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

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
  padding-inline: .75rem;
}
.btn--ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }

.btn__icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---------------------------------------------------------------------------
 * Badges & pills
 * ------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .65rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: .8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.badge svg { width: 14px; height: 14px; flex: 0 0 auto; }
.badge--brand { background: var(--brand-primary-soft); color: var(--brand-primary-hover); border-color: transparent; }
.badge--success { background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success); border-color: transparent; }

/* ---------------------------------------------------------------------------
 * Apps grid
 * ------------------------------------------------------------------------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0;
  margin-left: 0;
  padding-left: 0;
  list-style: none;
  align-items: stretch;
}
.apps-grid > li {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  overflow: hidden;
}
.app-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: var(--color-text);
}
.app-card:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.app-card__head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.app-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  color: #fff;
  flex: 0 0 auto;
}
.app-card__icon svg { width: 24px; height: 24px; }
.app-card__name { margin: 0; font-size: 1.125rem; }
.app-card__cat { font-size: .8125rem; color: var(--color-text-subtle); margin: 0; }

.app-card__summary {
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
  flex-grow: 1;
}

.app-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .4rem;
}
.app-card__features li {
  margin: 0;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: .25rem .55rem;
  border-radius: 999px;
}

.app-card__more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--brand-primary);
  font-weight: 600;
  font-size: .9375rem;
}
.app-card:hover .app-card__more { color: var(--brand-primary-hover); }
.app-card__more svg { width: 18px; height: 18px; transition: transform var(--dur) var(--ease); }
.app-card:hover .app-card__more svg { transform: translateX(3px); }

/* ---------------------------------------------------------------------------
 * App detail page
 * ------------------------------------------------------------------------- */
.app-detail__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 720px) {
  .app-detail__head {
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
  }
}

.app-detail__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient);
  color: #fff;
}
.app-detail__icon svg { width: 38px; height: 38px; }

.app-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.app-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin-top: 2rem;
  align-items: stretch;
}

.feature {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.feature__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}
.feature__title svg {
  width: 18px; height: 18px;
  color: var(--brand-primary);
  flex: 0 0 auto;
}
.feature__desc {
  color: var(--color-text-muted);
  margin: 0;
  font-size: .9375rem;
  flex-grow: 1;
}
.feature ol,
.feature ul {
  margin: 0;
  flex-grow: 1;
}

/* Screenshots */
.screenshots {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

.screenshot {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-alt);
  cursor: zoom-in;
  position: relative;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.screenshot:hover { border-color: var(--brand-primary); transform: translateY(-1px); }
.screenshot:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.screenshot img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: top center;
  background: var(--color-bg-alt);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility 0s var(--dur);
}
.lightbox[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease);
}
.lightbox__inner {
  position: relative;
  max-width: min(1400px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.lightbox__caption {
  color: #e2e8f0;
  font-size: .9375rem;
  text-align: center;
}
.lightbox__close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-md);
  padding: .5rem .75rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .2); }
.lightbox__close svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
 * Generic content cards / prose blocks
 * ------------------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { margin-bottom: 1.25rem; }
.prose hr { margin: 2.5rem 0; }
.prose a { font-weight: 500; }

.notice {
  border-left: 4px solid var(--brand-primary);
  background: var(--brand-primary-soft);
  color: var(--color-text);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
}
.notice strong { color: var(--brand-primary-hover); }

/* ---------------------------------------------------------------------------
 * Services grid (home + about): "free apps + paid services" store window
 * ------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0;
  margin-left: 0;
  padding-left: 0;
  list-style: none;
  align-items: stretch;
}
.services-grid > li {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.service {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.service:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.service--free {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary-soft) 60%, transparent), var(--color-surface) 60%);
  border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--color-border));
}

.service__head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}
.service__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  color: #fff;
  flex: 0 0 auto;
}
.service__icon svg { width: 24px; height: 24px; }
.service__name { margin: 0; font-size: 1.125rem; }
.service__price {
  margin: 0;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.service--free .service__price { color: var(--color-success); }

.service__summary {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  font-size: .9375rem;
  flex-grow: 1;
}

.service__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  gap: .35rem;
}
.service__bullets li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0;
  font-size: .875rem;
  color: var(--color-text);
}
.service__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: .9rem;
  height: .9rem;
  background-color: var(--brand-primary);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center / contain no-repeat;
}

.service__cta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: auto;
  color: var(--brand-primary);
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
}
.service__cta:hover,
.service__cta:focus-visible {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}
.service__cta svg { width: 18px; height: 18px; transition: transform var(--dur) var(--ease); }
.service__cta:hover svg { transform: translateX(3px); }

/* Trust / engagement-model strip */
.trust-strip {
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.25rem;
  align-items: center;
  font-size: .875rem;
  color: var(--color-text-muted);
}
.trust-strip__item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.trust-strip__item svg {
  width: 16px;
  height: 16px;
  color: var(--brand-primary);
  flex: 0 0 auto;
}
.trust-strip__item strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Engagement model list (about page) */
.engagement-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.engagement-list > li {
  margin: 0;
  padding: 1rem 1.15rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.engagement-list strong {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: .25rem;
}
.engagement-list p {
  margin: 0;
  font-size: .9375rem;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------------
 * About — team grid
 * ------------------------------------------------------------------------- */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
  align-items: stretch;
}
.team-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
}
.team-card__avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.25rem;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border);
  border: 2px solid var(--color-border);
}
.team-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.team-card__name { margin: 0 0 .25rem; font-size: 1.15rem; }
.team-card__role {
  margin: 0 0 1rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.team-card__bio {
  margin: 0;
  color: var(--color-text-muted);
  font-size: .9375rem;
  flex-grow: 1;
}
.team-card__social {
  margin: .75rem 0 0;
  font-size: .875rem;
  flex-shrink: 0;
}
.team-card__social a {
  font-weight: 600;
  color: var(--brand-primary);
}
.team-card__social a:hover,
.team-card__social a:focus-visible {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
 * CTA banner
 * ------------------------------------------------------------------------- */
.cta {
  background: var(--brand-gradient);
  color: var(--color-text-on-brand);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3rem);
  display: grid;
  gap: 1.25rem;
  align-items: center;
}
@media (min-width: 720px) {
  .cta { grid-template-columns: 1fr auto; gap: 2rem; }
}
.cta h2, .cta p { margin: 0; }
.cta h2 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.875rem);
  color: var(--color-text-on-brand);
}
.cta p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 62ch;
}
/* Inline links: global `a { color: brand-primary }` fails on blue gradient */
.cta a:not(.btn) {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.55);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.cta a:not(.btn):hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}
.cta a:not(.btn):focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  border-radius: 4px;
}
.cta .btn--secondary {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}
.cta .btn--secondary:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.cta .btn--primary {
  background: #fff;
  color: #0f172a;
  border-color: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.cta .btn--primary:hover {
  background: #f1f5f9;
  color: #020617;
  border-color: #f1f5f9;
}
.cta .btn--primary:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.site-footer h3 {
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-subtle);
  margin: 0 0 .85rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: .35rem; }
.site-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: .9375rem;
}
.site-footer a:hover { color: var(--brand-primary); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  color: var(--color-text-subtle);
  font-size: .875rem;
}
.site-footer__bottom a { font-size: .875rem; }

/* ---------------------------------------------------------------------------
 * Tables (used in privacy / imprint)
 * ------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: .9375rem;
}
.table-wrap th,
.table-wrap td {
  text-align: left;
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.table-wrap th {
  font-weight: 700;
  background: var(--color-bg-alt);
}

/* ---------------------------------------------------------------------------
 * Page header (sub-pages)
 * ------------------------------------------------------------------------- */
.page-head {
  padding-block: clamp(2.25rem, 6vw, 4.25rem) clamp(1.75rem, 4vw, 2.75rem);
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--brand-primary) 9%, transparent) 0%,
      transparent 55%
    ),
    var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.page-head h1 {
  font-size: clamp(1.85rem, 1.35rem + 1.35vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text);
}
.page-head .lead {
  max-width: min(62ch, 100%);
}
.page-head__crumbs {
  font-size: .875rem;
  color: var(--color-text-subtle);
  margin-bottom: 1rem;
}
.page-head__crumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.page-head__crumbs a:hover { color: var(--brand-primary); }

/* ---------------------------------------------------------------------------
 * Definition lists & address (used in legal & contact pages)
 * ------------------------------------------------------------------------- */
.prose dl,
.contact-list {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: .35rem 1.25rem;
  margin: 0 0 1.25rem;
}
.prose dt,
.contact-list dt {
  font-weight: 700;
  color: var(--color-text);
}
.prose dd,
.contact-list dd {
  margin: 0;
  color: var(--color-text-muted);
}
@media (max-width: 520px) {
  .prose dl,
  .contact-list {
    grid-template-columns: 1fr;
    gap: .15rem;
  }
  .prose dt,
  .contact-list dt { margin-top: .5rem; }
  .prose dt:first-child,
  .contact-list dt:first-child { margin-top: 0; }
}

.prose address {
  font-style: normal;
  display: inline-block;
}

/* Table of contents block (used in privacy / accessibility pages) */
.toc {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
}
.toc h2 {
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-subtle);
  margin: 0 0 .5rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 1;
}
@media (min-width: 720px) {
  .toc ol { columns: 2; column-gap: 2rem; }
}
.toc li { break-inside: avoid; }
.toc a {
  color: var(--color-text);
  text-decoration: none;
}
.toc a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
 * 404 page
 * ------------------------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 50vh;
  padding-block: clamp(3rem, 8vw, 6rem);
}
.error-page__code {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 .25rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
}
.error-page__title { margin: 0 0 .25rem; }
.error-page__title-alt {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.error-page__lead { max-width: 50ch; margin: 0 auto 1rem; color: var(--color-text-muted); }
.error-page__lead + .error-page__lead { margin-top: 0; margin-bottom: 2rem; }
.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}

/* ---------------------------------------------------------------------------
 * Misc helpers
 * ------------------------------------------------------------------------- */
.text-center { text-align: center; }
.flex-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Wide content (full-width inside container, narrower text inside) */
.content-narrow { max-width: 70ch; margin-inline: auto; }

/* Print: ensure links remain visible and content is readable */
@media print {
  .site-header, .site-footer, .nav-toggle, .lang-switch, .cta { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .toc { display: none; }
  .hero::before, .hero::after { display: none; }
}
