/* Lixity documentation site: presentation layer on the shared app components.
   The canonical design-tokens.css and components.css come from the packaged
   assets (scripts/stage_pages.py stages them); this file adds only the
   site-specific layout and editorial styles. */
@import url("./design-tokens.css");
@import url("./components.css");

/* Public navigation start */
.site-page {
  --site-width: 76rem;
  --site-gutter: var(--space-5);
  padding-block-end: 4.5rem;
}
.site-return, .site-breadcrumbs {
  max-inline-size: var(--site-width);
  margin: 0 auto;
  padding: var(--space-2) var(--site-gutter);
  color: var(--muted);
  font: var(--text-control)/var(--line-compact) var(--font);
}
.site-return { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--panel-padding); }
.site-return a { display: inline-flex; align-items: center; min-height: 2.25rem; color: var(--accent); text-underline-offset: .18em; }
.site-return a[aria-current] { color: var(--fg); font-weight: var(--weight-bold); text-decoration-thickness: 2px; }
.site-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); list-style: none; margin: 0; padding: 0; }
.site-breadcrumbs li { display: inline; margin: 0; overflow-wrap: anywhere; }
.site-breadcrumbs li + li::before { content: "/"; margin-inline-end: var(--space-2); color: var(--muted); }
.site-breadcrumbs a { color: var(--accent); text-underline-offset: .18em; }
.site-back-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--accent);
  font: var(--weight-semibold) var(--text-control)/var(--line-compact) var(--font);
  text-decoration: none;
  box-shadow: 0 2px 10px rgb(0 0 0 / .12);
}
.site-return a:focus-visible, .site-breadcrumbs a:focus-visible, .site-back-top:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .site-page { padding-block-end: 0; }
  .site-back-top {
    position: static;
    display: flex;
    width: max-content;
    margin: .75rem max(1rem, env(safe-area-inset-right)) 1rem auto;
  }
}
@media (max-width: 480px) {
  .site-page { --site-gutter: var(--space-4); }
  .site-return { column-gap: var(--space-4); }
  .site-back-top { right: max(.75rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .site-page { scroll-behavior: auto; }
  .site-back-top { transition: none; }
}
/* Public navigation end */

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--text-body)/var(--line-reading) var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
p, li, figcaption { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--fg-heading); line-height: var(--line-heading); hyphens: auto; }
h1, h2 { font-family: var(--font-title); text-wrap: balance; font-weight: var(--weight-strong); }
h2 { font-size: var(--text-heading); margin-block: 0 var(--space-4); }
h3 { font-size: var(--text-subhead); }
p { margin-block: 0 var(--space-4); }
:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
section[id], article[id] { scroll-margin-top: 4rem; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 1000; background: var(--surface); padding: 1rem; }

/* --- Header ----------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  padding: var(--space-2) var(--site-gutter);
}
.header-inner { max-inline-size: var(--site-width); margin: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg-heading); text-decoration: none; }
.brand-name { font-size: 1.25rem; font-weight: var(--weight-strong); }
.brand-badge { padding: .12rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--muted); font-size: var(--text-micro); }
.header-inner .site-return { flex: 1; margin: 0; padding: 0; }
.theme-btn { margin-left: auto; }

/* --- Layout ----------------------------------------------------------- */
main { max-inline-size: var(--site-width); margin: auto; padding: 0 var(--site-gutter) 3rem; }
.section { padding: 3rem 0; border-top: 1px solid var(--line); }
.section-note { color: var(--muted); font-size: var(--text-small); }

/* --- Hero ------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem 3rem;
  align-items: center;
  padding: 3.5rem 0 2rem;
}
.hero-copy { max-width: 42rem; }
.hero-title { margin: 0 0 1.2rem; font-size: clamp(2.4rem, 4.6vw, 3.6rem); letter-spacing: -.025em; line-height: 1.06; }
.hero-sub { font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: var(--line-compact); color: var(--fg); }
.hero-copy > p { max-width: 62ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 1.7rem 0 1.1rem; }
.release-note { color: var(--muted); font-size: var(--text-control); }
.release-note { margin-top: 1.2rem; }

/* --- App window frame ------------------------------------------------- */
.frame { min-width: 0; width: 100%; margin: 0; }
.frame-window {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.hero .frame { max-width: 40rem; justify-self: center; }
.hero .frame-window img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(28rem, 70vh); margin-inline: auto; object-fit: contain; }
.frame figcaption { padding: .7rem .2rem 0; color: var(--muted); font-size: var(--text-small); }

