.legal-page {
  background: var(--porcelain);
}

.legal-page .site-header {
  background: rgba(245, 244, 241, 0.74);
  backdrop-filter: blur(18px);
}

.legal-hero {
  position: relative;
  min-height: auto;
  padding: 124px 0 52px;
  overflow: hidden;
  border: 1px solid rgba(10, 10, 10, 0.18);
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(90deg, rgba(245, 244, 241, 0.98), rgba(245, 244, 241, 0.88)),
    var(--porcelain);
}

.legal-hero-grid {
  position: absolute;
  inset: 58px 62px 42px;
  pointer-events: none;
  opacity: 0.64;
  background:
    linear-gradient(rgba(10, 10, 10, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.052) 1px, transparent 1px);
  background-size: 156px 156px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 88%, transparent 100%);
}

.legal-hero-grid::before,
.legal-hero-grid::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(10, 10, 10, 0.11);
  border-radius: 50%;
}

.legal-hero-grid::before {
  right: 8%;
  top: 14px;
  width: 440px;
  height: 440px;
}

.legal-hero-grid::after {
  right: 18%;
  top: 128px;
  width: 190px;
  height: 190px;
  border-style: dashed;
}

.legal-hero-mark {
  position: absolute;
  right: -6vw;
  top: 102px;
  width: min(48vw, 720px);
  opacity: 0.052;
  pointer-events: none;
}

.legal-hero-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.95fr);
  gap: 48px;
  align-items: center;
}

.legal-hero h1 {
  max-width: 780px;
  margin-bottom: 28px;
  font-size: 5.05rem;
  line-height: 0.99;
}

.legal-hero .eyebrow {
  color: rgba(10, 10, 10, 0.64);
}

.legal-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.legal-eyebrow span + span {
  position: relative;
  padding-left: 14px;
}

.legal-eyebrow span + span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 1px;
  background: rgba(10, 10, 10, 0.32);
}

.legal-hero .hero-copy {
  max-width: 650px;
}

.legal-proof-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 650px;
  margin-top: 34px;
  border: 1px solid rgba(10, 10, 10, 0.13);
  background: rgba(10, 10, 10, 0.13);
}

.legal-proof-row span {
  min-height: 88px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: rgba(255, 253, 248, 0.56);
  color: rgba(10, 10, 10, 0.68);
  font-size: 0.92rem;
  line-height: 1.35;
}

.legal-workspace {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(10, 10, 10, 0.22);
  border-radius: 8px;
  background: var(--obsidian);
  color: var(--porcelain);
  box-shadow: 0 40px 110px rgba(10, 10, 10, 0.28);
}

.legal-workspace::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(245, 244, 241, 0.08);
}

.workspace-topline,
.workspace-grid,
.workspace-main,
.workspace-body,
.workspace-metrics {
  position: relative;
  z-index: 1;
}

.workspace-topline {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(245, 244, 241, 0.13);
}

.workspace-topline strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
}

.workspace-topline span,
.workspace-topline em,
.workspace-sidebar span,
.workspace-metrics span,
.workspace-metrics em,
.case-panel p,
.ai-panel p {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-topline span,
.workspace-metrics em {
  color: rgba(245, 244, 241, 0.44);
}

.workspace-topline em {
  padding: 8px 12px;
  border: 1px solid rgba(245, 244, 241, 0.16);
  border-radius: 999px;
  color: rgba(245, 244, 241, 0.72);
  font-style: normal;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 18px;
  padding-top: 22px;
}

.workspace-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid rgba(245, 244, 241, 0.1);
  padding-right: 16px;
}

.workspace-sidebar span {
  padding: 10px 12px;
  border: 1px solid transparent;
  color: rgba(245, 244, 241, 0.46);
}

.workspace-sidebar .is-active {
  border-color: rgba(245, 244, 241, 0.12);
  background: rgba(245, 244, 241, 0.08);
  color: var(--porcelain);
}

.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workspace-metrics article {
  min-height: 110px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  border: 1px solid rgba(245, 244, 241, 0.1);
  background: rgba(245, 244, 241, 0.045);
}

.workspace-metrics strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 1.8rem;
  font-weight: 500;
}

.workspace-body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
  margin-top: 10px;
}

