:root {
  --vault: #061322;
  --ink: #0B1F36;
  --steel: #7D8EA3;
  --silver: #D7DEE8;
  --teal: #2D8C93;
  --violet: #B79CFF;
  --bone: #ECE7DA;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--vault);
  color: var(--silver);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(45, 140, 147, .16), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(183, 156, 255, .1), transparent 24%),
    linear-gradient(90deg, rgba(215, 222, 232, .035) 1px, transparent 1px),
    linear-gradient(rgba(215, 222, 232, .025) 1px, transparent 1px);
  background-size: auto, auto, 92px 92px, 92px 92px;
  opacity: .72;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .15;
  background-image: repeating-radial-gradient(circle at 20% 30%, rgba(236,231,218,.45) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
}

.mono { font-family: "IBM Plex Mono", monospace; font-weight: 500; letter-spacing: .08em; }

.ledger-nav {
  position: fixed;
  right: clamp(18px, 3vw, 42px);
  top: 34px;
  z-index: 5;
  display: flex;
  gap: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.ledger-nav a {
  color: var(--steel);
  text-decoration: none;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(125, 142, 163, .3);
  transition: color .35s ease, border-color .35s ease;
}

.ledger-nav a:hover, .ledger-nav a.active { color: var(--violet); border-color: var(--teal); }

.chamber {
  position: relative;
  min-height: 100vh;
  padding: clamp(32px, 6vw, 86px);
}

.threshold {
  display: grid;
  place-items: center start;
  isolation: isolate;
}

.threshold-copy { max-width: 1120px; position: relative; z-index: 2; }
.kicker { color: var(--teal); font-size: 12px; margin: 0 0 26px; }

.metal-title {
  position: relative;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(3.5rem, 10vw, 9rem);
  line-height: .86;
  letter-spacing: -.06em;
  color: transparent;
  background: linear-gradient(115deg, var(--silver), var(--steel) 34%, var(--bone) 48%, var(--silver) 62%, #6f8096);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.46));
  animation: titleStamp 1.4s cubic-bezier(.2,.7,.15,1) both, titleGlitch 5s steps(1,end) 1.8s infinite;
}

.metal-title::before, .metal-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.metal-title::before { color: var(--teal); clip-path: inset(18% 0 62% 0); }
.metal-title::after { color: var(--violet); clip-path: inset(64% 0 19% 0); }

.threshold-line {
  max-width: 560px;
  margin: 34px 0 0 5px;
  color: var(--steel);
  font-size: clamp(1rem, 1.7vw, 1.32rem);
  line-height: 1.7;
}

.threshold-rule {
  position: absolute;
  left: 9vw;
  right: 16vw;
  bottom: 14vh;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--steel), var(--teal), transparent);
  opacity: .45;
}

.floating-fragment {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(125, 142, 163, .32);
  background: rgba(11, 31, 54, .72);
  box-shadow: 0 30px 80px rgba(0,0,0,.42);
  backdrop-filter: blur(10px);
  animation: slowFloat 9s ease-in-out infinite;
}
.receipt-fragment { width: 170px; height: 230px; padding: 22px; color: var(--bone); }
.receipt-fragment i { display: block; height: 1px; margin-top: 24px; background: rgba(236,231,218,.38); }
.seal-fragment { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; color: var(--violet); text-transform: uppercase; font-size: 11px; }
.strip-fragment { width: 260px; height: 34px; background: repeating-linear-gradient(90deg, var(--silver) 0 2px, transparent 2px 10px), rgba(11,31,54,.7); opacity: .5; }
.f1 { right: 12vw; top: 19vh; transform: rotate(5deg); }
.f2 { right: 22vw; bottom: 17vh; animation-delay: -2s; }
.f3 { left: 8vw; top: 22vh; transform: rotate(-8deg); animation-delay: -4s; }

.bubble-field { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(183, 156, 255, .32);
  background: radial-gradient(circle at 34% 28%, rgba(215,222,232,.44), rgba(183,156,255,.18) 38%, rgba(45,140,147,.08) 70%, transparent);
  color: rgba(236,231,218,.72);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  filter: blur(.1px);
  animation: bubbleRise linear infinite;
}
.b1 { width: 42px; height: 42px; left: 12%; top: 88%; animation-duration: 23s; }
.b2 { width: 76px; height: 76px; left: 73%; top: 72%; animation-duration: 31s; animation-delay: -9s; }
.b3 { width: 26px; height: 26px; left: 44%; top: 93%; animation-duration: 19s; animation-delay: -5s; }
.b4 { width: 58px; height: 58px; left: 86%; top: 83%; animation-duration: 28s; animation-delay: -14s; }
.b5 { width: 34px; height: 34px; left: 31%; top: 78%; animation-duration: 25s; animation-delay: -17s; }
.b6 { width: 96px; height: 96px; left: 58%; top: 96%; animation-duration: 36s; animation-delay: -3s; }
.b7 { width: 48px; height: 48px; left: 7%; top: 68%; animation-duration: 22s; animation-delay: -11s; }

