/* ==========================================================================
   LegacySystems — Modern Medical & Enterprise Software Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0a0f1d;
  --bg-card: rgba(18, 26, 47, 0.75);
  --bg-card-hover: rgba(26, 38, 68, 0.9);
  --bg-surface: #0f172a;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;

  /* Brand Accents */
  --primary-blue: #0284c7;
  --primary-cyan: #06b6d4;
  --accent-teal: #0d9488;
  --accent-emerald: #10b981;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #10b981 100%);
  --grad-senior: linear-gradient(135deg, #1565c0 0%, #7b1fa2 100%);
  --grad-pigula: linear-gradient(135deg, #0288d1 0%, #00897b 100%);
  --grad-tarcza: linear-gradient(135deg, #0f766e 0%, #1e3a8a 100%);
  --grad-surface: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  --grad-hero: radial-gradient(circle at 50% -20%, rgba(14, 165, 233, 0.22), rgba(10, 15, 29, 0) 70%);

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Glow */
  --glow-cyan: 0 0 40px -10px rgba(6, 182, 212, 0.35);
  --glow-blue: 0 0 40px -10px rgba(2, 132, 199, 0.35);
  --glow-emerald: 0 0 40px -10px rgba(16, 185, 129, 0.35);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Ambient Background Lights */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background: var(--grad-hero);
  pointer-events: none;
  z-index: 0;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
p { color: var(--text-muted); font-size: 1.05rem; }

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  backdrop-filter: blur(8px);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Gradient Text */
.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.grad-text-senior {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grad-text-pigula {
  background: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grad-text-tarcza {
  background: linear-gradient(135deg, #2dd4bf 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.brand-text span {
  color: var(--primary-cyan);
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary-cyan);
  border-radius: 2px;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-main);
}

.mobile-toggle svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  font-size: 0.98rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 20px -2px rgba(6, 182, 212, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px -2px rgba(6, 182, 212, 0.65);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-glass);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-senior {
  background: var(--grad-senior);
  color: #fff;
  box-shadow: 0 4px 18px rgba(123, 31, 162, 0.4);
}
.btn-senior:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123, 31, 162, 0.6);
}

.btn-pigula {
  background: var(--grad-pigula);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 137, 123, 0.4);
}
.btn-pigula:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 137, 123, 0.6);
}

.btn-tarcza {
  background: var(--grad-tarcza);
  color: #fff;
  box-shadow: 0 4px 18px rgba(30, 58, 138, 0.4);
}
.btn-tarcza:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.6);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 90px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 50px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-title {
  margin-top: 10px;
}

.hero-description {
  font-size: 1.18rem;
  line-height: 1.7;
  color: #cbd5e1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.hero-tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tech-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-media {
  position: relative;
}

.hero-card-glow {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-card), var(--glow-cyan);
  overflow: hidden;
}

.hero-card-glow img {
  border-radius: var(--radius-lg);
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-card-glow:hover img {
  transform: scale(1.02);
}

/* Floating Metrics Badge */
.floating-metric {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(14px);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* ==========================================================================
   Section Header & Common Styles
   ========================================================================== */
.section {
  padding: 90px 0;
  position: relative;
}

.section-alt {
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Author Card Section
   ========================================================================== */
.author-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.author-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--grad-primary);
}

.author-avatar-box {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(56, 189, 248, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.author-info h3 {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.author-role {
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 14px;
  display: inline-block;
}

.author-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #cbd5e1;
  margin-bottom: 18px;
}

.author-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
}

.author-stat-item {
  display: flex;
  flex-direction: column;
}

.author-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.author-stat-lbl {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Applications Grid (Piguła+, Senior+, Tarcza+)
   ========================================================================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.app-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.app-card.card-pigula:hover {
  box-shadow: var(--shadow-card), 0 0 30px -5px rgba(0, 137, 123, 0.35);
  border-color: rgba(0, 137, 123, 0.4);
}

.app-card.card-senior:hover {
  box-shadow: var(--shadow-card), 0 0 30px -5px rgba(123, 31, 162, 0.35);
  border-color: rgba(123, 31, 162, 0.4);
}

.app-card.card-tarcza:hover {
  box-shadow: var(--shadow-card), 0 0 30px -5px rgba(30, 58, 138, 0.45);
  border-color: rgba(45, 212, 191, 0.4);
}

.app-card-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.app-icon-pigula {
  background: linear-gradient(135deg, #0288d1, #00897b);
}

.app-icon-senior {
  background: linear-gradient(135deg, #1565c0, #7b1fa2);
}

.app-icon-tarcza {
  background: linear-gradient(135deg, #0f766e, #1e3a8a);
}

.app-category {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.app-card h3 {
  font-size: 1.6rem;
  margin-top: 4px;
}

.app-tagline {
  color: #38bdf8;
  font-size: 0.95rem;
  font-weight: 500;
}

.app-features-list {
  list-style: none;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-features-list li {
  font-size: 0.94rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.app-features-list li svg {
  width: 18px;
  height: 18px;
  fill: #38bdf8;
  flex-shrink: 0;
  margin-top: 3px;
}

.app-card-bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}

/* ==========================================================================
   Pillars & Architecture Section
   ========================================================================== */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.pillar-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
}

.pillar-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-3px);
}

.pillar-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.pillar-item h4 {
  font-size: 1.25rem;
}

.pillar-item p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Detail Pages (pigula.html, senior.html, tarcza.html)
   ========================================================================== */
.detail-hero {
  padding: 70px 0 50px;
  border-bottom: 1px solid var(--border-glass);
  position: relative;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #38bdf8;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.back-link:hover {
  gap: 12px;
  color: #7dd3fc;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}

.feature-block {
  margin: 60px 0;
}

.feature-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.feature-grid-2.reverse {
  direction: rtl;
}
.feature-grid-2.reverse > * {
  direction: ltr;
}

.feature-visual {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.feature-visual img {
  border-radius: var(--radius-lg);
  width: 100%;
}

.feature-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-info h3 {
  font-size: 1.85rem;
}

.specs-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 30px 0;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.specs-table th, .specs-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
}

.specs-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  color: #ffffff;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.specs-table td {
  font-size: 0.96rem;
  color: var(--text-muted);
}

.specs-table tr:last-child td {
  border-bottom: none;
}

/* Gallery Showcase */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin: 40px 0;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

.gallery-item img {
  border-radius: var(--radius-md);
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.gallery-caption {
  padding: 12px 6px 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #070b14;
  border-top: 1px solid var(--border-glass);
  padding: 70px 0 30px;
  color: var(--text-muted);
  position: relative;
  z-index: 10;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-brand p {
  font-size: 0.94rem;
  line-height: 1.6;
}

.footer-col h5 {
  font-size: 1.05rem;
  color: #ffffff;
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: #38bdf8;
  padding-left: 4px;
}

.footer-disclaimer {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 30px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 25px;
  border-top: 1px solid var(--border-glass);
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid,
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .apps-grid,
  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .author-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .author-avatar-box {
    margin: 0 auto;
  }

  .author-stats {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(10, 15, 29, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .header-cta .btn {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid-2,
  .feature-grid-2.reverse {
    grid-template-columns: 1fr;
  }

  .floating-metric {
    position: static;
    margin-top: 16px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
