:root {
  --paper: #f2f2ee;
  --paper-2: #d7d7d1;
  --ink: #050505;
  --graphite: #252525;
  --muted: #696965;
  --line: rgba(5, 5, 5, 0.28);
  --glow: rgba(0, 0, 0, 0.3);
  --panel: rgba(247, 247, 243, 0.68);
  --font-display: "Bahnschrift Condensed", "Arial Narrow", "Aptos Narrow", sans-serif;
  --font-heading: "Segoe UI Semibold", "Segoe UI", Arial, sans-serif;
  --font-body: "Segoe UI", Arial, sans-serif;
  --font: var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  cursor: none;
}

button,
a,
input {
  font: inherit;
}

#drone-field,
#cursor-field {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#drone-field {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.96), rgba(232, 232, 225, 0.66) 30%, rgba(198, 198, 190, 0.34) 64%, rgba(245, 245, 241, 0.9)),
    linear-gradient(180deg, #fbfbf8 0%, #d4d4cd 100%);
}

#cursor-field {
  z-index: 20;
  pointer-events: none;
}

.site-shell {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(42px, 7vh) 1fr auto;
  align-items: center;
  padding: clamp(12px, 2.3vw, 28px);
  isolation: isolate;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}

.ambient-large {
  width: min(86vw, 1080px);
  aspect-ratio: 1;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -48%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.08), 0 0 140px rgba(255, 255, 255, 0.72);
}

.ambient-small {
  width: min(42vw, 500px);
  aspect-ratio: 1;
  right: -12vw;
  top: 12vh;
  opacity: 0.5;
}

.fortress {
  grid-row: 2;
  width: min(1280px, 98vw);
  min-height: clamp(430px, 68vh, 720px);
  aspect-ratio: 16 / 8.4;
  margin: 0 auto;
  position: relative;
  perspective: 1200px;
}

.fortress-art {
  position: absolute;
  left: 50%;
  bottom: -1%;
  width: min(100vw, 1920px);
  aspect-ratio: 16 / 9;
  transform: translateX(-50%);
  background-image: url("../img/jivatown-fortress-bg.png");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  filter: contrast(1.08) brightness(0.98) grayscale(1);
  opacity: 0.98;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.fortress-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 47%, transparent 0 28%, rgba(255, 255, 255, 0.06) 54%, rgba(245, 245, 241, 0.28) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(245, 245, 241, 0.16));
}

.wall {
  position: absolute;
  left: 50%;
  bottom: 1%;
  width: min(100%, 1240px);
  height: 73%;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  clip-path: none;
  box-shadow: none;
  overflow: hidden;
}

.wall::before,
.wall::after {
  content: "";
  position: absolute;
  inset: 12% 6% 11%;
  border: 1px solid rgba(0, 0, 0, 0.055);
  clip-path: polygon(2% 18%, 9% 0, 91% 0, 98% 18%, 100% 100%, 0 100%);
}

.wall::after {
  inset: 25% 17% 0;
  border-color: rgba(0, 0, 0, 0.08);
  background: transparent;
}

.wall-top {
  position: absolute;
  left: 50%;
  top: 11%;
  width: min(74%, 880px);
  height: 58px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 18px;
  z-index: 2;
  opacity: 0.45;
}

.wall-top span {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(205, 205, 198, 0.08));
  box-shadow: inset 0 -18px 24px rgba(0, 0, 0, 0.055), 0 18px 34px rgba(255, 255, 255, 0.28);
}

.orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 50%;
  transform: translate(-50%, -45%);
}

.orbit-ring-a {
  width: min(83vw, 1120px);
  aspect-ratio: 1;
}

.orbit-ring-b {
  width: min(58vw, 760px);
  aspect-ratio: 1;
  opacity: 0.62;
}

.wall-cap {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 0;
  height: 16%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-top: 0;
  background: transparent;
  opacity: 0.45;
}

