:root {
  /* Defaults for pages with no site (the landing page). A site's theme
     overrides these from a <style> block in <head>; see sites/theme.py. */
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --line: #e4e2dc;
  --code-bg: #f1f0eb;
  --accent: #1c1c1a;
  --on-accent: #ffffff;
  --link: #1c1c1a;
  --accent-soft: #f1f1ee;
  --scheme: light;
  --font-body: "Avenir Next", "Segoe UI Variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-heading: inherit;
  --heading-weight: 700;
  --warn: #fff4d6;
  --error: #fde8e8;
  --radius: 2px;
  --max: 1080px;
  --bg: #ffffff;
  --accent-2: #1c1c1a;
  --page-bg: var(--bg);
  --card-pad: 0px;
  /* Motion; a site's theme overrides these (sites/theme.py). */
  --motion-scale: 1;
  --motion-on: 1;
  --motion-time: .8s;
  --reveal-anim: nx-fade;
  --img-rest: none;
  --img-hover-transform: scale(1.05);
  --img-hover-filter: none;
  --img-hover-shadow: none;
  --btn-hover-transform: translateY(-2px);
  --btn-hover-shadow: 0 10px 26px rgba(0,0,0,.18);
  --btn-arrow: none;
  --btn-press: scale(.97);
  --btn-magnetic: 0;
  --card-tilt: 0;
  --scroll-pad: 0px;
  --curtain-display: none;
  --curtain-bg: #1c1c1a;
  --curtain-anim: nx-curtain-lift;
  --link-rest: 0%;
  --card-hover-transform: translateY(-4px);
  --card-hover-shadow: 0 18px 40px rgba(0,0,0,.14);
  --header-position: static;
  --header-bg: transparent;
  --header-blur: none;
  --header-pad-scrolled: 1.6rem;
  --backdrop-tint: rgba(255,255,255,.7);
  --backdrop-anim: none;
  --parallax: 0;
  --gradient-display: none;
  --page-bg-anim: none;
  --body-bg: var(--bg);
  --vt-out: nx-vt-fade-out;
  --vt-in: nx-vt-fade-in;
  --vt-time: .3s;
  --marquee-play: running;
  --decor-grain-display: none;
  --decor-shapes-display: none;
  --decor-shapes: none;
  --decor-anim: none;
}
* { box-sizing: border-box; }
html { color-scheme: var(--scheme); scroll-behavior: smooth; scroll-padding-top: var(--scroll-pad); }
body {
  margin: 0;
  font: 16px/1.75 var(--font-body);
  color: var(--text);
  background: var(--body-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--heading-weight); letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.site-header {
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  padding: 1.6rem max(1.25rem, calc(50% - var(--max) / 2));
  position: var(--header-position); top: 0; z-index: 50;
  background: var(--header-bg); -webkit-backdrop-filter: var(--header-blur); backdrop-filter: var(--header-blur);
  transition: padding .3s ease, box-shadow .3s ease;
}
body.scrolled .site-header { padding-top: var(--header-pad-scrolled); padding-bottom: var(--header-pad-scrolled); }
body.scrolled .site-header[style*="sticky"], body.scrolled .site-header.is-sticky { box-shadow: 0 1px 0 var(--line); }
.brand { font-weight: 800; font-size: 1.05rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text); display: flex; align-items: center; gap: .6rem; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 32px; width: 32px; object-fit: cover; border-radius: 4px; }
.site-header nav { display: flex; gap: 1.6rem; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.site-header nav a { color: var(--text); font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; padding: .35rem 0; background: linear-gradient(currentColor, currentColor) no-repeat left bottom / var(--link-rest) 2px; transition: background-size calc(var(--motion-time) * .45) ease; }
.site-header nav a:hover { text-decoration: none; background-size: 100% 2px; }
[dir="rtl"] .site-header nav a { background-position: right bottom; }
.account { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
/* A long brand or many links: the navigation keeps at least 40% of the row,
   so the search box and account links drop to a second row, right-aligned,
   rather than the links squeezing into three lines. */
.site-header nav { flex: 1 1 40%; min-width: 40%; }
.site-search { margin-left: auto; }
.lang-switch { margin-left: auto; }
.lang-switch + .site-search { margin-left: 0; }
.account a, .account .linkish { color: var(--muted); font-size: inherit; letter-spacing: inherit; text-transform: inherit; }
.account a:hover, .account .linkish:hover { color: var(--text); text-decoration: none; }
.account { display: flex; gap: 1rem; align-items: center; margin-left: auto; }
.lang-switch { display: flex; gap: .35rem; flex-wrap: wrap; }
.lang-switch a { font-size: .8rem; padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.lang-switch a.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Right-to-left: mirror the few directional rules. */
[dir="rtl"] .account { margin-left: 0; margin-right: auto; }
[dir="rtl"] .block-quote { border-left: 0; border-right: 4px solid var(--accent); }
[dir="rtl"] .media-text-image-right img { order: 0; }
[dir="rtl"] .media-text-image-left img { order: 2; }
[dir="rtl"] .faq-item summary { text-align: right; }
[dir="rtl"] .prose blockquote { border-left: 0; border-right: 3px solid var(--line); }
/* ----- Site menu: a header row on wide screens, a side drawer below 900px -- */
.site-menu { display: contents; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); cursor: pointer; grid-auto-rows: 2px; row-gap: 5px; align-content: center; justify-items: center; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: currentColor; margin: 0; transition: transform .25s, opacity .25s; }
.menu-backdrop { display: none; }
[dir="rtl"] .menu-toggle { margin-left: 0; margin-right: auto; }
@media (max-width: 900px) {
  .site-header { gap: .75rem 1rem; padding: 1rem 1.25rem; flex-wrap: nowrap; }
  .menu-toggle { display: grid; }
  .site-menu { display: flex; flex-direction: column; align-items: stretch; gap: 1.5rem; position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 86vw); padding: 5.5rem 1.5rem 2rem; background: var(--bg); color: var(--text); box-shadow: -24px 0 60px rgba(0,0,0,.22); transform: translateX(105%); visibility: hidden; transition: transform .32s cubic-bezier(.2,.7,.2,1), visibility 0s .32s; overflow-y: auto; z-index: 900; }
  body.menu-open .site-menu { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.2,.7,.2,1); }
  body.menu-open .site-menu nav a { animation: nx-menu calc(var(--motion-time) * .6) cubic-bezier(.2,.7,.2,1) both; }
  body.menu-open .site-menu nav a:nth-child(2) { animation-delay: 60ms; } body.menu-open .site-menu nav a:nth-child(3) { animation-delay: 120ms; }
  body.menu-open .site-menu nav a:nth-child(4) { animation-delay: 180ms; } body.menu-open .site-menu nav a:nth-child(5) { animation-delay: 240ms; }
  body.menu-open .site-menu nav a:nth-child(6) { animation-delay: 300ms; } body.menu-open .site-menu nav a:nth-child(n+7) { animation-delay: 360ms; }
  .site-menu nav { flex: none; min-width: 0; flex-direction: column; align-items: stretch; gap: 0; justify-content: flex-start; }
  .site-menu nav a { font-size: 1rem; letter-spacing: .12em; padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .site-menu nav a:hover { border-bottom-color: var(--text); }
  .site-menu .lang-switch { flex-direction: row; flex-wrap: wrap; gap: .4rem; }
  .site-menu .lang-switch a { border-bottom: 1px solid var(--line); padding: .25rem .7rem; font-size: .85rem; }
  .site-menu .site-search, .site-menu .lang-switch, .site-menu .account { margin: 0; }
  .site-menu .site-search input, .site-menu .site-search input:focus { width: 100%; }
  .site-menu .account { flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
  .menu-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 890; }
  .menu-backdrop[hidden] { display: none; }
  body.menu-open .menu-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  body.menu-open .menu-toggle { position: fixed; top: 1rem; right: 1.25rem; z-index: 910; background: var(--bg); }
  body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  [dir="rtl"] .site-menu { right: auto; left: 0; transform: translateX(-105%); box-shadow: 24px 0 60px rgba(0,0,0,.22); }
  [dir="rtl"] body.menu-open .site-menu { transform: none; }
  [dir="rtl"] body.menu-open .menu-toggle { right: auto; left: 1.25rem; }
}
.site-search input { font: inherit; font-size: .9rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); width: 150px; }
.site-search input:focus { width: 220px; outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.search-form { display: flex; gap: .5rem; max-width: 560px; margin-bottom: 1.5rem; }
.search-form input { flex: 1; font: inherit; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.search-group { margin-bottom: 2rem; }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.search-results li a { font-weight: 600; font-size: 1.05rem; }
.search-results li p { margin: .2rem 0 0; }
.inline-form { display: inline; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }

main { max-width: var(--max); margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
section { margin-bottom: 3.5rem; }
.narrow { max-width: 420px; }
.hero { padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; margin: 0 0 1rem; letter-spacing: -.02em; }
.hero h1 .hero-light { display: block; font-weight: 300; font-size: .62em; letter-spacing: 0; color: var(--text); margin-bottom: .1em; }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; max-width: 620px; }
.hero .prose { max-width: 620px; }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; margin: .25rem 0; }
.badge {
  display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  background: var(--warn); color: #7a5b00; padding: .1rem .45rem; border-radius: 999px; vertical-align: middle;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head h1, .section-head h2 { margin: 0 0 1.25rem; }
.section-head > a { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* Cards clip their picture to the theme radius. --card-pad is 0 on a plain
   page (the surface is invisible, so text lines up with the picture) and
   1rem when the surface shows against a coloured, gradient or picture
   background; sites/theme.py decides. */
.card { background: var(--surface); border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform calc(var(--motion-time) * .45) ease, box-shadow calc(var(--motion-time) * .45) ease; }
.card:hover, .featured-card:hover { transform: var(--card-hover-transform); box-shadow: var(--card-hover-shadow); }
.card > a { display: block; color: inherit; height: 100%; padding: 0 var(--card-pad) 1.25rem; }
.card > a:hover { text-decoration: none; }
.card > a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.card h3 { margin: .9rem 0 .25rem; font-size: 1.05rem; }
.card p { margin: 0; }
.card-image { border-radius: 0; margin: 0 calc(-1 * var(--card-pad)); width: calc(100% + 2 * var(--card-pad)); max-width: none; }
.card .meta { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
.card-image { aspect-ratio: 16 / 9; object-fit: cover; }
.card-logo { height: 48px; width: 48px; margin: 1rem 1rem 0; border-radius: 8px; object-fit: cover; }
.site-card .card-image { aspect-ratio: 4 / 3; }
.card-blank { display: grid; place-items: center; width: 100%; background: var(--accent-soft); color: var(--muted); font-size: 2.5rem; font-weight: 300; }

.pills { display: flex; gap: .5rem; flex-wrap: wrap; }
.pills a { padding: .25rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: .9rem; }
.pills a.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pagination { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; color: var(--muted); }

.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.caption { font-size: .9rem; color: var(--muted); margin: .4rem 0 0; }

.prose { max-width: 720px; }
.prose h1 { font-size: 2.1rem; line-height: 1.2; }
.prose .cover { border-radius: var(--radius); margin: 1.5rem 0; }
.prose pre { background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; }
.prose code { background: var(--code-bg); padding: .1rem .3rem; border-radius: 4px; font-size: .92em; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--line); margin: 1rem 0; padding: .25rem 1rem; color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table th, .table td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.stack { display: grid; gap: 1rem; }
.stack label { display: grid; gap: .3rem; font-weight: 600; }
.stack input { font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px; }
.button { background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); padding: .7rem 1.6rem; border-radius: 999px; font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; display: inline-block; }

.flashes { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.flash { padding: .6rem .9rem; border-radius: 6px; background: var(--accent-soft); margin-bottom: .5rem; }
.flash-warning { background: var(--warn); }
.flash-error { background: var(--error); }

.site-footer {
  max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem 2.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: flex-start;
}
.footer-nav a, .powered { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
.footer-main { display: grid; gap: .75rem; }
.footer-text.prose p { margin: 0; }
.footer-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.social-nav { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-nav a { padding: .15rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--text); }
.social-nav a:hover { border-color: var(--link); text-decoration: none; }
.footer-right { display: flex; gap: 1rem; align-items: center; }
.platform-lang select { font: inherit; font-size: .85rem; padding: .2rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); }

/* Editing tools on the live site: a small floating button, and the menu it
   opens. Hidden by default so the site is seen as visitors see it. */
.editor-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 800; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border: 0; border-radius: 999px; background: #1c1c1a; color: #fff; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.editor-fab:hover { background: #333; }
.editor-fab[aria-expanded="true"] { background: #7a5b00; }
.editor-bar { position: fixed; right: 1.25rem; bottom: 4.4rem; z-index: 800; width: min(320px, calc(100vw - 2.5rem)); max-height: calc(100vh - 6rem); overflow: auto; display: grid; gap: .15rem; padding: .8rem 1rem; background: var(--warn); color: #7a5b00; font-size: .9rem; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.22); }
.editor-bar[hidden] { display: none; }
.editor-bar span { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; margin-bottom: .3rem; }
.editor-bar a { font-weight: 600; color: #7a5b00; padding: .35rem 0; border-bottom: 1px solid rgba(122,91,0,.15); }
.editor-bar a:last-child { border-bottom: 0; }
.editor-bar-motion { font: inherit; font-size: .8rem; color: #7a5b00; padding: .35rem 0; text-align: left; border-top: 1px solid rgba(122,91,0,.15); margin-top: .2rem; }
.editor-bar-close { font-size: 1.2rem; line-height: 1; color: #7a5b00; padding: 0 .2rem; }
[dir="rtl"] .editor-fab, [dir="rtl"] .editor-bar { right: auto; left: 1.25rem; }
@media print { .editor-fab, .editor-bar { display: none; } }

.prose a, .card h3 a, .file-list a { text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat left bottom / var(--link-rest) 1px; transition: background-size calc(var(--motion-time) * .4) ease; }
.prose a:hover, .card h3 a:hover, .file-list a:hover { text-decoration: none; background-size: 100% 1px; }
[dir="rtl"] .prose a, [dir="rtl"] .card h3 a, [dir="rtl"] .file-list a { background-position: right bottom; }

.block-image { margin: 1.5rem 0; }
.block-image img { border-radius: var(--radius); width: 100%; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.embedded-page > h2 a { color: inherit; }

/* ----- Block wrappers: styling presets and columns ----------------------- */
.blk { margin: 0 0 2rem; }
.blk > section, .blk > article { margin-bottom: 0; }
.blk.sp-tight { margin-bottom: .75rem; }
.blk.sp-loose { margin-bottom: 4rem; }
.blk.w-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.blk.w-full { width: 100vw; margin-left: calc(50% - 50vw); padding-left: max(1.25rem, calc(50vw - 540px)); padding-right: max(1.25rem, calc(50vw - 540px)); }
.blk.al-center { text-align: center; }
.blk.al-center .section-head { justify-content: center; }
.blk.al-center .prose, .blk.al-center .hero { margin-left: auto; margin-right: auto; }
.blk.bg-tint, .blk.bg-accent, .blk.bg-dark { padding-top: 2rem; padding-bottom: 2rem; border-radius: var(--radius); }
.blk.bg-tint:not(.w-full), .blk.bg-accent:not(.w-full), .blk.bg-dark:not(.w-full) { padding-left: 1.5rem; padding-right: 1.5rem; }
.blk.w-full.bg-tint, .blk.w-full.bg-accent, .blk.w-full.bg-dark { border-radius: 0; }
.blk.bg-tint { background: var(--accent-soft); }
.blk.bg-accent { background: var(--accent); --text: var(--on-accent); --muted: color-mix(in srgb, var(--on-accent) 75%, transparent); --line: color-mix(in srgb, var(--on-accent) 25%, transparent); --surface: color-mix(in srgb, var(--on-accent) 12%, transparent); --code-bg: color-mix(in srgb, var(--on-accent) 12%, transparent); --link: var(--on-accent); color: var(--on-accent); }
.blk.bg-dark { background: #1c1c1a; --text: #f4f4f1; --muted: #b8b8b2; --line: #3a3a37; --surface: #2a2a28; --code-bg: #2a2a28; --link: color-mix(in srgb, var(--accent) 55%, white); color: #f4f4f1; }
.blk.bg-accent a, .blk.bg-dark a { color: var(--link); }
.blk.bg-accent .card, .blk.bg-dark .card, .blk.bg-accent .table, .blk.bg-dark .table { color: var(--text); }
.blk.bg-accent .prose code, .blk.bg-dark .prose code, .blk.bg-accent .prose pre, .blk.bg-dark .prose pre { background: var(--code-bg); }
.blk .blk:last-child { margin-bottom: 0; }

.row { display: grid; gap: 1.5rem; align-items: start; }
.row-1-1 { grid-template-columns: 1fr 1fr; }
.row-2-1 { grid-template-columns: 2fr 1fr; }
.row-1-2 { grid-template-columns: 1fr 2fr; }
.row-1-1-1 { grid-template-columns: 1fr 1fr 1fr; }
.row .col { min-width: 0; }
.row .cards { grid-template-columns: 1fr; }
.row .hero h1 { font-size: 1.8rem; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } }

/* ----- More block kinds ------------------------------------------------- */
.block-button { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.al-center .block-button { align-items: center; }
.button-note { margin: 0; font-size: .9rem; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-secondary { background: var(--accent-soft); color: var(--text); border-color: var(--accent-soft); }
.button-outline { background: transparent; color: var(--text); border: 2px solid var(--line); }
.button-outline:hover { border-color: var(--text); }
a.button:hover { text-decoration: none; filter: brightness(1.08); }
.button { transition: transform calc(var(--motion-time) * .35) ease, box-shadow calc(var(--motion-time) * .35) ease, filter .2s; }
.button:hover { transform: var(--btn-hover-transform); box-shadow: var(--btn-hover-shadow); }
.button:active { transform: var(--btn-press); box-shadow: none; }
.button::after { content: var(--btn-arrow); display: inline-block; transition: transform calc(var(--motion-time) * .35) ease; }
.button:hover::after { transform: translateX(4px); }
[dir="rtl"] .button::after { transform: scaleX(-1); }
[dir="rtl"] .button:hover::after { transform: scaleX(-1) translateX(4px); }
.block-button { gap: .75rem; flex-direction: row; flex-wrap: wrap; }

.media-text { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr 1fr; }
.media-text img { width: 100%; border-radius: var(--radius); }
.media-text-image-right img { order: 2; }
@media (max-width: 720px) { .media-text { grid-template-columns: 1fr; } .media-text-image-right img { order: 0; } }

.block-video { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.faq { max-width: 760px; }
.faq-item { border-top: 1px solid var(--line); padding: .25rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; padding: .6rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .prose { padding: 0 0 .8rem; }

.block-quote { margin: 0; padding: 1.5rem 2rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: var(--radius); max-width: 760px; }
.quote-text { font-size: 1.25rem; line-height: 1.5; font-family: var(--font-heading); }
.quote-text p { margin: 0 0 .5rem; }
.block-quote cite { display: block; font-style: normal; color: var(--muted); font-size: .95rem; }
.al-center .block-quote { margin-left: auto; margin-right: auto; border-left: 0; border-top: 4px solid var(--accent); }

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: feature; }
.feature { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 0 1.5rem; position: relative; counter-increment: feature; }
.feature::after { content: "0" counter(feature); position: absolute; left: 0; bottom: -1.6rem; font-size: .7rem; letter-spacing: .14em; color: var(--muted); }
.feature-icon { font-size: 1.9rem; display: block; margin-bottom: .9rem; filter: grayscale(1) contrast(1.1); }
.feature h3 { margin: 0 0 .5rem; font-size: 1rem; }
.feature .prose p { margin: 0; }
.feature .prose p + p { margin-top: .5rem; }

.form-frame { width: 100%; min-height: 520px; border: 0; border-radius: var(--radius); background: var(--surface); }

.featured-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; }
.featured-card:hover { text-decoration: none; border-color: var(--accent); }
.featured-card img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.featured-body { padding: 1.5rem; display: grid; align-content: center; gap: .4rem; }
.featured-body h3 { margin: 0; font-size: 1.6rem; }
.featured-body .lead { margin: 0; font-size: 1.05rem; }
.read-more { color: var(--link); font-weight: 600; }
@media (max-width: 720px) { .featured-card { grid-template-columns: 1fr; } }

.native-form { max-width: 620px; }
.native-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.native-form .ff { display: grid; gap: .3rem; font-weight: 600; }
.native-form .ff input, .native-form .ff textarea, .native-form .ff select { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.native-form .ff.has-error input, .native-form .ff.has-error textarea, .native-form .ff.has-error select { border-color: #b91c1c; }
.native-form .ff-check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.flash-ok { background: #e6f4ea; color: #1b5e20; }
.spacer-small { height: 1.5rem; }
.spacer-medium { height: 4rem; }
.spacer-large { height: 8rem; }

/* Inside the builder's preview frame: blocks are clickable targets. */
.preview-mode [data-block-ref] { position: relative; cursor: pointer; }
.preview-mode [data-block-ref]:hover { outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 4px; }
.preview-mode [data-block-ref].is-selected { outline: 2px solid var(--accent); outline-offset: 4px; }
.preview-mode [data-block-ref] [data-block-ref]:hover { outline-offset: 2px; }
.draft-ribbon { max-width: var(--max); margin: .5rem auto 0; padding: .4rem 1.25rem; background: var(--error); color: #7a1b1b; font-size: .85rem; border-radius: 8px; }

/* ----- Signup and site wizard --------------------------------------------- */
.wizard { max-width: 720px; }
.wizard-form { display: grid; gap: 1.5rem; }
.wizard-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; display: grid; gap: .9rem; background: var(--surface); }
.wizard-form legend { font-weight: 700; padding: 0 .4rem; }
.wizard-form label { display: grid; gap: .3rem; font-weight: 600; }
.wizard-form input[type=text], .stack input { font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.wizard-form .hint, .stack .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field-error { font-weight: 400; color: #b91c1c; font-size: .85rem; }
.addr { display: flex; align-items: center; gap: .3rem; }
.addr input { flex: 1; }
.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.starter input { position: absolute; opacity: 0; }
.starter-card { display: grid; gap: .25rem; padding: .9rem 1rem; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400; height: 100%; }
.starter input:checked + .starter-card { border-color: var(--accent); background: var(--accent-soft); }
.starter input:focus-visible + .starter-card { outline: 2px solid var(--accent); }
.accent-pick { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.accent-pick input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; }
.swatches { display: flex; gap: .35rem; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.bases { display: flex; gap: 1.25rem; }
.base { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
.button.big { font-size: 1.05rem; padding: .8rem 1.6rem; justify-self: start; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.landing-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }

/* ----- Landing page ----------------------------------------------------- */
.ld-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding: 2.5rem 0 3rem; }
.ld-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.ld-hero h1 { font-size: clamp(2.6rem, 5.5vw, 4.4rem); line-height: 1.02; margin: 0 0 1rem; letter-spacing: -.025em; }
.ld-hero h1 .hero-light { display: block; font-weight: 300; font-size: .6em; letter-spacing: 0; margin-bottom: .15em; }
.ld-stats { display: flex; gap: 2.5rem; margin: 2.25rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid var(--line); }
.ld-stats div { display: grid; gap: .1rem; }
.ld-stats dt { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.ld-stats dd { margin: 0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ld-collage { position: relative; height: 440px; }
.ld-collage-card { position: absolute; width: 62%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: 0 30px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06); transition: transform .35s ease; }
.ld-collage-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-collage-card span { position: absolute; left: .8rem; bottom: .7rem; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.ld-collage-card:nth-child(1) { left: 0; top: 8%; transform: rotate(-4deg); z-index: 1; }
.ld-collage-card:nth-child(2) { right: 0; top: 0; transform: rotate(3deg); z-index: 2; }
.ld-collage-card:nth-child(3) { left: 19%; bottom: 0; transform: rotate(-1deg); z-index: 3; }
.ld-collage:hover .ld-collage-card { transform: rotate(0) translateY(-6px); }

.ld-section { padding: 3rem 0 0; }
.ld-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.ld-section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.ld-section-head p { margin: 0; }
.ld-more { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.ld-mosaic { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 210px; grid-auto-flow: dense; gap: .9rem; }
.ld-mosaic .ld-tile { grid-column: span 2; }
.ld-mosaic .ld-tile:nth-child(6n + 1) { grid-column: span 4; grid-row: span 2; }
.ld-mosaic-small { grid-auto-rows: 180px; }
.ld-mosaic-small .ld-tile, .ld-mosaic-small .ld-tile:nth-child(6n + 1) { grid-column: span 2; grid-row: span 1; }
.ld-tile { position: relative; display: block; overflow: hidden; border-radius: 10px; background: var(--accent-soft); color: #fff; isolation: isolate; }
.ld-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ld-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%); z-index: 1; transition: opacity .3s; }
.ld-tile-blank { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.5rem; font-weight: 300; color: var(--muted); }
.ld-tile-body { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1rem; z-index: 2; display: grid; gap: .15rem; }
.ld-tile-body strong { font-size: 1.05rem; letter-spacing: -.01em; }
.ld-mosaic .ld-tile:nth-child(6n + 1) .ld-tile-body strong { font-size: 1.6rem; }
.ld-tile-body em { font-style: normal; font-size: .85rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-visit { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: .4rem; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.ld-tile:hover .ld-visit, .ld-tile:focus-visible .ld-visit { opacity: 1; transform: none; }
.ld-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.ld-features { margin-top: 1rem; }
.ld-feature-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ld-feature-list li { padding: 1.5rem 1.4rem 1.6rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: .4rem; align-content: start; }
.ld-feature-list h3 { margin: 0; font-size: 1.05rem; }
.ld-feature-list p { margin: 0; font-size: .92rem; }
.ld-num { font-size: .72rem; font-weight: 700; letter-spacing: .18em; color: var(--muted); }

.ld-cta { margin-top: 3.5rem; padding: 3.5rem 2rem; border-radius: 14px; background: var(--accent); color: var(--on-accent); text-align: center; display: grid; gap: .6rem; justify-items: center; }
.ld-cta h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.02em; }
.ld-cta p { margin: 0 0 1rem; opacity: .85; max-width: 480px; }
.button-invert { background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }

@media (max-width: 900px) {
  .ld-hero { grid-template-columns: 1fr; gap: 2rem; }
  .ld-collage { height: 300px; max-width: 480px; }
  .ld-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
  .ld-mosaic .ld-tile, .ld-mosaic .ld-tile:nth-child(6n + 1) { grid-column: span 1; grid-row: span 1; }
  .ld-mosaic .ld-tile:nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
  .ld-mosaic .ld-tile:nth-child(6n + 1) .ld-tile-body strong { font-size: 1.3rem; }
  .ld-feature-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .ld-stats { gap: 1.5rem; }
  .ld-collage { height: 240px; }
  .ld-mosaic { gap: .6rem; grid-auto-rows: 150px; }
  .ld-feature-list { grid-template-columns: 1fr; }
  .ld-cta { padding: 2.5rem 1.25rem; }
}
[dir="rtl"] .ld-collage-card span { left: auto; right: .8rem; }

/* ----- Gallery layouts -------------------------------------------------- */
.gal { list-style: none; margin: 0; padding: 0; }
.gal a { display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--accent-soft); }
.gal img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gal a:hover img { transform: scale(1.04); }
.gal-over { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .8rem .6rem; font-size: .82rem; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0)); opacity: 0; transition: opacity .3s; pointer-events: none; }
.gal a:hover .gal-over { opacity: 1; }
.gal-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.gal-grid a { aspect-ratio: 1; }
.gal-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gal-cards a { aspect-ratio: 4 / 3; }
.gal-cards .caption { margin-top: .5rem; }
.gal-masonry { columns: 3 220px; column-gap: .8rem; }
.gal-masonry li { break-inside: avoid; margin-bottom: .8rem; }
.gal-masonry img { height: auto; }
.gal-mosaic { display: grid; gap: .6rem; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 180px; grid-auto-flow: dense; }
.gal-mosaic li.wide { grid-column: span 2; }
.gal-mosaic li.tall { grid-row: span 2; }
.gal-mosaic li.big { grid-column: span 2; grid-row: span 2; }
.gal-mosaic a { height: 100%; }
.gal-list { display: grid; gap: 2.5rem; }
.gal-list li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: end; }
.gal-list li:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.gal-list li:nth-child(even) a { order: 2; }
.gal-list img { height: auto; }
.gal-list .gal-text p { margin: 0 0 .5rem; font-size: 1.05rem; }
.gal-index { font-size: .72rem; letter-spacing: .14em; color: var(--muted); }
.gal-strip-wrap { margin: 0 calc(50% - 50vw); padding: 0 max(1.25rem, calc(50vw - var(--max) / 2)); overflow: hidden; }
.gal-strip { display: flex; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .8rem; scrollbar-width: thin; }
.gal-strip li { flex: 0 0 min(72vw, 420px); scroll-snap-align: start; }
.gal-strip a { aspect-ratio: 3 / 2; }
@media (max-width: 700px) {
  .gal-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
  .gal-list li, .gal-list li:nth-child(even) { grid-template-columns: 1fr; gap: .6rem; }
  .gal-list li:nth-child(even) a { order: 0; }
}

/* Lightbox */
.lb[hidden] { display: none; }
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(12,12,12,.94); display: grid; place-items: center; padding: 3rem 1rem; }
.lb figure { margin: 0; display: grid; gap: .6rem; justify-items: center; max-width: 100%; max-height: 100%; }
.lb img { max-width: min(92vw, 1400px); max-height: 82vh; object-fit: contain; border-radius: 4px; }
.lb figcaption { color: #fff; font-size: .9rem; opacity: .85; text-align: center; max-width: 60ch; }
.lb button[hidden] { display: none; }
.lb figcaption[hidden] { display: none; }
.lb button { position: absolute; background: none; border: 0; color: #fff; font: inherit; font-size: 2.2rem; line-height: 1; cursor: pointer; padding: .4rem .8rem; opacity: .8; }
.lb button:hover { opacity: 1; }
.lb-close { top: .6rem; right: .8rem; }
.lb-prev { left: .4rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .4rem; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }
[dir="rtl"] .gal-list li:nth-child(even) a { order: 0; }

/* ----- Background picture ------------------------------------------------
   A fixed element behind the page (sites/theme.py:backdrop_html) with a
   wash of the page colour over it. The picture is taller than the frame so
   it can drift (Ken Burns) or move with parallax without showing edges. */
.site-backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); pointer-events: none; }
.site-backdrop img { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: translate(-50%, calc(-50% + var(--py, 0px))); animation: var(--backdrop-anim); will-change: transform; }
.site-backdrop.parallax img { height: 140%; }
.site-backdrop video { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: cover; transform: translate(-50%, -50%); }
.site-backdrop.has-video img { animation: none; }
body.lite .site-backdrop video { display: none; }
.site-backdrop::after { content: ""; position: absolute; inset: 0; background: var(--backdrop-tint); }
/* Rotating hero words */
.hero-word { display: inline-block; color: var(--accent); min-width: 1ch; }
.hero-word.is-out { animation: nx-word-out calc(var(--motion-time) * .45) ease both; }
.hero-word.is-in { animation: nx-word-in calc(var(--motion-time) * .55) cubic-bezier(.2,.7,.2,1) both; }
.hero-word.typing::after { content: ""; display: inline-block; width: .06em; height: .9em; margin-left: .06em; background: currentColor; vertical-align: -.08em; animation: nx-caret 1s steps(1) infinite; }
@keyframes nx-word-out { to { opacity: 0; transform: translateY(calc(-.4em * var(--motion-scale))); } }
@keyframes nx-word-in { from { opacity: 0; transform: translateY(calc(.4em * var(--motion-scale))); } to { opacity: 1; transform: none; } }
@keyframes nx-caret { 50% { opacity: 0; } }
@keyframes nx-kenburns { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-48.5%, -51.5%) scale(1.12); } }
/* The drifting gradient is a fixed layer moved with transform, which the
   compositor handles; animating background-position would repaint. */
.site-gradient { display: var(--gradient-display); position: fixed; inset: -30%; z-index: -2; background: var(--page-bg); animation: var(--page-bg-anim); pointer-events: none; will-change: transform; contain: strict; }
@keyframes nx-gradient { from { transform: translate(-4%, -3%) scale(1.05); } to { transform: translate(4%, 3%) scale(1.18); } }

/* ----- Decoration: grain over the page, shapes behind it ------------------ */
body::before { content: ""; display: var(--decor-grain-display); position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
body::after { content: ""; display: var(--decor-shapes-display); position: fixed; inset: -20%; z-index: -1; pointer-events: none; background: var(--decor-shapes); filter: blur(60px); animation: var(--decor-anim); }
@keyframes nx-shapes { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(6%, -5%) rotate(8deg); } }
/* Blur is the expensive part: phones get a smaller, lighter layer. */
@media (max-width: 700px) { body::after { inset: -10%; filter: blur(32px); } body::before { opacity: .05; } }
.site-backdrop, body::before, body::after { contain: strict; }

/* ----- Marquee block -------------------------------------------------------- */
.marquee-block h2 { margin-bottom: .75rem; }
.marquee { overflow: hidden; padding: .6rem 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: nx-marquee 30s linear infinite; animation-play-state: var(--marquee-play); }
.marquee-slow .marquee-track { animation-duration: 55s; }
.marquee-fast .marquee-track { animation-duration: 15s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { padding: 0 1.6rem; font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 1.6rem; }
.marquee-track span::after { content: "·"; color: var(--accent); }
[dir="rtl"] .marquee-track { animation-direction: reverse; }
@keyframes nx-marquee { to { transform: translateX(-50%); } }

/* ----- Before and after ------------------------------------------------------ */
.compare { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--accent-soft); user-select: none; --pos: 50%; }
.compare img { display: block; width: 100%; height: auto; }
.compare img, .compare:hover img { transform: none; filter: none; box-shadow: none; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); pointer-events: none; }
.compare-handle::after { content: "\2039\00a0\203a"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #1c1c1a; font-size: 1.1rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); letter-spacing: -.05em; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: transparent; }
.compare-range::-webkit-slider-thumb { -webkit-appearance: none; width: 40px; height: 100%; }
.compare-range::-moz-range-thumb { width: 40px; height: 100%; border: 0; }
.compare-range:focus-visible + .compare-handle::after, .compare:focus-within .compare-handle::after { outline: 3px solid var(--accent); outline-offset: 2px; }
.compare-label { position: absolute; top: .8rem; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.45); padding: .25rem .6rem; border-radius: 999px; pointer-events: none; }
.compare-label.is-before { left: .8rem; } .compare-label.is-after { right: .8rem; }
.compare-vertical .compare-before { clip-path: inset(0 0 calc(100% - var(--pos)) 0); }
.compare-vertical .compare-handle { top: var(--pos); bottom: auto; left: 0; right: 0; width: auto; height: 2px; margin: -1px 0 0; }
.compare-vertical .compare-handle::after { content: "\02c4\00a0\02c5"; letter-spacing: 0; }
.compare-vertical .compare-range { cursor: ns-resize; }
.compare-vertical .compare-label.is-after { right: auto; left: .8rem; top: auto; bottom: .8rem; }
.compare.sweeping { transition: --pos 0s; }
.compare-block .caption { margin-top: .6rem; }

/* ----- Filmstrip controls and reading progress ------------------------------ */
.gal-strip-wrap { position: relative; }
.gal-dots { display: flex; justify-content: center; gap: .45rem; margin: .2rem 0 0; }
.gal-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: transform .2s, background .2s; }
.gal-dots button.active { background: var(--accent); transform: scale(1.35); }
.gal-arrow { position: absolute; top: 40%; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; font-size: 1.3rem; line-height: 1; opacity: 0; transition: opacity .2s; }
.gal-strip-wrap:hover .gal-arrow, .gal-arrow:focus-visible { opacity: 1; }
.gal-arrow.prev { left: max(.75rem, calc(50vw - var(--max) / 2)); } .gal-arrow.next { right: max(.75rem, calc(50vw - var(--max) / 2)); }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; pointer-events: none; transition: width .1s linear; }
[dir="rtl"] .read-progress { left: auto; right: 0; }

/* ----- Loading and feedback ---------------------------------------------- */
.curtain { display: var(--curtain-display); position: fixed; inset: 0; z-index: 1200; background: var(--curtain-bg); pointer-events: none; animation: var(--curtain-anim) .9s cubic-bezier(.7,0,.2,1) .25s both; }
html.visited .curtain, html.motion-off .curtain, body.preview-mode .curtain { display: none; }
@keyframes nx-curtain-lift { from { transform: translateY(0); } to { transform: translateY(-101%); } }
@keyframes nx-curtain-fade { from { opacity: 1; } to { opacity: 0; } }
.button.is-sending { position: relative; color: transparent !important; pointer-events: none; }
.button.is-sending::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1.1em; height: 1.1em; margin: -.55em 0 0 -.55em; border: 2px solid var(--on-accent); border-right-color: transparent; border-radius: 50%; animation: nx-spin .7s linear infinite; }
.button-outline.is-sending::before { border-color: var(--text); border-right-color: transparent; }
@keyframes nx-spin { to { transform: rotate(360deg); } }
.form-success { display: flex; align-items: center; gap: .6rem; animation: nx-rise var(--motion-time) cubic-bezier(.2,.7,.2,1) both; }
.form-success .tick { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--accent); position: relative; }
.form-success .tick::after { content: ""; position: absolute; left: .42rem; top: .2rem; width: .3rem; height: .6rem; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); animation: nx-tick .35s .3s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes nx-tick { to { transform: rotate(45deg) scale(1); } }
/* A pulse of opacity (composited) over a soft gradient while a lazy picture loads. */
main img[loading="lazy"]:not(.is-loaded) { background: linear-gradient(110deg, var(--accent-soft), var(--surface) 55%, var(--accent-soft)); animation: nx-pulse calc(var(--motion-time) * 1.8) ease-in-out infinite; }
@keyframes nx-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.to-top { position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 800; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.2); cursor: pointer; font-size: 1.2rem; line-height: 1; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
[dir="rtl"] .to-top { left: auto; right: 1.25rem; }
.card.tilting { transition: none; transform-style: preserve-3d; }
.button.magnet { transition: transform .12s ease-out, box-shadow calc(var(--motion-time) * .35) ease; }

/* ----- Page transitions ----------------------------------------------------
   Cross-document view transitions; every site page opts in and the theme
   variables pick the animation (a 0s duration is "none"). Browsers without
   the API simply load the next page. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: var(--vt-out) var(--vt-time) ease both; }
::view-transition-new(root) { animation: var(--vt-in) var(--vt-time) ease both; }
@keyframes nx-vt-fade-out { to { opacity: 0; } }
@keyframes nx-vt-fade-in { from { opacity: 0; } }
@keyframes nx-vt-slide-out { to { opacity: 0; transform: translateX(-3%); } }
@keyframes nx-vt-slide-in { from { opacity: 0; transform: translateX(3%); } }
[dir="rtl"] ::view-transition-old(root) { animation-name: var(--vt-out); }

/* ----- Motion -------------------------------------------------------------
   Pictures react to hover through the theme's variables; static/js/motion.js
   reveals blocks, cards, tiles and paragraphs as they scroll into view with
   the keyframes the theme names (a block can name its own with .rv-*), and
   --motion-scale / --motion-time set how far and how long. Reduced motion,
   and the builder's live preview, turn reveals off. */
main img { transition: transform calc(var(--motion-time) * .6) cubic-bezier(.2,.7,.2,1), filter calc(var(--motion-time) * .6) ease, box-shadow calc(var(--motion-time) * .6) ease; filter: var(--img-rest); }
:is(.card, .gal a, .featured-card, .ld-tile, .ld-collage-card, .block-image, .media-text):hover img, main img:hover {
  transform: var(--img-hover-transform); filter: var(--img-hover-filter); box-shadow: var(--img-hover-shadow);
}
.rv-none { --reveal-anim: none; } .rv-fade { --reveal-anim: nx-fade; } .rv-rise { --reveal-anim: nx-rise; }
.rv-zoom { --reveal-anim: nx-zoom; } .rv-blur { --reveal-anim: nx-blur; } .rv-slide { --reveal-anim: nx-slide; }
.reveal { opacity: 0; }
.reveal.is-in { animation: var(--reveal-anim) var(--motion-time) cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--stagger, 0ms) + var(--reveal-delay, 0s)); }
.dl-1 { --reveal-delay: .15s; } .dl-2 { --reveal-delay: .3s; } .dl-3 { --reveal-delay: .45s; } .dl-4 { --reveal-delay: .6s; }
.rv-wipe { --reveal-anim: nx-wipe; } .rv-unveil { --reveal-anim: nx-unveil; }
/* Per-block hover, scaled by --motion-on so "Off" still wins. */
.hv-none { --img-hover-transform: none; --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none; --card-hover-transform: none; --card-hover-shadow: none; }
.hv-zoom { --img-hover-transform: scale(calc(1 + .05 * var(--motion-on))); --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none; }
.hv-lift { --img-hover-transform: translateY(calc(-4px * var(--motion-on))); --img-hover-shadow: 0 16px 32px rgba(0,0,0,calc(.18 * var(--motion-on))); --img-hover-filter: none; --img-rest: none; }
.hv-glow { --img-hover-filter: brightness(calc(1 + .08 * var(--motion-on))) saturate(calc(1 + .15 * var(--motion-on))); --img-hover-transform: none; --img-hover-shadow: none; --img-rest: none; }
.hv-colour { --img-rest: grayscale(var(--motion-on)); --img-hover-filter: grayscale(0); --img-hover-transform: none; --img-hover-shadow: none; }
.hv-tilt { --img-hover-transform: perspective(800px) rotateX(calc(2deg * var(--motion-on))) rotateY(calc(-3deg * var(--motion-on))) scale(calc(1 + .02 * var(--motion-on))); --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none; }
/* Pin the picture of an Image and text block while its text scrolls. */
.pin-image .media-text { align-items: start; }
.pin-image .media-text img { position: sticky; top: 1.25rem; }
body.scrolled .pin-image .media-text img { top: 4.5rem; }
.reveal.done { opacity: 1; animation: none; }
@keyframes nx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nx-rise { from { opacity: 0; transform: translateY(calc(28px * var(--motion-scale))); } to { opacity: 1; transform: none; } }
@keyframes nx-zoom { from { opacity: 0; transform: scale(calc(1 - .08 * var(--motion-scale))); } to { opacity: 1; transform: none; } }
@keyframes nx-blur { from { opacity: 0; filter: blur(calc(14px * var(--motion-scale))); } to { opacity: 1; filter: var(--img-rest, none); } }
@keyframes nx-slide { from { opacity: 0; transform: translateX(calc(-32px * var(--motion-scale))); } to { opacity: 1; transform: none; } }
@keyframes nx-wipe { from { opacity: 1; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes nx-unveil { from { opacity: 1; clip-path: inset(100% 0 0 0); transform: translateY(calc(12px * var(--motion-scale))); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
[dir="rtl"] .rv-wipe .reveal.is-in, [dir="rtl"] .reveal.is-in.rv-wipe { animation-name: nx-wipe-rtl; }
@keyframes nx-wipe-rtl { from { opacity: 1; clip-path: inset(0 0 0 100%); } to { opacity: 1; clip-path: inset(0); } }
@keyframes nx-menu { from { opacity: 0; transform: translateX(calc(16px * var(--motion-scale))); } to { opacity: 1; transform: none; } }
[dir="rtl"] .reveal.is-in { animation-name: var(--reveal-anim); }
body.preview-mode .reveal, body.preview-mode .reveal.is-in { opacity: 1; animation: none; }
body.preview-mode.replaying .reveal { opacity: 0; }
body.preview-mode.replaying .reveal.is-in { animation: var(--reveal-anim) var(--motion-time) cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--stagger, 0ms) + var(--reveal-delay, 0s)); }
.dl-1 { --reveal-delay: .15s; } .dl-2 { --reveal-delay: .3s; } .dl-3 { --reveal-delay: .45s; } .dl-4 { --reveal-delay: .6s; }
.rv-wipe { --reveal-anim: nx-wipe; } .rv-unveil { --reveal-anim: nx-unveil; }
/* Per-block hover, scaled by --motion-on so "Off" still wins. */
.hv-none { --img-hover-transform: none; --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none; --card-hover-transform: none; --card-hover-shadow: none; }
.hv-zoom { --img-hover-transform: scale(calc(1 + .05 * var(--motion-on))); --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none; }
.hv-lift { --img-hover-transform: translateY(calc(-4px * var(--motion-on))); --img-hover-shadow: 0 16px 32px rgba(0,0,0,calc(.18 * var(--motion-on))); --img-hover-filter: none; --img-rest: none; }
.hv-glow { --img-hover-filter: brightness(calc(1 + .08 * var(--motion-on))) saturate(calc(1 + .15 * var(--motion-on))); --img-hover-transform: none; --img-hover-shadow: none; --img-rest: none; }
.hv-colour { --img-rest: grayscale(var(--motion-on)); --img-hover-filter: grayscale(0); --img-hover-transform: none; --img-hover-shadow: none; }
.hv-tilt { --img-hover-transform: perspective(800px) rotateX(calc(2deg * var(--motion-on))) rotateY(calc(-3deg * var(--motion-on))) scale(calc(1 + .02 * var(--motion-on))); --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none; }
/* Pin the picture of an Image and text block while its text scrolls. */
.pin-image .media-text { align-items: start; }
.pin-image .media-text img { position: sticky; top: 1.25rem; }
body.scrolled .pin-image .media-text img { top: 4.5rem; }
body.preview-mode.replaying .reveal.done { opacity: 1; animation: none; }
/* An editor's quick "motion off" (html.motion-off, from the Edit menu) and
   the lite mode for modest devices. */
html.motion-off { --reveal-anim: none; --motion-scale: 0; --motion-on: 0; --btn-magnetic: 0; --card-tilt: 0; --gradient-display: none; --body-bg: var(--page-bg); scroll-behavior: auto; --img-hover-transform: none; --img-hover-filter: none; --img-hover-shadow: none; --img-rest: none;
  --btn-hover-transform: none; --btn-hover-shadow: none; --btn-press: none; --card-hover-transform: none; --card-hover-shadow: none;
  --backdrop-anim: none; --parallax: 0; --page-bg-anim: none; --decor-anim: none; --marquee-play: paused; --vt-time: 0s; }
html.motion-off .reveal { opacity: 1; animation: none; }
body.lite .site-backdrop img, body.lite::after { animation: none; }
body.lite::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .site-backdrop img, body, body::after, .site-gradient, .marquee-track, .hero-word, main img[loading="lazy"] { animation: none; }
  html { scroll-behavior: auto; }
  .curtain { display: none; }
  .site-backdrop video { display: none; }
  .marquee-track { transform: none; }
  .reveal, .reveal.is-in { opacity: 1; animation: none; }
  main img, .button, .card, .site-header nav a, .prose a { transition: none; }
  :is(.card, .gal a, .featured-card, .ld-tile, .ld-collage-card, .block-image, .media-text):hover img, main img:hover, .button:hover, .card:hover, .featured-card:hover { transform: none; box-shadow: none; }
  body.menu-open .site-menu nav a { animation: none; }
}

/* ----- Landing page: motion demos ----------------------------------------- */
.ld-demos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ld-demo { display: grid; gap: .4rem; align-content: start; }
.ld-demo h3 { margin: .6rem 0 0; font-size: 1.05rem; }
.ld-demo > p { margin: 0; font-size: .92rem; }
.ld-demo-stage { position: relative; height: 150px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; }
.ld-demo-card { width: 60%; padding: .9rem; background: var(--surface); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.08); display: grid; gap: .45rem; }
.ld-demo-card span { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.ld-demo-card span.short { width: 55%; }
.ld-demo-rise { animation: nx-demo-rise 3.2s cubic-bezier(.2,.7,.2,1) infinite; }
@keyframes nx-demo-rise { 0% { opacity: 0; transform: translateY(28px); } 28%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(28px); } }
.ld-demo-hover img { width: 100%; height: 100%; object-fit: cover; }
.ld-demo-hover em { position: absolute; right: .6rem; bottom: .5rem; font-style: normal; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.ld-demo-words strong { font-size: 1.4rem; letter-spacing: -.01em; }
.ld-demo-stage .marquee { width: 100%; }
@media (prefers-reduced-motion: reduce) { .ld-demo-rise { animation: none; } }

/* ----- Landing page: plans ---------------------------------------------- */
.ld-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: stretch; }
.ld-plan { position: relative; display: grid; gap: .6rem; align-content: start; padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ld-plan.is-highlighted { border: 2px solid var(--accent); box-shadow: 0 20px 50px rgba(0,0,0,.08); }
.ld-plan h3 { margin: 0; font-size: 1.25rem; }
.ld-plan > p { margin: 0; }
.ld-plan-badge { position: absolute; top: -.75rem; left: 1.5rem; background: var(--accent); color: var(--on-accent); font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px; }
.ld-plan-price { font-size: 2rem; line-height: 1; margin: .4rem 0 !important; }
.ld-plan-price span { font-size: .8rem; color: var(--muted); }
.ld-plan ul { margin: 0 0 .8rem; padding: 0; list-style: none; display: grid; gap: .4rem; font-size: .92rem; }
.ld-plan li::before { content: "✓"; font-weight: 700; margin-right: .5rem; color: var(--accent); }
.ld-plan .button { margin-top: auto; justify-self: start; }