.case-panel,
.ai-panel {
  min-height: 220px;
  padding: 18px;
  border: 1px solid rgba(245, 244, 241, 0.1);
  background: rgba(245, 244, 241, 0.045);
}

.case-panel p,
.ai-panel p {
  margin-bottom: 14px;
  color: rgba(245, 244, 241, 0.42);
}

.panel-title {
  display: block;
  margin: 0 0 20px;
  font-family: var(--sans);
  font-size: 1.12rem;
  line-height: 1.36;
  font-weight: 650;
  color: var(--porcelain);
}

.case-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-panel li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(245, 244, 241, 0.08);
  background: rgba(10, 10, 10, 0.24);
}

.case-panel li span {
  color: rgba(245, 244, 241, 0.42);
  font-size: 0.78rem;
}

.case-panel li strong {
  font-size: 0.92rem;
}

.ai-findings {
  display: grid;
  gap: 8px;
}

.ai-findings span {
  padding: 12px;
  border: 1px solid rgba(245, 244, 241, 0.09);
  background: rgba(245, 244, 241, 0.08);
  color: rgba(245, 244, 241, 0.72);
}

.legal-pain-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 58px;
  border: 1px solid rgba(10, 10, 10, 0.14);
  background: rgba(10, 10, 10, 0.12);
  box-shadow: 0 32px 90px rgba(10, 10, 10, 0.07);
}

.legal-risk {
  position: relative;
  overflow: hidden;
}

.legal-risk::after,
.legal-ai::after,
.legal-close::after {
  content: "";
  position: absolute;
  right: 7%;
  top: 76px;
  width: min(28vw, 420px);
  height: min(28vw, 420px);
  border: 1px solid rgba(245, 244, 241, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

.legal-risk-grid,
.legal-ai-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 90px;
  align-items: start;
}

.legal-risk-copy p {
  margin-bottom: 34px;
  color: rgba(245, 244, 241, 0.66);
  font-size: 1.04rem;
}

.risk-ledger {
  display: grid;
  border-top: 1px solid rgba(245, 244, 241, 0.14);
}

.risk-ledger span {
  position: relative;
  padding: 22px 0 22px 34px;
  border-bottom: 1px solid rgba(245, 244, 241, 0.14);
  color: rgba(245, 244, 241, 0.78);
}

.risk-ledger span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(245, 244, 241, 0.52);
  border-radius: 50%;
}

.legal-modules,
.legal-security {
  position: relative;
  overflow: hidden;
  background: rgba(245, 244, 241, 0.78);
}

.legal-problem {
  padding-top: 20px;
}

.legal-system {
  position: relative;
  overflow: hidden;
  background: rgba(245, 244, 241, 0.78);
}

.legal-system-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 72px;
  align-items: start;
  padding: clamp(30px, 4.4vw, 62px);
  border: 1px solid rgba(245, 244, 241, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 244, 241, 0.045), transparent 44%),
    var(--obsidian);
  box-shadow: 0 34px 110px rgba(10, 10, 10, 0.18);
}

.system-copy {
  max-width: 500px;
}

.system-copy .eyebrow {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(245, 244, 241, 0.18);
  border-radius: 999px;
  background: rgba(245, 244, 241, 0.08);
  color: rgba(245, 244, 241, 0.82);
  font-size: 0.875rem;
  line-height: 1.2;
}

.system-copy h2 {
  color: var(--porcelain);
}

.system-copy p:not(.eyebrow) {
  color: rgba(245, 244, 241, 0.7);
}

.system-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.context-card {
  min-height: 216px;
  padding: 18px;
  border: 1px solid rgba(245, 244, 241, 0.13);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.07);
}

.context-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(245, 244, 241, 0.16);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.1);
  color: rgba(245, 244, 241, 0.88);
}

.context-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.context-card h3 {
  max-width: 280px;
  margin-bottom: 14px;
  color: var(--porcelain);
  font-size: 1.04rem;
  line-height: 1.28;
}

.context-card p {
  margin-bottom: 0;
  color: rgba(245, 244, 241, 0.66);
  font-size: 0.94rem;
  line-height: 1.72;
}

.modules-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.88fr);
  gap: 72px;
  align-items: start;
}

.modules-heading .section-copy {
  max-width: 560px;
}

.modules-heading > p {
  align-self: end;
  max-width: 640px;
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.72;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 56px;
}

