/* ==========================================================================
   Zakład Introligatorski Musioł — style.css (v2)
   Direction: modern dark atelier. Archival engravings framed as museum
   plates against a near-black ground; warm brass light; restrained motion
   used as signature moments, not decoration on every element.
   Type: Fraunces (light/italic display) + Inter (UI/body).
   ========================================================================== */

:root {
  --bg: #0B0908;
  --bg-soft: #120D0A;
  --panel: #17110C;
  --panel-glass: rgba(24, 18, 13, 0.55);
  --stroke: rgba(243, 238, 228, 0.10);
  --stroke-strong: rgba(203, 163, 92, 0.35);

  --text: #F3EEE4;
  --text-dim: rgba(243, 238, 228, 0.64);
  --text-faint: rgba(243, 238, 228, 0.4);

  --gold: #CBA35C;
  --gold-bright: #EAC77E;
  --gold-dim: rgba(203, 163, 92, 0.5);
  --oxblood: #9A4433;

  --paper: #ECE3D0; /* used only for the "plate" cards, deliberately light */
  --paper-ink: #241812;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1220px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film-grain texture, constant across the page */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--paper-ink); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

h2 {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.3rem;
  font-weight: 500;
}

p { margin: 0 0 1em; color: var(--text-dim); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: 1.14rem;
  max-width: 44ch;
  color: var(--text-dim);
}

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold-dim);
}

ul.craft-list {
  list-style: none;
  margin: 1.5em 0 0;
  padding: 0;
  max-width: 48ch;
}

ul.craft-list li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.75em;
  color: var(--text-dim);
}

ul.craft-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px 1px rgba(203, 163, 92, 0.5);
}

/* ---- scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- ambient gradient mesh (hero backdrop) ---- */
.mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.mesh span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  animation: drift 22s ease-in-out infinite;
}

.mesh span:nth-child(1) {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(203,163,92,0.9), transparent 70%);
  top: -140px; left: -80px;
  animation-duration: 26s;
}

.mesh span:nth-child(2) {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(154,68,51,0.7), transparent 70%);
  bottom: -160px; right: -60px;
  animation-duration: 30s;
  animation-delay: -8s;
}

.mesh span:nth-child(3) {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(203,163,92,0.5), transparent 70%);
  top: 30%; right: 18%;
  animation-duration: 34s;
  animation-delay: -14s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 25px) scale(0.96); }
}

/* cursor-follow spotlight, set via JS custom properties */
.spotlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--x, 50%) var(--y, 30%),
    rgba(203, 163, 92, 0.10),
    transparent 65%
  );
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

.site-header.scrolled {
  background: rgba(11, 9, 8, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--stroke);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  height: 46px;
  width: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(203,163,92,0.25));
}

.brand-text { font-family: var(--font-display); line-height: 1.1; }

.brand-text .top {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-weight: 400;
}

.brand-text .name {
  display: block;
  font-size: 1.22rem;
  font-weight: 500;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.93rem;
  position: relative;
  padding: 4px 0;
  transition: color 0.25s ease;
}

nav.main-nav a:hover { color: var(--text); }

nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

nav.main-nav a:hover::after,
nav.main-nav a:focus-visible::after { transform: scaleX(1); }

.header-phone {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.header-phone:hover { color: var(--gold-bright); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius);
  width: 42px;
  height: 42px;
  color: var(--text);
  cursor: pointer;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.35s var(--ease), border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
  will-change: transform;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #201607;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(203,163,92,0.55); }

.btn-outline {
  background: transparent;
  border-color: var(--stroke-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-bright); transform: translateY(-2px); }

/* ---- hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--stroke);
}

.hero .wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding-top: 88px;
  padding-bottom: 96px;
  min-height: 620px;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  font-weight: 300;
  max-width: 15ch;
  letter-spacing: -0.01em;
}

.hero-copy h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-bright);
}

.hero-copy p.lede { margin-top: 24px; }

.hero-actions {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.hero-badges {
  margin-top: 48px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel-glass);
  backdrop-filter: blur(6px);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 1px rgba(203,163,92,0.6);
}

/* hero plate: framed photograph */
.hero-plate {
  position: relative;
  perspective: 1200px;
}

.plate {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 30px 70px -25px rgba(0,0,0,0.7), 0 0 0 1px var(--stroke-strong);
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease);
  will-change: transform;
}

.plate-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ar, 4 / 5);
  background: var(--panel);
}

.plate-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ken Burns: slow ambient drift, reserved for real photographs */
.kb-img {
  animation: kenburns 24s ease-in-out infinite alternate;
  will-change: transform;
  transform-origin: 55% 45%;
}

@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.1) translate(-1.5%, -1%); }
}

.plate-caption {
  margin-top: 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-faint);
  text-align: center;
}

/* corner brackets that draw in on reveal */
.bracket {
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid var(--gold);
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}
.is-visible .bracket { opacity: 1; }
.bracket.tl { top: -10px; left: -10px; border-right: none; border-bottom: none; }
.bracket.tr { top: -10px; right: -10px; border-left: none; border-bottom: none; }
.bracket.bl { bottom: -10px; left: -10px; border-right: none; border-top: none; }
.bracket.br { bottom: -10px; right: -10px; border-left: none; border-top: none; }

