:root {
  --uni-maroon: #711610;
  --uni-maroon-dark: #3f0f0b;
  --uni-gray: #9a999d;
  --uni-sand: #e6d9aa;
  --ink: #171412;
  --muted: #676568;
  --line: #dedbd4;
  --paper: #ffffff;
  --surface: #f6f5f2;
  --surface-strong: #edeae2;
  --technical: #201b19;
  --error: #9b1c17;
  --shadow: 0 14px 32px rgba(29, 19, 15, 0.08);
  --title-font: "Barlow Condensed", "Oswald", "Archivo Narrow", sans-serif;
  --text-font: "Inter", "IBM Plex Sans", "Source Sans 3", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--text-font);
  line-height: 1.5;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(113, 22, 16, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(113, 22, 16, 0.06) 1px, transparent 1px),
    var(--surface);
  background-size: 44px 44px;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.site-shell::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--uni-maroon);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--uni-maroon);
  border-radius: 50%;
  color: var(--uni-maroon);
  font-family: var(--title-font);
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  background: var(--paper);
  box-shadow: inset 0 0 0 4px rgba(113, 22, 16, 0.08);
  flex: 0 0 auto;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
}

.brand-name {
  font-family: var(--title-font);
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.brand-office {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.process-badge {
  border: 1px solid rgba(113, 22, 16, 0.22);
  border-left: 4px solid var(--uni-maroon);
  border-radius: 4px;
  background: var(--paper);
  color: var(--uni-maroon);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}

.hero-grid {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 10px auto 0;
}

.consult-panel,
.technical-panel,
.instructions {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.consult-panel {
  position: relative;
  padding: clamp(22px, 6vw, 42px);
}

.consult-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 6px 0 0 6px;
  background: var(--uni-maroon);
}

.kicker {
  margin: 0 0 8px;
  color: var(--uni-maroon);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: var(--title-font);
  letter-spacing: 0;
  line-height: 0.95;
}

h1 {
  margin-bottom: 10px;
  color: var(--uni-maroon);
  font-size: clamp(3.4rem, 18vw, 6.5rem);
  font-weight: 800;
  text-transform: uppercase;
}

.subtitle {
  max-width: 620px;
  margin-bottom: 28px;
  color: #373332;
  font-size: clamp(1rem, 3vw, 1.17rem);
  font-weight: 600;
}

.query-form {
  display: grid;
  gap: 15px;
}

.field-group {
  display: grid;
  gap: 6px;
}

label {
  color: #312d2b;
  font-size: 0.9rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #c9c5bd;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input:focus {
  border-color: var(--uni-maroon);
  box-shadow: 0 0 0 4px rgba(113, 22, 16, 0.12);
}

input[aria-invalid="true"] {
  border-color: var(--error);
  background: #fff8f7;
}

.field-error {
  min-height: 18px;
  margin: 0;
  color: var(--error);
  font-size: 0.82rem;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 48px;
  border-radius: 4px;
  padding: 11px 16px;
  font-weight: 800;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.primary-button {
  border: 1px solid var(--uni-maroon);
  background: var(--uni-maroon);
  color: #fff;
  box-shadow: 0 10px 18px rgba(113, 22, 16, 0.18);
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: #aaa6a1;
  background: #aaa6a1;
  box-shadow: none;
  opacity: 0.82;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active {
  transform: translateY(0);
}

.form-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.turnstile-box {
  grid-column: 1 / -1;
  min-height: 65px;
}

.state-message,
.result-card {
  margin-top: 20px;
}

.state-message {
  border: 1px solid rgba(113, 22, 16, 0.22);
  border-left: 4px solid var(--uni-maroon);
  border-radius: 4px;
  background: #fffaf8;
  padding: 18px;
}

.state-message.maintenance {
  border-color: rgba(154, 153, 157, 0.45);
  border-left-color: var(--uni-gray);
  background: #fafafa;
}

.state-message.consulting {
  border-color: rgba(230, 217, 170, 0.74);
  border-left-color: var(--uni-sand);
  background: #fffdf7;
}

.state-message h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
  text-transform: uppercase;
}

.state-message p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 600;
}

.result-card {
  border: 1px solid rgba(113, 22, 16, 0.28);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}

.result-header {
  display: grid;
  gap: 12px;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(230, 217, 170, 0.34), transparent 70%),
    var(--uni-maroon);
  color: #fff;
}

.result-label {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-header h2 {
  margin-bottom: 0;
  font-size: clamp(2.4rem, 12vw, 5rem);
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.result-header h2 span {
  display: inline-block;
}

.result-status {
  width: fit-content;
  border: 1px solid rgba(230, 217, 170, 0.48);
  border-radius: 4px;
  color: var(--uni-sand);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 8px;
}

dl {
  margin: 0;
}

.priority-facts,
.identity-list,
.assignment-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.priority-facts {
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}

.identity-list {
  grid-template-columns: 1fr;
}

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

.priority-facts div,
.identity-list div,
.assignment-grid div {
  min-width: 0;
  background: var(--paper);
  padding: 13px;
}

.priority-facts div {
  background: #fbfaf6;
}

.priority-facts dd {
  color: var(--uni-maroon);
  font-size: 1.08rem;
}

.highlight-fact dd {
  color: var(--uni-maroon);
  font-size: 1.02rem;
}

.assignment-grid .wide {
  grid-column: 1 / -1;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-actions {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.secondary-button {
  border: 1px solid var(--uni-maroon);
  background: var(--paper);
  color: var(--uni-maroon);
}

.ghost-button {
  border: 1px solid #cbc7bd;
  background: #f9f8f5;
  color: #292522;
}

.map-button {
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.map-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.brief-note {
  border-top: 1px solid var(--line);
  background: #faf8f0;
  color: #443d33;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 14px 16px;
}

.technical-panel {
  position: relative;
  min-height: 360px;
  padding: 16px;
  background:
    radial-gradient(circle at 72% 20%, rgba(230, 217, 170, 0.18), transparent 28%),
    var(--technical);
  color: #fff;
  overflow: hidden;
}

.technical-panel::before,
.technical-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(230, 217, 170, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(230, 217, 170, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.42;
}

.coordinate-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--title-font);
  font-size: 0.86rem;
  font-weight: 700;
}

.coordinate-strip span {
  border: 1px solid rgba(230, 217, 170, 0.24);
  border-radius: 4px;
  padding: 5px 7px;
}

.technical-map {
  position: relative;
  height: 310px;
  margin-top: 18px;
  border: 1px solid rgba(230, 217, 170, 0.24);
  border-radius: 6px;
  overflow: hidden;
}

.axis,
.route,
.node,
.block,
.marker {
  position: absolute;
  z-index: 1;
}

.axis {
  background: rgba(230, 217, 170, 0.35);
}

.axis-x {
  left: 8%;
  right: 8%;
  top: 48%;
  height: 1px;
}

.axis-y {
  top: 10%;
  bottom: 12%;
  left: 45%;
  width: 1px;
}

.route {
  height: 2px;
  background: var(--uni-sand);
  transform-origin: left center;
  opacity: 0.72;
}

.route-one {
  left: 17%;
  top: 34%;
  width: 48%;
  transform: rotate(16deg);
}

.route-two {
  left: 45%;
  top: 48%;
  width: 33%;
  transform: rotate(-28deg);
}

.route-three {
  left: 29%;
  top: 67%;
  width: 40%;
  transform: rotate(-8deg);
}

.node {
  width: 13px;
  height: 13px;
  border: 2px solid var(--uni-sand);
  border-radius: 50%;
  background: var(--technical);
  box-shadow: 0 0 0 7px rgba(230, 217, 170, 0.08);
}

.node-a {
  left: 16%;
  top: 31%;
}

.node-b {
  left: 44%;
  top: 46%;
}

.node-c {
  left: 75%;
  top: 28%;
}

.node-d {
  left: 68%;
  top: 63%;
}

.block {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--title-font);
  font-size: 1.2rem;
  font-weight: 800;
}

.block-a {
  width: 76px;
  height: 52px;
  left: 54%;
  top: 39%;
}

.block-b {
  width: 58px;
  height: 48px;
  left: 14%;
  top: 63%;
}

.block-c {
  width: 66px;
  height: 46px;
  right: 13%;
  top: 16%;
}

.marker {
  right: 11%;
  bottom: 21%;
  border-left: 4px solid var(--uni-sand);
  background: rgba(113, 22, 16, 0.96);
  color: #fff;
  font-family: var(--title-font);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 0.86;
  padding: 12px 14px 11px;
}

.instructions {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: clamp(20px, 5vw, 30px);
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  text-transform: uppercase;
}

.instruction-list {
  display: grid;
  gap: 1px;
  margin: 20px 0 0;
  padding: 0;
  background: var(--line);
  list-style: none;
}

.instruction-list li {
  position: relative;
  min-height: 54px;
  background: var(--paper);
  color: #322d2a;
  font-weight: 700;
  padding: 15px 14px 15px 34px;
}

.instruction-list li::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 14px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--uni-maroon);
  border-radius: 50%;
}

.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-name {
    font-size: clamp(1.05rem, 6vw, 1.35rem);
  }

  .process-badge {
    align-self: stretch;
    text-align: center;
  }

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

  .result-header {
    padding: 18px 16px;
  }
}

@media (max-width: 460px) {
  .result-header {
    padding: 18px 16px;
  }

  .result-header h2 span {
    display: block;
  }
}

@media (min-width: 640px) {
  .query-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .primary-button {
    grid-column: 1 / -1;
  }

  .form-note {
    grid-column: 1 / -1;
  }

  .priority-facts {
    grid-template-columns: 0.8fr 1.2fr;
  }

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

  .result-actions {
    grid-template-columns: 1fr;
  }

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

}

@media (min-width: 980px) {
  .topbar {
    padding: 24px 0;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.76fr);
    align-items: stretch;
    margin-top: 20px;
  }

  .consult-panel {
    min-height: 630px;
  }

  .technical-panel {
    min-height: 630px;
  }

  .technical-map {
    height: calc(100% - 54px);
    min-height: 520px;
  }

  .primary-button {
    grid-column: auto;
    align-self: end;
  }

  .query-form {
    grid-template-columns: 1fr 1fr auto;
  }

  .form-note {
    grid-column: 1 / -1;
  }

  .result-header {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .assignment-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .assignment-grid .wide {
    grid-column: span 2;
  }

  .instruction-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

}

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