:root {
  color-scheme: dark;
  --bg: #080806;
  --surface: rgba(19, 22, 18, 0.82);
  --surface-2: rgba(31, 34, 27, 0.9);
  --line: rgba(246, 230, 197, 0.16);
  --text: #f7edd9;
  --muted: #b8aa92;
  --green: #93c85d;
  --amber: #ffb347;
  --orange: #ff7a1a;
  --red: #db3d2f;
  --discord: #5865f2;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 6%, rgba(255, 122, 26, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(147, 200, 93, 0.13), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Urbanist, "Trebuchet MS", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background:
    url("/assets/noise.webp"),
    linear-gradient(rgba(255, 179, 71, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 179, 71, 0.06) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.hero {
  min-height: min(820px, 96vh);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 5, 4, 0.94) 0%, rgba(5, 5, 4, 0.72) 42%, rgba(5, 5, 4, 0.2) 76%),
    linear-gradient(0deg, rgba(5, 5, 4, 0.95) 0%, transparent 38%),
    url("/assets/hero-isla-mortal.webp") center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background:
    repeating-linear-gradient(180deg, transparent 0 9px, rgba(255, 255, 255, 0.055) 10px),
    linear-gradient(rgba(255, 179, 71, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 179, 71, 0.09) 1px, transparent 1px);
  background-size: auto, 88px 88px, 88px 88px;
}