.module-card {
  min-height: 318px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 22px 70px rgba(10, 10, 10, 0.07);
}

.module-card.is-dark {
  border-color: rgba(245, 244, 241, 0.12);
  background: var(--obsidian);
  color: var(--porcelain);
  box-shadow: 0 28px 84px rgba(10, 10, 10, 0.18);
}

.module-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.76);
  color: var(--ink);
}

.module-card.is-dark .module-icon {
  border-color: rgba(245, 244, 241, 0.14);
  background: rgba(245, 244, 241, 0.11);
  color: var(--porcelain);
}

.module-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-card h3 {
  margin-bottom: 12px;
  font-size: 1.12rem;
  line-height: 1.24;
}

.module-card p {
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.7;
}

.module-card.is-dark p {
  color: rgba(245, 244, 241, 0.68);
}

.module-card ul {
  display: grid;
  gap: 9px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.module-card li {
  position: relative;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 8px 12px 8px 34px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.045);
  color: rgba(10, 10, 10, 0.62);
  font-size: 0.78rem;
  line-height: 1.35;
}

.module-card li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
}

.module-card li::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}

.module-card.is-dark li {
  background: rgba(245, 244, 241, 0.075);
  color: rgba(245, 244, 241, 0.78);
}

.legal-ai {
  position: relative;
  overflow: hidden;
}

.legal-ai .section-copy {
  max-width: 560px;
}

.legal-ai .eyebrow {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(245, 244, 241, 0.18);
  border-radius: 999px;
  background: rgba(245, 244, 241, 0.08);
  color: rgba(245, 244, 241, 0.82);
  font-size: 0.875rem;
  line-height: 1.2;
}

.ai-differentiator {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(245, 244, 241, 0.13);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.055);
}

.ai-differentiator .module-icon,
.ai-context-strip .module-icon {
  margin-bottom: 0;
  border-color: rgba(245, 244, 241, 0.14);
  background: rgba(245, 244, 241, 0.09);
  color: var(--porcelain);
}

.ai-differentiator span,
.ai-context-strip span,
.ai-applied-card > span {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ai-differentiator span {
  display: block;
  margin-bottom: 8px;
  color: rgba(245, 244, 241, 0.62);
}

.ai-differentiator strong {
  display: block;
  color: var(--porcelain);
  font-size: 1rem;
  line-height: 1.45;
}

.ai-differentiator p {
  margin: 14px 0 0;
  color: rgba(245, 244, 241, 0.62);
  font-size: 0.92rem;
  line-height: 1.72;
}

.ai-applied-stack {
  display: grid;
  gap: 16px;
  margin-top: 64px;
}

.ai-applied-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  min-height: 126px;
  padding: 24px;
  border: 1px solid rgba(245, 244, 241, 0.12);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.055);
}

.ai-applied-card h3 {
  margin-bottom: 10px;
  color: var(--porcelain);
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 650;
}

.ai-applied-card p {
  margin: 0;
  color: rgba(245, 244, 241, 0.62);
  font-size: 0.94rem;
  line-height: 1.7;
}

.ai-applied-card > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 7px 10px;
  border: 1px solid rgba(245, 244, 241, 0.14);
  border-radius: 999px;
  background: rgba(245, 244, 241, 0.075);
  color: rgba(245, 244, 241, 0.66);
}

.ai-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8edc9b;
  box-shadow: 0 0 0 0 rgba(142, 220, 155, 0.34);
  animation: ai-status-breathe 2.8s ease-in-out infinite;
}

@keyframes ai-status-breathe {
  0%,
  100% {
    opacity: 0.68;
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(142, 220, 155, 0.2);
  }

  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(142, 220, 155, 0.08);
  }
}

.ai-context-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(245, 244, 241, 0.14);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.045);
}

.ai-context-strip > div {
  min-height: 94px;
  display: grid;
  align-content: space-between;
  padding: 14px;
  border: 1px solid rgba(245, 244, 241, 0.11);
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.065);
}

.ai-context-strip span {
  color: rgba(245, 244, 241, 0.72);
}

.security-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 0.92fr);
  gap: 76px;
  align-items: start;
}

.security-heading .section-copy {
  max-width: 560px;
}

.security-heading > p {
  max-width: 650px;
  margin: 46px 0 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.74;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 56px;
}

