/* ============================================
   shared.css — TwinTides
   ============================================ */
:root {
  --bg: #09090b;
  --bg2: #111113;
  --bg3: #18181b;
  --text: #fafafa;
  --muted: #71717a;
  --dim: #3f3f46;
  --border: #1f1f23;
  --border2: #27272a;
  --accent: #6ee7b7;
  --accent2: #f43f5e;
  --accent3: #fbbf24;
  --mono: "JetBrains Mono", "Courier New", monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
.page {
  min-height: 100vh;
  padding-top: 64px;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 56px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--text);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: 3px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 10px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}
.lang-btn:hover {
  color: var(--text);
}
.lang-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.lang-btn + .lang-btn {
  border-left: 1px solid var(--border2);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-p {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-p:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 28px rgba(110, 231, 183, 0.2);
}
.btn-s {
  background: transparent;
  color: var(--text);
  border-color: var(--border2);
}
.btn-s:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== TAGS ===== */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--border2);
  letter-spacing: 0.05em;
}

/* ===== SECTION HEAD ===== */
.label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
.sec-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.sec-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.sec-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== CURSOR ===== */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-right {
  display: flex;
  gap: 20px;
  align-items: center;
}
.site-footer a {
  color: var(--muted);
  transition: color 0.2s;
}
.site-footer a:hover {
  color: var(--accent);
}

/* ===== PAGE HEADER ===== */
.page-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 56px 60px;
}
.page-head .eyebrow {
  margin-bottom: 18px;
}
.page-head h1 {
  font-size: clamp(44px, 6.5vw, 88px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.page-head h1 .accent {
  color: var(--accent);
}
.page-head .lead {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--muted);
  max-width: 640px;
  line-height: 1.8;
  font-weight: 300;
}

/* ===== CONSENT CHECKBOX ===== */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.consent.error {
  border-color: var(--accent2);
}
.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--muted);
  background: var(--bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s;
}
.consent input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.consent input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
}
.consent label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.consent label a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== FORM FIELDS ===== */
.field {
  margin-bottom: 20px;
  position: relative;
}
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 13px 16px;
  transition: all 0.2s;
  font-weight: 300;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg3);
  box-shadow: 0 0 0 1px var(--accent);
}
.field.error input,
.field.error textarea {
  border-color: var(--accent2);
  box-shadow: 0 0 0 1px var(--accent2);
}
.field-error {
  display: none;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent2);
  margin-top: 5px;
}
.field.error .field-error {
  display: block;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
}
.field textarea {
  min-height: 140px;
  line-height: 1.6;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-msg {
  display: none;
  padding: 16px 20px;
  border: 1px solid;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-top: 16px;
}
.form-msg.show {
  display: block;
}
.form-msg.success {
  border-color: var(--accent);
  background: rgba(110, 231, 183, 0.06);
  color: var(--accent);
}
.form-msg.error {
  border-color: var(--accent2);
  background: rgba(244, 63, 94, 0.06);
  color: var(--accent2);
}

/* ===== LEGAL ===== */
.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 56px 100px;
  font-weight: 300;
  line-height: 1.85;
}
.legal h2 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 52px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.legal h2:first-of-type {
  margin-top: 0;
}
.legal p {
  margin-bottom: 14px;
  color: var(--text);
}
.legal ul {
  padding-left: 20px;
  margin-bottom: 14px;
}
.legal li {
  margin-bottom: 7px;
}
.legal strong {
  color: #fff;
  font-weight: 500;
}
.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--bg2);
  margin-bottom: 40px;
  letter-spacing: 0.04em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .nav {
    padding: 0 20px;
  }
  .nav-links {
    gap: 14px;
  }
  .nav-link {
    font-size: 10px;
  }
  .page-head {
    padding: 56px 24px 40px;
  }
  .legal {
    padding: 0 24px 60px;
  }
  .site-footer {
    padding: 20px 24px;
    flex-direction: column;
    text-align: center;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== HAMBURGER ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  transition: all 0.25s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 760px) {
  .nav {
    padding: 0 20px;
  }

  /* 1. UWALNIAMY MENU: Gdy .nav-links ma klasę .open, zdejmujemy z .nav blokujący filter i tło */
  .nav:has(.nav-links.open) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    border-bottom: transparent;
  }

  /* 2. NA WIERZCH: Logo i hamburger muszą być wyżej niż pełnoekranowe menu */
  .nav-brand,
  .nav-toggle {
    position: relative;
    z-index: 101;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* bottom: 0; zmienione na 100dvh dla lepszego wsparcia na iPhone (uwzględnia pasek adresu) */
    height: 100dvh;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
    /* padding-top spycha lekko linki w dół, żeby logo ich nie przysłoniło */
    padding-top: 64px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    font-size: 18px;
    letter-spacing: 0.12em;
  }

  .lang-switch {
    margin-top: 8px;
  }

  .lang-btn {
    padding: 8px 18px;
    font-size: 13px;
  }

  /* Poniżej zostawiamy Twoje reguły dla reszty strony */
  .page-head {
    padding: 32px 24px 32px;
  }

  .legal {
    padding: 0 24px 60px;
  }

  .site-footer {
    padding: 20px 24px;
    flex-direction: column;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Hamburger z Twojego pliku (nie musimy w nim nic zmieniać, działa idealnie!) */
  .nav-toggle {
    display: flex;
  }
}
