:root {
  --ink: #11201a;
  --muted: #52615c;
  --line: #13241c;
  --paper: #fffbea;
  --white: #ffffff;
  --blue: #1ab6ff;
  --green: #00b978;
  --green-deep: #0f8d61;
  --yellow: #ffd93d;
  --coral: #ff6f61;
  --mint: #7dffcf;
  --shadow: 8px 8px 0 #13241c;
  --soft-shadow: 4px 4px 0 #13241c;
  --card-shadow: 0 22px 40px rgba(19, 36, 28, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 217, 61, 0.9), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(26, 182, 255, 0.22), transparent 22%),
    radial-gradient(circle at 20% 100%, rgba(0, 185, 120, 0.22), transparent 24%),
    linear-gradient(135deg, #fffdf3, #f5ffe8 34%, #f1fff8 100%);
  font-family:
    "Trebuchet MS", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.75;
}

body::before {
  top: 78px;
  right: -56px;
  width: 220px;
  height: 220px;
  background: rgba(255, 217, 61, 0.42);
}

body::after {
  left: -54px;
  bottom: 60px;
  width: 180px;
  height: 180px;
  background: rgba(26, 182, 255, 0.2);
}

body.is-loading {
  overflow: hidden;
}

.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(255, 247, 183, 0.9), rgba(255, 232, 110, 0.65) 22%, rgba(7, 28, 18, 0.97) 64%),
    linear-gradient(180deg, rgba(0, 185, 120, 0.16), rgba(0, 0, 0, 0));
  transition: opacity 720ms ease, visibility 720ms ease, transform 720ms ease;
}

.intro-splash::before,
.intro-splash::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 217, 61, 0.18);
  filter: blur(10px);
  animation: splashPulse 3.2s ease-in-out infinite;
}

.intro-splash::before {
  width: 240px;
  height: 240px;
  top: 14%;
  left: 12%;
}

.intro-splash::after {
  width: 180px;
  height: 180px;
  right: 14%;
  bottom: 12%;
  animation-delay: 0.5s;
}

.intro-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
}

.intro-splash__logo {
  position: relative;
  width: min(70vw, 420px);
  max-width: 420px;
  height: auto;
  filter:
    drop-shadow(0 0 26px rgba(255, 217, 61, 0.42))
    drop-shadow(0 18px 50px rgba(0, 0, 0, 0.42));
  animation: splashLogo 2.1s ease-in-out infinite alternate;
}

.topbar,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar,
main,
.help-strip article,
.tools,
.profile-card,
.empty-state {
  transition: opacity 500ms ease, transform 500ms ease;
}

body.is-loading .topbar,
body.is-loading main {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
}

body.is-ready .topbar,
body.is-ready main {
  opacity: 1;
  transform: none;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 42px 0 24px;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.hero-text {
  min-width: 0;
}

.hero-title {
  min-width: 0;
}

.hero-logo {
  display: block;
  width: min(120px, 24vw);
  margin: 2px 0 0;
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(17, 32, 26, 0.14));
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 14px;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink);
  background: linear-gradient(135deg, #fffad9, #ffd93d);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: var(--soft-shadow);
  transform: rotate(-2deg);
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-shadow:
    4px 4px 0 rgba(255, 217, 61, 0.92),
    8px 8px 0 rgba(26, 182, 255, 0.22);
}

.intro {
  max-width: 700px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.stats {
  display: grid;
  place-items: center;
  width: 124px;
  aspect-ratio: 1;
  border: 4px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, var(--green), var(--blue));
  box-shadow: var(--shadow);
  transform: rotate(3deg);
}

.stats span {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--white);
  text-shadow: 2px 2px 0 var(--ink);
}

.stats small {
  max-width: 80px;
  color: var(--white);
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}

.tools {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding: 20px;
  border: 4px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.tools::after {
  content: "";
  position: absolute;
  right: 16px;
  top: -14px;
  width: 78px;
  height: 16px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--coral));
  transform: rotate(4deg);
}

.search-box,
.filter-wrap {
  display: grid;
  gap: 10px;
}

.search-box span,
.filter-wrap > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input {
  width: 100%;
  min-height: 52px;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  background: #fffef8;
  font: inherit;
  font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(19, 36, 28, 0.08);
}

input::placeholder {
  color: #819089;
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(26, 182, 255, 0.28);
  outline-offset: 2px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-button {
  min-height: 40px;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  color: var(--ink);
  background: #fffef8;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.filter-button:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--ink);
}

.filter-button.is-active {
  color: var(--white);
  background: linear-gradient(135deg, var(--green), var(--blue));
  text-shadow: 1px 1px 0 var(--ink);
}

.help-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 22px;
}

.help-strip article {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 18px 18px 18px 58px;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
}

.help-strip article:nth-child(1) {
  transform: rotate(-0.7deg);
}

.help-strip article:nth-child(2) {
  transform: rotate(0.7deg);
}