.side-bastion {
  position: absolute;
  top: 19%;
  bottom: 0;
  width: 24%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: transparent;
  opacity: 0.4;
}

.side-bastion-left {
  left: 0;
  clip-path: polygon(0 18%, 15% 0, 100% 0, 100% 100%, 0 100%);
}

.side-bastion-right {
  right: 0;
  clip-path: polygon(0 0, 85% 0, 100% 18%, 100% 100%, 0 100%);
}

.panel-matrix {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: min(36%, 400px);
  height: 58%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: clamp(5px, 0.8vw, 10px);
  padding: 0 clamp(10px, 1.2vw, 18px);
  opacity: 0.22;
}

.panel-matrix span {
  display: block;
  height: 58%;
  border: 1px solid rgba(0, 0, 0, 0.19);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(0, 0, 0, 0.045));
}

.panel-matrix span:nth-child(2),
.panel-matrix span:nth-child(5) {
  height: 73%;
}

.panel-matrix span:nth-child(3),
.panel-matrix span:nth-child(4) {
  height: 83%;
}

.gate-frame {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(23%, 280px);
  height: 70%;
  transform: translateX(-50%);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(15, 15, 15, 0.05));
  box-shadow: inset 0 0 52px rgba(0, 0, 0, 0.05), 0 0 42px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gate-arch {
  position: absolute;
  left: 50%;
  top: 4%;
  width: 72%;
  aspect-ratio: 1;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.16);
}

.gate-light {
  position: absolute;
  inset: 15% 14% 0;
  border: 1px solid rgba(0, 0, 0, 0.24);
  background: radial-gradient(circle at 50% 13%, rgba(255, 255, 255, 0.92), rgba(22, 22, 22, 0.04) 48%, rgba(0, 0, 0, 0.16));
  transform: translateY(100%);
  transition: transform 900ms cubic-bezier(0.18, 0.86, 0.24, 1);
}

.gate {
  position: absolute;
  inset: 31% 11% 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(5px, 0.7vw, 9px);
  transform-origin: top;
  transition: transform 900ms cubic-bezier(0.18, 0.86, 0.24, 1);
}

.gate span {
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(0, 0, 0, 0.075));
}

.circuit,
.glyph {
  position: absolute;
  pointer-events: none;
  opacity: 0.82;
  filter: drop-shadow(0 0 4px var(--glow));
}

.circuit::before,
.circuit::after {
  content: "";
  position: absolute;
  background: var(--ink);
  animation: pulseCircuit 3.6s ease-in-out infinite;
}

.circuit-a {
  left: 9%;
  top: 34%;
  width: 28%;
  height: 2px;
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}

.circuit-a::before {
  width: 44%;
  height: 1px;
  right: 0;
  top: 52px;
}

.circuit-a::after {
  width: 1px;
  height: 52px;
  right: 0;
  top: 0;
}

