/* Sablab: shared styles for sablab.io */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-sunk: #efede6;
  --demo-bg: #e7f0ed;
  --ink: #121817;
  --text: #2a3230;
  --muted: #59625f;
  --rule: #e2dfd6;
  --rule-strong: #c9c5b9;
  --accent: #0f766e;
  --on-accent: #ffffff;
  --idelio: #0d9488;
  --dot: rgba(18, 24, 23, 0.13);
  --shadow: 0 1px 2px rgba(18, 24, 23, 0.06), 0 12px 28px -18px rgba(18, 24, 23, 0.3);

  --bubble-guest: #f1efe9;
  --bubble-agent: #0f766e;
  --bubble-agent-text: #ffffff;

  --mark-tile: #121817;
  --mark-top: #f7f6f2;
  --mark-bottom: #2dd4bf;

  --radius: 14px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1211;
    --surface: #151c1b;
    --surface-sunk: #111817;
    --demo-bg: #0f211e;
    --ink: #eef2f0;
    --text: #d3dad7;
    --muted: #97a29e;
    --rule: #232d2b;
    --rule-strong: #35413e;
    --accent: #4fd1c1;
    --on-accent: #0d1211;
    --dot: rgba(238, 242, 240, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px -18px rgba(0, 0, 0, 0.8);

    --bubble-guest: #1e2726;
    --bubble-agent: #0f5f58;
    --bubble-agent-text: #effaf8;

    --mark-tile: #eef2f0;
    --mark-top: #0d1211;
    --mark-bottom: #0d9488;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 720px) {
  body {
    font-size: 1.0625rem;
  }
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

address {
  font-style: normal;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 720px) {
  .wrap {
    padding-inline: 2rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--idelio);
}

/* ---------- Brand mark ---------- */

.mark-tile {
  fill: var(--mark-tile);
}

.mark-top {
  fill: var(--mark-top);
}

.mark-bottom {
  fill: var(--mark-bottom);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--ink);
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button-quiet {
  border-color: var(--rule-strong);
  background: transparent;
  color: var(--ink);
}

.button-quiet:hover {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 3.5rem 3.5rem;
  border-bottom: 1px solid var(--rule);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 95% at 90% 10%, #000 15%, transparent 70%);
  mask-image: radial-gradient(ellipse 75% 95% at 90% 10%, #000 15%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 2.5rem;
}

.hero h1 {
  max-width: 15ch;
  margin-top: 1.25rem;
  font-size: clamp(2.375rem, 1.5rem + 3.6vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 36rem;
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
}

.facts {
  margin: 0;
  padding: 0.25rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.facts div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.9375rem;
  border-bottom: 1px solid var(--rule);
}

.facts div:last-child {
  border-bottom: 0;
}

.facts dt,
.contact-list dt {
  padding-top: 0.2em;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

@media (min-width: 900px) {
  .hero {
    padding-block: 7rem 6rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: end;
    gap: 4rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: 4.5rem;
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section-head {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-title {
  margin-top: 1rem;
  font-size: clamp(1.875rem, 1.35rem + 1.9vw, 2.75rem);
  letter-spacing: -0.035em;
}

.section-intro {
  max-width: 34rem;
  color: var(--muted);
}

@media (min-width: 900px) {
  .section {
    padding-block: 7rem;
  }

  .section-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 4rem;
    margin-bottom: 3rem;
  }
}

/* ---------- Product ---------- */

.product {
  display: grid;
  gap: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-id {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.idelio-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  background: var(--idelio);
  color: #ffffff;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
}

.product-name {
  font-size: 2rem;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.product-tagline {
  margin-top: 0.125rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.product-tagline span {
  display: block;
}

@media (min-width: 560px) {
  .product-tagline span {
    display: inline;
  }

  .product-tagline span + span::before {
    content: "· ";
  }
}

.product-desc {
  max-width: 34rem;
  margin-top: 1.5rem;
}

.features {
  display: grid;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
}

.feature-title {
  display: block;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.features p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (min-width: 560px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }
}

@media (min-width: 900px) {
  .product {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 3.5rem;
    padding: 3rem;
  }
}

/* ---------- Example conversations ---------- */

.demo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0.625rem;
  border-radius: var(--radius);
  background-color: var(--demo-bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: 18px 18px;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.thread-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.375rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.thread-channel svg {
  display: block;
  width: 0.9375rem;
  height: 0.9375rem;
  color: var(--accent);
}

.bubble {
  max-width: 90%;
  padding: 0.625rem 0.875rem;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.bubble-guest {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: var(--bubble-guest);
  color: var(--ink);
}

.bubble-agent {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--bubble-agent);
  color: var(--bubble-agent-text);
}

.demo figcaption {
  padding-inline: 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (min-width: 900px) {
  .demo {
    align-self: start;
    gap: 1rem;
    padding: 1.5rem;
  }

  .thread {
    padding: 1rem;
  }

  .bubble {
    max-width: 86%;
  }
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  gap: 2.5rem;
}

.contact-copy p {
  max-width: 28rem;
  margin-top: 1.25rem;
  color: var(--muted);
}

.contact-list {
  margin: 0;
  border-top: 1px solid var(--rule-strong);
}

.contact-list div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--rule);
}

.contact-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
  }

  .contact-list dd {
    font-size: 1.1875rem;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.footer-brand .brand-mark {
  width: 1.25rem;
  height: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- Privacy policy ---------- */

.legal-head {
  padding-block: 3.5rem 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.legal-head h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.375rem, 1.6rem + 2.8vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.legal-updated {
  margin-top: 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.legal-head .lede {
  max-width: 40rem;
}

.legal-layout {
  display: grid;
  gap: 2.5rem;
  padding-block: 2.5rem 5rem;
}

.toc {
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc-title {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 0.75rem;
  padding-block: 0.3rem;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  padding-top: 0.15em;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.toc a:hover {
  color: var(--accent);
}

.prose {
  max-width: 42rem;
  counter-reset: section;
}

.prose section {
  scroll-margin-top: 1.5rem;
}

.prose section + section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.prose .numbered h2::before {
  counter-increment: section;
  content: counter(section, decimal-leading-zero);
  flex: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
}

.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.prose p,
.prose ul,
.prose ol,
.prose dl {
  margin-top: 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose li::marker {
  color: var(--muted);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.summary {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary h2 {
  font-size: 1.25rem;
}

.defs {
  border-top: 1px solid var(--rule);
}

.defs div {
  display: grid;
  gap: 0.25rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}

.defs dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.defs dd {
  margin: 0;
}

@media (min-width: 640px) {
  .defs div {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 1.5rem;
  }

  .defs dt {
    padding-top: 0.3em;
  }
}

@media (min-width: 960px) {
  .legal-head {
    padding-block: 5.5rem 3.5rem;
  }

  .legal-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 4rem;
    padding-block: 3.5rem 7rem;
  }

  .toc {
    position: sticky;
    top: 2rem;
    align-self: start;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .summary {
    padding: 2rem;
  }
}