.archive { padding-top: 12vh; }
.section-marker { margin-bottom: 58px; max-width: 760px; }
.section-marker span { color: var(--teal); font-size: 11px; }
.section-marker h2, .settlement h2 {
  margin: 14px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  line-height: .88;
  letter-spacing: -.06em;
  color: var(--silver);
}

.masonry-wall {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 62px;
  gap: clamp(14px, 2vw, 30px);
  align-items: stretch;
}

.artifact, .quiet-panel, .quiet-statement {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.2vw, 34px);
  background: linear-gradient(145deg, rgba(11,31,54,.96), rgba(6,19,34,.86));
  border: 1px solid rgba(125,142,163,.28);
  box-shadow: 0 28px 80px rgba(0,0,0,.34), inset 0 1px 0 rgba(215,222,232,.08);
  opacity: 0;
  transform: translate3d(var(--x, 0), var(--y, 28px), 0) scale(var(--s, .985));
  transition: opacity 1s ease, transform 1.15s cubic-bezier(.2,.7,.15,1), border-color .35s ease, box-shadow .35s ease;
}

.artifact::before, .quiet-panel::before, .quiet-statement::before {
  content: attr(data-code);
  position: absolute;
  right: 14px;
  top: 12px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--violet);
  font-size: 10px;
  opacity: 0;
  transform: translateY(-6px);
  transition: .35s ease;
}

.artifact::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 44%, rgba(215,222,232,.18) 49%, transparent 54% 100%);
  transform: translateX(-120%);
  transition: transform .75s ease;
}

.artifact:hover, .quiet-panel:hover, .quiet-statement:hover {
  border-color: rgba(215,222,232,.58);
  box-shadow: 0 34px 92px rgba(0,0,0,.43), 0 0 0 1px rgba(45,140,147,.16);
}
.artifact:hover::before, .quiet-panel:hover::before, .quiet-statement:hover::before { opacity: 1; transform: translateY(0); }
.artifact:hover::after { transform: translateX(120%); }
.artifact.is-visible, .quiet-panel.is-visible, .quiet-statement.is-visible { opacity: 1; transform: translate3d(0,0,0) scale(1); }

.artifact-label { display: block; color: var(--steel); font-size: 10px; margin-bottom: 20px; }
.artifact h3 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(1.45rem, 2.5vw, 2.5rem); line-height: 1; letter-spacing: -.045em; }
.artifact p { color: var(--steel); line-height: 1.65; margin: 20px 0 0; }
.tall { grid-row: span 7; }
.medium { grid-row: span 5; }
.square { grid-row: span 4; }
.narrow { grid-row: span 6; }
.wide { grid-row: span 5; }
.thin { grid-row: span 2; }
.receipt { grid-column: span 4; background: linear-gradient(160deg, rgba(236,231,218,.13), rgba(11,31,54,.95) 34%); }
.seal { grid-column: span 3; }
.cipher { grid-column: span 2; }
.collage { grid-column: span 6; margin-top: 34px; z-index: 2; }
.note { grid-column: span 3; margin-top: -18px; }
.specimen { grid-column: span 4; }
.divider { grid-column: span 2; display: flex; align-items: center; justify-content: center; color: var(--steel); background: linear-gradient(90deg, transparent, rgba(215,222,232,.2), transparent); }
.ledger { grid-column: span 5; margin-top: -28px; }
.promise { grid-column: span 3; }

