body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    font-family: 'Garamond', serif;
}

.contract-container {
    position: relative;
    width: 60%;
    margin: 30px auto;
    background: #fdf1d0;
    padding: 100px 70px; /* reserve space for borders around the text */
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    box-sizing: border-box;
    animation: parchmentPulse 2s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes parchmentPulse {
    0% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.4); }
    100% { box-shadow: 0 0 80px rgba(255, 0, 0, 0.8); }
}

.contract-text {
    z-index: 10;
    font-size: 18px;
    line-height: 1.6;
    color: #2b0707;
    text-align: justify;
}
h4, h1{
   background: linear-gradient(
    145deg,
    #2b0000 0%,
    #6b0f0f 30%,
    #8b1a1a 45%,
    #a02929 60%,
    #2b0000 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 6px rgba(255, 50, 20, 0.2),
    0 0 12px rgba(80, 0, 0, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.6);
  font-weight: 700;
   /* animation: emberPulse 4s ease-in-out infinite; */
}

/* @keyframes emberPulse {
  0%, 100% {
    filter: brightness(1);
    text-shadow:
      0 0 6px rgba(255, 50, 20, 0.2),
      0 0 12px rgba(80, 0, 0, 0.6),
      0 2px 4px rgba(0, 0, 0, 0.6);
  }
  50% {
    filter: brightness(1.2);
    text-shadow:
      0 0 12px rgba(255, 80, 40, 0.4),
      0 0 24px rgba(100, 0, 0, 0.8),
      0 2px 4px rgba(0, 0, 0, 0.6);
  }
} */

/* Borders - positioned around the outer padding area */
.border-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.6;
}

.border-top,
.border-bottom,
.border-left,
.border-right {
    position: absolute;
    color: darkred;
    overflow: hidden;
    white-space: nowrap;
}

/* Horizontal borders */
.border-top {
    top: 4cqb; /* distance from container bottom edge */
    left: 0;
    width: 100%;
    text-align: center;
}

.border-bottom {
    bottom: 40px; /* distance from container bottom edge */
    left: 0;
    width: 100%;
    text-align: center;
}

/* Vertical borders */
.border-left {
    top: 0;
    left: 40px; /* distance from container left edge */
    height: 100%;
    writing-mode: vertical-rl;
    text-align: center;
}

.border-right {
    top: 0;
    right: 40px; /* distance from container right edge */
    height: 100%;
    writing-mode: vertical-rl;
    text-align: center;
}
.subClause{

    padding-left: 20px;
}
.subClause li{
    list-style-type: none;
    font-size: 14px;
    
}

.signature-row {
    display: flex;
    justify-content: space-between; /* pushes devil to the right */
    margin-top: 50px;
}
.signature{
    width: 200px;
    margin: 0px;
    padding: 0px;
}

.mortal, .devil {
    width: 45%; /* optional: controls space each box takes */
}

.devil {
    text-align: right; /* right-align the text inside */
}

.mortal {
    text-align: left;
}


.fineprint {
    font-size: 6px;                /* ultra tiny */
    color: rgba(139,0,0,0.09);     /* faint, barely readable */
    column-count: 3;                /* split into two columns */
    column-gap: 20px;               /* space between columns */
    margin-top: 10px;               /* spacing from main content */
    line-height: 1.2;
    z-index: 11;
}

/* === INFERNAL FLICKERING BORDERS === */
.border-top,
.border-bottom,
.border-left,
.border-right {
    position: absolute;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    display: flex;
}

/* Horizontal borders */
.border-top,
.border-bottom {
    width: 100%;
    height: 6px;
}

/* Vertical borders */
.border-left,
.border-right {
    height: 100%;
    width: 6px;
}

.fire-flame {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ff4d00;
    opacity: 0.5;
    z-index: 3;
    animation: flicker 1s infinite alternate;
    filter: blur(2px);
    will-change: transform, opacity;
}

.flame-medium-horizontal {
    height: 80%;
    animation-delay: -0.05s;
   background-color: #ff9500;
   z-index: 5;
}
.flame-medium-vertical {
    width: 80%;
    animation-delay: -0.05s;
   background-color: #ff9500;
}

.flame-small-horizontal {
    height: 60%;
    animation-delay: -0.1s;
    background-color: #aa0000;
    z-index: 7;
}
.flame-small-vertical {
    width: 60%;
    animation-delay: -0.1s;
    background-color: #aa0000;
}
@keyframes flicker {
    0%   { transform: scale(1);     opacity: 0.5; }
    10%  { transform: scale(1.02);  opacity: 0.65; }
    30%  { transform: scale(1.04);  opacity: 0.8; }
    45%  { transform: scale(1.01);  opacity: 0.55; }
    60%  { transform: scale(1.03);  opacity: 0.75; }
    75%  { transform: scale(0.995); opacity: 0.4; }
    90%  { transform: scale(1.02);  opacity: 0.85; }
    100% { transform: scale(1);     opacity: 0.6; }
}

/* --- Canvas Layering --- */
#hangingMen,
#ghostTrail,
#ghostFaces{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* inside contract parchment */
#hangingMen { z-index: 1; opacity: 0.7; }
#ghostTrail { z-index: 2; opacity: 0.3; }
#ghostFaces { z-index: 3; opacity: 0.4; }

  .infernal-signature {
    
  position: relative;
  display: inline-block;
}

.infernal-signature img {
  filter: brightness(1.2) contrast(1.1) sepia(0.5) hue-rotate(-10deg) saturate(1.4);
  animation: infernalGlow 6s ease-in-out infinite;
  width: 200px;
}

@keyframes infernalGlow {
  0% { filter: brightness(1.1) drop-shadow(0 0 3px rgba(255,60,0,0.4)); }
  50% { filter: brightness(1.5) drop-shadow(0 0 10px rgba(255,100,0,0.7)); }
  100% { filter: brightness(1.1) drop-shadow(0 0 3px rgba(255,60,0,0.4)); }
}

.signature {
  width: 150px;   /* adjust to match space for signatures */
  height: auto;
  margin: 5px;
}
.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
  gap: 10px;
  justify-items: center;
  align-items: center;
}
