/* Wartości 1:1 z packages/brand/src/tokens.ts. Marka Robi (packages/brand/DESIGN.md): jasno, mono, jeden kolor = słońce Robiego. */
:root {
  --canvas: #F6F6F4;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --sunken: #EFEFEC;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.6);
  --border: rgba(17, 17, 17, 0.08);
  --accent: #111111; /* mono: główny przycisk jest czarny */
  --accent-hover: #333333;
  --on-accent: #FFFFFF;
  --sun: #FF6633; /* jedyny kolor marki: Robi, kropki „pracuje”, liczniki */
  --success: #1F9D55;
  --warning: #C88A12; /* „czeka na ciebie” jak w appce */
  --focus: rgba(17, 17, 17, 0.55);
  --lights: rgba(17, 17, 17, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --window-shadow: 0 40px 100px -30px rgba(17, 17, 17, 0.25);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --fast: 160ms;

  --column: 640px;
  --gutter: 24px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0C0C0D;
    --surface: #141416;
    --raised: #1C1C1F;
    --sunken: #101012;
    --text: #F5F5F6;
    --muted: #8B8B92;
    --border: rgba(255, 255, 255, 0.07);
    --accent: #F5F5F6;
    --accent-hover: #D9D9DC;
    --on-accent: #0C0C0D;
    --sun: #FF7A45;
    --success: #34C77B;
    --warning: #F2B33D;
    --focus: rgba(245, 245, 246, 0.55);
    --lights: #2A2A2E;
    --shadow: none;
    --window-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 16px/24px Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

/* Nav + stopka */
.nav, .footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 800 22px/28px Manrope, Inter, system-ui, sans-serif; letter-spacing: -0.05em; }
.wordmark svg { width: 24px; height: 24px; flex: none; }
.footer { padding-block: 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.footer .wordmark { color: var(--text); font-size: 18px; }
.footer .wordmark svg { width: 20px; height: 20px; }

/* Wspólne */
main > section {
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
}
h1 {
  font-size: clamp(40px, 7.4vw, 64px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 span { color: var(--muted); }
h2 {
  font-size: clamp(32px, 5vw, 40px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lead {
  margin: 20px auto 0;
  max-width: 460px;
  color: var(--muted);
  font-size: 18px;
  line-height: 28px;
  text-wrap: balance;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .button:hover { background: var(--accent-hover); } }
.button:active { transform: scale(0.98); }
.button.full { width: 100%; }
.button.secondary { background: var(--sunken); color: var(--text); }
@media (hover: hover) and (pointer: fine) { .button.secondary:hover { background: var(--border); } }

/* HERO */
.hero { max-width: 960px; padding-top: clamp(40px, 8vh, 88px); }
.hero h1.meet { font-size: clamp(32px, 10.5vw, 96px); line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.meet-av { display: inline-block; width: 1em; height: 1em; vertical-align: -0.17em; margin: 0 0.02em; }
.hero .lead { max-width: 780px; }
.ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* Wycinek appki: prawdziwe kształty z packages/ui (Sidebar, ChatView, Blocks), dekoracja */
.shot {
  position: relative;
  max-width: 960px;
  margin: 72px auto 0;
  text-align: left;
  /* fragment, nie zrzut: dół i boki gasną */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 128px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 128px), transparent);
}
.window {
  display: grid;
  grid-template-columns: 300px 1fr;
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--window-shadow);
  font-size: 15px;
  line-height: 22px;
}
.window svg { fill: currentColor; }
.round { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--sunken); color: var(--muted); }
.round svg { width: 20px; height: 20px; }

/* Sidebar */
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 0 8px; }
.side-top { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px 0 12px; margin-bottom: 8px; }
.lights { display: flex; gap: 8px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: var(--lights); }
.row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px; border-radius: 14px; margin-bottom: 4px; }
.row.active { background: var(--canvas); }
.av { position: relative; flex: none; width: 48px; height: 48px; }
.wait { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--sun); border: 2px solid var(--surface); }
.row.active .wait { border-color: var(--canvas); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-top { display: flex; align-items: center; gap: 8px; }
.row-top strong { flex: 1; font-weight: 600; }
.row-top time { color: var(--muted); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
.row-top .warn { width: 16px; height: 16px; color: var(--warning); }
.row-prev { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.active .row-prev { color: var(--text); }

/* Rozmowa */
.chat { min-width: 0; display: flex; flex-direction: column; }
.chat-top { position: relative; display: flex; justify-content: center; align-items: center; padding: 8px 32px 0; height: 52px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 8px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); font-size: 13px; line-height: 18px; }
.pill strong { font-weight: 600; }
.wait-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.col { width: 100%; max-width: 560px; margin: 0 auto; padding: 32px 32px 0; display: flex; flex-direction: column; gap: 12px; }
.msg-card { align-self: flex-start; padding: 16px 20px; border-radius: 20px; background: var(--raised); box-shadow: var(--shadow); }
.receipt { display: flex; align-items: center; gap: 8px; height: 32px; padding-left: 4px; font-size: 13px; line-height: 18px; font-weight: 500; }
.receipt svg { width: 16px; height: 16px; color: var(--success); }
.approval { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 20px; background: var(--raised); border: 1px solid var(--border); box-shadow: var(--shadow); }
.head { display: flex; flex-direction: column; gap: 4px; }
.status { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--muted); font-size: 12px; line-height: 16px; }
.status svg { width: 16px; height: 16px; }
.title { font-weight: 600; }
.target { color: var(--muted); font-size: 13px; line-height: 18px; font-weight: 500; }
.preview { padding: 12px; border-radius: var(--r-sm); background: var(--sunken); }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); font-size: 16px; line-height: 24px; font-weight: 500; }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.secondary { background: var(--sunken); color: var(--text); }
.composer { display: flex; align-items: center; gap: 4px; margin: 20px 0 48px; padding: 8px; min-height: 52px; border-radius: var(--r-pill); background: var(--raised); border: 1px solid var(--border); color: var(--muted); }
.composer .round { background: none; }
.composer .ph { flex: 1; padding: 0 4px; font-size: 16px; }

