/* 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");

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 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: 1.2; }
h1, h2 { font-family: var(--font-title); text-wrap: balance; font-weight: var(--weight-strong); }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1.15rem; }
: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 {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  padding: .7rem 1.5rem;
}
.header-inner { max-width: 76rem; margin: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg-heading); text-decoration: none; }
.brand-logo { width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--action-bg); color: var(--on-action); border-radius: var(--radius-sm); font-family: var(--font-title); font-size: 1.4rem; }
.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); }
.site-nav { display: flex; flex-wrap: wrap; flex: 1; gap: .2rem 1rem; font-size: var(--text-control); }
.site-nav a { color: var(--muted); text-decoration: none; padding: .45rem 0; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.theme-btn { margin-left: auto; }

/* --- Layout ----------------------------------------------------------- */
main { max-width: 76rem; margin: auto; padding: 0 1.5rem 3rem; }
.section { padding: 3rem 0; border-top: 1px solid var(--line); }
.section-head { max-width: 52rem; }
.section-head p { max-width: 72ch; }
.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: 1.5; color: var(--fg); }
.hero-copy > p { max-width: 62ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.7rem 0 1.1rem; }
.hero-note, .release-note, .license-note, .capture-note { color: var(--muted); font-size: var(--text-control); }
.license-note { border-left: 2px solid var(--line-strong); padding-left: 1rem; }
.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;
}
.frame-bar { display: flex; gap: .4rem; padding: .6rem .85rem; border-bottom: 1px solid var(--line); background: var(--bg-subtle); }
.frame-bar i { display: block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--line-strong); opacity: .7; }
.frame img, .frame video { display: block; width: 100%; height: auto; max-height: 34rem; object-fit: contain; object-position: top center; background: var(--surface); }
.frame figcaption { padding: .7rem .2rem 0; color: var(--muted); font-size: var(--text-small); }
.feature-media a.still-only { display: none; }

/* --- 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: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.2rem; display: grid; gap: .35rem; align-content: start; }
.tile .tile-icon { font-size: 1.35rem; line-height: 1; }
.tile h3 { margin: 0; font-size: var(--text-section-title); }
.tile p { margin: 0; color: var(--muted); font-size: var(--text-small); line-height: 1.5; }

.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: .2rem 0 0; color: var(--muted); font-size: var(--text-small); line-height: 1.5; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; margin-top: 1.5rem; }
.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); line-height: 1.35; }
.card p { margin: 0; color: var(--muted); font-size: var(--text-small); line-height: 1.5; }
.card a { margin-top: auto; padding-top: .3rem; }

.whats-new {
  margin: 1.6rem 0 0;
  padding: .9rem 1.1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-light);
  font-size: var(--text-control);
}
.whats-new p { margin: 0; }

/* --- 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); }
.feature-copy { max-width: 42ch; }
.feature-copy > a { display: inline-block; padding: .25rem 0; }
.feature-copy code { overflow-wrap: anywhere; }

/* --- Editorial content (guides, blog, legal) -------------------------- */
code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-subtle); padding: .1rem .25rem; border-radius: var(--radius-xs); }
pre { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; font: var(--text-control)/1.65 var(--font-mono); overflow-x: auto; }
pre code { 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-width: 54rem; padding-top: 2rem; }
.guide h1 { font-size: clamp(2rem, 5vw, 3rem); }
.guide h2 { margin-top: 2.6rem; }
.guide p, .guide li { max-width: 72ch; line-height: 1.75; }
.guide li { margin-bottom: .55rem; }
.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; }
.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; }
.guide table { width: 100%; min-width: 44rem; table-layout: fixed; }
.guide td, .guide th { 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; max-width: 100%; }
figure.walkthrough video, figure.walkthrough img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface, #fff); }
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, .site-nav a { 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; }
  .feature-copy { max-width: 65ch; }
}
@media (max-width: 480px) {
  main { padding-inline: 1rem; }
  .site-header { padding-inline: 1rem; }
  .header-inner { gap: .5rem .9rem; }
  .site-nav { order: 3; flex-basis: 100%; gap: 0 1.2rem; }
  .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; }
  .feature-media video { display: none; }
  .feature-media a.still-only { display: block; }
}
