/* =========================================================================
   KONOPIE PL 2026 — Design system
   Ciemny, premium, scrollytelling. Głębia > płaskość.
   Tokeny + komponenty. Cała mechanika ruchu zgodna z zasadami craftu
   (custom easing, transform/opacity na GPU, reduced-motion = mniej ruchu).
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300..700&family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..500&display=swap');

:root {
  /* — Tła i powierzchnie (warstwy głębi) — */
  --bg-0: #05080a;          /* najgłębsze tło */
  --bg-1: #070c0e;          /* baza dokumentu */
  --bg-2: #0a1316;          /* sekcje */
  --surface: rgba(18, 30, 31, 0.55);     /* szkło */
  --surface-solid: #0e1719;
  --surface-hi: rgba(255, 255, 255, 0.06);

  /* — Atrament / tekst — */
  --ink: #eaf4ef;
  --ink-soft: #b6c7c0;
  --ink-mut: #7d918a;
  --ink-dim: #54635e;

  /* — Akcenty — */
  --emerald: #34e0a1;
  --emerald-deep: #19b37e;
  --amber: #f2c14e;
  --amber-deep: #d99b2a;
  --violet: #a78bfa;
  --cyan: #46c2ff;
  --rose: #ff7a8a;

  /* — Sygnały pewności — */
  --c-pewne: #34e0a1;
  --c-praw: #46c2ff;
  --c-zgad: #f2c14e;

  /* — Hairline / obrysy — */
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  --line-glow: rgba(52, 224, 161, 0.35);

  /* — Cienie / głębia — */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 80px -28px rgba(0,0,0,.85);
  --glow-emerald: 0 0 40px -6px rgba(52,224,161,.35);

  /* — Typografia — */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Inter', Georgia, serif;

  /* — Ruch (custom easing — mocniejsze niż wbudowane) — */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 420ms;

  /* — Layout — */
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-1);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv05';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* — Tło: warstwy głębi (gradient mesh + winieta + grain) — */
.bg-layers { position: fixed; inset: 0; z-index: -3; pointer-events: none; }
.bg-mesh {
  position: fixed; inset: -10%; z-index: -4; pointer-events: none;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(25, 179, 126, .14), transparent 60%),
    radial-gradient(50% 45% at 85% 8%, rgba(70, 194, 255, .08), transparent 60%),
    radial-gradient(55% 60% at 78% 88%, rgba(167, 139, 250, .10), transparent 62%),
    radial-gradient(50% 50% at 30% 95%, rgba(242, 193, 78, .06), transparent 60%);
  filter: saturate(1.1);
  animation: meshDrift 32s ease-in-out infinite alternate;
}
@keyframes meshDrift { to { transform: translate3d(2%, -1.5%, 0) scale(1.05); } }

.bg-vignette {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0,0,0,.55) 100%);
}
/* Grain: SVG turbulencja jako data-uri, bardzo subtelnie — zabija "płaskość" */
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
}

/* — Canvas Three.js (scena 3D) — fixed za treścią — */
#scene {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  width: 100vw; height: 100vh;
  transition: opacity .6s var(--ease-out);
}
/* Scrubowana sekwencja klatek (bohater hero) — portretowy panel po prawej, wtopiony w tło */
.hero-seq {
  position: fixed; top: 0; right: 0; height: 100svh;
  width: clamp(340px, 52vw, 720px);
  z-index: -2; pointer-events: none;
  filter: brightness(.9) saturate(1.06) contrast(1.04);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%), linear-gradient(0deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 32%), linear-gradient(0deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-composite: intersect;
  transition: opacity .8s var(--ease-out);
}
@media (max-width: 820px) { .hero-seq { width: 100vw; opacity: .32; } }
body.no-webgl #scene { display: none; }
.viz-legend span i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* =========================== NAV =========================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(5,8,10,.8), rgba(5,8,10,0));
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  transition: background var(--dur) var(--ease-out);
}
.nav.solid { background: rgba(5,8,10,.86); border-bottom: 1px solid var(--line-soft); }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.nav__mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: conic-gradient(from 200deg, var(--emerald), var(--cyan), var(--violet), var(--amber), var(--emerald));
  box-shadow: var(--glow-emerald);
  filter: saturate(1.2);
}
.nav__links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a {
  color: var(--ink-mut); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav__links a:hover { color: var(--ink); background: var(--surface-hi); }
.nav__links a.active { color: var(--bg-0); background: var(--emerald); }

/* =========================== LAYOUT =========================== */
main { position: relative; z-index: 1; }
.section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vh, 160px) var(--gutter);
  scroll-margin-top: calc(var(--nav-h) + 12px);
}
.section--wide { max-width: 1440px; }
.section--full { max-width: none; padding-left: 0; padding-right: 0; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--emerald); margin: 0 0 14px;
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--emerald); opacity: .6; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -.02em; line-height: 1.04; }
h2.title { font-size: clamp(30px, 4.6vw, 58px); margin: 0 0 18px; }
.lead { font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-soft); max-width: 62ch; margin: 0 0 8px; }
.muted { color: var(--ink-mut); }
.grad-text {
  background: linear-gradient(100deg, var(--emerald), var(--cyan) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* =========================== HERO =========================== */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  position: relative;
}
.hero__kicker { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-mut); margin-bottom: 22px; }
.hero h1 { font-size: clamp(44px, 8.5vw, 132px); margin: 0; line-height: .96; }
.hero h1 em { font-style: italic; color: var(--emerald); }
.hero__sub { margin-top: 26px; font-size: clamp(17px, 1.9vw, 23px); color: var(--ink-soft); max-width: 54ch; }
.hero__meta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 13px; color: var(--ink-mut); }
.hero__meta b { color: var(--ink); font-weight: 600; }
.scroll-cue {
  position: absolute; bottom: 34px; left: var(--gutter);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim);
  display: flex; align-items: center; gap: 10px;
}
.scroll-cue .dot { width: 22px; height: 36px; border: 1px solid var(--line); border-radius: 12px; position: relative; }
.scroll-cue .dot::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; border-radius: 2px;
  background: var(--emerald); transform: translateX(-50%); animation: cue 1.8s var(--ease-in-out) infinite;
}
@keyframes cue { 0%,100% { opacity: .3; transform: translate(-50%, 0); } 50% { opacity: 1; transform: translate(-50%, 12px); } }

