/* Isto Intents — shared styles for istointents.com and istointents.org.
   Colours come from the approved logo (brand/): green #0d4f31 (#3fb883 on dark), black #12181f. */

:root {
  --bg: #ffffff;
  --bg-soft: #f3f7f5;
  --bg-card: #ffffff;
  --text: #12181f;
  --muted: #4b5862;
  --brand: #0d4f31;
  --brand-text: #0d4f31;
  --brand-hover: #0a3d26;
  --on-brand: #ffffff;
  --accent-bg: #e6f2ec;
  --border: #dbe3df;
  --code-bg: #f3f7f5;
  --focus: #1f7a50;
  --warn-bg: #fff7e0;
  --warn-text: #5c4300;
  --tok-key: #0d4f31;
  --tok-str: #8a3b12;
  --tok-num: #1d4ed8;
  --tok-lit: #7c3aed;
  --shadow: 0 1px 2px rgba(18, 24, 31, .06), 0 4px 16px rgba(18, 24, 31, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1316; --bg-soft: #131c20; --bg-card: #151f24; --text: #e7eeeb; --muted: #a5b3ad;
    --brand: #3fb883; --brand-text: #5fcf9b; --brand-hover: #5fcf9b; --on-brand: #0d1316;
    --accent-bg: #10291e; --border: #26343a; --code-bg: #131c20; --focus: #7fe0b2;
    --warn-bg: #2d2610; --warn-text: #f3dc9a;
    --tok-key: #7fe0b2; --tok-str: #f0b38a; --tok-num: #93b8ff; --tok-lit: #c9a7ff;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1316; --bg-soft: #131c20; --bg-card: #151f24; --text: #e7eeeb; --muted: #a5b3ad;
  --brand: #3fb883; --brand-text: #5fcf9b; --brand-hover: #5fcf9b; --on-brand: #0d1316;
  --accent-bg: #10291e; --border: #26343a; --code-bg: #131c20; --focus: #7fe0b2;
  --warn-bg: #2d2610; --warn-text: #f3dc9a;
  --tok-key: #7fe0b2; --tok-str: #f0b38a; --tok-num: #93b8ff; --tok-lit: #c9a7ff;
  --shadow: none; color-scheme: dark;
}

/* Logo variants follow the active theme. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand-text); text-underline-offset: .18em; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -.02em; margin-top: .4em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
code, pre, kbd { font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .9em; }
:not(pre) > code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: .05em .35em; overflow-wrap: anywhere; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 1em 1.1em; overflow-x: auto; line-height: 1.5; font-size: .86rem; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-lit { color: var(--tok-lit); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--brand); color: var(--on-brand); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 1rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: .5rem 1.25rem; flex-wrap: wrap; min-height: 64px; padding-top: .5rem; padding-bottom: .5rem; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 30px; width: auto; }
.site-nav { display: flex; align-items: center; gap: .25rem 1.1rem; flex-wrap: wrap; margin-left: auto; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; padding: .3rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--brand-text); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .4em; }
.tools { display: flex; align-items: center; gap: .5rem; }
.lang { display: flex; gap: .15rem; font-size: .85rem; }
.lang a, .lang span { padding: .2rem .4rem; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 600; }
.lang [aria-current="true"] { background: var(--accent-bg); color: var(--brand-text); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--brand); }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .site-nav { margin-left: 0; order: 3; width: 100%; gap: .1rem 1rem; }
  .tools { margin-left: auto; }
  .brand img { height: 26px; }
}

/* Draft banner */
.draft { background: var(--warn-bg); color: var(--warn-text); font-size: .88rem; border-bottom: 1px solid var(--border); }
.draft .wrap { padding-top: .45rem; padding-bottom: .45rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.15rem; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid var(--brand); line-height: 1.2; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-ghost { color: var(--brand-text); background: transparent; }
.btn-ghost:hover { background: var(--accent-bg); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Product site sections */
.hero { padding: 3.5rem 0 3rem; background: linear-gradient(180deg, var(--accent-bg), var(--bg) 85%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--brand-text); margin: 0; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } .hero { padding: 2rem 0; } }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow); }
.intent-card .statement { font-size: 1.1rem; font-weight: 600; margin: .35rem 0 1rem; }
.intent-card dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; font-size: .93rem; }
.intent-card dt { color: var(--muted); }
.intent-card dd { margin: 0; font-weight: 500; }
.intent-card .sealed { display: inline-flex; align-items: center; gap: .35rem; }
.intent-card .note { font-size: .82rem; color: var(--muted); margin: 1rem 0 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: var(--accent-bg); color: var(--brand-text); }

