/*
 * ========================================
 * Brand Style Summary
 * ========================================
 * Kolorystyka: ciemna zielen (#0a1510) z akcentem zlotym (#8b6914).
 *   Tekst w cieplej bieli (#f5f2eb).
 * Nastroj: premium rzemioslo, cisza warsztatu, precyzja detalu.
 * Brand vibe: "nocny warsztat artysty" — zloto przebijajace
 *   przez ciemnosc, kontrast miedzy surowoscia a elegancja.
 * Typografia: Cormorant Garamond (headings), Segoe UI (body).
 * ========================================
 *
 * Struktura pliku:
 *   1. Design Tokens
 *   2. Reset & Base
 *   3. Buttons (bazowy komponent)
 *   4. Hero
 *   5. Sections (story / capabilities / vision / cta)
 *   6. Footer
 *   7. Brand Utilities (future-proof)
 *   8. Media Queries (tablet, mobile)
 * ========================================
 */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
  /* Colors — background */
  --color-bg-primary: #0a1510;
  --color-bg-section: rgba(10, 21, 16, 0.6);

  /* Colors — accent (gold) */
  --color-accent: #8b6914;
  --color-accent-light: #a47d1a;
  --color-accent-glow: rgba(139, 105, 20, 0.3);

  /* Colors — text (warm white) */
  --color-text-primary: #f5f2eb;
  --color-text-white: #f5f2eb;
  --color-text-light: rgba(245, 242, 235, 0.8);
  --color-text-subtle: rgba(245, 242, 235, 0.6);
  --color-text-muted: rgba(245, 242, 235, 0.35);

  /* Typography — headings */
  --font-heading: 'Cormorant Garamond', serif;

  /* Colors — overlay / shadow base */
  --color-shadow-light: rgba(0, 0, 0, 0.2);
  --color-shadow-medium: rgba(0, 0, 0, 0.5);
  --color-shadow-strong: rgba(0, 0, 0, 0.6);
  --color-shadow-heavy: rgba(0, 0, 0, 0.7);
  --color-shadow-deep: rgba(0, 0, 0, 0.8);

  /* Typography */
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-xs: 0.875rem;
  --font-size-sm: 1rem;
  --font-size-md: 1.1rem;
  --font-size-lg: 1.3rem;
  --font-size-xl: 2.2rem;
  --line-height-base: 1.6;

  /* Spacing */
  --space-xs: 0.3rem;
  --space-sm: 0.85rem;
  --space-md: 1.2rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 5rem;

  /* Border radius */
  --radius-sm: 4px;

  /* Shadows */
  --shadow-text-heavy: 0 2px 10px var(--color-shadow-deep);
  --shadow-text-medium: 0 2px 8px var(--color-shadow-strong);
  --shadow-text-soft: 0 1px 6px var(--color-shadow-medium);
  --shadow-accent-glow: 0 0 20px var(--color-accent-glow);
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

body {
  font-family: var(--font-family);
  color: var(--color-text-primary);
  line-height: var(--line-height-base);
  background: var(--color-bg-primary) url('../images/body-bg.png') center top / 100% auto repeat-y fixed;
}

/* Sections wrapper — kontener na sekcje */
.sections-wrapper {
  position: relative;
  overflow: hidden;
}

/* Gradient Morph effect — tylko dla sekcji */
.sections-wrapper::before {
  content: "";
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 40% 30% at 30% 30%, rgba(61, 90, 71, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 35% 40% at 70% 40%, rgba(139, 105, 20, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 45% 35% at 50% 70%, rgba(45, 80, 90, 0.18) 0%, transparent 70%);
  filter: blur(40px);
  animation: gradientMorph 25s ease-in-out infinite;
}

/* Grain texture — subtelny szum malarski */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}


/* ==========================================================================
   3. BUTTONS — bazowy komponent
   ========================================================================== */

/* Baza CTA */
.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
  opacity: 0.85;
}

.cta-button:focus-visible {
  outline: 2px solid rgba(245, 242, 235, 0.7);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(139, 105, 20, 0.2);
}

/* Wariant primary — zloty gradient */
.cta-button.primary {
  background: linear-gradient(135deg, #8b6914, #6b5210);
  color: #0a1510;
}

/* Wariant secondary — outline jasny */
.cta-button.secondary {
  background: transparent;
  border: 1.1px solid rgba(245, 242, 235, 0.35);
  color: #f5f2eb;
}

.cta-button.secondary:hover {
  border-color: rgba(245, 242, 235, 0.6);
}

/* Alias .btn (kompatybilnosc) */
.btn { /* dziedziczy styl z .cta-button jesli uzywany w HTML */ }


/* ==========================================================================
   4. HERO
   ========================================================================== */

/* 4a. Kontener hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1510;
  overflow: hidden;
}

/* 4b. Tlo — oryginalne kolory z subtelnym vignette */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.png');
  background-size: 100% 100%;
  background-position: center;
  z-index: 0;
}

/* Subtelny vignette dla czytelności tekstu */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 21, 16, 0.25) 100%);
}