.circuit-b {
  right: 9%;
  top: 30%;
  width: 30%;
  height: 2px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.circuit-b::before {
  width: 38%;
  height: 1px;
  left: 0;
  top: 68px;
}

.circuit-b::after {
  width: 1px;
  height: 68px;
  left: 0;
  top: 0;
}

.circuit-c {
  left: 22%;
  bottom: 20%;
  width: 19%;
  height: 80px;
  border-left: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.circuit-c::before {
  width: 58%;
  height: 1px;
  left: 0;
  bottom: 28px;
}

.circuit-c::after {
  width: 5px;
  height: 5px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
}

.circuit-d {
  right: 21%;
  bottom: 18%;
  width: 22%;
  height: 96px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.circuit-d::before {
  width: 48%;
  height: 1px;
  right: 0;
  bottom: 36px;
}

.circuit-d::after {
  width: 5px;
  height: 5px;
  left: -3px;
  bottom: -3px;
  border-radius: 50%;
}

.circuit-e {
  left: 7%;
  top: 39%;
  width: 30%;
  height: 118px;
  border-top: 1px solid rgba(0, 0, 0, 0.72);
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  animation-delay: -1.8s;
}

.circuit-e::before {
  width: 42%;
  height: 1px;
  right: 0;
  top: 70px;
}

.circuit-e::after {
  width: 1px;
  height: 70px;
  right: 0;
  top: 0;
}

.circuit-f {
  right: 7%;
  top: 39%;
  width: 30%;
  height: 118px;
  border-top: 1px solid rgba(0, 0, 0, 0.72);
  border-left: 1px solid rgba(0, 0, 0, 0.5);
  animation-delay: -2.4s;
}

.circuit-f::before {
  width: 42%;
  height: 1px;
  left: 0;
  top: 70px;
}

.circuit-f::after {
  width: 1px;
  height: 70px;
  left: 0;
  top: 0;
}

.glyph {
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, 0.56);
  transform: rotate(45deg);
  animation: pulseGlyph 4.5s ease-in-out infinite;
}

.glyph::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(0, 0, 0, 0.42);
}

.glyph-one {
  left: 17%;
  top: 18%;
}

.glyph-two {
  right: 18%;
  top: 19%;
  animation-delay: -1.2s;
}

.glyph-three {
  left: 50%;
  top: 13%;
  width: 54px;
  transform: translateX(-50%) rotate(45deg);
  animation-delay: -2.4s;
}

.sentinel {
  position: absolute;
  left: 50%;
  bottom: 46%;
  width: min(220px, 26vw);
  aspect-ratio: 0.82;
  transform: translate(-50%, 40%) scale(0.76);
  opacity: 0;
  transition: transform 700ms cubic-bezier(0.18, 0.86, 0.24, 1), opacity 500ms ease;
  z-index: 3;
}

.sentinel-skull {
  position: absolute;
  inset: 0 8% 22%;
  border: 1px solid rgba(0, 0, 0, 0.62);
  border-radius: 48% 48% 36% 36%;
  background: rgba(244, 244, 240, 0.78);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.22), inset 0 0 26px rgba(0, 0, 0, 0.08);
}

.sentinel-skull span {
  position: absolute;
  top: 42%;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #050505;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.45);
}

.sentinel-skull span:first-child {
  left: 26%;
}

.sentinel-skull span:last-child {
  right: 26%;
}

.sentinel-jaw {
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 7%;
  height: 25%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: rgba(245, 245, 241, 0.78);
}

.turret {
  position: absolute;
  bottom: 60%;
  width: 74px;
  height: 98px;
  opacity: 0;
  transform: translateY(54px);
  transition: opacity 360ms ease, transform 620ms cubic-bezier(0.18, 0.86, 0.24, 1);
  z-index: 4;
}

.turret-left {
  left: 13%;
}

.turret-right {
  right: 13%;
}

.turret::before {
  content: "";
  position: absolute;
  inset: auto 25% 0;
  height: 58%;
  border: 1px solid rgba(0, 0, 0, 0.42);
  background: rgba(247, 247, 243, 0.86);
}

.turret-head {
  position: absolute;
  left: 0;
  top: 2px;
  width: 100%;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.54);
  background: linear-gradient(180deg, #fbfbf8, #d4d4ce);
}

.turret-head::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 58px;
  height: 6px;
  background: #050505;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.turret-left .turret-head {
  transform: rotate(14deg);
}

.turret-right .turret-head {
  transform: rotate(-14deg);
}

.turret-left .turret-head::after {
  right: -42px;
}

.turret-right .turret-head::after {
  left: -42px;
}

