/* ============================================================
   MECHANIZM — wariant C: równowaga
   Mono jako podstawa. Serif tylko w credzie.
   Jedna linia copy na akt. Numeracja aktów jako anchor.
============================================================ */

:root {
  --bg:     #000000;
  --fg:     #D8D4CB;   /* primary — ciepły off-white, mniej sterylne niż A, czytelniejsze niż B */
  --dim:    #8A847A;   /* drugi rejestr */
  --faint:  #3A352E;   /* tła / grid */
  --line:   rgba(216, 212, 203, 0.12);
  --line-strong: rgba(216, 212, 203, 0.22);

  --mono:   'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif:  'Source Serif 4', 'Source Serif Pro', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

p { margin: 0; }

a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color 200ms ease, color 200ms ease;
}
a:hover { border-color: var(--fg); }

::selection { background: var(--fg); color: var(--bg); }

.dim { color: var(--dim); }

/* ============================================================
   AKT — wspólne
============================================================ */

.akt {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 0 6vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

/* numerator w prawym górnym rogu każdego aktu */
.act-mark {
  position: absolute;
  top: 2rem;
  right: 6vw;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.line {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--fg);
  max-width: 36em;
  text-align: center;
  line-height: 1.55;
}

/* ============================================================
   AKT 0 — LICZNIK
============================================================ */

.akt-0 .prefix {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--dim);
  text-transform: uppercase;
}

.akt-0 .counter {
  font-size: clamp(1.6rem, 5vw, 3.4rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 0.1em;
  letter-spacing: 0;
}

.akt-0 .counter .num { color: var(--fg); }

.akt-0 .counter .u {
  font-size: 0.42em;
  color: var(--dim);
  margin-right: 0.5em;
  font-weight: 300;
}

.akt-0 .counter .time {
  font-size: 0.55em;
  color: var(--dim);
  margin-left: 0.4em;
  font-weight: 300;
}

/* ============================================================
   AKT 1 — CISZA
============================================================ */

.akt-1 {
  min-height: 280vh;
  padding: 0;
  display: block;
}

.akt-1-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  overflow: hidden;
  padding: 0 6vw;
}

.akt-1-sticky .act-mark {
  position: absolute;
  top: 2rem;
  right: 6vw;
}

.grid-wrap {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.grid-strip {
  display: grid;
  grid-template-rows: repeat(2, 8px);
  grid-auto-flow: column;
  grid-auto-columns: 8px;
  gap: 3px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.grid-strip .cell {
  width: 8px;
  height: 8px;
  background: var(--faint);
  border-radius: 1px;
}

.grid-strip .cell.mark {
  background: var(--dim);
  cursor: help;
}

/* ============================================================
   AKT 2 — SLOT
============================================================ */

.lead {
  font-family: var(--mono);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--fg);
  text-align: center;
  max-width: 32em;
  letter-spacing: 0.02em;
}

.slot {
  width: min(560px, 80vw);
  border: 1px solid var(--line-strong);
}

.slot-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
}

.slot-label { color: var(--dim); }
.slot-date  { color: var(--fg); letter-spacing: 0.08em; }

.slot-body {
  padding: 2.6rem 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slot-cd {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--fg);
}

.cross {
  font-size: 0.9rem;
  color: var(--dim);
  text-align: center;
  letter-spacing: 0.02em;
}

.cross a { color: var(--fg); }

/* ============================================================
   AKT 3 — PAUZA
============================================================ */

.akt-3 .timeline {
  width: min(720px, 88vw);
  color: var(--fg);
}

.akt-3 .timeline svg {
  width: 100%;
  height: 60px;
  display: block;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  margin-top: 0.5rem;
}

/* ============================================================
   AKT 4 — COVER
============================================================ */

.cover {
  width: clamp(220px, 26vw, 300px);
  aspect-ratio: 2 / 3;
  background: #050505;
  border: 1px solid var(--line-strong);
  padding: 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.cover-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--dim);
}

.cover-title {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.cover-meta {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  text-align: center;
}

/* ============================================================
   CODA
============================================================ */

.coda {
  padding: 10rem 6vw 6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

/* sigil — jedyny moment koloru w całym dokumencie */
.sigil {
  width: clamp(140px, 18vw, 200px);
  height: auto;
  margin-bottom: 1rem;
  opacity: 0;
  transition: opacity 1200ms ease-in;
  user-select: none;
  -webkit-user-drag: none;
}

.sigil.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .sigil { transition: none; opacity: 1; }
}

.creed {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--fg);
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 28em;
}

.foot-nav {
  display: inline-flex;
  gap: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  align-items: center;
}

.foot-nav a {
  color: var(--dim);
  border-bottom-color: transparent;
}

.foot-nav a:hover { color: var(--fg); }

.foot-nav .sp { color: var(--faint); }

/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 720px) {
  body { font-size: 14px; }

  .akt-1 { min-height: 220vh; }

  .grid-strip {
    grid-template-rows: repeat(4, 6px);
    grid-auto-columns: 6px;
    gap: 2px;
  }
  .grid-strip .cell { width: 6px; height: 6px; }

  .akt-0 .counter { font-size: clamp(1.3rem, 6vw, 2.4rem); }
  .akt-0 .counter .u { font-size: 0.38em; }
  .akt-0 .counter .time { font-size: 0.48em; }

  .act-mark { font-size: 0.6rem; top: 1.2rem; right: 5vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grid-strip { transition: none !important; }
}