.perforation { position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: radial-gradient(circle, var(--vault) 0 3px, transparent 4px) 0 9px/12px 22px; }
.micro-lines i { display:block; height:1px; margin: 18px 0; background: rgba(215,222,232,.22); }
.embossed-seal { width: 118px; height: 118px; border-radius: 50%; display:grid; place-items:center; margin: 12px auto 26px; border: 1px solid rgba(183,156,255,.55); color: var(--violet); font-size: 54px; box-shadow: inset 0 0 28px rgba(183,156,255,.1); }
.vertical { writing-mode: vertical-rl; color: var(--teal); }
.barcode { position:absolute; right:24px; bottom:22px; width:54px; height:70%; background: repeating-linear-gradient(90deg, var(--silver) 0 2px, transparent 2px 7px, var(--steel) 7px 9px, transparent 9px 16px); opacity:.4; }
.barcode.thin { right:92px; height:42%; opacity:.2; }
.glitch-line { position: relative; max-width: 560px; animation: subtleGlitch 7s steps(1,end) infinite; }
.glitch-line::after { content: attr(data-text); position:absolute; inset:0; color: var(--violet); clip-path: inset(56% 0 24% 0); transform: translateX(0); opacity:0; }
.id-card { position:absolute; right:22px; bottom:22px; width:210px; height:118px; border-radius:22px; background: rgba(236,231,218,.08); border:1px solid rgba(236,231,218,.18); }
.check-window { position:absolute; right:84px; top:34px; width:170px; height:40px; background: rgba(45,140,147,.16); clip-path: polygon(0 0, 100% 0, 90% 100%, 8% 100%); }
.bubble-cluster { position:absolute; right:26px; bottom:24px; }
.bubble-cluster i { display:inline-grid; place-items:center; width:38px; height:38px; margin-left:-8px; border-radius:50%; background: rgba(183,156,255,.16); border:1px solid rgba(183,156,255,.35); font-style: normal; font-size: 10px; }
.qr-ghost { width: 150px; height: 150px; background: conic-gradient(from 90deg, rgba(215,222,232,.35) 25%, transparent 0 50%, rgba(45,140,147,.25) 0 75%, transparent 0), repeating-linear-gradient(90deg, transparent 0 14px, rgba(215,222,232,.12) 14px 22px); background-size: 38px 38px, auto; opacity:.75; }
.stamp-ring { position:absolute; right:28px; top:28px; width:116px; height:116px; border-radius:50%; border:1px dashed rgba(236,231,218,.5); display:grid; place-items:center; color:var(--bone); font-family:"IBM Plex Mono", monospace; font-size:9px; text-align:center; }
.ledger-columns { position:absolute; inset:auto 24px 20px 24px; height:96px; background: linear-gradient(90deg, rgba(125,142,163,.26) 1px, transparent 1px), linear-gradient(rgba(125,142,163,.16) 1px, transparent 1px); background-size: 25% 100%, 100% 24px; }
.promise-orb { width: 124px; height:124px; border-radius:50%; margin: 24px auto; display:grid; place-items:center; background: radial-gradient(circle, rgba(183,156,255,.36), rgba(45,140,147,.11) 60%, transparent 70%); color: var(--bone); }

.settlement { min-height: 92vh; display: grid; align-items: center; }
.settlement-grid { display:grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px, 4vw, 64px); align-items:end; }
.quiet-panel { min-height: 360px; display:flex; flex-direction:column; justify-content:flex-end; }
.quiet-panel span { color: var(--teal); font-size: 11px; }
.quiet-statement { min-height: 260px; background: transparent; }
.quiet-statement p { color: var(--steel); font-size: clamp(1.1rem, 2vw, 1.55rem); line-height: 1.65; margin:0; }
.final-stamp { margin-top: 42px; width: 180px; height: 180px; border-radius: 50%; border: 1px solid rgba(236,231,218,.5); display:grid; place-items:center; color: var(--bone); font-family:"IBM Plex Mono", monospace; font-size: 11px; transform: rotate(-8deg); }
.fade-bubbles i { position:absolute; bottom: 10vh; border-radius:50%; background: rgba(183,156,255,.12); border:1px solid rgba(183,156,255,.25); animation: finalFade 8s ease-in-out infinite; }
.fade-bubbles i:nth-child(1) { width:68px; height:68px; left:18%; }
.fade-bubbles i:nth-child(2) { width:34px; height:34px; left:28%; animation-delay:-2s; }
.fade-bubbles i:nth-child(3) { width:92px; height:92px; right:18%; animation-delay:-4s; }

@keyframes titleStamp { from { opacity: 0; transform: translateY(24px) scale(.98); filter: blur(8px); } to { opacity: 1; transform: none; filter: drop-shadow(0 18px 30px rgba(0,0,0,.46)); } }
@keyframes titleGlitch { 0%, 91%, 100% { transform: none; } 92% { transform: translateX(2px); } 93% { transform: translateX(-3px); } 94% { transform: none; } }
@keyframes subtleGlitch { 0%, 88%, 100% { transform:none; } 89% { transform:translateX(3px); text-shadow:-2px 0 var(--teal); } 90% { transform:translateX(-2px); text-shadow:2px 0 var(--violet); } 91% { transform:none; } }
@keyframes slowFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -18px; } }
@keyframes bubbleRise { from { transform: translateY(10vh) scale(.9); opacity:0; } 12%, 72% { opacity:.72; } to { transform: translateY(-115vh) scale(1.18); opacity:0; } }
@keyframes finalFade { 0%,100% { transform:translateY(20px); opacity:0; } 40% { opacity:.6; } 70% { transform:translateY(-70px); opacity:.08; } }

@media (max-width: 900px) {
  .masonry-wall { grid-template-columns: repeat(6, 1fr); }
  .receipt, .collage, .ledger { grid-column: span 6; }
  .seal, .note, .promise, .specimen { grid-column: span 3; }
  .cipher, .divider { grid-column: span 3; }
  .settlement-grid { grid-template-columns: 1fr; }
  .id-card, .check-window { opacity: .35; }
}

@media (max-width: 560px) {
  .chamber { padding: 28px; }
  .masonry-wall { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .artifact { grid-column: auto !important; grid-row: auto !important; min-height: 240px; margin-top: 0; }
  .floating-fragment { opacity: .45; }
}