.showcase .hero-title { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.showcase .section { padding: 2.5rem 0; }
.workflow-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.workflow-list h3 { margin: .5rem 0; }
.workflow-list p { max-width: 45ch; }
.workflow-list blockquote { margin-block: var(--space-3); padding-inline-start: var(--space-3); border-inline-start: 2px solid var(--line-strong); font-family: var(--font-title); font-size: var(--text-subhead); }
.command-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.command-list article { display: grid; grid-template-rows: subgrid; grid-row: span 4; min-width: 0; }
.command-list h3 { margin: .5rem 0; }
.command-list pre { margin: .5rem 0 1rem; }
.resource-list > p { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; }
.showcase footer details { padding: .75rem 0; }
.showcase footer summary { min-height: 2.75rem; align-content: center; }
.showcase footer address { margin-top: .75rem; }
.showcase footer nav { margin-top: 1.25rem; }
@media (max-width: 700px) {
  .workflow-list { grid-template-columns: 1fr; gap: .5rem; }
  .command-list { grid-template-columns: 1fr; gap: 1rem; }
  .resource-list > p { grid-template-columns: 1fr; gap: .2rem; }
}

/* --- Pillars, steps, cards -------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; margin: 1.6rem 0 0; }
.tile { border-top: 2px solid var(--line); padding: 1rem 0; display: grid; gap: .5rem; align-content: start; }
.tile h3 { margin: 0; font-size: var(--text-section-title); }
:is(.tile, .steps, .card) p { margin: 0; color: var(--muted); font-size: var(--text-small); line-height: var(--line-compact); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.4rem; margin: 1.6rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding-left: 2.7rem; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: .1rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--action-bg);
  color: var(--on-action);
  display: grid;
  place-items: center;
  font-weight: var(--weight-strong);
  font-size: var(--text-small);
}
.steps strong { display: block; color: var(--fg-heading); }
.steps p { margin-block-start: var(--space-1); }

.card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem 1.2rem;
}
.card h3 { margin: 0; font-size: var(--text-section-title); }
.card a { margin-top: auto; padding-top: .3rem; }
#examples .card { max-inline-size: var(--measure-reading); }
#examples .card p { font-size: var(--text-body); line-height: var(--line-reading); }

/* --- Feature blocks --------------------------------------------------- */
.feature { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 3rem; align-items: center; padding: 3rem 0; border-top: 1px solid var(--line); }

/* --- Editorial content (guides, blog, legal) -------------------------- */
code { font-family: var(--font-mono); font-size: .875em; background: var(--bg-subtle); padding: .1rem .25rem; border-radius: var(--radius-xs); }
pre { min-inline-size: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--panel-padding); font: var(--text-control)/var(--line-reading) var(--font-mono); overflow-x: auto; }
pre code { font-size: inherit; padding: 0; background: none; }
details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
details:last-of-type { border-bottom: 0; }
summary { cursor: pointer; font-weight: var(--weight-semibold); color: var(--fg-heading); }
details p { margin: 1rem 0 0; }
address { font-style: normal; }
footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-small); }
footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }

