/* ------------------------------------------------------------
   Tokens
------------------------------------------------------------ */
:root {
  --bg: #EAE3D6;
  --ink: #221D1A;
  --ink-soft: #6E6656;
  --accent: #7C4C6B;
  --line: #C7BB9E;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
}

/* ------------------------------------------------------------
   Reset
------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Ambient grain texture — matte, stone-like surface
------------------------------------------------------------ */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 28%, rgba(255,255,255,0.22), transparent 65%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(48,42,32,0.10), transparent 60%);
}

/* ------------------------------------------------------------
   Layout
------------------------------------------------------------ */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vh 1.5rem;
}

/* ------------------------------------------------------------
   Entrance
------------------------------------------------------------ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dotsFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal {
  opacity: 0;
  animation: fadeUp 1.1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  animation-delay: var(--d, 0s);
}

.orb-dots {
  opacity: 0;
  animation: dotsFade 1.6s ease-out forwards;
  animation-delay: 0.1s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .orb-dots { opacity: 1; animation: none; transform: none; }
}

/* ------------------------------------------------------------
   3D orb — text at the centre, autumn leaves held in slow orbit
------------------------------------------------------------ */
.orb-stage {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  perspective: 1500px;
}

.orb-frame {
  position: relative;
  transform-style: preserve-3d;
}

.orb-dots {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.orb-dots--back  { z-index: 1; }
.orb-dots--front { z-index: 3; }

.orbit-tilt {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
}

.orbit-spin {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
  animation-name: orbitSpin;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes orbitSpin {
  from { transform: rotateZ(0deg); }
  to   { transform: rotateZ(360deg); }
}

.leaf {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) translateX(var(--r, 100px));
  color: #C1652F;
}

.leaf,
.leaf-counter,
.leaf-untilt {
  transform-style: preserve-3d;
}

/* odwrotność obrotu orbity — liść nie kręci się razem z nią */
.leaf-counter,
.leaf-untilt {
  display: block;
  width: 100%;
  height: 100%;
}

.leaf-counter {
  animation: counterSpin 40s linear infinite;
}

@keyframes counterSpin {
  from { transform: rotateZ(0deg); }
  to   { transform: rotateZ(-360deg); }
}

.leaf-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: leafFlutter 5s ease-in-out infinite alternate;
}

/* trzepotanie liścia — kołysanie w płaszczyźnie + lekki obrót wokół osi */
@keyframes leafFlutter {
  from { transform: rotateZ(-30deg) rotateX(-22deg) rotateY(-14deg); }
  to   { transform: rotateZ(30deg)  rotateX(28deg)  rotateY(34deg); }
}

.orb-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem 1.25rem;
}

/* ------------------------------------------------------------
   Typography / Content
------------------------------------------------------------ */
.specimen-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1.6rem;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.headline {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 480;
  font-size: clamp(2rem, 5.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.6rem;
}

.subheadline {
  font-family: var(--font-display);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

.body-text {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 1.8rem;
}

.br-desktop { display: none; }
@media (min-width: 640px) { .br-desktop { display: inline; } }

.divider {
  display: block;
  width: 44px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.6;
  padding-bottom: 2rem;
}

/* ------------------------------------------------------------
   Reduced motion
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .orbit-spin, .leaf-counter, .leaf-svg { animation: none !important; }
}