.security-card {
  min-height: 258px;
  padding: 28px;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 22px 70px rgba(10, 10, 10, 0.07);
}

.security-card .module-icon {
  margin-bottom: 26px;
}

.security-card h3 {
  margin-bottom: 14px;
  font-size: 1.08rem;
  line-height: 1.28;
}

.security-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.72;
}

.legal-close {
  position: relative;
  overflow: hidden;
}

.legal-page .demo-form {
  align-self: start;
}

@media (max-width: 1180px) {
  .legal-hero-shell {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .legal-hero h1 {
    max-width: 900px;
    font-size: 5.1rem;
  }

  .legal-workspace {
    max-width: 900px;
  }

  .legal-system-panel {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .system-copy {
    max-width: 720px;
  }

  .modules-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .security-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .modules-heading > p,
  .security-heading > p {
    max-width: 760px;
    margin-top: 0;
  }

  .module-grid,
  .security-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-risk-grid,
  .legal-ai-grid {
    gap: 52px;
  }

  .ai-applied-stack {
    margin-top: 52px;
  }
}

@media (max-width: 900px) {
  .legal-hero {
    min-height: auto;
    padding: 106px 0 74px;
    border-radius: 12px 12px 0 0;
  }

  .legal-hero-grid {
    inset: 68px 16px 28px;
  }

  .legal-hero-grid::before,
  .legal-hero-grid::after {
    display: none;
  }

  .legal-hero-mark {
    right: -260px;
    top: 96px;
    width: 560px;
  }

  .legal-hero::after {
    content: "";
    position: absolute;
    right: -190px;
    bottom: 52px;
    z-index: 1;
    width: 520px;
    height: 520px;
    background: url("../assets/visuals/vertical-legal-architectural.webp") center / cover no-repeat;
    opacity: 0.13;
    filter: grayscale(1);
    pointer-events: none;
  }

  .legal-hero h1 {
    font-size: 4.2rem;
  }

  .legal-workspace {
    display: none;
  }

  .legal-proof-row,
  .legal-pain-grid,
  .module-grid,
  .security-grid,
  .legal-risk-grid,
  .legal-ai-grid,
  .system-context-grid,
  .workspace-body {
    grid-template-columns: 1fr;
  }

  .legal-workspace {
    padding: 18px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    padding-right: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(245, 244, 241, 0.1);
  }

  .workspace-metrics,
  .ai-context-strip {
    grid-template-columns: 1fr;
  }

  .ai-applied-card {
    grid-template-columns: 1fr;
  }

  .ai-applied-stack {
    margin-top: 0;
  }

  .ai-applied-card > span {
    width: fit-content;
  }

  .legal-system-panel {
    padding: 24px;
    gap: 28px;
  }

  .context-card {
    min-height: auto;
  }

  .legal-risk::after,
  .legal-ai::after,
  .legal-close::after {
    display: none;
  }
}

@media (max-width: 620px) {
  .legal-hero {
    padding: 126px 0 40px;
  }

  .legal-hero h1 {
    font-size: 2.82rem;
    line-height: 1.02;
  }

  .legal-hero .eyebrow {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .legal-eyebrow {
    display: grid;
    gap: 3px;
  }

  .legal-eyebrow span + span {
    padding-left: 0;
  }

  .legal-eyebrow span + span::before {
    display: none;
  }

  .legal-hero::after {
    content: "";
    position: absolute;
    right: -150px;
    bottom: 34px;
    z-index: 1;
    width: 360px;
    height: 360px;
    background: url("../assets/visuals/vertical-legal-architectural.webp") center / cover no-repeat;
    opacity: 0.15;
    filter: grayscale(1);
    pointer-events: none;
  }

  .legal-hero .hero-copy {
    max-width: 100%;
  }

  .legal-proof-row span {
    min-height: 58px;
    padding: 16px 18px;
  }

  .legal-problem {
    padding-top: 36px;
  }

  .workspace-topline,
  .workspace-metrics {
    grid-template-columns: 1fr;
  }

  .workspace-topline {
    display: grid;
  }

  .workspace-sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .case-panel,
  .ai-panel {
    min-height: auto;
  }

  .ai-differentiator {
    grid-template-columns: 1fr;
  }

  .context-card,
  .module-card,
  .security-card {
    min-height: auto;
  }
}

/* High-end Aetrium Legal redesign */
.legal-page {
  background:
    linear-gradient(rgba(10, 10, 10, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.018) 1px, transparent 1px),
    var(--porcelain);
  background-size: 118px 118px;
}

.legal-hero {
  min-height: 80svh;
  padding: 112px 0 58px;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(90deg, rgba(245, 244, 241, 0.99) 0%, rgba(245, 244, 241, 0.9) 42%, rgba(245, 244, 241, 0.68) 100%),
    var(--porcelain);
}

.legal-hero-grid {
  inset: 58px 72px 58px 62px;
  opacity: 0.72;
  background-size: 168px 168px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 88%, transparent 100%);
}

.legal-hero-grid::before {
  right: 25%;
  top: -16px;
  width: 210px;
  height: 210px;
}

.legal-hero-grid::after {
  right: 6%;
  top: 46px;
  width: 520px;
  height: 520px;
  border-style: solid;
}

.legal-hero-ruler {
  position: absolute;
  left: 48px;
  top: 150px;
  bottom: 118px;
  width: 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  color: rgba(10, 10, 10, 0.48);
  font-family: var(--mono);
  font-size: 0.58rem;
  pointer-events: none;
}

.legal-hero-ruler i {
  position: relative;
  width: 1px;
  height: 100%;
  margin: 12px auto;
  background: repeating-linear-gradient(to bottom, rgba(10, 10, 10, 0.34) 0 1px, transparent 1px 20px);
}

.legal-hero-ruler i::before,
.legal-hero-ruler i::after {
  content: "";
  position: absolute;
  left: -5px;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(10, 10, 10, 0.28);
  border-radius: 50%;
}

.legal-hero-ruler i::before {
  top: 44%;
}

.legal-hero-ruler i::after {
  bottom: 8%;
}

.legal-hero-principles {
  position: absolute;
  right: 54px;
  top: 226px;
  z-index: 2;
  width: 236px;
  border-top: 1px solid rgba(10, 10, 10, 0.18);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  color: rgba(10, 10, 10, 0.76);
}

.legal-hero-principles span {
  position: relative;
  display: block;
  padding: 18px 36px 18px 0;
  border-bottom: 1px solid rgba(10, 10, 10, 0.16);
}

.legal-hero-principles span::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--obsidian);
  transform: translateY(-50%);
}