.topbar {
  position: relative;
  z-index: 3;
  width: min(1200px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand,
.nav-actions,
.hero-actions,
.hero-stats,
.guide-meta,
.reward-cell,
footer,
.footer-discord {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-family: "Saira Condensed", Impact, sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #160d06;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}

.nav-actions { gap: 16px; }
.nav-actions a {
  color: #e1d5be;
  font-family: "Saira Condensed", Impact, sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-actions a:hover { color: white; }
.discord-nav {
  min-height: 38px;
  padding: 0 13px;
  background: linear-gradient(135deg, var(--discord), #7b86ff);
  color: white !important;
  border: 1px solid rgba(255,255,255,.22);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 40px));
  margin: auto;
  padding: 84px 0 60px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #c8ff6a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; }
h1 {
  max-width: 860px;
  margin-bottom: 18px;
  color: #fff8e7;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(58px, 10vw, 122px);
  line-height: .86;
  letter-spacing: -0.075em;
  text-transform: uppercase;
  text-shadow: 0 0 34px rgba(255, 122, 26, 0.22);
}
.hero-kicker {
  margin: -4px 0 16px;
  color: var(--orange);
  font-family: "Saira Condensed", Impact, sans-serif;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  text-transform: uppercase;
}
.hero-copy {
  max-width: 620px;
  margin: 0 0 30px;
  color: #e7dac3;
  font-size: 18px;
  line-height: 1.58;
}
.hero-actions { flex-wrap: wrap; gap: 10px; }
.primary-action,
.discord-action {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.28);
  font-family: "Saira Condensed", Impact, sans-serif;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.primary-action {
  color: #160d06;
  background: linear-gradient(135deg, var(--orange), var(--amber));
}
.discord-action { background: rgba(255, 255, 255, 0.07); }

.mission-mascot {
  position: absolute;
  right: max(20px, calc((100vw - 1200px) / 2));
  bottom: 72px;
  z-index: 2;
  width: min(410px, 32vw);
  filter: drop-shadow(0 30px 48px rgba(0, 0, 0, 0.62));
}

.hero-stats {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto 28px;
  padding-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stats div { display: grid; gap: 3px; }
.hero-stats strong {
  color: var(--orange);
  font-family: "Saira Condensed", Impact, sans-serif;
  font-size: 30px;
}
.hero-stats span { color: var(--muted); font-size: 12px; text-transform: uppercase; }

main section {
  padding: 86px max(20px, calc((100% - 1200px) / 2));
}
.guides-section { background: rgba(255,255,255,.025); }
.catalog-section { border-top: 1px solid var(--line); }
.section-heading {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
}
.section-heading h2 {
  margin-bottom: 0;
  color: #fff8e7;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(38px, 5vw, 70px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.section-heading > p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.6; }

.mission-guide {
  width: fit-content;
  max-width: 560px;
  margin: -12px 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}
.mission-guide img {
  width: 96px;
  flex: 0 0 auto;
}
.mission-guide strong { color: var(--amber); }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.guide-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.guide-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
}
.guide-body { padding: 22px; }
.guide-meta { flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.guide-meta span,
.reward-cell span {
  padding: 5px 8px;
  background: rgba(255,255,255,.065);
  color: #d8cab2;
  border: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  text-transform: uppercase;
}
.guide-card h3 { margin-bottom: 10px; font-family: "Saira Condensed", Impact, sans-serif; font-size: 28px; text-transform: uppercase; }
.guide-card p, .guide-card li { color: var(--muted); line-height: 1.55; }
.guide-card ul { margin: 15px 0 0; padding-left: 18px; }

.controls {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  gap: 12px;
}
.search-box {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
select {
  min-height: 46px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
select option { color: #111; }
.tier-tabs { display: flex; border: 1px solid var(--line); }
.tier-tabs button {
  min-width: 72px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: "Saira Condensed", Impact, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}
.tier-tabs button:last-child { border-right: 0; }
.tier-tabs button.active { background: linear-gradient(135deg, var(--orange), var(--amber)); color: #160d06; }

.mission-list { border-top: 1px solid var(--line); }
.mission-row {
  display: grid;
  grid-template-columns: 68px minmax(220px, 1.3fr) minmax(170px, .8fr) 90px 180px;
  align-items: center;
  gap: 18px;
  min-height: 122px;
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease, transform .15s ease;
}
.mission-row:hover { background: rgba(255,122,26,.08); transform: translateY(-2px); }
.tier-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font-family: "Saira Condensed", Impact, sans-serif;
  font-weight: 900;
}
.tier-1 { color: var(--green); }
.tier-2 { color: var(--amber); }
.tier-3 { color: var(--red); }
.mission-title strong { display: block; margin-bottom: 5px; color: #fff8e7; }
.mission-title span, .npc-cell, .time-cell { color: var(--muted); font-size: 13px; }
.mission-title span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}
.mission-title .delivery-line {
  margin-top: 8px;
  display: block;
  padding: 8px 10px;
  border: 1px solid rgba(151, 192, 86, .18);
  border-left: 3px solid var(--green);
  background: rgba(151, 192, 86, .075);
  color: #e7f3cf;
  -webkit-line-clamp: unset;
}
.mission-title .delivery-line strong {
  color: var(--amber);
}
.reward-cell { flex-wrap: wrap; gap: 5px; }
.empty-state { padding: 50px 0; color: var(--muted); text-align: center; }

footer {
  min-height: 90px;
  padding: 24px max(20px, calc((100% - 1200px) / 2));
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-discord { gap: 8px; color: var(--text); }
.footer-discord:hover { color: var(--orange); }

.mascot-fly {
  animation: mascotFly 5.8s ease-in-out infinite;
}

@keyframes mascotFly {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
  35% { transform: translate3d(7px, -12px, 0) rotate(1.5deg); }
  70% { transform: translate3d(-5px, -5px, 0) rotate(-0.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 980px) {
  .mission-mascot { opacity: .35; width: 320px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { display: grid; grid-template-columns: 42% 1fr; }
  .guide-card img { height: 100%; aspect-ratio: auto; }
  .controls { grid-template-columns: 1fr 220px; }
  .tier-tabs { grid-column: 1 / -1; min-height: 44px; }
  .tier-tabs button { flex: 1; }
  .mission-row { grid-template-columns: 54px 1.4fr .8fr 80px 150px; }
}

@media (max-width: 680px) {
  .nav-actions { display: none; }
  .hero { min-height: 760px; background-position: 60% center; }
  .hero-content { align-self: end; padding-bottom: 38px; }
  h1 { font-size: 54px; }
  .hero-copy { font-size: 16px; }
  .mission-mascot { right: -60px; bottom: 116px; width: 260px; opacity: .45; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  main section { padding-top: 58px; padding-bottom: 58px; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .section-heading h2 { font-size: 40px; }
  .mission-guide { align-items: flex-start; }
  .mission-guide img { width: 78px; }
  .guide-card { display: block; }
  .guide-card img { aspect-ratio: 16 / 10; }
  .controls { grid-template-columns: 1fr; }
  .tier-tabs { grid-column: auto; overflow-x: auto; }
  .tier-tabs button { min-height: 42px; white-space: nowrap; }
  .mission-row {
    grid-template-columns: 46px 1fr;
    gap: 10px 14px;
    padding: 18px 4px;
  }
  .npc-cell, .time-cell, .reward-cell { grid-column: 2; }
  footer { align-items: start; flex-direction: column; }
}
