/* ==========================================
   EMBERIZA — Modern Woodcraft Website
   ========================================== */

:root {
  --color-bg: #0e0c09;
  --color-surface: #1a1610;
  --color-surface2: #221e17;
  --color-accent: #c8873a;
  --color-accent-light: #e8a456;
  --color-text: #f0ebe2;
  --color-text-muted: #a09080;
  --color-eyebrow: #c8873a;

  --font-display: 'Dela Gothic One', cursive;
  --font-body: 'Inter', sans-serif;

  --nav-h: 72px;
  --section-pad: clamp(5rem, 10vw, 9rem);
  --container: 1200px;
}

/* ==========================================
   GRAIN OVERLAY
   ========================================== */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.032;
  pointer-events: none;
  z-index: 9999;
  animation: grainShift 0.4s steps(1) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,   0);   }
  20%  { transform: translate(-3%, 4%);  }
  40%  { transform: translate(5%,  -2%); }
  60%  { transform: translate(-4%, 6%);  }
  80%  { transform: translate(3%,  -5%); }
  100% { transform: translate(-2%, 2%);  }
}

/* PAGE LOAD */
body.loading { opacity: 0; }
body { transition: opacity 0.6s ease; }

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
section[id] { scroll-margin-top: var(--nav-h); }

/* ==========================================
   NAVIGATION
   ========================================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
  z-index: 100;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

#nav.scrolled {
  background: rgba(14, 12, 9, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(200, 135, 58, 0.15);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  color: var(--color-text);
  transition: color 0.25s;
}
.nav-logo:hover { color: var(--color-accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color 0.25s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 0;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}
.nav-links a:hover,
.nav-links a.active { color: var(--color-text); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================
   PARALLAX BASE
   ========================================== */
.parallax-section {
  position: relative;
  overflow: hidden;
}
.parallax-bg {
  position: absolute;
  inset: -30% 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  z-index: 0;
}

/* ==========================================
   HERO
   ========================================== */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 12, 9, 0.35) 0%,
    rgba(14, 12, 9, 0.55) 60%,
    rgba(14, 12, 9, 0.9) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 1.5rem;
  max-width: 800px;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 9rem);
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--color-text);
  margin: 0.5rem 0 1rem;
}

.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 300;
  color: rgba(240, 235, 226, 0.75);
  letter-spacing: 0.05em;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: fadeUp 1s ease 1.2s both;
}
.mouse {
  width: 26px;
  height: 42px;
  border: 2px solid rgba(200, 135, 58, 0.6);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.mouse-wheel {
  width: 3px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 2px;
  animation: mouseScroll 1.8s ease-in-out infinite;
}
@keyframes mouseScroll {
  0%   { transform: translateY(0); opacity: 1; }
  60%  { transform: translateY(10px); opacity: 0; }
  61%  { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================
   EYEBROW + BUTTONS
   ========================================== */
.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  border: 1px solid rgba(200, 135, 58, 0.5);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  border-radius: 2px;
}
.btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #0e0c09;
}

/* ==========================================
   MARQUEE
   ========================================== */
.marquee-strip {
  background: var(--color-accent);
  overflow: hidden;
  padding: 0.9rem 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  animation: marquee 22s linear infinite;
  will-change: transform;
}
.marquee-track span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #0e0c09;
  padding: 0 1.5rem;
}
.marquee-track .dot {
  padding: 0;
  opacity: 0.4;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==========================================
   INTRO BANNER
   ========================================== */
.intro-banner {
  background: var(--color-surface);
  border-top: 1px solid rgba(200, 135, 58, 0.12);
  border-bottom: 1px solid rgba(200, 135, 58, 0.12);
  padding: 4rem clamp(1.5rem, 8vw, 6rem);
  text-align: center;
}
.intro-banner p {
  max-width: 780px;
  margin: 0 auto;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  line-height: 1.9;
  color: rgba(240, 235, 226, 0.75);
  letter-spacing: 0.02em;
}

/* ==========================================
   FEATURE SECTIONS (parallax + text)
   ========================================== */
.feature-section {
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.feature-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(14, 12, 9, 0.85) 0%,
    rgba(14, 12, 9, 0.6) 50%,
    rgba(14, 12, 9, 0.2) 100%
  );
  z-index: 1;
}
.feature-section--right .feature-overlay {
  background: linear-gradient(
    to left,
    rgba(14, 12, 9, 0.85) 0%,
    rgba(14, 12, 9, 0.6) 50%,
    rgba(14, 12, 9, 0.2) 100%
  );
}

.feature-content {
  position: relative;
  z-index: 2;
  padding: var(--section-pad) clamp(2rem, 8vw, 7rem);
  max-width: 560px;
}
.feature-section--right .feature-content {
  margin-left: auto;
}

