/* ==========================================================
   JURISAL OÜ// — Shared Stylesheet
   ========================================================== */

:root {
  --bg: #0a0907;
  --ink: #f3ede2;
  --blood: #ff2a1f;
  --bone: #c9bfae;
  --ash: #2a2520;
  --ember: #ff7a18;
  --sulfur: #d4ff00;
  --line: rgba(243, 237, 226, 0.12);
  --line-strong: rgba(243, 237, 226, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

a, a:visited, a:hover, a:active {
  color: inherit;
  text-decoration: none;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body { position: relative; cursor: none; min-height: 100vh; }

/* Disable custom cursor on touch devices */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none !important; }
}

img, svg { display: block; max-width: 100%; }

/* ========== CUSTOM CURSOR ========== */
.cursor {
  position: fixed;
  width: 14px; height: 14px;
  background: var(--blood);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.15s ease, width 0.2s, height 0.2s;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  position: fixed;
  width: 44px; height: 44px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s, height 0.3s, border-color 0.3s;
}
.cursor.hover { width: 8px; height: 8px; }
.cursor-ring.hover { width: 80px; height: 80px; border-color: var(--blood); }

/* ========== WEBGL CANVAS BG ========== */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}

/* grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  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' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.25;
  mix-blend-mode: overlay;
}

/* scanlines overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 3px,
    transparent 4px
  );
  opacity: 0.5;
}

main, nav, header, section, footer { position: relative; z-index: 3; }

/* ========== NAV ========== */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 36px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  mix-blend-mode: difference;
  color: #fff;
}
nav.site-nav .brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
nav.site-nav .brand .dot {
  width: 9px; height: 9px;
  background: var(--blood);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
nav.site-nav .links { display: flex; gap: 32px; align-items: center; }
nav.site-nav .links a {
  color: inherit;
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
nav.site-nav .links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
nav.site-nav .links a:hover::after,
nav.site-nav .links a.active::after { width: 100%; }
nav.site-nav .cta-pill {
  border: 1px solid currentColor;
  padding: 9px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s, color 0.3s;
}
nav.site-nav .cta-pill:hover {
  background: var(--blood);
  color: #fff;
  border-color: var(--blood);
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 101;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  margin: 5px auto;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: none;
  flex-direction: column;
  padding: 100px 28px 40px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mobile-menu.open { display: flex; opacity: 1; }
.mobile-menu a {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.03em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--blood); }
.mobile-menu a .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  opacity: 0.4;
  letter-spacing: 0.2em;
}
.mobile-menu .mm-cta {
  margin-top: auto;
  padding: 18px 24px;
  border-radius: 999px;
  background: var(--blood);
  color: #fff;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: none;
  display: block;
}
.mobile-menu .mm-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ========== SECTION HELPERS ========== */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--blood);
  margin-bottom: 32px;
}
.section-label::before {
  content: '';
  width: 28px; height: 1px;
  background: var(--blood);
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(60px, 10vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  margin-bottom: 60px;
}
.section-title em {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  color: var(--blood);
}

/* ========== CTA BUTTONS ========== */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 22px 32px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: color 0.4s;
  cursor: pointer;
}
.hero-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blood);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}
.hero-cta:hover::before { transform: translateY(0); }
.hero-cta:hover { color: #fff; }
.hero-cta span { position: relative; z-index: 1; }
.hero-cta .arrow {
  position: relative;
  z-index: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: transform 0.3s;
}
.hero-cta:hover .arrow {
  transform: rotate(-45deg);
  background: var(--ink);
  color: var(--blood);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 22px 32px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.3s, color 0.3s, transform 0.3s;
}
.btn-ghost:hover {
  border-color: var(--blood);
  color: var(--blood);
}

/* ========== PAGE HEADER (subpages) ========== */
.page-header {
  padding: 160px 36px 80px;
  border-bottom: 1px solid var(--line);
}
.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  opacity: 0.6;
  margin-bottom: 30px;
}
.page-header .breadcrumb a { color: inherit; text-decoration: none; }
.page-header .breadcrumb a:hover { color: var(--blood); }
.page-header .breadcrumb span.sep { opacity: 0.4; }

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(68px, 12vw, 180px);
  line-height: 0.85;
  letter-spacing: -0.02em;
  max-width: 1400px;
}
.page-title em {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  color: var(--blood);
}
.page-lede {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.4;
  max-width: 720px;
  opacity: 0.85;
  margin-top: 40px;
}

