:root {
  --ink: #12284a;
  --muted: #5c6d86;
  --faint: #8b98ab;
  --navy: #123a8c;
  --navy-deep: #0c2d6e;
  --line: #dce3ee;
  --paper: #ffffff;
  --ring: rgba(18, 58, 140, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 4px 0 var(--navy);
}

::selection {
  background: #d6e2fb;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lookup-main {
  width: min(740px, calc(100% - 40px));
  margin: 0 auto;
  padding: 8vh 0 40px;
  flex: 1;
}

.crest {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 28px auto 8px;
}

.crest::before,
.crest::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--ring);
  pointer-events: none;
}

.crest::before {
  inset: -16px;
}

.crest::after {
  inset: -34px;
  border-color: rgba(18, 58, 140, 0.08);
}

.crest img {
  position: relative;
  z-index: 1;
  width: 108px;
  height: 108px;
  object-fit: contain;
  display: block;
}

.uni {
  margin: 28px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}

.campus {
  margin: 6px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

h1 {
  margin: 36px 0 0;
  text-align: center;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 560;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #10264d;
}

.lede {
  max-width: 46ch;
  margin: 16px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.lookup {
  margin-top: 32px;
}

.lookup label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lookup-row {
  display: flex;
  gap: 10px;
}

.lookup input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 700 16px/1 "Nunito", "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lookup input::placeholder {
  color: #9aa7b8;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.lookup input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(18, 58, 140, 0.12);
}

.lookup button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font: 800 16px/1 "Nunito", "Segoe UI", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lookup button svg {
  display: block;
}

.lookup button:hover {
  background: var(--navy-deep);
}

.lookup button:active {
  transform: translateY(1px);
}

.lookup button:focus-visible {
  outline: 3px solid #8eb0f0;
  outline-offset: 2px;
}

.lookup button.is-busy {
  opacity: 0.88;
  cursor: wait;
}

.lookup button.is-busy svg {
  display: none;
}

.lookup button.is-busy::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.result-open {
  overflow: hidden;
}

.result {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 16px;
}

.result[hidden] {
  display: none;
}

.result-scrim {
  position: absolute;
  inset: 0;
  background: rgba(12, 28, 58, 0.46);
  animation: scrim-in 180ms ease;
}

.result-sheet {
  position: relative;
  width: min(420px, 100%);
  margin-bottom: 8px;
  padding: 28px 24px 20px;
  border-radius: 28px;
  background: #fff;
  color: var(--ink);
  box-shadow:
    0 1px 2px rgba(16, 38, 77, 0.08),
    0 16px 40px rgba(16, 38, 77, 0.2);
  animation: sheet-in 280ms cubic-bezier(0.2, 0, 0, 1);
}

.result-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin-bottom: 18px;
  background: #e8eef8;
  color: var(--navy);
}

.result-icon svg {
  display: none;
}

.result-icon[data-tone="miss"] .icon-miss,
.result-icon[data-tone="found"] .icon-found,
.result-icon[data-tone="problem"] .icon-problem {
  display: block;
}

.result-icon[data-tone="found"] {
  background: #e5f6ee;
  color: #0c7a45;
}

.result-icon[data-tone="problem"] {
  background: #fff3df;
  color: #8a5a00;
}

.result-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.result-sheet h2 {
  margin: 8px 0 0;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #10264d;
}

.result-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.result-action {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-top: 22px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font: 800 15px/1 "Nunito", "Segoe UI", sans-serif;
  text-decoration: none;
}

.result-action:hover {
  background: var(--navy-deep);
}

.result-action:focus-visible {
  outline: 3px solid #8eb0f0;
  outline-offset: 2px;
}

@keyframes scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 680px) {
  .result {
    place-items: center;
  }

  .result-sheet {
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-scrim,
  .result-sheet,
  .lookup button.is-busy::after {
    animation: none;
  }
}

.hint {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 13.5px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 40px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.steps li {
  margin: 0;
}

.steps span {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}

.staff-out {
  display: block;
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.staff-out:hover { color: var(--navy); }

.staff-out:focus-visible {
  outline: 3px solid #8eb0f0;
  outline-offset: 2px;
}

.site-foot {
  padding: 8px 20px 28px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .lookup-main {
    width: min(740px, calc(100% - 32px));
    padding-top: 36px;
  }

  .crest {
    margin-top: 16px;
  }

  .uni {
    letter-spacing: 0.08em;
  }

  .lookup-row {
    flex-direction: column;
  }

  .lookup button {
    width: 100%;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