.feature-content h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin: 0.25rem 0 1.5rem;
  color: var(--color-text);
}

.feature-content p {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-weight: 300;
  color: rgba(240, 235, 226, 0.8);
  line-height: 1.9;
  max-width: 420px;
}

/* ==========================================
   SPLIT SECTION (Produkcja)
   ========================================== */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
  background: var(--color-surface);
}

.split-images {
  display: grid;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
}
.split-img {
  overflow: hidden;
}
.split-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.split-img:hover img { transform: scale(1.04); }

.split-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--section-pad) clamp(2rem, 6vw, 5rem);
}

.split-text h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin: 0.25rem 0 1.5rem;
  color: var(--color-text);
}

.split-text p {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-weight: 300;
  color: rgba(240, 235, 226, 0.75);
  line-height: 1.9;
  max-width: 420px;
}

/* ==========================================
   CARDS SECTION (Właściwości + Zastosowanie)
   ========================================== */
.cards-section {
  background: var(--color-bg);
  padding: var(--section-pad) clamp(1.5rem, 6vw, 5rem);
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-width: var(--container);
  margin: 0 auto;
}

.card {
  background: var(--color-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img {
  overflow: hidden;
  height: 320px;
}
.card-img--tall { height: 400px; }

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.card:hover .card-img img { transform: scale(1.05); }

.card-body {
  padding: 2.5rem 2.5rem 3rem;
  flex: 1;
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin: 0.25rem 0 1rem;
}

.card-body p {
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(240, 235, 226, 0.7);
  line-height: 1.9;
}

/* ==========================================
   CONTACT SECTION
   ========================================== */
.contact-section {
  min-height: 80svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 12, 9, 0.82);
  z-index: 1;
}

.contact-content {
  position: relative;
  z-index: 2;
  padding: 0 1.5rem;
}

.contact-content h2 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin: 0.5rem 0 0.5rem;
}

.contact-phone {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--color-accent-light);
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: 1px solid rgba(200, 135, 58, 0.35);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text);
  border-radius: 2px;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.2s;
}
.contact-btn svg {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}
.contact-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #0e0c09;
  transform: translateY(-2px);
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid rgba(200, 135, 58, 0.12);
  text-align: center;
  padding: 2rem 1.5rem;
}
.site-footer p {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.site-footer a {
  color: var(--color-accent);
  transition: color 0.25s;
}
.site-footer a:hover { color: var(--color-accent-light); }

/* ==========================================
   ANIMATIONS
   ========================================== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.9s ease forwards;
}
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll-triggered reveals */
.reveal, .reveal-left, .reveal-right {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }

.reveal.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0);
}

.reveal.delay-1,
.reveal-left.delay-1,
.reveal-right.delay-1 {
  transition-delay: 0.15s;
}

/* ==========================================
   RESPONSIVE — TABLET
   ========================================== */
@media (max-width: 900px) {
  .split-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .split-images {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px;
    height: 240px;
  }
  .split-text {
    padding: 3.5rem 2rem;
  }
  .feature-content {
    padding: 5rem 2rem;
    max-width: 100%;
  }
  .feature-overlay {
    background: rgba(14, 12, 9, 0.7) !important;
  }
  .feature-section--right .feature-content {
    margin-left: 0;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   RESPONSIVE — MOBILE
   ========================================== */
@media (max-width: 640px) {
  :root { --nav-h: 60px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(14, 12, 9, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    gap: 0;
    padding: 1.5rem 0 2rem;
    border-bottom: 1px solid rgba(200, 135, 58, 0.15);
    transform: translateY(calc(-100% - var(--nav-h)));
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s ease, opacity 0.35s ease, visibility 0.35s;
    z-index: 99;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links li { text-align: center; }
  .nav-links a {
    display: block;
    padding: 1rem 2rem;
    font-size: 0.85rem;
  }

  .nav-toggle { display: flex; }

  .hero-content h1 {
    font-size: clamp(2.4rem, 12vw, 5rem);
    letter-spacing: 0.04em;
  }

  .split-images {
    height: 200px;
  }

  .card-img { height: 240px; }
  .card-body { padding: 1.75rem 1.5rem 2.25rem; }

  .contact-links { flex-direction: column; align-items: center; }
  .contact-btn { width: 100%; max-width: 260px; justify-content: center; }

  .feature-content h2, .split-text h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

/* High-end screens — subtle texture */
@media (prefers-reduced-motion: reduce) {
  .fade-up, .reveal, .reveal-left, .reveal-right {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
  .parallax-bg {
    inset: 0;
    will-change: auto;
  }
  .marquee-track {
    animation: none;
  }
}
