/*
======================================================================
  MK WEK-GRAF Marcin Krawczyk Base Styles (base.css)
  Modern, minimalistic, professional, business-oriented
======================================================================
*/

/*======================================================================
  Variables
======================================================================*/
:root {
  /* Color Palette - neutral, professional, high contrast */
  --color-bg: #0f1115;              /* main background - deep charcoal */
  --color-bg-alt: #151820;          /* section background */
  --color-surface: #1d212b;         /* cards / elevated surfaces */

  --color-text: #f5f5f7;            /* primary text on dark bg */
  --color-text-muted: #a0a4b0;      /* secondary text */
  --color-border: #2b303c;          /* subtle borders/dividers */

  --color-primary: #ffcc33;         /* accent - warm, striking yellow */
  --color-primary-soft: rgba(255, 204, 51, 0.1);

  --color-success: #2ecc71;
  --color-warning: #f1c40f;
  --color-danger: #e74c3c;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "SF Pro Display", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  /* Font sizes (fluid-friendly scale) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.0625rem; /* 17px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  /* Line heights */
  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-7: 1.75rem;  /* 28px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Shadows (subtle, for minimalistic design) */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-soft-border: 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 18px 45px rgba(0, 0, 0, 0.55);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 260ms ease-out;

  /* Layout */
  --container-max-width: 1120px;
  --header-height: 72px;
}

/* Respect prefers-reduced-motion: limit animations globally */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/*======================================================================
  Reset / Normalize
======================================================================*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
}

input,
textarea,
button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

/* Remove default focus outlines; we'll add custom focus-visible below */
:focus {
  outline: none;
}

/*======================================================================
  Base Styles
======================================================================*/
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.is-locked {
  overflow: hidden;
}

main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.5rem, 4vw, var(--font-size-5xl));
}

h2 {
  font-size: clamp(2rem, 3vw, var(--font-size-4xl));
}

h3 {
  font-size: clamp(1.5rem, 2.4vw, var(--font-size-3xl));
}

h4 {
  font-size: var(--font-size-2xl);
}

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--transition-normal),
    text-decoration-color var(--transition-normal),
    opacity var(--transition-fast);
}

a:hover {
  text-decoration: underline;
}

a:active {
  opacity: 0.8;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

::selection {
  background-color: var(--color-primary);
  color: #000;
}

/*======================================================================
  Accessibility & Focus
======================================================================*/
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/*======================================================================
  Utilities
======================================================================*/
/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  padding-inline: var(--space-4);
  margin-inline: auto;
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

/* Layout spacing helpers (for sections) */
.section {
  padding-block: var(--space-12);
}

.section--dense {
  padding-block: var(--space-8);
}

.section--spacious {
  padding-block: var(--space-16);
}

/* Flex utilities */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-xs {
  gap: var(--space-2);
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

.gap-xl {
  gap: var(--space-8);
}

/* Grid utilities */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Alignment & text */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--color-text-muted);
}

/* Width helpers */
.w-full {
  width: 100%;
}

/* Spacing utilities (margin/padding blocks only for cleanliness) */
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: var(--space-2) !important; }
.mt-sm { margin-top: var(--space-3) !important; }
.mt-md { margin-top: var(--space-4) !important; }
.mt-lg { margin-top: var(--space-6) !important; }
.mt-xl { margin-top: var(--space-8) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: var(--space-2) !important; }
.mb-sm { margin-bottom: var(--space-3) !important; }
.mb-md { margin-bottom: var(--space-4) !important; }
.mb-lg { margin-bottom: var(--space-6) !important; }
.mb-xl { margin-bottom: var(--space-8) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-sm { padding-top: var(--space-3) !important; }
.pt-md { padding-top: var(--space-4) !important; }
.pt-lg { padding-top: var(--space-6) !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-sm { padding-bottom: var(--space-3) !important; }
.pb-md { padding-bottom: var(--space-4) !important; }
.pb-lg { padding-bottom: var(--space-6) !important; }

/*======================================================================
  Components
======================================================================*/
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.btn-primary {
  background: var(--color-primary);
  color: #000;
  box-shadow: 0 14px 40px rgba(255, 204, 51, 0.25);
}

.btn-primary:hover {
  background: #ffd755;
  transform: translateY(-1px);
  box-shadow: 0 18px 55px rgba(255, 204, 51, 0.32);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(255, 204, 51, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.02);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Inputs & form elements */
.input,
.textarea,
.select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: rgba(12, 14, 18, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

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

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft);
  background-color: rgba(17, 20, 26, 0.95);
}

.input--invalid,
.textarea--invalid {
  border-color: var(--color-danger);
}

.field-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.field-helper {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.field-error {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Card */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft-border);
  padding: var(--space-6);
}

.card--minimal {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Tag / pill for categories (e.g., case studies, blog, services) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag--primary {
  border-color: rgba(255, 204, 51, 0.35);
  background-color: rgba(255, 204, 51, 0.08);
  color: var(--color-primary);
}

/* Simple badge for status (e.g., Wynik, ROI, KPI in case studies) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  font-size: var(--font-size-xs);
}

.badge--success {
  background-color: rgba(46, 204, 113, 0.12);
  color: var(--color-success);
}

.badge--danger {
  background-color: rgba(231, 76, 60, 0.12);
  color: var(--color-danger);
}

/* Header spacing helper (for fixed headers) */
.page-offset-top {
  padding-top: var(--header-height);
}

/*======================================================================
  Helpers for Polish business context (subtle, typographic)
======================================================================*/
.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: 600;
}

.kpi-label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
