/* ============================================
   Chomicza Nora — Projekt Maszynownia
   Modern mobile-first stylesheet
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Colors */
  --c-bg:          #faf5ff;
  --c-bg-alt:      #f3e8ff;
  --c-surface:     #ffffff;
  --c-border:      #e2d9f3;
  --c-text:        #1f2937;
  --c-text-muted:  #2a2d33;
  --c-heading:     #111827;

  /* Brand */
  --c-discord:     #5865F2;
  --c-minecraft:   #62A87C;
  --c-teamspeak:   #FF9500;
  --c-kofi:        #13C3A4;
  --c-primary:     #827a91;

  /* Typography */
  --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 20px 48px rgba(0,0,0,0.16);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.3s;

  /* Layout */
  --max-w: 1200px;
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  font-size: var(--fs-base);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: color-mix(in srgb, var(--c-primary) 85%, black); }

ul { list-style: none; }

h1, h2, h3, h4 {
  color: var(--c-heading);
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- Utilities ---------- */
.container {
  width: min(var(--max-w), 100% - 2rem);
  margin-inline: auto;
}
.container--narrow {
  width: min(820px, 100% - 2rem);
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn--sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn--lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn--full { width: 100%; justify-content: center; }

.btn--discord { background: var(--c-discord); color: #fff; }
.btn--discord:hover { background: #4752c4; color: #fff; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--kofi { background: var(--c-kofi); color: #fff; }
.btn--kofi:hover { background: #0fa88e; color: #fff; }
.btn--xl { padding: 1rem 2.5rem; font-size: 1.075rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-heading);
  text-decoration: none;
}
.logo:hover { color: var(--c-primary); }
.logo img { border-radius: var(--radius-sm); }
.logo-text { display: none; }
@media (min-width: 480px) {
  .logo-text { display: inline; }
}

/* Navigation */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.main-nav a {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--dur) var(--ease);
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--c-primary);
  background: rgba(124, 58, 237, 0.07);
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-heading);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    width: min(420px, 92vw);
    background: var(--c-surface);
    box-shadow: var(--shadow-xl);
    padding: 1.25rem 1.5rem max(2rem, env(safe-area-inset-bottom));
    transform: translateX(100%);
    transition: transform var(--dur) var(--ease);
    z-index: 999;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .main-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
  .main-nav.is-open {
    transform: translateX(0);
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }
  .main-nav a {
    display: block;
    padding: 0.9rem 1rem;
    font-size: 1.0625rem;
  }
  .main-nav .btn {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 0.95rem 1rem;
    font-size: 1.0625rem;
    margin-top: 0.75rem;
    border-radius: var(--radius-sm);
  }
  .main-nav .nav-cta {
    border-top: 1px solid var(--c-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
  }
}
@media (max-width: 480px) {
  .main-nav {
    left: 0;
    width: 100vw;
    padding-inline: 1rem;
  }
}
@media (min-width: 769px) {
  .nav-toggle { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--header-h) + 2rem) 1rem 4rem;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 10% 65%, rgba(109, 40, 217, 0.85) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 90% 20%, rgba(67, 56, 202, 0.75) 0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 50% 100%, rgba(19, 195, 164, 0.25) 0%, transparent 50%),
    #080112;
  z-index: -1;
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.25em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 2rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}
.hero-desc {
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.75);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}
.hero-scroll a { color: rgba(255, 255, 255, 0.5); }
.hero-scroll a:hover { color: #fff; }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* ---------- Hero Badge ---------- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  margin-bottom: 1.25rem;
}

/* ---------- Hero Stats ---------- */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2.5rem auto 0;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  padding: 0.25rem 0;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9rem 1.75rem;
}
.hero-stat strong {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.hero-stat span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.hero-stat-sep {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
@media (max-width: 400px) {
  .hero-stat-sep { display: none; }
  .hero-stat { padding: 0.75rem 1rem; }
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-2xl) 0;
  background: var(--c-surface);
}
.section--alt {
  background: var(--c-bg-alt);
}
.section--dark {
  background: #0d0620;
  color: rgba(255, 255, 255, 0.8);
}
.section--dark .section-title {
  color: #fff;
}
.section--dark .section-subtitle {
  color: rgba(255, 255, 255, 0.55);
}
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.5rem;
}
.section-subtitle {
  font-size: 1.1rem;
  color: var(--c-text-muted);
}

