/* Layout and components. Colours come only from themes.css variables. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
p { margin: 0 0 1em; text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { width: min(76rem, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(46rem, 100% - 2.5rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: .75rem; top: .75rem; z-index: 60; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: 8px; font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- header (sticky, compacts on scroll) ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom-color: var(--border); box-shadow: 0 12px 30px -26px var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.75rem; transition: min-height .3s; }
.is-scrolled .header-row { min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; font: 650 1.15rem/1 var(--font-display); letter-spacing: -.01em; }
.brand img { border-radius: 10px; }
.menu { display: flex; align-items: center; gap: 2rem; margin-left: auto; }
.nav { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding-block: .4rem; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .28s, color .2s; }
.nav a:hover, .nav a[aria-current] { color: var(--text); background-size: 100% 2px; }
.menu-toggle { display: none; margin-left: auto; width: 2.75rem; height: 2.75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; margin-inline: auto; position: relative; transition: transform .25s, background-color .25s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Knotra sub-navigation */
.subnav { border-block: 1px solid var(--border); background: var(--bg-alt); }
.subnav-row { display: flex; align-items: center; gap: 1.5rem; min-height: 3.25rem; overflow-x: auto; scrollbar-width: none; }
.subnav-brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 600; flex: none; padding-right: 1.5rem; border-right: 1px solid var(--border); }
.subnav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; flex: none; }
.subnav ul a { display: block; color: var(--muted); text-decoration: none; font-size: .95rem; white-space: nowrap; padding-block: .9rem; box-shadow: inset 0 -2px 0 transparent; }
.subnav ul a:hover { color: var(--text); }
.subnav ul a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- buttons and links ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 3rem; padding: .8rem 1.35rem;
  border-radius: 12px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap; transition: filter .2s, background-color .2s, border-color .2s;
}
.button:hover { filter: brightness(1.1); text-decoration: none; }
.button.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.button.ghost:hover { background: var(--surface-hover); border-color: var(--accent); filter: none; }
.button.small { min-height: 2.5rem; padding: .5rem 1.05rem; font-size: .95rem; }
.button.wide { width: 100%; min-height: 3.5rem; font-size: 1.05rem; }
.arrow { flex: none; transition: transform .28s cubic-bezier(.22,.61,.36,1); }
.button:hover .arrow, .link-arrow:hover .arrow, .card:hover .card-link .arrow { transform: translateX(4px); }
.link-arrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; text-decoration: none; color: var(--text); }
.link-arrow:hover { color: var(--accent); }