.section { padding: 3.5rem 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section > .wrap > h2:first-child { margin-top: 0; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cols-2 { grid-template-columns: 1fr; } }
.card h3 { margin-top: 0; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .8rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .5em; width: .7rem; height: .4rem; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.ticks li:last-child { margin-bottom: 0; }
.planned { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: .05rem .45rem; margin-left: .25rem; white-space: nowrap; }
.planned.live { color: var(--brand-text); border-color: var(--brand); background: var(--accent-bg); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stats { grid-template-columns: 1fr; } }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; background: var(--bg-card); }
.stat b { display: block; font-size: 1.7rem; color: var(--brand-text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .9rem; color: var(--muted); }
.small { font-size: .88rem; color: var(--muted); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps > li { counter-increment: step; position: relative; padding: 1.1rem 1.2rem 1.1rem 4rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
.steps > li::before { content: counter(step); position: absolute; left: 1.1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; display: grid; place-items: center; }
.steps h3 { margin: .15rem 0 .35rem; }
.steps p { margin: 0; }

.roadmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .roadmap { grid-template-columns: 1fr; } }
.roadmap li { border-top: 3px solid var(--brand); padding-top: .8rem; }
.roadmap b { display: block; margin-bottom: .25rem; }

.table-wrap { overflow-x: auto; margin: 0 0 1.25em; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem .8rem; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

details.faq { border-bottom: 1px solid var(--border); padding: .9rem 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: .6rem 0 0; color: var(--muted); }

.contact-mail { font-size: clamp(1.3rem, 1rem + 1.5vw, 1.9rem); font-weight: 700; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0 2.5rem; margin-top: 3rem; font-size: .88rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* ---------- Documentation site (istointents.org) ---------- */
.doc-badge { font-size: .78rem; font-weight: 700; color: var(--brand-text); background: var(--accent-bg); border-radius: 99px; padding: .15rem .55rem; white-space: nowrap; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search input { width: 100%; font: inherit; font-size: .95rem; padding: .5rem .8rem; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); }
.search input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-height: min(70vh, 480px); overflow-y: auto; z-index: 40; padding: .3rem; margin: 0; list-style: none; }
.search-results[hidden] { display: none; }
.search-results a { display: block; padding: .5rem .65rem; border-radius: 7px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--accent-bg); }
.search-results .r-page { font-size: .75rem; color: var(--muted); display: block; }
.search-results .r-head { font-weight: 600; display: block; }
.search-results .r-text { font-size: .82rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: var(--accent-bg); color: var(--brand-text); padding: 0; }
.search-empty { padding: .6rem .7rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) { .search { order: 3; max-width: none; flex-basis: 100%; } }

.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.5rem; padding-top: 2rem; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1rem; } }
.doc-nav { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: .93rem; }
.doc-nav details > summary { display: none; }
.doc-nav h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.25rem 0 .4rem; }
.doc-nav h2:first-of-type { margin-top: 0; }
.doc-nav ul { list-style: none; padding: 0; margin: 0; }
.doc-nav a { display: block; padding: .28rem .6rem; border-radius: 7px; color: var(--text); text-decoration: none; }
.doc-nav a:hover { background: var(--bg-soft); }
.doc-nav a[aria-current="page"] { background: var(--accent-bg); color: var(--brand-text); font-weight: 600; }
@media (max-width: 900px) {
  .doc-nav { position: static; max-height: none; overflow: visible; }
  .doc-nav details > summary { display: list-item; cursor: pointer; font-weight: 600; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft); }
  .doc-nav details[open] > summary { margin-bottom: .6rem; }
}
.doc { min-width: 0; max-width: 820px; }
.doc h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); }
.doc h2 { padding-top: .5rem; border-top: 1px solid var(--border); margin-top: 2.2em; }
.doc h1 + h2, .doc .toc + h2 { border-top: 0; }
.doc :is(h2, h3, h4) { scroll-margin-top: 90px; }
.doc .anchor { margin-left: .35rem; text-decoration: none; color: var(--muted); opacity: 0; font-weight: 400; }
.doc :is(h2, h3, h4):hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc blockquote { margin: 0 0 1.2em; padding: .7rem 1rem; border-left: 4px solid var(--brand); background: var(--bg-soft); border-radius: 0 8px 8px 0; }
.doc blockquote p:last-child { margin: 0; }
.doc li > p { margin: 0; }
.toc { border: 1px solid var(--border); border-radius: 10px; padding: .7rem 1rem; margin: 0 0 1.5rem; background: var(--bg-soft); font-size: .92rem; }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { margin: .6rem 0 0; padding-left: 1.2rem; }
.toc ol ol { margin: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: -.2rem 0 1.2rem; font-size: .9rem; color: var(--muted); }
.pill-ok, .pill-bad { font-size: .78rem; font-weight: 700; border-radius: 99px; padding: .1rem .55rem; }
.pill-ok { background: var(--accent-bg); color: var(--brand-text); }
.pill-bad { background: var(--warn-bg); color: var(--warn-text); }
.card-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
@media (max-width: 700px) { .card-list { grid-template-columns: minmax(0, 1fr); } }
.card-list a { display: block; height: 100%; border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; text-decoration: none; color: var(--text); background: var(--bg-card); }
.card-list a:hover { border-color: var(--brand); }
.card-list b { display: block; color: var(--brand-text); }
.card-list span { font-size: .9rem; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: .92rem; }
.pager a { text-decoration: none; }
.pager .next { margin-left: auto; text-align: right; }
.validator-errors { font-size: .88rem; }
.code-figure { margin: 0; min-width: 0; }
.code-figure figcaption { margin-bottom: .5rem; }
.card-title { font-size: 1.15rem; margin-top: 0; }
.push-right { margin-left: auto; }
.h1-small { font-size: 1.6rem; }
.license-text { white-space: pre-wrap; font-size: .8rem; }
.cols-2 > * { min-width: 0; }
.card h2 { margin-top: 0; }
.site-header .wrap > .tools:last-child { margin-left: auto; }
@media (max-width: 640px) {
  .tools .home-link { display: none; }
  .intent-card dl { grid-template-columns: 1fr; gap: 0; }
  .intent-card dd { margin-bottom: .5rem; }
}
.company { font-style: normal; line-height: 1.7; }
