/* CSS Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #1a2332;
  --navy-dark: #0d1520;
  --tan: #d4c5a9;
  --tan-light: #e5d9c3;
  --tan-dark: #c4b596;
  --cream: #f5f0e6;
  --gold: #c9a962;
  --text-dark: #1a2332;
  --text-light: #5a6378;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "JetBrains Mono", monospace;
  background: var(--tan);
  color: var(--navy);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--navy-dark);
}

.logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-link {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--cream);
  text-decoration: none;
  transition: opacity 0.2s;
}

.connect-wallet-btn {
  background: transparent;
  border: 1px solid rgba(245, 240, 230, 0.28);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  opacity: 0.8;
}

.nav-link .arrow {
  margin-left: 4px;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 108px 24px 72px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(13, 21, 32, 0.52) 0%,
    rgba(26, 35, 50, 0.22) 38%,
    rgba(212, 197, 169, 0.66) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  text-align: center;
  padding: 12px 18px;
}

.hero-wave-image {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 14px 42px rgba(26, 35, 50, 0.22);
}

.hero-tagline {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--navy);
  opacity: 0.88;
  margin-bottom: 16px;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(42px, 7vw, 74px);
  font-weight: 700;
  font-style: italic;
  line-height: 1.02;
  color: var(--navy);
  margin-bottom: 24px;
}

.hero-subtitle {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  color: var(--navy);
  opacity: 1;
  margin-bottom: 32px;
  line-height: 1.8;
}

.eligibility-form {
  display: flex;
  gap: 8px;
  max-width: 380px;
  margin: 0 auto 12px;
}

.handle-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(26, 35, 50, 0.15);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--navy);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.handle-input::placeholder {
  color: var(--text-light);
}

.handle-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 35, 50, 0.1);
}

.check-btn {
  min-width: 92px;
  height: 44px;
  background: var(--cream);
  border: 1px solid rgba(26, 35, 50, 0.15);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1.4px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    opacity 0.2s,
    transform 0.2s;
}

.check-btn:hover {
  background: var(--tan-light);
}

.check-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.eligibility-result {
  min-height: 22px;
  max-width: 520px;
  margin: 0 auto 10px;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.4px;
  color: var(--navy);
}

.eligibility-result.loading {
  opacity: 0.72;
}

.eligibility-result.eligible {
  color: #1e5b43;
  font-weight: 600;
}

.eligibility-result.ineligible {
  color: #8b3e2d;
  font-weight: 600;
}

.eligibility-result.error,
.eligibility-result.blocked {
  color: #9a3d3d;
  font-weight: 600;
}

.eligibility-result.success-burst {
  animation: successPulse 0.9s ease-out;
}

.eligibility-note {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--navy);
  opacity: 1;
  margin-bottom: 20px;
}

.claim-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 21, 32, 0.56);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
  z-index: 200;
}

.claim-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.claim-modal {
  position: relative;
  width: min(460px, 100%);
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(245, 240, 230, 0.98),
    rgba(229, 217, 195, 0.96)
  );
  border: 1px solid rgba(26, 35, 50, 0.12);
  box-shadow: 0 30px 70px rgba(13, 21, 32, 0.24);
  text-align: left;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s ease;
}

.eligibility-modal {
  width: min(560px, 100%);
}

.eligibility-form-modal {
  max-width: none;
  margin-bottom: 14px;
}

.eligibility-modal .eligibility-result {
  margin: 0;
  max-width: none;
  min-height: 40px;
}

.claim-modal-backdrop.open .claim-modal {
  transform: translateY(0) scale(1);
}

.claim-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(26, 35, 50, 0.08);
  color: var(--navy);
  font-size: 22px;
  cursor: pointer;
}

.claim-modal-kicker {
  font-size: 10px;
  letter-spacing: 2px;
  color: #1e5b43;
  margin-bottom: 10px;
}

.claim-modal-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}

.claim-modal-copy {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(26, 35, 50, 0.82);
  margin-bottom: 20px;
}

.claim-modal-action {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: var(--navy);
  color: var(--cream);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1.3px;
  font-weight: 600;
  cursor: pointer;
}

/* Stats Section */
.stats {
  background: var(--tan);
  padding: 18px 24px 40px;
  margin-top: 12px;
  position: relative;
  z-index: 2;
}

.stats-grid {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(26, 35, 50, 0.08);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-light);
  text-transform: uppercase;
}

.stat-value {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
}

/* Escrow Section */
.escrow {
  background: var(--tan);
  padding: 40px 24px 60px;
  text-align: center;
}

.escrow-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #c75050;
  margin-bottom: 8px;
}

.escrow-amount {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 8px;
}

.escrow-claimed {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.progress-bar {
  max-width: 500px;
  height: 6px;
  background: rgba(26, 35, 50, 0.15);
  border-radius: 3px;
  margin: 0 auto 12px;
  position: relative;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a574 0%, #c9a962 100%);
  border-radius: 3px;
  position: relative;
}

.progress-marker {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--navy);
  border-radius: 2px;
}

.progress-text {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-light);
}

.section-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--tan);
  opacity: 0.7;
  margin-bottom: 16px;
}

/* Communities Section */
.communities {
  background: var(--tan);
  padding: 60px 24px;
  text-align: center;
}

.communities-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 16px;
}

.communities-description {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.8;
}