/* ---------- Grids ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* ---------- Cards ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--dur) var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card--highlight {
  border: 2px solid var(--c-primary);
  background: linear-gradient(135deg, var(--c-surface) 0%, #f5eeff 100%);
}
.card--highlight:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

/* Service card accent left border */
.card[data-color] {
  border-left: 4px solid var(--accent);
}

.card-icon {
  font-size: 2.25rem;
  margin-bottom: var(--space-md);
}
.card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.card p {
  color: var(--c-text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
.card-link {
  display: inline-block;
  margin-top: var(--space-md);
  font-weight: 600;
  font-size: 0.95rem;
}
.card-address {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-md);
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--c-bg-alt);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: 1px solid var(--c-border);
}
.card-address:hover {
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.card-address svg {
  width: 14px;
  height: 14px;
  opacity: 0.4;
  transition: opacity var(--dur);
}
.card-address:hover svg { opacity: 0.8; }

/* ---------- Service Tiles ---------- */
.service-tile {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}
.service-tile:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
}
.service-tile__header {
  padding: 2.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-tile__icon {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
}
.service-tile__body {
  padding: 1.5rem;
  border-top: 1px solid var(--c-border);
}
.service-tile__body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.service-tile__body p {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}
.service-tile__link {
  display: inline-block;
  margin-top: var(--space-md);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Sponsor Block ---------- */
.sponsor-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  max-width: 520px;
  margin: 0 auto;
}
.sponsor-banner {
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  width: 100%;
}
.status-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: all var(--dur) var(--ease);
}
.status-card:hover {
  box-shadow: var(--shadow-md);
}
.status-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-text-muted);
}
.status-dot--online  { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.status-dot--offline { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.3); }
.status-dot--loading { background: #f59e0b; animation: pulse 1.5s infinite; }
.status-name {
  font-weight: 600;
  font-size: 1rem;
}
.status-info {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  text-align: right;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ---------- FAQ Accordion ---------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.accordion-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease);
}
.accordion-item:hover {
  box-shadow: var(--shadow-sm);
}
.accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--c-heading);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}
.accordion-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--c-text-muted);
  transition: transform var(--dur) var(--ease);
}
.accordion-item.is-open .accordion-btn svg {
  transform: rotate(180deg);
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.accordion-body-inner {
  padding: 0 1.5rem 1.25rem;
  color: var(--c-text-muted);
  line-height: 1.7;
}

/* ---------- Sponsor ---------- */
.sponsor-grid {
  display: grid;
  gap: var(--space-lg);
}
@media (min-width: 640px) {
  .sponsor-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.sponsor-info h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.sponsor-info h3:first-child { margin-top: 0; }
.sponsor-info p {
  color: var(--c-text-muted);
  line-height: 1.7;
}
.benefit-list {
  margin-top: 0.75rem;
}
.benefit-list li {
  padding: 0.5rem 0;
  padding-left: 1.75rem;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}
.benefit-list li::before {
  content: '✅';
  position: absolute;
  left: 0;
}
.sponsor-cta-inner {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sponsor-banner {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #160d28;
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xl) 0 var(--space-lg);
}
.footer-inner {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: auto 1fr auto;
    text-align: left;
    justify-items: start;
    align-items: start;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.footer-brand img { border-radius: var(--radius-sm); }
.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
}
.footer-brand small {
  display: block;
  font-size: 0.8rem;
  opacity: 0.6;
}
.footer-widget {
  justify-self: center;
}
.footer-widget iframe {
  border-radius: var(--radius-md);
  max-width: 100%;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: center;
}
@media (min-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-start;
  }
}
.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  transition: color var(--dur);
}
.footer-links a:hover { color: #fff; }
.footer-copy {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.5;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  color: var(--c-text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all var(--dur) var(--ease);
  z-index: 100;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  transform: translateY(-2px);
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Mobile overlay for nav ---------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
  z-index: 998;
}
.nav-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .hero-scroll,
  .back-to-top,
  .nav-toggle,
  .footer-widget { display: none; }
  .hero { min-height: auto; padding: 2rem 0; }
  .section { padding: 1.5rem 0; }
}
