/* ============================================================
   BudArtAI · style.css
   Mobile-first, dev/terminal aesthetic, dark mode only
   ============================================================ */

:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev-2: #1c2128;
  --border: #30363d;
  --border-strong: #484f58;
  --text: #c9d1d9;
  --text-strong: #f0f6fc;
  --text-muted: #8b949e;
  --accent: #3fb950;        /* terminal green */
  --accent-dim: #238636;
  --accent-2: #f59e0b;      /* amber for numbers */
  --accent-3: #58a6ff;      /* blue for links */
  --danger: #f85149;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --max-width: 1200px;
  --pad-mobile: 1.25rem;
  --pad-desktop: 2rem;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--accent); color: var(--bg); }

/* noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

main, header, footer, nav { position: relative; z-index: 1; }

a { color: var(--accent-3); }

/* ===== NAV ===== */
nav {
  position: sticky;
  top: 0;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem var(--pad-mobile);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-strong);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand::before {
  content: '~/';
  color: var(--accent);
  margin-right: 4px;
}
.brand .ai { color: var(--accent); }
.brand-cursor {
  display: inline-block;
  width: 7px;
  height: 1rem;
  background: var(--accent);
  vertical-align: -1px;
  margin-left: 3px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* mobile menu */
.nav-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(13, 17, 23, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  padding: 1rem var(--pad-mobile);
  gap: 0;
}
.nav-links.open { display: flex; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-links a:last-child { border-bottom: none; }
.nav-links a:hover { color: var(--accent); }

/* ===== HERO ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--pad-mobile) 3rem;
}
.hero-prompt {
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  word-break: break-all;
}
.hero-prompt .green { color: var(--accent); }
.hero-prompt .blue { color: var(--accent-3); }

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(1.85rem, 8vw, 3.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  margin-bottom: 1.25rem;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .underline {
  position: relative;
  display: inline-block;
}
.hero h1 .underline::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: var(--accent);
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  text-align: center;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn-secondary:hover, .btn-secondary:focus {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-disabled {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.55;
  position: relative;
}
.btn-disabled:hover { transform: none; }
.btn-disabled::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.btn-disabled:hover::after, .btn-disabled:focus::after { opacity: 1; }

.btn .arrow { transition: transform 0.15s; display: inline-block; }
.btn:hover .arrow, .btn:focus .arrow { transform: translateX(3px); }

.hero-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.hero-meta span::before {
  content: '// ';
  color: var(--accent);
}

/* ===== SECTIONS ===== */
section.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--pad-mobile);
}
.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: lowercase;
  word-break: break-all;
}
.section-label::before { content: '$ '; }
.section-title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 2rem;
  max-width: 800px;
  line-height: 1.25;
}

/* services */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.service {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s;
}
.service:hover {
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.service-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}
.service h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}
.service p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* projects */
.projects { display: grid; gap: 1rem; }
.project {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  transition: all 0.2s;
}
.project:hover {
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.project-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  justify-content: space-between;
}
.project-number {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.project-stat {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-2);
  text-align: right;
  line-height: 1.1;
}
.project-stat small {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}
.project-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}
.project-content p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.project-stack {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.tech-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  background: var(--bg-elev-2);
  color: var(--text);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* inne-projekty */
.inne-projekty-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.inne-projekt-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.inne-projekt-card.locked { border-style: dashed; }
.inne-projekt-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.inne-projekt-tag.muted { color: var(--text-muted); }
.inne-projekt-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
}
.inne-projekt-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.inne-projekt-card .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.inne-projekt-card .actions .btn { font-size: 0.78rem; padding: 0.6rem 0.9rem; min-height: 38px; }

/* wiedza-box */
.wiedza-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.wiedza-box h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.4rem;
}
.wiedza-box p { color: var(--text-muted); font-size: 0.92rem; }
.wiedza-tags {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.9;
}
.wiedza-tags span { color: var(--accent); }
.wiedza-tags a { color: var(--text-muted); text-decoration: none; }
.wiedza-tags a:hover { color: var(--accent); }

/* contact form */
.contact-form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 580px;
  margin: 0 auto;
}
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-group label::before { content: '> '; color: var(--accent); }
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  color: var(--text-strong);
  font-family: var(--sans);
  font-size: 1rem;
  min-height: 44px;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 120px; font-family: var(--sans); }