/* =========================== GLASS CARD =========================== */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
/* górny highlight = nie-płaskie szkło */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  opacity: .6;
}
@media (hover: hover) and (pointer: fine) {
  .card.lift:hover { transform: translateY(-4px); border-color: var(--line-glow); box-shadow: var(--shadow-lg), var(--glow-emerald); }
}

/* =========================== TAGI PEWNOŚCI =========================== */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor; line-height: 1.4;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--pewne { color: var(--c-pewne); background: rgba(52,224,161,.08); }
.tag--praw  { color: var(--c-praw);  background: rgba(70,194,255,.08); }
.tag--zgad  { color: var(--c-zgad);  background: rgba(242,193,78,.08); }

/* przypis źródła */
sup.fn { font-size: .62em; }
sup.fn a { color: var(--cyan); text-decoration: none; padding: 0 1px; }
sup.fn a:hover { text-decoration: underline; }

/* =========================== "NIEWYGODNA PRAWDA" =========================== */
.truth-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.truth {
  padding: 26px 28px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(52,224,161,.06), rgba(18,30,31,.5));
  backdrop-filter: blur(14px);
}
.truth--lead { border-color: var(--line-glow); box-shadow: var(--glow-emerald); }
.truth h3 { font-size: clamp(20px, 2.4vw, 28px); margin: 0 0 10px; }
.truth p { margin: 0; color: var(--ink-soft); }
.truth .tag { margin-bottom: 12px; }

/* =========================== STAT KARTY =========================== */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { padding: 22px; }
.stat .val { font-family: var(--font-display); font-size: clamp(30px, 4vw, 46px); line-height: 1; color: var(--ink); }
.stat .val .unit { font-size: .45em; color: var(--ink-mut); margin-left: 4px; }
.stat .desc { margin-top: 10px; font-size: 14px; color: var(--ink-mut); }
.stat .tag { margin-top: 12px; }

/* =========================== KARTY FIRM =========================== */
.firm-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.firm { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.firm__top { display: flex; align-items: center; gap: 12px; }
.firm__flag { font-size: 22px; }
.firm__name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.firm__roles { display: flex; flex-wrap: wrap; gap: 6px; }
.role {
  font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 500;
  background: var(--surface-hi); color: var(--ink-soft); border: 1px solid var(--line-soft);
}
.role[data-r="producent"] { color: var(--emerald); border-color: rgba(52,224,161,.3); }
.role[data-r="hodowla"]   { color: var(--amber);   border-color: rgba(242,193,78,.3); }
.role[data-r="dystrybutor"]{ color: var(--cyan);   border-color: rgba(70,194,255,.3); }
.role[data-r="marka"]     { color: var(--violet);  border-color: rgba(167,139,250,.3); }
.firm__desc { font-size: 13.5px; color: var(--ink-mut); }
.firm__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-dim); }

/* filtr ról */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.fbtn {
  font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all var(--dur-fast) var(--ease-out);
}
.fbtn:hover { border-color: var(--line-glow); color: var(--ink); }
.fbtn.active { background: var(--emerald); color: var(--bg-0); border-color: var(--emerald); }
.fbtn:active { transform: scale(0.97); }