.help-strip article:nth-child(3) {
  transform: rotate(-0.3deg);
}

.help-strip span {
  color: var(--muted);
}

.help-mark {
  position: absolute;
  left: 16px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border: 3px solid var(--line);
  border-radius: 50%;
  color: var(--ink) !important;
  background: var(--yellow);
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--ink);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
  padding-bottom: 12px;
}

.section-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(19, 36, 28, 0), rgba(19, 36, 28, 0.45), rgba(19, 36, 28, 0));
}

.section-divider span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 2px 2px 0 var(--ink);
}

.profile-card {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 255, 248, 0.96));
  box-shadow: var(--card-shadow);
  animation: cardIn 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--card-delay, 0ms);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-card:nth-child(4n + 1) {
  transform: rotate(-1deg);
}

.profile-card:nth-child(4n + 2) {
  transform: rotate(0.95deg);
}

.profile-card:nth-child(4n + 3) {
  transform: rotate(-0.35deg);
}

.profile-card:hover {
  transform: translate(-4px, -6px) rotate(0deg);
  box-shadow: 12px 18px 0 rgba(19, 36, 28, 0.14);
}

.photo-frame {
  position: relative;
  aspect-ratio: 60 / 93;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255, 217, 61, 0.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(26, 182, 255, 0.24) 25%, transparent 25%),
    linear-gradient(180deg, #fffef7, #e8fff3);
  background-size: 18px 18px, 18px 18px, cover;
  border-bottom: 4px solid var(--line);
}

.photo-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(180deg, rgba(17, 32, 26, 0), rgba(17, 32, 26, 0.12));
  pointer-events: none;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 380ms ease;
}

.profile-card:hover .photo-frame img {
  transform: scale(1.04);
}

.photo-frame.is-missing img {
  display: none;
}

.photo-frame.is-missing::before {
  content: attr(data-initial);
  position: absolute;
  inset: 18px;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 4px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe783, #ffd93d);
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow: 3px 3px 0 rgba(26, 182, 255, 0.24);
}

.division-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100% - 24px);
}

.division-badge span {
  display: inline-flex;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
  text-shadow: 1px 1px 0 var(--ink);
  transition: transform 180ms ease;
}

.profile-card:hover .division-badge span {
  transform: translateY(-3px) rotate(-2deg);
}

.profile-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.profile-head {
  display: grid;
  gap: 8px;
}

.nickname {
  width: fit-content;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--green-deep);
  background: rgba(125, 255, 207, 0.26);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.08;
  text-shadow: 2px 2px 0 rgba(255, 217, 61, 0.65);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.division-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 2px dashed rgba(19, 36, 28, 0.16);
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.meta-chip-division {
  border-style: solid;
  border-color: rgba(0, 185, 120, 0.34);
  background: rgba(0, 185, 120, 0.12);
  color: var(--green-deep);
}

.meta-chip-class {
  border-color: rgba(26, 182, 255, 0.24);
  background: rgba(26, 182, 255, 0.1);
  color: #145c78;
}

.motto {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.96rem;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--yellow), #ffe88b);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.contact-button::after {
  content: "->";
  transition: transform 160ms ease;
}

.contact-button:hover {
  transform: translate(-1px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.contact-button:hover::after {
  transform: translateX(3px);
}

.contact-button.is-disabled {
  color: #4d5960;
  background: #d8e2e8;
  pointer-events: none;
}

.empty-state {
  margin: 28px 0 52px;
  padding: 24px;
  border: 3px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  box-shadow: var(--soft-shadow);
}

.doodle {
  position: absolute;
  pointer-events: none;
  animation: floaty 3.4s ease-in-out infinite;
}

.doodle-spark {
  right: 150px;
  top: 34px;
  color: var(--coral);
  font-size: 3rem;
  font-weight: 900;
  text-shadow: 2px 2px 0 var(--ink);
}

.doodle-zigzag {
  right: 280px;
  top: 24px;
  width: 92px;
  height: 28px;
  background:
    linear-gradient(135deg, transparent 0 35%, var(--blue) 35% 46%, transparent 46% 100%),
    linear-gradient(45deg, transparent 0 35%, var(--yellow) 35% 46%, transparent 46% 100%);
  background-size: 28px 28px;
  animation-delay: 0.4s;
}

@keyframes splashLogo {
  from {
    transform: translateY(0) scale(0.97);
  }

  to {
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes splashPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.14);
    opacity: 0.9;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96) rotate(0deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

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

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .hero-copy {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 14px;
    align-items: start;
  }

  .hero-logo {
    width: min(88px, 24vw);
  }

  .stats {
    width: 100%;
    aspect-ratio: auto;
    min-height: 78px;
  }

  .tools,
  .help-strip {
    grid-template-columns: 1fr;
  }

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

  .doodle {
    display: none;
  }

  .intro-splash__logo {
    width: min(84vw, 360px);
  }
}