.community-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.pill {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(26, 35, 50, 0.25);
  border-radius: 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover {
  background: rgba(26, 35, 50, 0.05);
}

.pill.active {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

/* Tables */
.table-container {
  max-width: 900px;
  margin: 0 auto;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(26, 35, 50, 0.08);
  border-radius: 14px;
  box-shadow: 0 18px 32px rgba(26, 35, 50, 0.05);
  -webkit-overflow-scrolling: touch;
}

.data-table,
.whale-table,
.value-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  min-width: 720px;
}

.data-table th,
.whale-table th,
.value-table th {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-light);
  font-weight: 500;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(26, 35, 50, 0.1);
}

.data-table td,
.whale-table td,
.value-table td {
  padding: 14px 8px;
  border-bottom: 1px solid rgba(26, 35, 50, 0.06);
  vertical-align: middle;
}

.data-table tbody tr:hover,
.whale-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.3);
}

.table-footer {
  max-width: 900px;
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.table-summary {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-light);
  text-transform: uppercase;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(26, 35, 50, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--navy);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(26, 35, 50, 0.32);
}

.pagination-btn.active {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

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

.sort-icon::before {
  content: "↕";
  margin-left: 6px;
  opacity: 0.35;
}

.sort-asc .sort-icon::before {
  content: "↑";
  opacity: 0.9;
}

.sort-desc .sort-icon::before {
  content: "↓";
  opacity: 0.9;
}

.wallet-link {
  font-family: "JetBrains Mono", monospace;
  color: var(--navy);
  text-decoration: none;
}

.wallet-link:hover {
  text-decoration: underline;
}

/* Whale Watching Section */
.whale-watching {
  background: var(--tan);
  padding: 60px 24px;
  text-align: center;
}

.watching-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 12px;
}

.watching-stats {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-light);
  margin-bottom: 28px;
}

.claimed-count {
  color: var(--navy);
  font-weight: 600;
}

.unclaimed-count {
  color: var(--navy);
  font-weight: 600;
}

.search-container {
  max-width: 500px;
  margin: 0 auto 32px;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(26, 35, 50, 0.12);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--navy);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 35, 50, 0.08);
}

/* Whale table specific */
.whale-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  vertical-align: middle;
}

.whale-handle {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}

.whale-handle:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 600;
}

.status-badge.claimed {
  background: rgba(26, 35, 50, 0.12);
  color: var(--navy);
}

.status-badge.unclaimed {
  background: rgba(26, 35, 50, 0.06);
  color: var(--text-light);
}

.allocation-primary {
  font-weight: 600;
  color: var(--navy);
}

.allocation-secondary {
  font-size: 10px;
  color: var(--text-light);
  display: block;
}

.empty-state {
  text-align: center;
  color: var(--text-light);
  letter-spacing: 1px;
  padding: 24px 12px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 35, 50, 0.08);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.42) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.3s ease-in-out infinite;
}

.skeleton-row td {
  padding-top: 18px;
  padding-bottom: 18px;
}

.table-row-enter {
  animation: rowFadeIn 0.45s ease-out;
}

/* Footer */
.footer {
  background: var(--navy-dark);
  padding: 24px;
  text-align: center;
}

.footer p {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--tan);
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .hero {
    min-height: 72vh;
    padding: 90px 20px 40px;
  }

  .hero-wave-image {
    width: 124px;
    height: 124px;
  }

  .hero-subtitle br,
  .communities-description br {
    display: none;
  }

  .eligibility-form {
    flex-direction: column;
    max-width: 280px;
  }

  .check-btn {
    width: 100%;
  }

  .stats {
    padding: 0 16px 30px;
  }

  .communities,
  .whale-watching,
  .escrow {
    padding-left: 16px;
    padding-right: 16px;
  }

  .community-pills {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .pill {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .data-table,
  .whale-table {
    font-size: 11px;
    min-width: 640px;
  }

  .data-table th,
  .whale-table th {
    font-size: 8px;
  }

  .data-table td,
  .whale-table td,
  .value-table td {
    padding: 12px 6px;
  }

  .search-container {
    margin-bottom: 22px;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    justify-content: flex-start;
  }

  .whale-avatar {
    width: 24px;
    height: 24px;
    margin-right: 8px;
  }

  .allocation-secondary {
    font-size: 9px;
  }
}

@media (max-width: 520px) {
  .hero-title {
    font-size: 38px;
  }

  .hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
  }

  .communities-description {
    font-size: 14px;
    line-height: 1.6;
  }

  .contract-info {
    flex-wrap: wrap;
    justify-content: center;
  }

  .watching-stats {
    font-size: 10px;
    line-height: 1.8;
  }

  .search-input {
    padding: 13px 16px;
  }

  .data-table,
  .whale-table {
    min-width: 580px;
  }

  .pagination-btn {
    min-width: 34px;
    padding: 8px 10px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes successPulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(30, 91, 67, 0);
  }
  35% {
    transform: scale(1.04);
    text-shadow: 0 0 24px rgba(30, 91, 67, 0.28);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(30, 91, 67, 0);
  }
}

.hero-content {
  animation: fadeInUp 0.8s ease-out;
}

.stat-card {
  animation: fadeInUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) {
  animation-delay: 0.1s;
}
.stat-card:nth-child(2) {
  animation-delay: 0.2s;
}
.stat-card:nth-child(3) {
  animation-delay: 0.3s;
}
.stat-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--tan);
}

::-webkit-scrollbar-thumb {
  background: rgba(26, 35, 50, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 35, 50, 0.3);
}