/* ---------- sections ---------- */
section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.eyebrow { display: block; font: 650 .75rem/1.4 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: .9rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 3rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin: 0; }
.section-head p { max-width: 30rem; color: var(--muted); margin: 0; }
.grad { background: linear-gradient(90deg, var(--grad-1), var(--grad-2) 50%, var(--grad-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--muted); }
.muted { color: var(--muted); }

/* pills (product path chips) */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.75rem; }
.pills li, .pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; color: var(--muted); }
.pills a { color: inherit; text-decoration: none; }
.pills a:hover { color: var(--text); }
.dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 10px var(--accent2); }
.dot.soon::before { background: var(--muted); box-shadow: none; }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; color: var(--text); padding-block: clamp(3.5rem, 7vw, 6rem) clamp(4rem, 8vw, 6.5rem);
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-mid) 50%, var(--hero-to) 100%); }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; }
.hero::before { width: 60rem; height: 44rem; left: -24rem; top: -20rem; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 45%, transparent), transparent); }
.hero::after { width: 52rem; height: 40rem; right: -20rem; bottom: -24rem; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent3) 26%, transparent), transparent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(3rem, 7.2vw, 5.6rem); line-height: .98; letter-spacing: -.035em; margin-bottom: .35em; }
.hero .tagline { font: 650 clamp(1.15rem, 1.8vw, 1.4rem)/1.35 var(--font-display); margin-bottom: .8rem; }
.hero p.lead { max-width: 36rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
@media (prefers-reduced-motion: no-preference) {
  .hero-grid > * { animation: rise .8s cubic-bezier(.22,.61,.36,1) both; }
  .hero-grid > *:nth-child(2) { animation-delay: .12s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* panel beside the hero text */
.panel { border-radius: 20px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); box-shadow: 0 40px 90px -40px var(--shadow); overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); font: .85rem/1 var(--font-mono); color: var(--muted); }
.panel-bar .lights { display: flex; gap: .35rem; margin-right: .4rem; }
.panel-bar .lights i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--border); }
.panel-bar .pill { margin-left: auto; font-family: var(--font-body); }
.panel-body { padding: 1.25rem; }
.panel-shot { border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.panel-app { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.panel-app img { border-radius: 14px; }
.panel-app strong { display: block; font: 650 1.25rem/1.2 var(--font-display); }
.panel-app span { color: var(--muted); font-size: .95rem; }
.panel .button.wide { margin-top: 1.1rem; }
.panel-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0 1.25rem 1.2rem; font-size: .9rem; }
.panel-links a { color: var(--muted); }
.panel-links a:hover { color: var(--text); }

/* ---------- cards ---------- */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: 18px; border: 1px solid var(--border); padding: 1.6rem;
  background: var(--surface); transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 20px 40px -28px var(--shadow); background: var(--surface-hover); }
.card h3 { font-size: 1.25rem; margin: 0 0 .45rem; }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }
.card .icon { width: 2.6rem; height: 2.6rem; border-radius: 11px; display: grid; place-items: center; margin-bottom: 1.1rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.card:nth-child(3n+2) .icon { color: var(--accent2); background: color-mix(in srgb, var(--accent2) 10%, transparent); border-color: color-mix(in srgb, var(--accent2) 22%, transparent); }
.card:nth-child(3n) .icon { color: var(--accent3); background: color-mix(in srgb, var(--accent3) 10%, transparent); border-color: color-mix(in srgb, var(--accent3) 22%, transparent); }
.card .icon svg { width: 1.3rem; height: 1.3rem; }
.card .tag { font-size: .8rem; font-weight: 650; color: var(--eyebrow); margin-bottom: .35rem; }
.card-foot { margin-top: auto; padding-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-link { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--text); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.card.big { padding: 2rem; min-height: 21rem; }
.card.big h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.card.soon { border-style: dashed; background: transparent; }
.card.soon:hover { box-shadow: none; border-color: var(--border); }
.card-logo { width: 4rem; height: 4rem; border-radius: 16px; margin-bottom: 1.25rem; }
.list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .6rem; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.list li > span:first-child { font-weight: 600; }
.list .pill { font-size: .78rem; flex: none; }

/* split blocks */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.phone { border-radius: 30px; overflow: hidden; border: 1px solid var(--border); max-width: 18rem; justify-self: center; box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--accent3) 60%, transparent); }
.checks { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: grid; gap: .9rem; }
.checks li { padding-left: 2rem; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1.1rem; height: 1.1rem; border-radius: 6px; background: color-mix(in srgb, var(--accent2) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent2) 55%, transparent); }
.checks li::after { content: ""; position: absolute; left: .38rem; top: .48em; width: .3rem; height: .55rem; border: solid var(--accent2); border-width: 0 2px 2px 0; transform: rotate(45deg); }
code { font-family: var(--font-mono); font-size: .9em; background: var(--surface); border: 1px solid var(--border); padding: .05em .35em; border-radius: 6px; overflow-wrap: anywhere; }