/* =========================== ODMIANY =========================== */
.strain-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.strain { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.strain__name { font-weight: 600; font-size: 16px; }
.strain__brand { font-size: 12px; color: var(--ink-mut); }
.strain__thc { font-family: var(--font-display); font-size: 32px; line-height: 1; margin-top: 4px; }
.strain__thc .u { font-size: .4em; color: var(--ink-mut); }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-soft); width: max-content; }
.chip--indica { color: #c4a5ff; border-color: rgba(167,139,250,.35); background: rgba(167,139,250,.08); }
.chip--sativa { color: #ffd27a; border-color: rgba(242,193,78,.35); background: rgba(242,193,78,.08); }
.chip--hybryda{ color: var(--emerald); border-color: rgba(52,224,161,.35); background: rgba(52,224,161,.08); }
.strain[data-status="zapowiedź"], .strain[data-status="pozwolenie"] { border-style: dashed; opacity: .9; }
.badge-soon { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); border: 1px dashed var(--amber-deep); padding: 2px 7px; border-radius: 6px; }

/* =========================== MAPA + GRAF =========================== */
.viz-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: rgba(8,13,14,.6); box-shadow: var(--shadow-lg); }
#map, #graph { width: 100%; display: block; }
#map { height: clamp(420px, 60vh, 640px); }
#graph { height: clamp(460px, 66vh, 720px); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--ink-mut); }
.viz-legend span { display: inline-flex; align-items: center; gap: 7px; }
.viz-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.viz-hint { font-size: 13px; color: var(--ink-dim); margin-top: 10px; }
.map-tooltip, .graph-tooltip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0;
  background: rgba(8,13,14,.95); border: 1px solid var(--line-glow); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; max-width: 280px; box-shadow: var(--shadow-lg);
  transition: opacity var(--dur-fast) var(--ease-out);
}
.map-tooltip b, .graph-tooltip b { color: var(--emerald); }

/* legenda krawędzi pewności grafu */
.edge-line { display:inline-block; width:26px; height:0; border-top:2px solid var(--ink-soft); vertical-align: middle; }
.edge-line.pewne { border-top-style: solid; border-color: var(--c-pewne); }
.edge-line.praw  { border-top-style: dashed; border-color: var(--c-praw); }
.edge-line.zgad  { border-top-style: dotted; border-color: var(--c-zgad); }

/* =========================== TIMELINE (zapowiedzi) =========================== */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--emerald), var(--cyan), var(--violet)); opacity: .5; }
.tl-item { position: relative; padding: 0 0 26px 4px; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-1); border: 2px solid var(--emerald); }
.tl-year { font-family: var(--font-display); font-size: 22px; color: var(--emerald); }

/* =========================== THC oś (beeswarm) =========================== */
#thc-axis { width: 100%; height: clamp(220px, 32vh, 340px); display: block; }

/* =========================== LUKI =========================== */
.blind { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.blind .card { padding: 20px; }
.blind h4 { margin: 0 0 8px; font-family: var(--font-sans); font-size: 15px; font-weight: 600; color: var(--ink); }
.blind p { margin: 0; font-size: 14px; color: var(--ink-mut); }

/* =========================== ŹRÓDŁA =========================== */
.sources { display: grid; gap: 8px; counter-reset: src; }
.src { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: rgba(255,255,255,.015); }
.src .n { color: var(--emerald); font-variant-numeric: tabular-nums; font-weight: 600; min-width: 26px; }
.src a { color: var(--ink-soft); text-decoration: none; word-break: break-word; }
.src a:hover { color: var(--ink); text-decoration: underline; }

/* =========================== METRYCZKA =========================== */
.meta-bar { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.meta-bar .card { padding: 18px; }
.meta-bar h4 { margin: 0 0 8px; font-family: var(--font-sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mut); }
.meta-bar ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-soft); }
.meta-bar li { margin: 4px 0; }

/* bilans pewności */
.balance { display: flex; height: 12px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); margin-top: 10px; }
.balance i { display: block; height: 100%; }
.balance .b-pewne { background: var(--c-pewne); }
.balance .b-praw { background: var(--c-praw); }
.balance .b-zgad { background: var(--c-zgad); }

/* =========================== FOOT =========================== */
.foot { max-width: var(--maxw); margin: 0 auto; padding: 40px var(--gutter) 80px; color: var(--ink-dim); font-size: 13px; border-top: 1px solid var(--line-soft); }

/* =========================== REVEAL (scroll-in) =========================== */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal[data-d="1"].in { transition-delay: .06s; }
.reveal[data-d="2"].in { transition-delay: .12s; }
.reveal[data-d="3"].in { transition-delay: .18s; }

/* =========================== RESPONSYWNOŚĆ =========================== */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav__brand span { display: none; }
}

/* =========================== REDUCED MOTION =========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-mesh, .scroll-cue .dot::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: opacity .3s ease; }
  * { scroll-behavior: auto !important; }
}