.access-panel {
  position: absolute;
  left: 50%;
  top: clamp(50px, 7vh, 82px);
  width: min(690px, calc(100vw - 34px));
  transform: translateX(-50%);
  padding: clamp(20px, 2.8vw, 30px) clamp(24px, 3.8vw, 44px) clamp(18px, 2.6vw, 28px);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(0, 0, 0, 0.08) 9.1% 9.22%, transparent 9.35% 90.65%, rgba(0, 0, 0, 0.08) 90.78% 90.9%, transparent 91%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.035) 0 8%, transparent 8.2% 92%, rgba(0, 0, 0, 0.035) 92.2%),
    linear-gradient(180deg, rgba(255, 255, 253, 0.62), rgba(242, 242, 237, 0.42));
  backdrop-filter: blur(14px);
  clip-path: polygon(0 0, 94% 0, 100% 13%, 100% 100%, 6% 100%, 0 87%);
  box-shadow: 0 24px 88px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.76);
  transition: transform 680ms cubic-bezier(0.18, 0.86, 0.24, 1), box-shadow 300ms ease;
}

.access-panel > * {
  position: relative;
}

.access-panel::before,
.access-panel::after {
  content: "";
  position: absolute;
  top: 56%;
  width: min(19vw, 210px);
  height: 58px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(215, 215, 208, 0.16));
  z-index: -1;
}

.access-panel::before {
  right: calc(100% - 2px);
}

.access-panel::after {
  left: calc(100% - 2px);
}

.eyebrow,
.tagline,
.status,
.district small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: var(--font-display);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2,
h3,
button,
label,
.hub-card span,
.hub-kicker,
.eyebrow,
.status {
  font-family: var(--font-heading);
}

.tagline {
  max-width: 36rem;
  margin-inline: auto;
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
}

.access-form {
  margin-top: 24px;
}

.access-form label {
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--graphite);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  position: relative;
}

.input-row::before,
.input-row::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 48px;
  height: 1px;
  background: rgba(0, 0, 0, 0.32);
}

.input-row::before {
  right: calc(100% + 10px);
}

.input-row::after {
  left: calc(100% + 10px);
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(0, 0, 0, 0.34);
  border-radius: 0;
  padding: 0 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  outline: none;
  caret-color: var(--ink);
}

input:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.16);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(255, 255, 248, 0.72) inset, 0 0 0 3px rgba(0, 0, 0, 0.12);
  transition: background-color 9999s ease-in-out 0s;
}

button,
.district {
  cursor: none;
}

button {
  min-height: 52px;
  border: 1px solid #050505;
  padding: 0 24px;
  color: #f7f7f3;
  background:
    linear-gradient(135deg, transparent 0 12%, rgba(255, 255, 255, 0.18) 12.5% 13.5%, transparent 14%),
    #050505;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
  background: #f7f7f3;
  color: #050505;
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 0.86rem;
}

.districts {
  grid-row: 3;
  width: min(980px, 94vw);
  margin: clamp(12px, 2vh, 22px) auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.district {
  position: relative;
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px 20px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.24);
  background:
    linear-gradient(135deg, transparent 0 74%, rgba(0, 0, 0, 0.045) 74.2% 100%),
    rgba(247, 247, 243, 0.66);
  overflow: hidden;
  transition: transform 240ms ease, background 240ms ease, border-color 240ms ease;
}

.district::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent);
  opacity: 0.35;
}

.district::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
  transform: translateX(-120%);
  transition: transform 600ms ease;
}

.district span {
  position: relative;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.district small {
  position: relative;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
}

.district:not(.is-locked):hover,
.district:not(.is-locked):focus-visible {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.5);
}

.district:not(.is-locked):hover::before,
.district:not(.is-locked):focus-visible::before {
  transform: translateX(120%);
}

.content-section {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto 28px;
  padding: clamp(22px, 4vw, 44px) 0;
}

.content-section h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  text-transform: uppercase;
}

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

.content-grid article {
  min-height: 160px;
  padding: 22px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  background: rgba(247, 247, 243, 0.78);
}

.hero[data-state="open"] .gate {
  transform: translateY(-78%);
}

.hero[data-state="open"] .gate-light {
  transform: translateY(0);
}

.hero[data-state="open"] .access-panel {
  transform: translateX(-50%) translateY(-10px);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.17), 0 0 34px rgba(0, 0, 0, 0.12);
}

