:root,
[data-theme="light"] {
  color-scheme: light;
  --background: #FAF8F5;
  --foreground: #2C2C2C;
  --card: #FFFFFF;
  --primary: #2C2C2C;
  --primary-fg: #FFFFFF;
  --secondary: #E8E3DC;
  --muted: #8B8680;
  --accent: #D4CFC7;
  --input: #F5F1EC;
  --gradient-start: #F5F1EC;
  --gradient-end: #FAF8F5;
  --destructive: #C84B31;
  --success: #10B981;
  --border: rgba(139, 134, 128, 0.15);
  --header-bg: rgba(250, 248, 245, 0.88);
  --shadow: 0 8px 32px rgba(44, 44, 44, 0.08);
  --shadow-lg: 0 24px 64px rgba(44, 44, 44, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.92);
  --toggle-thumb: #FFFFFF;
  --radius: 16px;
  --radius-pill: 999px;
  --max: 1120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #1A1A1A;
  --foreground: #E8E3DC;
  --card: #252525;
  --primary: #E8E3DC;
  --primary-fg: #1A1A1A;
  --secondary: #2C2C2C;
  --muted: #8B8680;
  --accent: #3D3D3D;
  --input: #2C2C2C;
  --gradient-start: #252525;
  --gradient-end: #1A1A1A;
  --border: rgba(232, 227, 220, 0.1);
  --header-bg: rgba(26, 26, 26, 0.9);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.4);
  --chip-bg: rgba(37, 37, 37, 0.95);
  --toggle-thumb: #1A1A1A;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3, .logo, .stat-value {
  font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.from-left { transform: translateX(-28px); }
.reveal.from-right { transform: translateX(28px); }

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--foreground); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-btn,
.theme-toggle {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.2s, background 0.2s;
}

.lang-btn {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
}

.lang-btn.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.control-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover { color: var(--foreground); }

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 4px 16px rgba(44, 44, 44, 0.18);
}

.btn-primary:hover { box-shadow: 0 6px 24px rgba(44, 44, 44, 0.22); }

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1.5px solid var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--foreground);
}

/* Hero */
.hero {
  padding: 72px 0 96px;
  background: linear-gradient(180deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 20px;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Sections */
section { padding: 96px 0; }

.section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 640px;
}

.section-desc {
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--input);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--foreground);
}

.feature-card h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-num {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}

.step h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.875rem;
  color: var(--muted);
}

.split-section {
  background: linear-gradient(180deg, var(--gradient-end) 0%, var(--gradient-start) 100%);
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9375rem;
}

.check-list li::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--secondary);
  border-radius: 6px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C2C2C' stroke-width='2.5'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}

[data-theme="dark"] .check-list li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E8E3DC' stroke-width='2.5'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

/* Newsletter */
.newsletter-section {
  background: var(--input);
}

.newsletter-box {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 48px;
  box-shadow: var(--shadow);
}

.newsletter-perks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.newsletter-perk {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

.newsletter-perk svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--success);
}

.newsletter-form-wrap {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.newsletter-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.newsletter-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.newsletter-input-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
}

.newsletter-input-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.newsletter-note {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.newsletter-success {
  display: none;
  padding: 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  font-size: 0.875rem;
  font-weight: 500;
}

.newsletter-success.is-visible { display: block; }

/* CTA */
.cta-section {
  text-align: center;
  padding: 80px 0;
}

.cta-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.cta-section p {
  color: var(--muted);
  margin-bottom: 32px;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.8125rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.store-badge:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.store-badge strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Footer */
footer {
  padding: 40px 0 28px;
  border-top: 1px solid var(--border);
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-brand .logo { margin-bottom: 8px; }

.footer-brand p {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 420px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
}

.footer-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--foreground); }

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 960px) {
  .split-grid, .newsletter-box { grid-template-columns: 1fr; gap: 48px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-bottom: 64px; }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background);
    padding: 20px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }
  .features-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  section { padding: 64px 0; }
  .newsletter-box { padding: 32px 24px; }
  .newsletter-input-row { flex-direction: column; }
  .footer-main { flex-direction: column; align-items: flex-start; }
}
  
/* Hero (screenshots slot lives under .hero-lead / .hero-actions when ready) */
.hero-copy { max-width: 720px; }
.hero-copy .hero-lead { max-width: 560px; }

/* Feature groups */
.feature-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.feature-card li {
  position: relative;
  padding-left: 16px;
  font-size: 0.875rem;
  color: var(--foreground);
  line-height: 1.5;
}

.feature-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Finance rules card */
.rules-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 24px;
  box-shadow: var(--shadow);
}

.rule {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.rule:last-child { border-bottom: none; }

.rule h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.rule p { font-size: 0.875rem; color: var(--muted); }

/* Account: guest vs account */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.account-note {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 720px;
}

/* Invite code */
.code-box {
  max-width: 440px;
  margin: 40px auto 0;
  text-align: left;
}

.code-box label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.code-row { display: flex; gap: 10px; }

.code-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.code-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.code-hint { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }

/* Deep link fallback page (open.html) */
.link-page { min-height: 70vh; display: flex; align-items: center; padding: 64px 0; }

.link-card {
  width: min(100% - 40px, 520px);
  margin-inline: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.link-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.link-card p { color: var(--muted); font-size: 0.9375rem; margin-bottom: 20px; }

.link-code {
  display: inline-block;
  padding: 10px 20px;
  margin-bottom: 20px;
  background: var(--input);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  font-family: 'IBM Plex Sans', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.link-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-bottom: 8px; }
.link-card .store-badges { margin-top: 20px; }
.link-card [hidden] { display: none !important; }

@media (max-width: 960px) {
  .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .code-row { flex-direction: column; }
  .link-card { padding: 32px 20px; }
}

/* Tymczasowy pasek, do usuniecia po zastapieniu szablonu */
.template-banner {
  background: var(--primary);
  color: var(--primary-fg);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 16px;
}
.store-badge[hidden] { display: none; }
