:root{
  --ink:    #0F2438;
  --paper:  #EDE7D9;
  --water:  #5B9C93;
  --amber:  #D69A45;
  --muted:  #93A6B5;
  --line:   rgba(237,231,217,0.14);
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  height:100%;
  background:var(--ink);
  color:var(--paper);
  font-family:sans-serif;
  overflow-x:hidden;
}

body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  isolation:isolate;
}

/* ---------- background: graticule ---------- */
.bg{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
}
.bg::before{
  content:"";
  position:absolute;
  inset:-1px;
  background-image:
    linear-gradient(to right, transparent 0, transparent calc(100% - 1px), var(--line) calc(100% - 1px), var(--line) 100%),
    linear-gradient(to bottom, transparent 0, transparent calc(100% - 1px), var(--line) calc(100% - 1px), var(--line) 100%);
  background-size:
    12.5% 100%,
    100% 16.6667%;
}

/* ---------- content ---------- */
.stage{
  position:relative;
  z-index:1;
  width:fit-content;
  max-width:100%;
  padding:64px 32px;
  animation:rise 900ms cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes rise{
  from{ opacity:0; transform:translateY(14px); }
  to{ opacity:1; transform:translateY(0); }
}

h1{
  font-family:'Fraunces', serif;
  font-weight:560;
  font-size:clamp(2.6rem, 7vw, 4.4rem);
  line-height:1.02;
  letter-spacing:-0.01em;
  margin:0 0 18px 0;
  color:var(--paper);
}

/* legend-style index entries */
.index{
  padding-top:22px;
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-bottom:44px;
}
.index-row{
  display:flex;
  align-items:baseline;
  gap:12px;
  font-family:'IBM Plex Mono', monospace;
  font-size:13px;
}
.index-row .k{
  color:var(--muted);
  letter-spacing:0.05em;
  text-transform:uppercase;
  white-space:nowrap;
}
.index-row .dots{
  flex:1;
  border-bottom:1px dotted var(--line);
  transform:translateY(-4px);
}
.index-row .v{
  white-space:nowrap;
  color:var(--paper);
}

/* data-layer legend swatches */
.legend{
  display:flex;
  flex-wrap:wrap;
  gap:22px;
  margin-bottom:56px;
}
.legend-item{
  display:flex;
  align-items:center;
  gap:8px;
  font-family:'IBM Plex Mono', monospace;
  font-size:11.5px;
  color:var(--muted);
  letter-spacing:0.02em;
}
.swatch{
  width:10px;
  height:10px;
  border-radius:2px;
  flex-shrink:0;
}
.swatch.c1{ background:var(--water); }
.swatch.c2{ background:var(--amber); }
.swatch.c3{ background:#8AA6C2; }
.swatch.c4{ background:#C97B6B; }

@media (max-width:560px){
  .stage{ padding:44px 22px; }
  .legend{ gap:14px 20px; }
}

@media (prefers-reduced-motion: reduce){
  .stage{ animation:none; }
}