.guide { max-inline-size: 54rem; padding-block-start: var(--space-5); }
.guide > .site-breadcrumbs { padding: 0 0 var(--space-3); }
.guide h1 { font-size: var(--text-display); }
.guide > h1 { margin-block: var(--space-3) var(--space-4); }
.install-heading { display: flex; align-items: center; gap: clamp(.5rem, 3vw, 1rem); margin-block: var(--space-3) var(--space-4); }
.install-heading h1 { margin: 0; min-inline-size: 0; overflow-wrap: anywhere; }
.guide .install-heading img { flex: none; inline-size: clamp(2.5rem, 8vw, 4rem); block-size: auto; }
@media (max-width: 34rem) { .install-heading h1 { font-size: clamp(1.8rem, 7vw, var(--text-display)); } }
.guide h2 { margin-block-start: calc(2 * var(--panel-padding)); }
.install-platforms { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.desktop-download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--space-3); }
.desktop-download-card { display: flex; flex-direction: column; gap: var(--space-3); min-inline-size: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.desktop-download-card :is(h3, p) { margin: 0; }
.desktop-download-card .desktop-platform-requirement { margin-block-start: calc(-1 * var(--space-2)); color: var(--muted); font-size: var(--text-small); }
.desktop-download-card p:last-child { margin-block-start: auto; }
.desktop-download-actions { display: grid; gap: var(--space-2); }
.desktop-download-actions .ctl { display: grid; justify-items: start; gap: var(--space-1); text-align: start; white-space: normal; }
.desktop-download-actions .ctl span { font-size: var(--text-small); font-weight: var(--weight-normal); }
#installer-check { margin-block: var(--space-4); }
#installer-check-file { display: block; max-inline-size: 100%; margin-block-start: var(--space-2); }
#installer-check-status:empty { margin: 0; }
.guide :is(p, li), .blog-index > :is(h2, ul, .notice-box) { max-inline-size: var(--measure-reading); }
.guide li { margin-block-end: var(--space-2); }
.guide code, .guide a { overflow-wrap: anywhere; }
.guide .updated { color: var(--muted); font-size: var(--text-small); }
.guide-nav { display: flex; flex-wrap: wrap; gap: .65rem 1.3rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.guide-nav a[aria-current="page"] { color: var(--fg-heading); font-weight: var(--weight-semibold); }
.guide-toc { margin: 1.5rem 0 2rem; }
.guide-toc ul { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; padding: 0; margin: .5rem 0 0; list-style: none; }
.guide-toc li { margin: 0; }

/* Article index: let the catalogue use the full reading width on wide screens. */
.blog-index { max-inline-size: var(--site-width); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; margin: 2.25rem 0 1rem; }
.blog-grid article { display: flex; flex-direction: column; padding: 1.35rem 1.45rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.blog-grid article > h2 { margin-block: 0 var(--space-2); font-size: clamp(1.2rem, 1.6vw, 1.5rem); }
.blog-grid article > h2 a { text-decoration: none; }
.blog-grid article > h2 a:hover { text-decoration: underline; text-underline-offset: .18em; }
.blog-grid .updated { margin: 0 0 .85rem; }
.blog-grid article > p:last-child { max-width: 60ch; margin: 0; color: var(--fg-secondary); }
.blog-grid .blog-featured { grid-column: 1 / -1; border-color: var(--accent-light); background: var(--accent-light); }
.blog-grid .blog-featured > h2 { max-width: 26ch; font-size: clamp(1.55rem, 2.2vw, 2rem); }
.notice-box { margin: 1.5rem 0; padding: 1rem 1.2rem; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--accent-light); line-height: var(--line-reading); }
.notice-box p:last-child { margin-bottom: 0; }
.analysis-mark-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.analysis-mark-key > div { padding-top: .85rem; border-top: 2px solid var(--line); }
.analysis-mark-key h3 { margin: 0; font-size: var(--text-section-title); font-weight: var(--weight-semibold); }
.analysis-mark-key p { margin: .6rem 0 0; }
.analysis-key-research { border-bottom: 1px dotted var(--fg-secondary); padding-block-end: .12em; }
.analysis-key-counted { text-decoration: underline solid var(--analysis-evidence-color) 2px; text-underline-offset: .2em; }
.analysis-key-direction { display: inline-block; padding-inline-start: .4rem; margin-inline-end: .4rem; border-inline-start: 3px solid var(--analysis-key-color); color: var(--analysis-key-color); }
.analysis-key-lower { --analysis-key-color: var(--accent); }
.analysis-key-higher { --analysis-key-color: var(--past); }
@media (max-width: 700px) {
  .analysis-mark-key { grid-template-columns: 1fr; gap: 1rem; }
}
.guide table { width: 100%; min-width: 44rem; table-layout: fixed; }
.guide table td, .guide table th { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.guide img { width: 100%; height: auto; border-radius: var(--radius); }
.feature-table-wrapper { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.feature-table-wrapper:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.editorial-table { border-collapse: collapse; font-size: var(--text-small); text-align: left; }
.editorial-table th, .editorial-table td { padding: .9rem; border-bottom: 1px solid var(--line); }
.editorial-table th { background: var(--surface); }
.editorial-table tr:last-child td { border-bottom: 0; }
.tech-metric { font-family: var(--font-mono); font-size: var(--text-small); color: var(--accent); }

figure.walkthrough { margin: 1.4rem 0; }
/* Product captures are previews; their linked originals retain the full UI. */
.frame, figure.walkthrough { max-width: 44rem; }
.frame :is(img, video), figure.walkthrough :is(img, video) {
  display: block; width: 100%; height: auto; max-width: 100%;
  max-height: min(28rem, 70vh); margin-inline: auto;
  object-fit: contain; object-position: top center; background: var(--surface);
}
figure.walkthrough :is(img, video) { border: 1px solid var(--line); border-radius: var(--radius); }
figure.walkthrough figcaption { margin-top: .5rem; color: var(--muted, #555); font-size: var(--text-small); }

/* --- Responsive ------------------------------------------------------- */
/* Touch targets keep the 44px minimum, exactly like the app controls. */
@media (pointer: coarse) {
  a.ctl, button.ctl, .ctl { min-height: 2.75rem; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 1.8rem; padding-top: 2.6rem; }
  .hero-copy { max-width: 65ch; }
  .feature { grid-template-columns: 1fr; gap: 1.5rem; padding: 2.2rem 0; }
}
@media (max-width: 480px) {
  .header-inner { gap: .5rem .9rem; }
  .header-inner .site-return { order: 3; flex-basis: 100%; }
  .theme-btn { margin-left: auto; }
  .brand-badge { font-size: var(--text-micro); }
  .hero-cta .ctl { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
