/* ========================================================================
   Variables
   ======================================================================== */

:root {
  /* Colors - wood-inspired, modern, trustworthy */
  --color-bg: #f5f3ef; /* soft warm neutral */
  --color-surface: #ffffff;
  --color-text: #1f2933;
  --color-text-muted: #6b7280;

  --color-primary: #b87932; /* warm wood / copper */
  --color-primary-soft: #f3e2cf;
  --color-primary-dark: #8b551c;

  --color-success: #2e7d32;
  --color-warning: #ed6c02;
  --color-danger: #d32f2f;

  --color-border-subtle: #e0e0e0;
  --color-border-strong: #b0b0b0;

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

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --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 */

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --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-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-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.18);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 240ms ease-out;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 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,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

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

img {
  height: auto;
}

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

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

/* Remove default link styles */
a {
  text-decoration: none;
  color: inherit;
}

/* ========================================================================
   Base Styles
   ======================================================================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

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

p:last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-gray-900);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

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

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

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

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

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

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

strong,
b {
  font-weight: 600;
}

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

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Links (global behaviour, detailed styles in utilities/components) */
a {
  cursor: pointer;
}

a:hover {
  text-decoration: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-gray-200);
  margin: var(--space-6) 0;
}

/* ========================================================================
   Accessibility & Focus
   ======================================================================== */

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

[tabindex="-1"]:focus {
  outline: none !important;
}

/* 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;
}

/* ========================================================================
   Layout Utilities
   ======================================================================== */

/* Container - central width for main content (e.g. services, O nas, blog) */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  max-width: 1120px;
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.section--alt {
  background-color: var(--color-gray-50);
}

/* Flex helpers */
.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;
}

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

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

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

/* Grid helpers */
.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: 1fr;
  }
}

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

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

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

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.p-4 {
  padding: var(--space-4);
}

.p-6 {
  padding: var(--space-6);
}

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

.w-1-2 {
  width: 50%;
}

@media (max-width: 768px) {
  .w-1-2 {
    width: 100%;
  }
}

/* ========================================================================
   Components - Buttons
   ======================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-base),
              color var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base),
              transform var(--transition-fast);
}

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

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-primary-soft);
}

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

.btn-ghost:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Icon size helper within buttons */
.btn svg {
  width: 1rem;
  height: 1rem;
}

/* ========================================================================
   Components - Form Elements
   ======================================================================== */

label {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--color-gray-800);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base),
              background-color var(--transition-base);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-gray-400);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

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);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.form-field {
  margin-bottom: var(--space-4);
}

.form-help {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

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

/* ========================================================================
   Components - Card (for services, testimonials, FAQ, blog teasers)
   ======================================================================== */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.card--hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card--hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 23, 42, 0.08);
}

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

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

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

/* ========================================================================
   Components - Links (for nav, footer, content)
   ======================================================================== */

.link {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  transition: color var(--transition-base);
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width var(--transition-base);
}

.link:hover::after {
  width: 100%;
}

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

.link-muted:hover {
  color: var(--color-primary);
}

/* ========================================================================
   Components - Layout blocks commonly used on the site
   ======================================================================== */

/* Hero section for homepage */
.hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.hero-heading {
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 40rem;
}

/* Section headings (e.g. Usługi, O nas, Realizacje, Opinie, FAQ, Blog, Kontakt) */
.section-title {
  font-size: var(--font-size-3xl);
  text-align: left;
  margin-bottom: var(--space-2);
}

.section-intro {
  max-width: 36rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .hero {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .section-title,
  .hero-heading {
    text-align: left;
  }
}

/* ========================================================================
   Misc Helpers
   ======================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  font-size: var(--font-size-xs);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
}

.alert-success {
  background-color: #edf7ed;
  border-color: #c8e6c9;
  color: #256029;
}

.alert-error {
  background-color: #fdecea;
  border-color: #f5c6cb;
  color: #a32528;
}

.alert-info {
  background-color: #e8f4fd;
  border-color: #b6e0fe;
  color: #084c85;
}

/* ========================================================================
   End of base.css
   ======================================================================== */
