@font-face {
  font-family: "Anton";
  src: url("../fonts/Anton-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("../fonts/Oswald-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("../fonts/Oswald-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("../fonts/Oswald-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #07111f;
  --navy-2: #0e1c33;
  --navy-3: #162a4a;
  --teal: #1aa3b0;
  --teal-bright: #3ad0d8;
  --orange: #f15a24;
  --hat: #f5c400;
  --cream: #f7f1e1;
  --ink: #14110e;
  --muted: #9db0c8;
  --line: #0a0a0a;
  --ok: #3dcf8a;
  --err: #ff6b6b;
  --shadow: 4px 4px 0 var(--line);
  --radius: 18px;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Oswald", system-ui, sans-serif;
  font-weight: 400;
  background: var(--navy);
  color: var(--cream);
  line-height: 1.45;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--teal-bright); }
button, input { font: inherit; }
/* Keep the hidden attribute working even when a class sets display. */
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--hat);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 20;
}

/* Top bar */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(7, 17, 31, 0.92);
  border-bottom: 3px solid var(--line);
  backdrop-filter: blur(8px);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: "Anton", sans-serif;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
}
.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--teal);
}
.nav-links {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.nav-links a {
  color: var(--cream);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}
.nav-links a:hover { color: var(--hat); }
.nav-ca {
  display: none;
  background: var(--navy-3);
  border: 2px solid var(--line);
  padding: 4px 8px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hat);
}

/* Hero banner */
.banner {
  border-bottom: 4px solid var(--line);
  background: #06101c;
}
.banner img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  object-position: center;
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

/* Intro */
.intro {
  padding: 32px 0 16px;
  display: grid;
  gap: 22px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal-bright);
  font-size: 0.78rem;
  font-weight: 500;
}
h1, h2, .display {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 0.95;
  margin: 0;
  text-transform: uppercase;
}
h1 { font-size: clamp(3rem, 12vw, 5.5rem); }
h2 { font-size: clamp(2rem, 7vw, 3.2rem); }
.ticker {
  margin: 6px 0 14px;
  font-family: "Anton", sans-serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--hat);
  letter-spacing: 0.04em;
}
.lore {
  margin: 0 0 16px;
  font-size: 1.12rem;
  max-width: 40rem;
  color: var(--cream);
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}
.pill {
  display: inline-block;
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  padding: 6px 10px;
  background: var(--navy-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--hat);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.buddy-card {
  justify-self: center;
  width: min(260px, 70vw);
  border: 4px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: var(--teal);
}
.buddy-card img { width: 100%; height: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--hat);
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--cream);
}
.btn-ghost:hover { background: var(--navy-3); }

/* Clock in */
.section {
  padding: 36px 0 48px;
}
.section-kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal-bright);
  font-size: 0.78rem;
  font-weight: 500;
}
.lede { color: var(--muted); margin: 8px 0 20px; max-width: 38rem; }

.clock-grid {
  display: grid;
  gap: 24px;
}
.panel {
  background: var(--navy-2);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px;
}
label.field {
  display: block;
  margin-bottom: 16px;
}
label.field span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  margin-bottom: 6px;
}
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
}
input[type="text"]:focus {
  outline: 3px solid var(--teal-bright);
  outline-offset: 1px;
}
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 0.95rem;
}
.status[data-kind="ok"] { color: var(--ok); }
.status[data-kind="error"] { color: var(--err); }

.preview-wrap { text-align: center; }
#pfp-preview {
  width: min(100%, 420px);
  height: auto;
  aspect-ratio: 1;
  background: #0a1a22;
  border: 4px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  border-radius: 24px;
}
.job-label {
  margin: 10px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hat);
  font-weight: 500;
}
.pfp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

/* Warehouse */
.warehouse-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}
.count {
  font-family: "Anton", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--hat);
  text-transform: uppercase;
}
.floor-wrap {
  position: relative;
  border: 4px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1a28;
}
.floor {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1a28 url("../assets/warehouse-scene.png") center / cover no-repeat;
}
.sprite, .buddy-pin {
  position: absolute;
  transform: translate(-50%, -80%);
  padding: 0;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 3px 3px 0 var(--line);
  cursor: pointer;
  z-index: 2;
  overflow: visible;
}
.sprite img, .buddy-pin img {
  width: 100%;
  height: auto;
  border-radius: 50%;
  display: block;
}
.sprite:hover, .sprite:focus, .buddy-pin:hover, .buddy-pin:focus {
  z-index: 5;
  outline: none;
  transform: translate(-50%, -80%) scale(1.12);
}
.sprite--gold, .buddy-pin { box-shadow: 3px 3px 0 var(--line), 0 0 0 3px var(--hat); }
.sprite-gold {
  position: absolute;
  right: -6%;
  top: -6%;
  width: 32%;
  aspect-ratio: 1;
  background: url("../assets/gold-badge.png") center / contain no-repeat;
}
.sprite-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  padding: 6px 10px;
  min-width: 120px;
  text-align: center;
  border-radius: 8px;
  pointer-events: none;
  z-index: 6;
}
.sprite-tip strong, .sprite-tip em, .sprite-tip small { display: block; }
.sprite-tip em { font-style: normal; color: #5a4a32; font-size: 0.85em; }
.sprite-tip small { color: #7a6a52; text-transform: uppercase; letter-spacing: 0.06em; }
.sprite:hover .sprite-tip, .sprite:focus .sprite-tip,
.buddy-pin:hover .sprite-tip, .buddy-pin:focus .sprite-tip { display: block; }

.buddy-pin { width: 8.2%; left: 39%; top: 44%; z-index: 3; }

.empty-floor {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  background: rgba(7, 17, 31, 0.82);
  border: 3px solid var(--line);
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  z-index: 4;
}

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 14px 0 0;
}
.crew-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 0;
  margin: 0;
}
.crew-chip {
  border: 2px solid var(--line);
  background: var(--navy-3);
  padding: 6px 10px;
  border-radius: 999px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.9rem;
}
.crew-chip--gold { box-shadow: inset 0 0 0 2px var(--hat); }
.crew-name { font-weight: 700; }
.crew-num { color: var(--hat); }
.crew-job { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.75rem; }

/* Footer */
footer {
  border-top: 3px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin-bottom: 10px;
}
.tiny { font-size: 0.8rem; color: #6d7e94; max-width: 42rem; }

@media (min-width: 720px) {
  .nav-ca { display: inline-block; }
  .intro {
    grid-template-columns: 1fr auto;
    padding-top: 44px;
  }
  .clock-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .banner img { max-height: 440px; }
}

@media (max-width: 600px) {
  .floor { aspect-ratio: 4 / 3; background-position: 50% 70%; }
  .sprite-tip { font-size: 0.85rem; }
}