.legal-hero-mark {
  right: 4%;
  top: 70px;
  width: min(58vw, 820px);
  opacity: 0.12;
  filter: drop-shadow(0 24px 14px rgba(10, 10, 10, 0.18)) drop-shadow(-1px -1px 0 rgba(255, 255, 255, 0.96));
}

.legal-hero-shell {
  grid-template-columns: minmax(600px, 0.98fr) minmax(560px, 1.02fr);
  gap: 44px;
  align-items: start;
}

.legal-hero h1 {
  max-width: 680px;
  font-size: clamp(4rem, 4.25vw, 5rem);
  line-height: 1.01;
}

.legal-hero-copy {
  padding-top: 22px;
}

.legal-eyebrow {
  font-size: 0.68rem;
  color: rgba(10, 10, 10, 0.58);
}

.legal-hero .hero-copy {
  max-width: 590px;
}

.legal-proof-row {
  max-width: 590px;
  margin-top: 36px;
  box-shadow: 0 24px 80px rgba(10, 10, 10, 0.07);
}

.legal-proof-row span {
  min-height: 76px;
  padding: 18px 18px 10px;
  background: rgba(255, 253, 248, 0.64);
  backdrop-filter: blur(12px);
}

.legal-hero-visual {
  position: relative;
  height: 650px;
  min-height: 0;
  transform: translateX(14px);
}

.legal-hero-visual::before {
  content: "";
  position: absolute;
  inset: 34px -18px 16px 42px;
  border: 1px solid rgba(10, 10, 10, 0.11);
  background:
    linear-gradient(rgba(10, 10, 10, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.04) 1px, transparent 1px);
  background-size: 86px 86px;
  opacity: 0.72;
  mask-image: linear-gradient(135deg, transparent 0%, #000 28%, #000 82%, transparent 100%);
}

.legal-hero-visual::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -8px;
  width: 92%;
  height: 34%;
  background: rgba(10, 10, 10, 0.2);
  filter: blur(38px);
  transform: rotate(-5deg);
  pointer-events: none;
}