/* Animacja wejścia (tylko z JS i bez reduced motion) */
.js:not(.still) .reveal { animation: rise 900ms var(--ease) both; }
.js:not(.still) .hero .reveal:nth-child(2) { animation-delay: 80ms; }
.js:not(.still) .hero .reveal:nth-child(3) { animation-delay: 160ms; }
.js:not(.still) .hero .reveal:nth-child(4) { animation: fade 1000ms var(--ease) 280ms both; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.how { margin-top: 96px; }

/* Integracje: jeden cichy rząd logo */
.works { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 64px; }
.works p { color: var(--muted); font-size: 13px; line-height: 18px; }
.works ul { display: flex; align-items: center; gap: 24px; }
.works svg { width: 22px; height: 22px; fill: var(--muted); }

/* Znaczki jak certyfikaty: maks. 3, tylko prawdziwe */
.certs { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 16px 48px; max-width: 840px; margin: 56px auto 0; list-style: none; padding: 0; }
.certs li { display: flex; align-items: center; justify-content: center; gap: 10px; }
.certs svg { width: 22px; height: 22px; fill: var(--text); flex: none; opacity: .9; }
.certs span { display: flex; flex-direction: column; text-align: left; color: var(--muted); font-size: 12px; line-height: 16px; }
.certs strong { color: var(--text); font-size: 13px; line-height: 18px; font-weight: 600; }
@media (max-width: 720px) { .certs { grid-template-columns: auto; justify-content: center; } .certs li { justify-content: flex-start; } }

/* Robi sam zauważa: jedna poranna wiadomość */
.how .lead { max-width: 520px; }
.morning { max-width: 520px; margin: 40px auto 0; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); text-align: left; display: grid; gap: 10px; }
.m-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.m-head svg { width: 28px; height: 28px; }
.m-head time { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.m-more { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.m-more::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }

/* Ekipa: stanowiska */
.team, .memory, .download, .faq, .final { margin-top: 160px; }
.jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 40px; text-align: left; }
.jobs li { display: grid; align-content: start; gap: 4px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.jobs svg { width: 40px; height: 40px; margin-bottom: 8px; }
.jobs strong { font-weight: 600; }
.jobs span { color: var(--muted); font-size: 14px; line-height: 20px; }

/* Pamięć */
.mem { max-width: 460px; margin: 40px auto 0; display: grid; gap: 12px; }
.mem .me { justify-self: end; padding: 10px 16px; border-radius: 20px; background: var(--accent); color: var(--on-accent); }
.saved { justify-self: start; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); text-align: left; }
.saved svg { width: 18px; height: 18px; fill: var(--success); flex: none; }
.saved span { display: grid; color: var(--muted); font-size: 14px; line-height: 20px; }
.saved strong { color: var(--text); font-weight: 600; }

/* Pobieranie, FAQ, na koniec */
.download .button { margin-top: 32px; }
.qa { max-width: 640px; margin: 32px auto 0; text-align: left; border-top: 1px solid var(--border); }
.qa details { border-bottom: 1px solid var(--border); }
.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 4px; font-weight: 500; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; transition: transform var(--fast) var(--ease); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa p { padding: 0 4px 20px; color: var(--muted); }
.final { padding-bottom: 160px; }
.final-av { width: 64px; height: 64px; margin: 0 auto 24px; }

/* Nagłówek: kilka linków i jeden przycisk */
.nav { gap: 24px; }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color var(--fast) var(--ease); }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--text); } }
.button.sm { height: 36px; padding: 0 16px; font-size: 14px; }

