/* Internetowe Rewolucje – cała grafika powstaje z cząsteczek (canvas); HTML to dostępna warstwa formularza. */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url('fonts/sora-latin-ext-300-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url('fonts/sora-latin-300-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('fonts/sora-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('fonts/sora-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('fonts/sora-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('fonts/sora-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #eceef6;
  --ink-soft: rgb(236 238 246 / 0.62);
  --ink-faint: rgb(236 238 246 / 0.38);
  --violet: #b3a3ff;
  --rose: #ffb3c4;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--ink);
  font-family: 'Sora', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html.js body {
  overflow: hidden;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Niewidoczny przycisk nad kołem – cel kliknięcia, dotyku i klawiatury */
.orb {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  touch-action: manipulation;
}
.orb:focus {
  outline: none;
}
.orb:focus-visible {
  box-shadow: 0 0 0 1px rgb(179 163 255 / 0.28);
}
body:not([data-state='start']):not([data-state='hover']):not([data-state='small']) .orb {
  visibility: hidden;
}

/* Warstwa formularza */
.panel {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  pointer-events: none;
}
.panel[data-open] {
  visibility: visible;
  pointer-events: auto;
}
.panel-inner {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: max(56px, env(safe-area-inset-top)) 24px max(56px, env(safe-area-inset-bottom));
}

.form {
  position: relative;
  width: min(340px, 100%);
  margin: 0 auto;
}

/* Tekst HTML pojawia się dopiero, gdy cząsteczki ułożą kształty */
.js .form .lbl,
.js .form input:not([type='radio']),
.js .form .opt span,
.js .form .send-label,
.js .form .close,
.js .form .err,
.js .form .status {
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js .panel[data-reveal] .form .lbl,
.js .panel[data-reveal] .form input:not([type='radio']),
.js .panel[data-reveal] .form .opt span,
.js .panel[data-reveal] .form .send-label,
.js .panel[data-reveal] .form .err,
.js .panel[data-reveal] .form .status {
  opacity: 1;
}
.js .panel[data-reveal] .form .close {
  opacity: 0.45;
}

.field {
  position: relative;
  margin: 0 0 18px;
  --i: 0;
}
.field .lbl,
.field input {
  transition-delay: calc(var(--i) * 70ms);
}

.lbl {
  display: inline-block;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  padding: 0;
  transition: color 300ms ease;
}
.field:focus-within .lbl {
  color: var(--ink);
}

input:not([type='radio']) {
  display: block;
  width: 100%;
  margin: 2px 0 0;
  padding: 8px 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f6f7fc;
  caret-color: var(--violet);
  font: 400 16px/1.4 'Sora', system-ui, sans-serif;
  letter-spacing: 0.01em;
  outline: none;
  appearance: none;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f6f7fc;
  -webkit-box-shadow: 0 0 0 1000px #000 inset;
  transition: background-color 9999s;
  caret-color: var(--violet);
}

.err {
  min-height: 0;
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--rose);
}
.err:empty {
  display: none;
}

.topics {
  border: 0;
  padding: 0;
  margin: 4px 0 0;
  min-width: 0;
}
.topics legend {
  padding: 0;
  margin-bottom: 10px;
}
.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 250ms ease;
  user-select: none;
}
.opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.opt:has(input:checked) {
  color: #fff;
}
@media (hover: hover) {
  .opt:hover {
    color: var(--ink);
  }
}

.send {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 30px;
  padding: 15px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: 500 15px/1.2 'Sora', system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}
.send:active:not(:disabled) {
  transform: scale(0.97);
}
.send[aria-disabled="true"] {
  cursor: progress;
}
.send:focus {
  outline: none;
}

.close {
  position: absolute;
  top: -44px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.close:focus-visible {
  outline: 1px solid rgb(179 163 255 / 0.5);
  outline-offset: 2px;
  opacity: 0.9 !important;
}
@media (hover: hover) {
  .close:hover {
    opacity: 0.9 !important;
  }
}

.status {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-soft);
}
.status[data-tone='error'] {
  color: var(--rose);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Formularz wyłączony w konfiguracji ('contact' => false) – zostaje samo koło */
body[data-contact='off'] .panel {
  display: none !important;
}

/* Bez JavaScriptu albo bez grafiki: zwykły, czytelny formularz */
html.no-js .orb,
html.no-js #stage {
  display: none;
}
html.no-js .panel,
.plain .panel {
  position: static;
  visibility: visible;
  pointer-events: auto;
}
html.no-js .panel-inner,
.plain .panel-inner {
  min-height: 100vh;
}
html.plain body {
  overflow: auto;
}
.plain .orb,
.plain #stage,
.plain .close {
  display: none;
}
html.no-js input:not([type='radio']),
.plain input:not([type='radio']) {
  border-bottom: 1px solid rgb(236 238 246 / 0.35);
}
html.no-js input:not([type='radio']):focus,
.plain input:not([type='radio']):focus {
  border-bottom-color: var(--violet);
}
html.no-js .opt,
.plain .opt,
html.no-js .send,
.plain .send {
  box-shadow: inset 0 0 0 1px rgb(236 238 246 / 0.3);
}
html.no-js .opt:has(input:checked),
.plain .opt:has(input:checked) {
  box-shadow: inset 0 0 0 1px rgb(236 238 246 / 0.9);
}
html.no-js .close {
  display: none;
}
.plain .opt:has(input:focus-visible),
.plain .send:focus-visible {
  box-shadow: inset 0 0 0 1px var(--violet);
}

@media (prefers-reduced-motion: reduce) {
  .js .form * {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