.legal-hero-architecture {
  position: absolute;
  z-index: 1;
  right: -8px;
  top: -8px;
  width: min(82%, 680px);
  height: 560px;
  object-fit: cover;
  border: 0;
  opacity: 0.4;
  filter: grayscale(1) contrast(1.08);
  mask-image: linear-gradient(110deg, transparent 0%, #000 18%, #000 76%, transparent 100%);
}

.legal-dashboard-hero {
  position: absolute;
  z-index: 3;
  right: -150px;
  bottom: -54px;
  width: min(142%, 1060px);
  max-width: none;
  height: auto;
  filter: drop-shadow(0 28px 22px rgba(10, 10, 10, 0.24)) drop-shadow(0 70px 80px rgba(10, 10, 10, 0.26));
}

.legal-problem {
  position: relative;
  overflow: hidden;
}

.legal-problem-atlas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
}

.legal-problem-atlas img {
  position: absolute;
  right: -9vw;
  top: 120px;
  width: min(46vw, 640px);
  filter: grayscale(1);
  opacity: 0.42;
}

.legal-problem-atlas span {
  position: absolute;
  left: 7vw;
  bottom: 110px;
  width: 44vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 10, 10, 0.34), transparent);
}

.legal-pain-grid {
  gap: 0;
  border-color: rgba(10, 10, 10, 0.16);
  background: rgba(10, 10, 10, 0.14);
}

.legal-pain-grid .line-card {
  min-height: 250px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.86), rgba(245, 244, 241, 0.58)),
    var(--porcelain);
}

.legal-pain-grid .line-card span {
  color: rgba(10, 10, 10, 0.38);
}

.legal-risk {
  background:
    linear-gradient(rgba(245, 244, 241, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 244, 241, 0.035) 1px, transparent 1px),
    var(--obsidian);
  background-size: 116px 116px;
}

.legal-risk-circuit {
  position: absolute;
  inset: 70px 6vw auto auto;
  width: min(44vw, 620px);
  height: 360px;
  pointer-events: none;
  opacity: 0.56;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(245, 244, 241, 0.34) 16% 16.3%, transparent 16.3% 100%),
    linear-gradient(135deg, transparent 0 38%, rgba(245, 244, 241, 0.22) 38% 38.3%, transparent 38.3% 100%),
    linear-gradient(rgba(245, 244, 241, 0.16), rgba(245, 244, 241, 0.16)) 18% 28% / 34% 1px no-repeat,
    linear-gradient(rgba(245, 244, 241, 0.16), rgba(245, 244, 241, 0.16)) 56% 46% / 32% 1px no-repeat;
}

.risk-ledger {
  border-top-color: rgba(245, 244, 241, 0.18);
}

.risk-ledger span {
  min-height: 74px;
  display: flex;
  align-items: center;
  border-bottom-color: rgba(245, 244, 241, 0.16);
}

.legal-system,
.legal-modules,
.legal-security {
  background:
    linear-gradient(rgba(10, 10, 10, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.02) 1px, transparent 1px),
    rgba(245, 244, 241, 0.82);
  background-size: 118px 118px;
}

.legal-system-architecture,
.legal-security-architecture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: url("../assets/visuals/vertical-legal-architectural.webp") right center / min(48vw, 760px) auto no-repeat;
  filter: grayscale(1);
  mask-image: linear-gradient(90deg, transparent 0%, #000 52%, transparent 100%);
}

.legal-system-panel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 40px 110px rgba(10, 10, 10, 0.22);
}

.legal-system-panel::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(245, 244, 241, 0.08);
  pointer-events: none;
}

.context-card,
.ai-applied-card,
.ai-context-strip > div {
  backdrop-filter: blur(10px);
}

.legal-modules {
  position: relative;
}

.legal-modules-rail {
  position: absolute;
  left: 46px;
  top: 118px;
  bottom: 140px;
  width: 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  color: rgba(10, 10, 10, 0.42);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  pointer-events: none;
}

.legal-modules-rail i {
  width: 1px;
  height: 100%;
  margin: 14px auto;
  background: repeating-linear-gradient(to bottom, rgba(10, 10, 10, 0.2) 0 1px, transparent 1px 18px);
}

.module-grid,
.security-grid {
  gap: 16px;
}