/* Stopka: kolumny */
.footer { align-items: flex-start; gap: 48px; flex-wrap: wrap; }
.foot-cols { display: grid; grid-template-columns: repeat(4, auto); gap: 16px 56px; font-size: 13px; line-height: 18px; }
.foot-cols div { display: flex; flex-direction: column; gap: 10px; }
.foot-cols p { color: var(--text); font-weight: 600; margin-bottom: 2px; }
.foot-cols a { transition: color var(--fast) var(--ease); }
@media (hover: hover) and (pointer: fine) { .foot-cols a:hover { color: var(--text); } }

/* Podstrony (pages/*.md) */
.legal.page h1 { margin-top: 48px; }
.legal.page h1 + p { font-size: 18px; line-height: 28px; color: var(--muted); }
.legal.page .button { margin-top: 4px; text-decoration: none; }
.legal h2 { display: flex; align-items: center; gap: 12px; }
.h-mascot { width: 32px; height: 32px; flex: none; }

/* Stopka: polska firma */
.footer-start { display: flex; flex-direction: column; gap: 8px; }
.legal-name { font-size: 12px; line-height: 16px; }
.made { display: inline-flex; align-items: center; gap: 5px; }
.heart { width: 12px; height: 11px; overflow: visible; }
.flag { width: 16px; height: 10px; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }

/* Strony dokumentów (build-legal.mjs) */
.legal { max-width: 720px; margin: 0 auto; padding: 24px var(--gutter) 96px; text-align: left; font-size: 15px; line-height: 24px; }
.legal h1 { font-size: clamp(32px, 5vw, 44px); margin: 24px 0 8px; }
.legal h2 { font-size: 22px; line-height: 30px; letter-spacing: -0.01em; margin: 40px 0 12px; }
.legal h3 { font-size: 17px; margin: 24px 0 8px; }
.legal p, .legal ul, .legal ol { margin: 0 0 12px; color: var(--text); }
.legal ul, .legal ol { padding-left: 20px; }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal li { margin-bottom: 6px; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal blockquote { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--sunken); color: var(--muted); }
.legal .table { overflow-x: auto; margin: 0 0 16px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 20px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.legal th { font-weight: 600; }
.legal code { font-size: 13px; padding: 1px 4px; border-radius: 4px; background: var(--sunken); }

/* Zaufanie */
.trust { margin-top: 160px; }

/* Cena */
.price { margin-top: 160px; }
.plan {
  max-width: 420px;
  margin: 40px auto 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  text-align: left;
}
.crew { display: flex; }
.crew svg { width: 36px; height: 36px; margin-right: -6px; }
.amount { margin-top: 24px; color: var(--muted); }
.amount strong { color: var(--text); font-size: 48px; line-height: 52px; font-weight: 600; letter-spacing: -0.035em; }
.amount strong { font-variant-numeric: tabular-nums; }
.sub { margin-top: 4px; color: var(--muted); }
.tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 24px 0 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--sunken); min-width: 0; }
.tiers label { position: relative; }
.tiers input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tiers span { display: grid; place-items: center; height: 36px; border-radius: var(--r-pill); color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.tiers input:checked + span { background: var(--raised); color: var(--text); }
.tiers input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .tiers input:not(:checked):hover + span { color: var(--text); } }
.fine { margin-top: 12px; text-align: center; color: var(--muted); font-size: 13px; line-height: 18px; }
.enterprise { margin-top: 24px; color: var(--muted); }
.enterprise a { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 25%, transparent); text-underline-offset: 4px; transition: text-decoration-color var(--fast) var(--ease); }
@media (hover: hover) and (pointer: fine) { .enterprise a:hover { text-decoration-color: currentColor; } }
.perks { display: flex; flex-direction: column; gap: 12px; margin: 28px 0 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.perks li { display: flex; gap: 12px; align-items: flex-start; }
.perks svg { width: 16px; height: 16px; margin-top: 4px; fill: var(--muted); flex: none; }

/* Telefon */
@media (max-width: 640px) {
  .footer { gap: 32px; }
  .nav-links { display: none; }
  .nav .button.sm { margin-left: auto; }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 24px 32px; }
  :root { --gutter: 16px; }
  .lead { font-size: 17px; line-height: 26px; }
  .trust, .price { margin-top: 112px; }
  .how { margin-top: 64px; }
  .team, .memory, .download, .faq, .final { margin-top: 112px; }
  .final { padding-bottom: 112px; }
  .jobs { grid-template-columns: 1fr 1fr; }
  .plan { padding: 24px; }
  .shot { margin-top: 48px; }
  .window { grid-template-columns: 1fr; }
  .side { display: none; }
  .chat-top { padding: 8px 16px 0; }
  .chat-top .round { right: 16px; }
  .col { padding: 24px 16px 0; }
  .actions { flex-direction: column-reverse; }
  .btn { width: 100%; }
  .works { margin-top: 48px; flex-direction: column; }
  .works ul { gap: 20px; }
}