/* ---- marquee strip ---- */
.marquee {
  border-bottom: 1px solid var(--stroke);
  background: var(--bg-soft);
  overflow: hidden;
  padding: 20px 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll-left 34s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-faint);
  padding: 0 28px;
  white-space: nowrap;
  border-right: 1px solid var(--stroke);
}

.marquee-track span em {
  color: var(--gold);
  font-style: normal;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- section shell ---- */
section { position: relative; z-index: 1; }

.section { padding: 120px 0; }

.section-head { margin-bottom: 56px; max-width: 62ch; }

/* ---- services: editorial split rows ---- */
.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
  padding: 64px 0;
}

.service-row + .service-row { border-top: 1px solid var(--stroke); }

.service-row.reverse .service-copy { order: 2; }
.service-row.reverse .service-figure { order: 1; }

.service-copy h3.service-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 6px;
}

.service-copy .service-sub {
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 20px;
  display: block;
}

.service-figure {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease);
  will-change: transform;
}

.tilt-card { max-width: 380px; }
.tilt-card.wide { max-width: 440px; }

/* ---- workshop gallery strip ---- */
.warsztat-gallery {
  position: relative;
  background: var(--bg-soft);
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  overflow: hidden;
}

.warsztat-gallery::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../images/tekstura-marmurkowa.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.warsztat-gallery::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-soft), rgba(18,13,10,0.25) 35%, var(--bg-soft));
  pointer-events: none;
}

.gallery-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  margin-top: 12px;
}

.gallery-grid figure { margin: 0; }

/* ---- feature cards (Doświadczenie i rzemiosło) ---- */
.pillars { background: var(--bg-soft); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 8px;
}

.pillar {
  position: relative;
  padding: 40px 32px;
  background: var(--panel-glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  transition: transform 0.4s var(--ease), border-color 0.4s ease, box-shadow 0.4s ease;
}

.pillar:hover {
  transform: translateY(-6px);
  border-color: var(--stroke-strong);
  box-shadow: 0 20px 40px -20px rgba(203,163,92,0.25);
}

.pillar .icon { width: 42px; height: 42px; margin-bottom: 20px; color: var(--gold); }

.pillar h3 { margin-bottom: 10px; }
.pillar p { font-size: 0.96rem; }

/* ---- contact / map ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  align-items: start;
}

.contact-info h2 { margin-bottom: 20px; }

.info-line {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.info-line svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--gold); }
.info-line a { text-decoration: none; color: var(--text); transition: color 0.2s ease; }
.info-line a:hover { color: var(--gold-bright); }
.info-line div { color: var(--text-dim); }

.map-frame {
  margin-top: 32px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}

.map-frame iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
  filter: invert(94%) hue-rotate(180deg) contrast(90%) saturate(120%);
}

/* form */
.contact-form {
  background: var(--panel-glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: 44px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.field { margin-bottom: 22px; }

.field label { display: block; font-size: 0.84rem; color: var(--text-dim); margin-bottom: 7px; }

.field input,
.field textarea {
  width: 100%;
  background: rgba(11,9,8,0.5);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(203, 163, 92, 0.16);
}

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

.hp-field { position: absolute; left: -9999px; top: -9999px; }

.form-note { font-size: 0.82rem; color: var(--text-faint); margin-top: 16px; }

.form-status {
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  display: none;
}

.form-status.ok {
  display: block;
  background: rgba(154, 68, 51, 0.08);
  border: 1px solid rgba(120, 160, 90, 0.4);
  color: #A9CE8E;
}

.form-status.err {
  display: block;
  background: rgba(154, 68, 51, 0.12);
  border: 1px solid rgba(154, 68, 51, 0.5);
  color: #E39C8B;
}

/* ---- footer ---- */
.site-footer {
  background: var(--bg-soft);
  color: var(--text-faint);
  padding: 56px 0 30px;
  font-size: 0.9rem;
  border-top: 1px solid var(--stroke);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--stroke);
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { height: 34px; width: 34px; object-fit: contain; }
.footer-brand span { font-family: var(--font-display); color: var(--text); font-size: 1.05rem; }

.footer-links { display: flex; gap: 32px; }
.footer-links a { text-decoration: none; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  nav.main-nav { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .site-header.nav-open { background: rgba(11,9,8,0.94); backdrop-filter: blur(14px); }

  .site-header.nav-open nav.main-nav {
    display: flex;
    position: absolute;
    top: 88px;
    left: 0; right: 0;
    background: rgba(11,9,8,0.96);
    flex-direction: column;
    gap: 0;
    padding: 8px 40px 24px;
    border-bottom: 1px solid var(--stroke);
  }

  .site-header.nav-open nav.main-nav a {
    padding: 14px 0;
    width: 100%;
    border-bottom: 1px solid var(--stroke);
  }

  .header-phone { display: none; }

  .hero .wrap { grid-template-columns: 1fr; padding-top: 52px; min-height: 0; }
  .hero-plate { order: -1; max-width: 320px; margin: 0 auto 12px; }

  .marquee-track span { font-size: 0.92rem; padding: 0 18px; }

  .service-row, .service-row.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 44px 0;
  }
  .service-row.reverse .service-copy,
  .service-row.reverse .service-figure { order: initial; }
  .service-figure { order: -1; }

  .pillars-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; gap: 32px; }
  .tilt-card, .tilt-card.wide { max-width: 100%; }

  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 30px 22px; }

  .section { padding: 76px 0; }
  .wrap { padding: 0 22px; }
}