/* 4b3. Top navigation (desktop: top-right) */
.top-nav {
  position: fixed;
  top: 1.25rem;
  right: calc(1.25rem + env(safe-area-inset-right));
  transform: translateY(0);
  z-index: 10001;

  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;

  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 105, 20, 0.18);
  background: rgba(10, 21, 16, 0.68);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  transition: top 0.25s ease, right 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.top-nav--docked {
  top: 50%;
  right: calc(1rem + env(safe-area-inset-right));
  transform: translateY(-50%);
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.55rem;
  padding: 0.65rem;
  background: rgba(10, 21, 16, 0.92);
}

@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .top-nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 21, 16, 0.5);
  }

  .top-nav--docked {
    background: rgba(10, 21, 16, 0.72);
  }
}

.top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 38px;
  padding: 0 0.85rem;
  border-radius: 999px;

  text-decoration: none;
  color: rgba(245, 242, 235, 0.78);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;

  border: 1px solid transparent;
  background: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.top-link__icon {
  display: none;
}

.top-link__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.top-nav--docked .top-link {
  width: 44px;
  height: 44px;
  padding: 0;
}

.top-nav--docked .top-link__label {
  display: none;
}

.top-nav--docked .top-link__icon {
  display: inline-flex;
}

.top-nav--docked .top-sep {
  display: none;
}

.top-link:hover {
  color: var(--color-text-white);
  border-color: rgba(245, 242, 235, 0.14);
  background: rgba(245, 242, 235, 0.04);
  transform: translateY(-1px);
}

.top-link:focus-visible {
  outline: 2px solid rgba(245, 242, 235, 0.7);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(139, 105, 20, 0.2);
}

.top-sep {
  width: 1px;
  height: 18px;
  background: rgba(245, 242, 235, 0.18);
  margin: 0 0.15rem;
}

.top-link--auth {
  letter-spacing: 0.12em;
}

.top-link--primary {
  color: rgba(10, 21, 16, 0.95);
  background: linear-gradient(135deg, #8b6914, #6b5210);
}

.top-link--primary:hover {
  border-color: rgba(139, 105, 20, 0.35);
  background: linear-gradient(135deg, #a47d1a, #6b5210);
}

/* 4b2. Starfield canvas */
#hero-starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* 4c. Tresc hero */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 4rem 2rem;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #8b6914;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.2rem, 6vw, 4.8rem);
  font-weight: 500;
  line-height: 1.05;
  color: #f5f2eb;
  margin-bottom: 2rem;
}

.hero-title span {
  position: relative;
}

.hero-title span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #8b6914, transparent);
  opacity: 0.7;
}

.hero-tagline {
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(245, 242, 235, 0.75);
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* ==========================================================================
   5. SECTIONS
   ========================================================================== */

/* 5a. Bazowy styl sekcji */
.section {
  position: relative;
  max-width: 100%;
  padding: 2rem 2rem;
  text-align: center;
}

/* 5b. Nakladka niebieska — plynne przejscie z hero */
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 21, 16, 0.2);
  pointer-events: none;
  z-index: 0;
}

/* 5c. Wewnetrzny kontener sekcji — zaokraglone tlo */
.section-inner {
  position: relative;
  z-index: 1;
  background: rgba(10, 21, 16, 0.6);
  border-radius: 16px;
  border: 1.1px solid rgba(139, 105, 20, 0.15);
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 3rem;
}