.hero[data-state="warning"] .sentinel,
.hero[data-state="armed"] .sentinel,
.hero[data-state="locked"] .sentinel {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.hero[data-state="armed"] .turret,
.hero[data-state="locked"] .turret {
  opacity: 1;
  transform: translateY(0);
}

.hero[data-state="locked"] {
  animation: lockPulse 620ms ease 2;
}

/* Current visual direction: let the generated fortress carry the architecture. */
.fortress {
  min-height: clamp(520px, 74vh, 790px);
}

.fortress-art {
  bottom: -4%;
  width: min(100vw, 1920px);
}

.access-panel {
  top: clamp(96px, 16vh, 150px);
  width: min(360px, calc(100vw - 34px));
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  clip-path: none;
  box-shadow: none;
}

.access-panel::before,
.access-panel::after {
  display: none;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
}

.access-form {
  margin-top: 0;
  position: relative;
}

.access-form label {
  margin-bottom: 9px;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
}

.input-row {
  display: block;
}

.input-row::before,
.input-row::after {
  display: none;
}

input {
  min-height: 30px;
  padding: 0 42px 0 15px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.45);
}

input::placeholder {
  color: rgba(0, 0, 0, 0.38);
  letter-spacing: 0;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.34) inset, inset 0 0 12px rgba(255, 255, 255, 0.45);
}

button {
  position: absolute;
  right: 6px;
  top: 28px;
  width: 28px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0;
}

button:hover,
button:focus-visible {
  transform: translateX(2px);
  color: var(--ink);
  background: transparent;
}

.status {
  min-height: 18px;
  margin-top: 9px;
  font-size: 0.68rem;
  opacity: 0.72;
}

.districts {
  position: absolute;
  left: 50%;
  bottom: clamp(36px, 8vh, 92px);
  z-index: 3;
  width: min(980px, 78vw);
  transform: translateX(-50%);
  margin: 0;
}

@keyframes pulseCircuit {
  0%,
  100% {
    opacity: 0.28;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.18);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.32);
  }
}

@keyframes pulseGlyph {
  0%,
  100% {
    opacity: 0.44;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.18));
  }
  50% {
    opacity: 0.92;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.34));
  }
}

@keyframes lockPulse {
  0%,
  100% {
    filter: invert(0);
  }
  50% {
    filter: invert(1);
  }
}

