/* ==========================================================================
   TALEA — Entrance Layer
   The privacy consent interface and the gateway to the site. It renders
   with the same self-hosted Fraunces/Inter typography as the main site.
   ========================================================================== */

html.consent-pending body,
body.consent-locked {
  overflow: hidden;
  height: 100%;
}

.entrance {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--charcoal);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin);
  overflow-y: auto;
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--dur-entrance) var(--ease),
              transform var(--dur-entrance) var(--ease);
}

.entrance.is-dismissing {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}

.entrance .corner-mark { color: var(--bronze); opacity: 0.55; }

/* The entrance layer's language switch sits top-right, mirroring the
   corner marks' top-left/bottom-right placement — first in reading and
   tab order, well before the Legal Notice checkbox and Enter button,
   but out of the way of the centred column below it. Scoped to a direct
   child of #entrance only, so it never affects the header's copy of
   this same component (see components.css / .nav-lang). */
#entrance > .lang-switch {
  position: absolute;
  top: var(--space-2);
  right: var(--margin);
  z-index: 5;
}

.entrance-inner {
  width: 100%;
  max-width: 560px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  animation: entranceIn 900ms var(--ease) 150ms forwards;
  margin-block: auto;
  padding-block: var(--space-3);
}

@keyframes entranceIn {
  to { opacity: 1; transform: translateY(0); }
}

.entrance-mark {
  height: clamp(64px, 8vw, 96px);
  width: auto;
  margin-inline: auto;
  display: block;
}

.entrance-wordmark {
  margin-top: var(--space-3);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ivory);
}

.entrance-tagline {
  margin-top: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.8rem, 0.7rem + 0.5vw, 1rem);
  letter-spacing: 0.1em;
  color: #EDE8DD;
  opacity: 0.8;
  white-space: nowrap;
}

html[lang="pl"] .entrance-tagline {
  max-width: 30rem;
  margin-inline: auto;
  white-space: normal;
}

.entrance-caveat {
  max-width: 520px;
  margin: var(--space-3) auto 0;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--paper-soft);
  text-align: justify;
  text-align-last: center;
  hyphens: auto;
}

.entrance-caveat a,
.entrance-legal-acceptance a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--bronze);
  text-underline-offset: 0.2em;
}

.entrance-legal-acceptance {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2);
  align-items: start;
  max-width: 520px;
  margin: var(--space-3) auto 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--paper-soft);
}

.entrance-legal-acceptance input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2em;
  accent-color: var(--bronze);
}

.entrance button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.entrance-divider {
  display: block;
  width: 120px;
  height: 12px;
  margin: var(--space-5) auto;
  color: var(--line-on-dark-strong);
}

.entrance-copy {
  max-width: 42ch;
  margin-inline: auto;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--paper-soft);
  text-align: justify;
  text-align-last: center;
  hyphens: auto;
}

.entrance-actions {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

/* Equal visual weight for both real choices — neither is styled to look
   more "correct" than the other. */
.entrance-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--line-on-dark-strong);
  padding: 0.95em 1.6em;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.entrance-btn:not(:disabled):hover,
.entrance-btn:not(:disabled):focus-visible {
  border-color: var(--bronze);
  transform: translateY(-2px);
}

/* The one path that hands over the most is deliberately the quietest
   element on screen — not hidden, not disabled, just not pushed. */
.entrance-link {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--paper-faint);
  background: none;
  border: none;
  padding: 0.4em;
  transition: color var(--dur-fast) var(--ease);
}

.entrance-link:hover,
.entrance-link:focus-visible {
  color: var(--paper-soft);
  text-decoration: underline;
}

.entrance-notice {
  display: inline-block;
  margin-top: var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.entrance-notice:hover,
.entrance-notice:focus-visible { color: var(--bronze); }

/* ---- Customize panel ------------------------------------------------------ */

.entrance-panel[hidden] { display: none; }

.entrance-panel:not([hidden]) {
  animation: panelIn 420ms var(--ease);
}

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

.entrance-categories {
  margin-top: var(--space-4);
  text-align: left;
}

.entrance-category {
  border-top: 1px solid var(--line-on-dark);
  padding-block: var(--space-3);
}

.entrance-category:last-child { border-bottom: 1px solid var(--line-on-dark); }

.entrance-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.entrance-category-name {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory);
}

.entrance-category-state {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.entrance-category-desc {
  margin-top: var(--space-1);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--paper-faint);
  max-width: 46ch;
}

/* Square, architectural toggle — no rounded consumer-app pill. */
.entrance-toggle {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.entrance-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.entrance-toggle span:not(.visually-hidden) {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-on-dark-strong);
  pointer-events: none;
  transition: border-color var(--dur-fast) var(--ease);
}

.entrance-toggle span:not(.visually-hidden)::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--paper-faint);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.entrance-toggle input:checked + span:not(.visually-hidden) {
  border-color: var(--bronze);
}

.entrance-toggle input:checked + span:not(.visually-hidden)::before {
  transform: translateX(16px);
  background: var(--bronze);
}

.entrance-toggle input:focus-visible + span:not(.visually-hidden) {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .entrance-actions { flex-direction: column; align-items: stretch; }
  .entrance-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .entrance,
  .entrance-inner,
  .entrance-panel:not([hidden]) {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