/* 5d. Eyebrow sekcji — maly label nad tytulem */
.section-eyebrow {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

/* 5e. Typografia sekcji */
.section h2 {
  position: relative;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 2rem;
  color: var(--color-text-white);
}

/* Pasek nad tytulem */
.section h2::before {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  margin: 0 auto 1rem;
  opacity: 0.6;
}

/* Pasek pod tytulem */
.section h2::after {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  margin: 0.8rem auto 0;
  opacity: 0.6;
}

.section p {
  max-width: 640px;
  margin: 0 auto;
  font-size: var(--font-size-md);
  line-height: 1.7;
  color: rgba(245, 242, 235, 0.75);
}

/* 5f. Portfolio grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 960px;
  margin: 2rem auto 0;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  background: rgba(10, 21, 16, 0.4);
  border: 1.27px solid rgba(139, 105, 20, 0.15);
}

.portfolio-item.tall {
  grid-row: span 2;
}

.portfolio-item.wide {
  grid-column: span 2;
}

.portfolio-meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  background: linear-gradient(
    to top,
    rgba(10, 21, 16, 0.85),
    rgba(10, 21, 16, 0.2),
    transparent
  );
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.portfolio-item:hover .portfolio-meta {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-meta h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-text-white);
  margin-bottom: 0.4rem;
}

.portfolio-meta p {
  font-size: 0.9rem;
  color: rgba(245, 242, 235, 0.7);
  max-width: none;
  margin: 0;
  text-align: left;
  line-height: 1.4;
}

/* 5g. CTA section */
.section--cta .hero-actions {
  margin-top: var(--space-xl);
}


/* ==========================================================================
   6. FOOTER
   ========================================================================== */

footer {
  text-align: center;
  padding: 1.25rem var(--space-xl);
  background: var(--color-bg-primary);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  border-top: 1px solid rgba(139, 105, 20, 0.15);
}


/* ==========================================================================
   6b. SOCIAL BAR (fixed)
   ========================================================================== */

.social-bar {
  position: fixed;
  left: calc(1rem + env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 2147483647; /* stay above grain overlay / hero canvas */

  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  justify-content: flex-start;
  align-items: center;

  padding: 0.65rem;
  border: 1px solid rgba(139, 105, 20, 0.22);
  background: rgba(10, 21, 16, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  border-radius: 999px;
}

@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .social-bar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 21, 16, 0.72);
  }
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;

  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  text-decoration: none;
  color: rgba(245, 242, 235, 0.8);
  background: rgba(245, 242, 235, 0.04);
  border: 1px solid rgba(245, 242, 235, 0.16);

  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.social-link svg {
  width: 20px;
  height: 20px;
  display: block;
}

.social-link:hover {
  color: var(--color-text-white);
  border-color: rgba(139, 105, 20, 0.45);
  background: rgba(139, 105, 20, 0.12);
  transform: translateY(-1px);
}

.social-link:focus-visible {
  outline: 2px solid rgba(245, 242, 235, 0.7);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(139, 105, 20, 0.2);
}


/* ==========================================================================
   7. BRAND UTILITIES — klasy wielokrotnego uzytku (future-proof)
      Korzystaja wylacznie z design tokens. Nie nadpisuja klas komponentowych.
   ========================================================================== */

/* Layout */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

/* Text color */
.text-accent {
  color: var(--color-accent);
}

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

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

/* Background */
.bg-dark {
  background-color: var(--color-bg-primary);
}

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

/* Shadows */
.shadow-soft {
  box-shadow: var(--shadow-text-soft);
}

.shadow-medium {
  box-shadow: var(--shadow-text-medium);
}

.shadow-glow {
  box-shadow: var(--shadow-accent-glow);
}

/* Spacing helpers */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Text utilities */
.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; }
.text-shadow { text-shadow: var(--shadow-text-medium); }

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


/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */

/* ---------- 8a. Tablet (769px – 1024px) ---------- */
@media (max-width: 1024px) {

  .hero-content {
    max-width: 600px;
    padding: 3rem var(--space-lg);
  }

  .hero-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
  }

  .hero-tagline {
    font-size: 1rem;
    margin-bottom: 2.5rem;
  }

  .section {
    padding: 1.5rem var(--space-lg);
  }

  .section-inner {
    padding: 3.5rem 2rem;
  }

  .section h2 {
    font-size: 1.8rem;
  }

  .section p {
    font-size: var(--font-size-sm);
  }

  .cta-button {
    padding: 0.85rem 2rem;
    font-size: 0.7rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }

  .portfolio-item.tall {
    grid-row: span 1;
  }
}

/* ---------- 8b. Mobile (≤768px) ---------- */
@media (max-width: 768px) {

  body {
    /* Mobile Safari and some Android browsers struggle with fixed backgrounds (jank/tearing). */
    background-attachment: scroll;
  }

  .hero {
    min-height: 100svh;
  }

  .hero-content {
    max-width: 100%;
    padding: 3rem 1.5rem;
    text-align: left;
  }

  .hero-eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-tagline {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-button {
    padding: 0.85rem 1.5rem;
    font-size: 0.7rem;
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .section {
    padding: 1rem var(--space-md);
  }

  .section-inner {
    padding: 2.5rem 1.5rem;
    border-radius: 12px;
  }

  .section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
  }

  .section p {
    font-size: var(--font-size-xs);
    max-width: 100%;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .portfolio-item.tall,
  .portfolio-item.wide {
    grid-column: auto;
    grid-row: auto;
  }

  .portfolio-meta {
    opacity: 1;
    transform: translateY(0);
  }

  footer {
    padding: 1rem var(--space-lg);
    font-size: 0.7rem;
  }

  .social-link {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .top-nav {
    left: calc(1rem + env(safe-area-inset-left));
    right: calc(1rem + env(safe-area-inset-right));
    top: 1rem;
    justify-content: center;
  }

  .top-link {
    height: 36px;
    padding: 0 0.75rem;
    font-size: 0.66rem;
  }
}

/* ---------- 8c. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sections-wrapper::before {
    animation: none;
  }

  .portfolio-meta,
  .cta-button {
    transition: none;
  }

  body::after {
    display: none;
  }

  .social-link,
  .top-link,
  .top-nav {
    transition: none;
  }

  #hero-starfield {
    display: none;
  }
}

/* ---------- 9. ANIMACJE ---------- */

/* Gradient Morph animation - smooth transform */
@keyframes gradientMorph {
  0% {
    transform: translate(0%, 0%) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(10%, 15%) rotate(3deg) scale(1.05);
  }
  50% {
    transform: translate(-5%, 10%) rotate(-2deg) scale(0.95);
  }
  75% {
    transform: translate(15%, -10%) rotate(4deg) scale(1.02);
  }
  100% {
    transform: translate(0%, 0%) rotate(0deg) scale(1);
  }
}