.module-card,
.security-card {
  border-color: rgba(10, 10, 10, 0.11);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.9), rgba(245, 244, 241, 0.68)),
    var(--paper);
  box-shadow: 0 28px 90px rgba(10, 10, 10, 0.08);
}

.module-card.is-dark {
  background:
    linear-gradient(135deg, rgba(245, 244, 241, 0.06), transparent 50%),
    var(--obsidian);
}

.legal-ai {
  background:
    linear-gradient(rgba(245, 244, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 244, 241, 0.04) 1px, transparent 1px),
    var(--obsidian);
  background-size: 116px 116px;
}

.legal-ai::before {
  content: "";
  position: absolute;
  right: -4vw;
  bottom: 40px;
  width: min(48vw, 720px);
  height: min(48vw, 720px);
  background: url("../assets/brand/monograma-invertido.svg") center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
}

.ai-applied-card,
.ai-differentiator,
.ai-context-strip {
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.18);
}

.legal-security {
  position: relative;
}

.legal-security-architecture {
  background-position: left bottom;
  mask-image: linear-gradient(90deg, transparent 0%, #000 16%, transparent 58%);
}

.legal-close {
  background:
    linear-gradient(rgba(245, 244, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 244, 241, 0.04) 1px, transparent 1px),
    var(--obsidian);
  background-size: 116px 116px;
}

@media (max-width: 1180px) {
  .legal-hero-principles {
    display: none;
  }

  .legal-hero-shell {
    grid-template-columns: 1fr;
  }

  .legal-hero h1 {
    max-width: 900px;
    font-size: clamp(4.2rem, 8.2vw, 5.4rem);
    line-height: 0.98;
  }

  .legal-hero-visual {
    height: 600px;
    min-height: 0;
    max-width: 920px;
  }

  .legal-hero-visual .legal-workspace {
    left: 20px;
    right: auto;
    width: min(92vw, 760px);
  }

  .legal-dashboard-hero {
    right: -92px;
    bottom: -46px;
    width: min(120%, 940px);
  }
}

@media (max-width: 900px) {
  .legal-hero-ruler,
  .legal-modules-rail {
    display: none;
  }

  .legal-hero {
    padding-top: 106px;
  }

  .legal-hero h1 {
    font-size: clamp(3.35rem, 8.4vw, 4.35rem);
    line-height: 1;
  }

  .legal-hero-visual {
    display: block;
    height: 400px;
    min-height: 0;
  }

  .legal-hero-architecture {
    right: -20px;
    top: 0;
    width: 100%;
    height: 400px;
  }

  .legal-dashboard-hero {
    top: 24px;
    right: -52px;
    bottom: auto;
    width: min(114%, 840px);
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid rgba(245, 244, 241, 0.1);
    padding-right: 0;
    padding-bottom: 14px;
  }
}

@media (max-width: 620px) {
  .legal-hero {
    padding: 118px 0 40px;
  }

  .legal-hero-shell,
  .legal-hero-copy,
  .legal-hero .hero-copy,
  .legal-hero .button-row,
  .legal-proof-row {
    min-width: 0;
    max-width: 100%;
  }

  .legal-hero-shell {
    width: min(calc(100% - 28px), var(--max));
    margin: 0 auto;
  }

  .legal-hero-copy,
  .legal-hero .hero-copy,
  .legal-hero .button-row,
  .legal-proof-row {
    width: 100%;
  }

  .legal-hero .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .legal-hero .button {
    min-width: 0;
    width: 100%;
  }

  .legal-hero-grid {
    inset: 70px 14px 28px;
    background-size: 92px 92px;
  }

  .legal-hero h1 {
    max-width: 340px;
    font-size: 2.58rem;
    line-height: 1.03;
    text-wrap: pretty;
  }

  .legal-hero .hero-copy {
    max-width: 340px;
  }

  .legal-hero .button-row,
  .legal-proof-row {
    max-width: 340px;
  }

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

  .legal-proof-row span {
    min-height: 54px;
  }

  .legal-hero-visual {
    display: none;
  }

  .legal-hero-architecture {
    height: 300px;
    opacity: 0.48;
  }

  .legal-hero-visual .legal-workspace {
    display: none !important;
  }

  .legal-pain-grid .line-card {
    min-height: auto;
  }

  .legal-system-panel {
    padding: 24px;
  }
}