@media (max-width: 760px) {
  body {
    cursor: auto;
  }

  #cursor-field {
    display: none;
  }

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 12px;
  }

  .fortress {
    width: 100%;
    min-height: 420px;
    flex: 0 0 420px;
  }

  .wall {
    height: 65%;
    clip-path: polygon(2% 0, 98% 0, 100% 12%, 100% 100%, 0 100%, 0 12%);
  }

  .gate-frame {
    width: 48%;
  }

  .access-panel {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    transform: none;
    margin: -96px auto 14px;
    overflow: hidden;
    padding: 18px;
  }

  .access-panel::before,
  .access-panel::after,
  .input-row::before,
  .input-row::after {
    display: none;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.35rem);
  }

  .tagline {
    font-size: 0.95rem;
  }

  .hero[data-state="open"] .access-panel {
    transform: translateY(-4px);
  }

  .input-row {
    display: block;
  }

  button {
    position: absolute;
    top: 28px;
    right: 6px;
    width: 28px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    color: var(--ink);
    background: transparent;
  }

  .districts {
    grid-row: 3;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .district {
    min-height: 58px;
  }

  .ambient-small {
    display: none;
  }

  .sentinel {
    width: 160px;
    bottom: 36%;
  }

  .turret {
    width: 54px;
    height: 78px;
    bottom: 53%;
  }

  .turret-left {
    left: 5%;
  }

  .turret-right {
    right: 5%;
  }

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

/* Gate v2 and hub page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 850ms ease;
}

body.transition-out::after {
  opacity: 1;
}

.hero {
  min-height: 100svh;
  grid-template-rows: 1fr;
  padding: 0;
}

.fortress {
  grid-row: 1;
  width: 100vw;
  max-width: none;
  min-height: 100svh;
  aspect-ratio: auto;
}

.fortress-art {
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transform: none;
  left: 0;
  bottom: auto;
  background-image: url("../img/jivatown-gate-v2.png");
  background-size: cover;
  background-position: center center;
  -webkit-mask-image: none;
  mask-image: none;
}

.fortress-art::after {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(180deg, rgba(245, 245, 241, 0.06), rgba(245, 245, 241, 0.16));
}

.access-panel {
  top: 15.2svh;
  width: min(250px, 21vw);
  color: var(--ink);
}

.access-panel h1 {
  margin-bottom: 12px;
  font-size: clamp(0.92rem, 1.55vw, 1.42rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.access-form label {
  margin-bottom: 6px;
  font-size: clamp(0.42rem, 0.62vw, 0.52rem);
  letter-spacing: 0.22em;
}

.input-row {
  position: relative;
}

input {
  min-height: clamp(18px, 2.25vh, 24px);
  padding: 0 34px 0 12px;
  border-color: rgba(0, 0, 0, 0.23);
  background: rgba(255, 255, 255, 0.3);
  font-size: clamp(0.56rem, 0.78vw, 0.72rem);
}

button {
  top: calc(100% - 27px);
  right: 4px;
  width: 26px;
  height: 18px;
  min-height: 18px;
}

.status {
  margin-top: 7px;
  font-size: clamp(0.48rem, 0.65vw, 0.58rem);
}

.locked-panel-labels {
  display: none;
}

.hub-page {
  background: #f2f2ee;
  animation: fadeInHub 850ms ease both;
}

.hub-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
}

.hub-stage {
  position: relative;
  min-height: 100svh;
  padding: clamp(22px, 4vw, 54px);
  overflow: hidden;
}

.hub-art {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("../img/jivatown-hub-clean.png");
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.05) brightness(1.02);
}

.hub-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, transparent 0 42%, rgba(245, 245, 241, 0.28) 100%);
}

.hub-header {
  width: min(880px, 92vw);
  margin: 0 auto clamp(34px, 7vh, 72px);
  text-align: center;
}

.hub-kicker {
  margin-bottom: 10px;
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hub-header h1 {
  font-size: clamp(2rem, 5.8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
}

.hub-grid {
  width: min(980px, 86vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.hub-card {
  position: relative;
  min-height: 142px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  border: 0;
  background-image: url("../img/jivatown-file-card.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  backdrop-filter: none;
  box-shadow: none;
}

.hub-card::before {
  content: "";
  position: absolute;
  inset: 13% 5%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
}

.hub-card span {
  position: relative;
  font-size: clamp(1rem, 2vw, 1.32rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hub-card small {
  position: relative;
  color: rgba(0, 0, 0, 0.58);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

@keyframes fadeInHub {
  from {
    opacity: 0;
    background: #000;
  }
  to {
    opacity: 1;
    background: #f2f2ee;
  }
}

@media (max-width: 760px) {
  .hero {
    display: block;
    min-height: 100svh;
    padding: 0;
  }

  .fortress {
    width: 100vw;
    min-height: 100svh;
    flex: none;
  }

  .fortress-art {
    background-size: cover;
    background-position: center top;
  }

  .access-panel {
    position: absolute;
    left: 50%;
    top: 15.2svh;
    width: min(250px, 48vw);
    max-width: none;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .access-panel h1 {
    font-size: clamp(0.8rem, 5vw, 1.45rem);
    letter-spacing: 0.3em;
    text-indent: 0.3em;
  }

  .access-form label {
    font-size: 0.52rem;
  }

  button {
    width: 26px;
  }

  .locked-panel-labels {
    display: none;
  }

  .hub-stage {
    padding: 28px 14px;
  }

  .hub-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .hub-card {
    min-height: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