/* ========== TYPOGRAPHIC PROSE (legal pages) ========== */
.prose {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.75;
  opacity: 0.85;
}
.prose h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.02em;
  margin: 50px 0 20px;
  color: var(--ink);
  opacity: 1;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 32px 0 14px;
  color: var(--blood);
  font-weight: 700;
}
.prose p { margin-bottom: 18px; }
.prose ul { margin: 0 0 18px 22px; }
.prose ul li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a {
  color: var(--blood);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.prose code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--ash);
  padding: 1px 6px;
  font-size: 0.9em;
  border-radius: 3px;
  color: var(--sulfur);
}
.prose blockquote {
  border-left: 2px solid var(--blood);
  padding: 8px 0 8px 24px;
  margin: 24px 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 18px;
  opacity: 1;
}

/* ========== FOOTER ========== */
footer.site-footer {
  padding: 60px 36px 30px;
  border-top: 1px solid var(--line-strong);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
footer.site-footer .foot-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: 0.02em;
}
footer.site-footer .foot-brand em {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--blood);
}
footer.site-footer .foot-brand p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 16px;
}
footer.site-footer .col h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-bottom: 18px;
  font-weight: 400;
}
footer.site-footer .col a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  opacity: 0.85;
  transition: color 0.2s, transform 0.2s;
}
footer.site-footer .col a:hover {
  color: var(--blood);
  transform: translateX(4px);
}

.foot-bottom {
  grid-column: 1 / -1;
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.5;
  gap: 16px;
  flex-wrap: wrap;
}

/* ========== FORMS ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-strong);
}
.field {
  border-bottom: 1px solid var(--line-strong);
  padding: 28px 0;
  position: relative;
}
.field.full { grid-column: 1 / -1; }
.field.right-border { border-right: 1px solid var(--line-strong); padding-right: 32px; }
.field.left-pad { padding-left: 32px; }
.field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--blood);
  margin-bottom: 12px;
  font-weight: 700;
}
.field label .req { color: var(--ember); }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 300;
  letter-spacing: -0.01em;
  padding: 4px 0;
  outline: none;
  cursor: none;
}
@media (hover: none), (pointer: coarse) {
  .field input,
  .field select,
  .field textarea { cursor: auto; }
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(243, 237, 226, 0.3); }
.field textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23ff2a1f' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 28px;
}
.field option { background: var(--bg); color: var(--ink); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 400;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.checkbox-group label:hover {
  border-color: var(--blood);
}
.checkbox-group input[type="checkbox"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.checkbox-group input[type="checkbox"]:checked {
  border-color: var(--blood);
  background: var(--blood);
}
.checkbox-group input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ========== UTILITY ========== */
.container {
  max-width: 1400px;
  margin: 0 auto;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 60px 0;
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Tablet landscape */
@media (max-width: 1100px) {
  footer.site-footer { grid-template-columns: 1fr 1fr 1fr; }
  footer.site-footer .foot-brand { grid-column: 1 / -1; }
}

/* Tablet portrait */
@media (max-width: 900px) {
  nav.site-nav .links { display: none; }
  nav.site-nav .cta-pill { display: none; }
  .hamburger { display: block; }
  nav.site-nav { padding: 18px 22px; }
  nav.site-nav .brand { font-size: 20px; }

  .page-header { padding: 110px 22px 60px; }
  footer.site-footer {
    grid-template-columns: 1fr 1fr;
    padding: 50px 22px 24px;
    gap: 32px;
  }
  footer.site-footer .foot-brand {
    grid-column: 1 / -1;
    font-size: 48px;
  }

  .form-grid { grid-template-columns: 1fr; }
  .field.right-border { border-right: none; padding-right: 0; }
  .field.left-pad { padding-left: 0; }
  .field-row { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  nav.site-nav { padding: 16px 18px; }
  nav.site-nav .brand { font-size: 18px; letter-spacing: 0.1em; }
  nav.site-nav .brand .dot { width: 7px; height: 7px; }

  .page-header { padding: 100px 18px 50px; }
  .page-lede { font-size: 16px; margin-top: 28px; }

  footer.site-footer { padding: 40px 18px 20px; gap: 28px; }
  footer.site-footer .foot-brand { font-size: 38px; }
  footer.site-footer .foot-brand p { font-size: 10px; }
  .foot-bottom {
    flex-direction: column;
    gap: 8px;
    margin-top: 36px;
    text-align: left;
  }

  .hero-cta, .btn-ghost {
    padding: 18px 24px;
    font-size: 11px;
    gap: 10px;
  }
  .hero-cta .arrow { width: 24px; height: 24px; }

  .mobile-menu a { font-size: 36px; padding: 11px 0; }

  .section-label { font-size: 9px; letter-spacing: 0.2em; margin-bottom: 24px; }

  .prose { font-size: 14px; }
  .prose h2 { font-size: 26px; margin: 36px 0 16px; }
}

/* Small mobile */
@media (max-width: 380px) {
  nav.site-nav .brand { font-size: 16px; }
  .mobile-menu a { font-size: 30px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor, .cursor-ring { display: none !important; }
  body { cursor: auto; }
  #bg-canvas { display: none; }
}