.form-honey { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.flash-success {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.85rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: left;
}
.flash-error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.85rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: left;
}

/* cta section */
.cta-section {
  text-align: center;
  padding: 3.5rem var(--pad-mobile);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.cta-section h2 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cta-section .cta-lead {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* footer */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem var(--pad-mobile) 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .brand {
  font-size: 1rem;
  display: inline-block;
  margin-bottom: 0.75rem;
}
.footer-brand p {
  font-family: var(--sans);
  max-width: 320px;
}
.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: color 0.15s;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.footer-col a:hover { color: var(--accent); }

.footer-social { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.footer-social a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
  color: var(--text-muted);
  margin-bottom: 0;
}
.footer-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}
.footer-bottom .legal { font-size: 0.7rem; line-height: 1.6; }
.footer-bottom .legal span { color: var(--text); font-weight: 500; }
.footer-bottom a { color: var(--text-muted); text-decoration: underline; }
.footer-bottom a:hover { color: var(--accent); }

/* ===== WIEDZA PAGE ===== */
.wiedza-page { max-width: 800px; margin: 0 auto; padding: 3rem var(--pad-mobile); }
.wiedza-back {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  display: inline-block;
}
.wiedza-back:hover { color: var(--accent); }
.wiedza-back::before { content: '← '; color: var(--accent); }

.wiedza-page h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.wiedza-page h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 2rem 0 0.75rem;
}
.wiedza-page h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 1.5rem 0 0.5rem;
}
.wiedza-page p { margin-bottom: 1rem; color: var(--text); }
.wiedza-page ul, .wiedza-page ol { margin: 0 0 1rem 1.5rem; }
.wiedza-page li { margin-bottom: 0.4rem; color: var(--text); }
.wiedza-page a { color: var(--accent-3); text-decoration: underline; }
.wiedza-page a:hover { color: var(--accent); }
.wiedza-page code {
  font-family: var(--mono);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}
.wiedza-page pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.wiedza-page blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.wiedza-index {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.wiedza-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  display: block;
  transition: all 0.2s;
}
.wiedza-card:hover {
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.wiedza-card .num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
}
.wiedza-card h3 {
  font-size: 1.1rem;
  color: var(--text-strong);
  margin: 0.4rem 0;
}
.wiedza-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* fade in */
.fade-in { opacity: 0; animation: fadeIn 0.5s ease-out forwards; }
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.15s; }
.fade-in:nth-child(3) { animation-delay: 0.25s; }
.fade-in:nth-child(4) { animation-delay: 0.35s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TABLET / DESKTOP ===== */
@media (min-width: 640px) {
  .nav-inner { padding: 1rem var(--pad-desktop); }
  .hero { padding: 5rem var(--pad-desktop) 4rem; }
  section.content-section { padding: 4rem var(--pad-desktop); }
  .cta-section { padding: 5rem var(--pad-desktop); }
  footer { padding: 3rem var(--pad-desktop) 2rem; }
  .wiedza-page { padding: 4rem var(--pad-desktop); }

  .hero-prompt { font-size: 0.85rem; }
  .hero-sub { font-size: 1.1rem; }
  .hero-meta { gap: 2rem; font-size: 0.78rem; }

  .hero-cta { flex-direction: row; }
  .btn { padding: 0.85rem 1.5rem; font-size: 0.9rem; }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .project {
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    padding: 2rem;
    align-items: center;
  }
  .project-header { display: contents; }
  .project-number { font-size: 2.5rem; }
  .project-stat { font-size: 1.75rem; }
  .project-stat small { font-size: 0.7rem; }

  .inne-projekty-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }

  .wiedza-box { flex-direction: row; align-items: center; justify-content: space-between; padding: 2.5rem; }
  .wiedza-box > div:first-child { flex: 1; }

  .wiedza-index { grid-template-columns: repeat(2, 1fr); }

  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
  .footer-bottom { flex-direction: row; align-items: center; }

  .contact-form { padding: 2rem; }
}

@media (min-width: 900px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
  .inne-projekty-grid { grid-template-columns: repeat(2, 1fr); }
  .wiedza-index { grid-template-columns: repeat(3, 1fr); }

  /* desktop nav */
  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 0;
    gap: 2rem;
  }
  .nav-links a { border: none; padding: 0; min-height: auto; font-size: 0.85rem; }
}