/* community */
.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.social { display: flex; flex-direction: column; gap: .4rem; padding: 1.4rem 1.5rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); transition: border-color .25s, background-color .25s; }
a.social:hover { border-color: var(--accent); background: var(--surface-hover); }
.social-name { font: 650 1.2rem/1.2 var(--font-display); }
.social-action { display: inline-flex; align-items: center; gap: .45rem; color: var(--accent); font-weight: 600; font-size: .95rem; }
.social.is-soon { border-style: dashed; background: transparent; }
.social.is-soon .social-action { color: var(--muted); font-weight: 500; }
.hero .social { min-width: 16rem; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem 4rem; align-items: center; }
.contact h2 { font-size: clamp(2rem, 4vw, 3rem); }
.mail { font: 650 clamp(1.3rem, 3.4vw, 2.2rem)/1.15 var(--font-display); color: var(--text); text-decoration: none; overflow-wrap: anywhere; background-image: linear-gradient(90deg, var(--grad-1), var(--grad-3)); background-size: 100% 2px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: .2rem; }
.mail:hover { background-size: 100% 3px; }

/* ---------- page heads and long-form pages ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(3rem, 6vw, 4.5rem); }
.page-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -.03em; }
.page-head .lead { max-width: 42rem; margin: 0; }
.doc-head { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(2.5rem, 6vw, 4.5rem) 2rem; }
.doc-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.doc-head .meta { color: var(--muted); font-size: .95rem; margin: 0; }
.aurora { position: relative; isolation: isolate; }
.aurora::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 90% at 0% 0%, color-mix(in srgb, var(--glow) 20%, transparent), transparent 70%), radial-gradient(45% 80% at 100% 100%, color-mix(in srgb, var(--accent3) 16%, transparent), transparent 70%); }
.prose { padding-block: 0 clamp(3rem, 7vw, 5rem); }
.prose h2 { font-size: 1.45rem; margin-top: 2.25em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.12rem; margin-top: 1.6em; letter-spacing: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }
.toc { border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.35rem; background: var(--surface); margin-bottom: 2rem; }
.toc ol { margin: .5rem 0 0; columns: 2 15rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin-bottom: .2em; }
.note { border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent); padding: 1rem 1.25rem; background: color-mix(in srgb, var(--accent2) 7%, transparent); border-radius: 14px; margin: 0 0 1.75rem; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.9rem; margin-bottom: 1rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; margin: 1rem 0 1.5rem; }
.compare { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 36rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: .8rem .9rem; border-bottom: 1px solid var(--border); }
.compare tr:last-child > * { border-bottom: 0; }
.compare thead th { color: var(--muted); font-size: .85rem; font-weight: 600; background: var(--surface); }
.compare tbody th { font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-top: 3.5rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.footer-brand p { color: var(--muted); max-width: 24rem; margin-top: 1rem; }
.site-footer h2 { font: 650 .75rem/1.4 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); }
.footer-base { border-top: 1px solid var(--border); margin-top: 3rem; padding-block: 1.4rem; color: var(--muted); font-size: .875rem; }
.footer-base p { margin: 0; }
.error-page { min-height: 60vh; display: grid; align-content: center; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .split, .contact { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .phone { justify-self: start; }
}
@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 1rem; padding: 1rem 1.25rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--border); margin: 0; }
  .menu.is-open { display: flex; }
  .nav { flex-direction: column; gap: 0; }
  .nav a { display: block; padding: .85rem 0; border-bottom: 1px solid var(--border); background-image: none; }
  .nav a[aria-current] { color: var(--accent); }
  .menu .button { width: 100%; }
  .cards, .cards.two { grid-template-columns: 1fr; }
  .card.big { min-height: 0; }
  .hero h1 { font-size: clamp(2.6rem, 12.5vw, 3.6rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
  .subnav-row, .subnav ul { gap: 1rem; }
  .subnav-brand { padding-right: 1rem; }
  .subnav-brand span { display: none; }
}
.card-logo-sm .icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0; border-radius: 14px; color: var(--accent2); background: color-mix(in srgb, var(--accent2) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent2) 30%, transparent); }
.card-logo-sm .icon svg { width: 1.6rem; height: 1.6rem; }
.panel .social { min-width: 0; }
