@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400;500;600&family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,700&display=swap&subset=latin-ext');

:root {
  --brand: #c2410c;
  --brand-light: #ea580c;
  --brand-dark: #9a3412;

  --surface: #fafaf9;
  --surface-raised: #ffffff;
  --surface-light: #f5f5f4;

  --foreground: #1c1917;
  --muted-foreground: #57534e;
  --border: #e7e5e4;
  --border-strong: #1c1917;

  --success: #059669;
  --destructive: #ef4444;

  --radius: 2px;
  --measure-prose: 65ch;
  --measure-wide: 80ch;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-heading: 'Merriweather', Georgia, 'Times New Roman', serif;

  --label-size: 0.75rem;
  --label-tracking: 0.12em;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--foreground);
  font-feature-settings: "kern", "liga", "calt", "ss01";
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface);
  color: var(--foreground);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--foreground);
  text-wrap: balance;
  font-feature-settings: "kern", "liga", "onum";
}

h1 { letter-spacing: -0.018em; }
h2 { letter-spacing: -0.015em; }
h3 { letter-spacing: -0.01em; }

p { text-wrap: pretty; }

code, kbd, samp, pre, .font-mono {
  font-family: var(--font-mono);
  font-feature-settings: "kern", "tnum", "zero", "ss01";
}

::selection {
  background-color: var(--brand);
  color: #ffffff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Editorial utilities (compose, nie generate)
   ============================================================ */

.label-mono {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  line-height: 1;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-feature-settings: "tnum", "zero", "ss01";
}

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

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

.measure-prose {
  max-width: var(--measure-prose);
}

.num-inline {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.display-xl {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 6vw + 0.5rem, 5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.display-lg {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw + 0.5rem, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.brand-accent {
  color: var(--brand);
  font-style: italic;
}

/* ============================================================
   Layout
   ============================================================ */

.page {
  min-height: 100vh;
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.container-narrow {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-mark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--foreground);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark:hover { color: var(--brand); }

.navbar-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  letter-spacing: 0.04em;
  flex: 1;
}

.nav-auth {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-user {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link {
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  border-color: var(--foreground);
  color: var(--brand);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.gate {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* ============================================================
   Hero - jasne tlo (bez czarnego)
   ============================================================ */

.hero {
  background-color: var(--surface);
  color: var(--foreground);
  padding: 5.5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #d6d3d1 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 56rem;
  margin: 0 auto;
}

.hero .label-mono {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.hero-title {
  color: var(--foreground);
  margin-bottom: 1.5rem;
}

.hero-title .brand-accent {
  color: var(--brand);
}

.hero-subtitle {
  font-size: clamp(1rem, 1vw + 0.75rem, 1.2rem);
  line-height: 1.6;
  color: var(--muted-foreground);
  max-width: 38rem;
  margin: 0 auto 1.75rem;
}

.hero-subtitle strong {
  color: var(--foreground);
  font-weight: 600;
}

.hero-meta {
  color: var(--muted-foreground);
  margin-top: 1.5rem;
}

/* ============================================================
   Section
   ============================================================ */

.section {
  padding: 4rem 0;
}

.section-narrow {
  padding: 3rem 0;
}

.section-label {
  margin-bottom: 1.5rem;
}

.section-heading {
  font-size: clamp(1.5rem, 2vw + 0.75rem, 2.25rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.section-intro {
  font-size: 1.05rem;
  color: var(--muted-foreground);
  max-width: var(--measure-prose);
  margin-bottom: 2rem;
}

/* ============================================================
   Form
   ============================================================ */

.form-wrap {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font: inherit;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}

.textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

.cta-row {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-solid {
  background-color: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(194, 65, 12, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-solid:hover:not(:disabled) {
  background-color: var(--brand-light);
  border-color: var(--brand-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.25);
}

.btn-solid:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(194, 65, 12, 0.2);
}

.btn-solid:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-outline:hover { border-color: var(--foreground); }

/* ============================================================
   Results
   ============================================================ */

.results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.meta-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
  text-align: right;
  margin-top: -0.5rem;
}

.card {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.card-category {
  margin-bottom: 0.4rem;
}

.card-name {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--foreground);
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.card-num {
  font-family: var(--font-mono);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 600;
}

.badge {
  background-color: var(--surface-light);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-why {
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.65;
  max-width: var(--measure-prose);
}

.gains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background-color: var(--surface-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.gain {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--border);
}

.gain:last-child { border-right: none; }

.gain-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.gain-value {
  color: var(--foreground);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
}

@media (max-width: 600px) {
  .gains { grid-template-columns: 1fr; }
  .gain { border-right: none; border-bottom: 1px solid var(--border); }
  .gain:last-child { border-bottom: none; }
}

.vision {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vision-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.vision-text {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--foreground);
  font-size: 1.02rem;
  line-height: 1.6;
  font-weight: 400;
}

.card-link {
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  align-self: flex-start;
  padding-top: 0.25rem;
}

.card-link:hover { text-decoration: underline; color: var(--brand-dark); }

/* ============================================================
   Extended schema blocks (risks, steps, alternatives, integration)
   ============================================================ */

.detail-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bullet-list li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--foreground);
}

.bullet-list li::before {
  content: "·";
  position: absolute;
  left: 0.25rem;
  top: -0.1rem;
  color: var(--brand);
  font-weight: 700;
  font-size: 1.1rem;
}

.risks-list li {
  color: var(--foreground);
}

.risks-list li::before {
  content: "!";
  color: #b45309;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  top: 0;
  left: 0.15rem;
}

.alt-list li::before {
  content: "~";
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  top: 0;
}

.steps-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.steps-list li {
  counter-increment: step;
  position: relative;
  padding-left: 2rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--foreground);
}

.steps-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.integration-text {
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--foreground);
}

.alt-block .bullet-list li {
  color: var(--muted-foreground);
}

/* ============================================================
   Status messages
   ============================================================ */

.status {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.status.loading {
  background-color: var(--surface-raised);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status.error {
  background-color: #fef2f2;
  border-color: var(--destructive);
  color: #991b1b;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  margin-top: auto;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  color: var(--muted-foreground);
}

.footer-top {
  display: flex;
  gap: 2.5rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .footer-top { flex-direction: row; }
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.01em;
  margin: 0;
}

.footer-brand-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.footer-brand-loc {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  font-size: 0.88rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}

.footer-col a {
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover { color: var(--brand); }

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted-foreground);
  letter-spacing: 0.03em;
}

.footer-badges .sep {
  color: var(--border);
}

.footer-divider {
  margin: 2rem 0 1.25rem;
  border-top: 1px solid var(--border);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; }
}

.footer-bottom a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-bottom a:hover { color: var(--foreground); }

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.footer-bottom-links .sep { color: var(--border); }
