@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@800;900&display=swap');

:root {
  /* Color Palette Tokens */
  --ak-marble: #f6f3ea;
  --ak-white: #ffffff;
  --ak-ink-950: #06080f;
  --ak-ink-900: #0b0f1a;
  --ak-ink-800: #172033;
  --ak-ink-700: #222d45;
  --ak-slate-500: #6c7791;
  --ak-slate-400: #98a2b8;
  --ak-slate-300: #c7cddc;
  --ak-slate-200: #e4e8f0;
  --ak-slate-100: #eff2f7;
  --ak-aegean-900: #071634;
  --ak-aegean-800: #0b2154;
  --ak-aegean-700: #123783;
  --ak-aegean-600: #1a4aa8;
  --ak-aegean-500: #2a63d6;
  --ak-aegean-100: #e2eafb;
  --ak-laurel-700: #96690a;
  --ak-laurel-600: #b98510;
  --ak-laurel-500: #d99d18;
  --ak-laurel-400: #f0b93e;
  --ak-laurel-100: #fbeed0;

  /* Theme variables - Light Mode */
  --background: var(--ak-marble);
  --foreground: var(--ak-ink-900);
  --card: var(--ak-white);
  --card-foreground: var(--foreground);
  --border: var(--ak-slate-200);
  --sidebar: var(--ak-marble);
  --sidebar-border: var(--ak-slate-200);
  --primary: var(--ak-aegean-700);
  --primary-foreground: #ffffff;
  --primary-hover: var(--ak-aegean-800);
  --primary-soft: #1237831f;
  --cta: var(--ak-laurel-500);
  --on-cta: var(--ak-ink-950);
  --sub: #686e7d;
  --muted: var(--ak-slate-100);
  --muted-foreground: #646e87;
  --line: var(--ak-slate-200);
  --line-strong: var(--ak-slate-400);
  --hover: var(--ak-slate-100);
  --gold-500: var(--ak-laurel-500);

  /* Fonts */
  --font-sans: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-wordmark: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-ui: 'Manrope', sans-serif;
}

html.dark, body.dark {
  --background: var(--ak-ink-950);
  --foreground: #ffffff;
  --card: var(--ak-ink-900);
  --card-foreground: #ffffff;
  --border: var(--ak-ink-800);
  --sidebar: var(--ak-ink-950);
  --sidebar-border: var(--ak-ink-800);
  --primary: #123783;
  --primary-foreground: #ffffff;
  --primary-hover: #1a4aa8;
  --primary-soft: #1a4aa81f;
  --cta: var(--ak-laurel-500);
  --on-cta: var(--ak-ink-950);
  --sub: #98a2b8;
  --muted: var(--ak-ink-800);
  --muted-foreground: #98a2b8;
  --line: var(--ak-ink-800);
  --line-strong: var(--ak-slate-500);
  --hover: var(--ak-ink-800);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* App Container */
.app-layout {
  display: flex;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  background-color: var(--background);
  color: var(--foreground);
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background-color: rgba(11, 14, 13, 0.42);
  transition: opacity 220ms ease-out;
  pointer-events: none;
  opacity: 0;
}

.sidebar-backdrop.active {
  pointer-events: auto;
  opacity: 1;
}

/* Aside / Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  display: flex;
  height: 100vh;
  height: 100svh;
  width: 206px;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  background-color: var(--sidebar);
  padding: 14px 10px;
  transition: transform 220ms ease-out, width 220ms ease-out;
  transform: translateX(-100%);
}

@media (min-width: 901px) {
  .sidebar {
    position: static;
    height: 100%;
    width: 168px;
    transform: translateX(0);
    box-shadow: none;
  }

  .sidebar.collapsed {
    width: 54px;
    padding: 14px 6px;
  }

  .sidebar.collapsed .wordmark,
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .collapse-text,
  .sidebar.collapsed .social-links {
    display: none;
  }

  .sidebar.collapsed .brand-link {
    justify-content: center;
    padding: 0 0 14px 0;
  }

  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0;
  }

  .sidebar.collapsed .collapse-btn {
    justify-content: center;
    padding: 0;
  }

  .sidebar.collapsed .collapse-icon {
    transform: rotate(180deg);
  }
}

.sidebar.mobile-open {
  transform: translateX(0);
}

/* Brand Link */
.brand-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px 14px 9px;
  text-decoration: none;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.dark .logo-light {
  display: none !important;
}

.dark .logo-dark {
  display: block !important;
}

.logo-dark {
  display: none;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-wordmark);
  font-size: 22px;
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.05em;
  transform: skewX(-7deg);
}

.wordmark-aka {
  color: var(--primary);
}

.dark .wordmark-aka {
  color: #ffffff;
}

.wordmark-dot {
  margin: 0 2px;
  display: inline-block;
  width: 4px;
  height: 4px;
  background-color: var(--gold-500);
  transform: skewX(7deg);
}

.wordmark-fun {
  color: var(--gold-500);
}

/* Nav items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 10px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.nav-item:hover {
  background-color: var(--hover);
  color: var(--foreground);
}

.nav-item.active {
  background-color: var(--primary-soft);
  font-weight: 700;
  color: var(--primary);
}

.dark .nav-item.active {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.15);
}

.nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px 12px 9px;
}

.social-btn {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--muted-foreground);
  transition: border-color 150ms ease, color 150ms ease;
}

.social-btn:hover {
  border-color: var(--line-strong);
  color: var(--foreground);
}

.social-icon {
  width: 15px;
  height: 15px;
}

.sidebar-collapse-wrapper {
  border-top: 1px solid var(--sidebar-border);
  padding-top: 12px;
}

.collapse-btn {
  display: none;
  height: 34px;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 150ms ease, color 150ms ease;
}

@media (min-width: 901px) {
  .collapse-btn {
    display: inline-flex;
  }
}

.collapse-btn:hover {
  background-color: var(--hover);
  color: var(--foreground);
}

.collapse-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 220ms ease;
}

/* Main Content Wrapper */
.content-wrapper {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 55px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background-color: var(--background);
  padding: 10px 12px;
}

@media (min-width: 768px) {
  .top-header {
    padding: 10px 20px;
  }
}

.mobile-menu-btn {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--foreground);
  transition: border-color 150ms ease;
}

.mobile-menu-btn:hover {
  border-color: var(--line-strong);
}

@media (min-width: 901px) {
  .mobile-menu-btn {
    display: none;
  }
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Launch Button */
.btn-launch {
  display: flex;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--cta);
  background-color: var(--cta);
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--on-cta);
  transition: filter 160ms cubic-bezier(0.2, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-launch:hover {
  filter: brightness(0.92);
}

.btn-launch .icon {
  width: 14px;
  height: 14px;
}

.btn-launch .label-mobile {
  display: inline;
}

.btn-launch .label-desktop {
  display: none;
}

@media (min-width: 640px) {
  .btn-launch .label-mobile {
    display: none;
  }
  .btn-launch .label-desktop {
    display: inline;
  }
}

/* Arc Network Badge */
.arc-badge {
  display: none;
  height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  padding: 0 10px;
}

@media (min-width: 1024px) {
  .arc-badge {
    display: flex;
  }
}

.arc-badge-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.arc-badge-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foreground);
}

/* Add Arc Button */
.btn-add-arc {
  display: none;
  height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foreground);
  transition: border-color 150ms ease;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .btn-add-arc {
    display: inline-flex;
  }
}

.btn-add-arc:hover {
  border-color: var(--line-strong);
}

.btn-add-arc .icon {
  width: 14px;
  height: 14px;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--foreground);
  transition: border-color 150ms ease;
}

.btn-theme-toggle:hover {
  border-color: var(--line-strong);
}

.theme-icon-moon {
  width: 15px;
  height: 15px;
  display: block;
}

.theme-icon-sun {
  width: 15px;
  height: 15px;
  display: none;
}

.dark .theme-icon-moon {
  display: none;
}

.dark .theme-icon-sun {
  display: block;
}

/* Connect Wallet Button */
.btn-connect-wallet {
  display: inline-flex;
  height: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 16px;
  border-radius: 0;
  transition: filter 150ms ease, background-color 150ms ease;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .btn-connect-wallet {
    min-width: 134px;
  }
}

.btn-connect-wallet:hover {
  filter: brightness(0.95);
  background-color: var(--primary-hover);
}

/* Migrate Button */
.btn-migrate {
  display: inline-flex;
  height: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  border-radius: 0;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.btn-migrate:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--hover);
}

.dark .btn-migrate:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.btn-migrate .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-migrate-hero {
  min-width: 120px;
  padding: 0 18px;
  font-size: 13.5px;
}

/* Main Area */
.main-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--background);
}

.page-container {
  margin: 0 auto;
  width: 100%;
  max-width: 1600px;
  padding: 12px 12px 28px 12px;
}

@media (min-width: 768px) {
  .page-container {
    padding: 12px 20px 28px 20px;
  }
}

/* Hero Portfolio Card */
.portfolio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: clamp(56px, 9vw, 112px) clamp(18px, 5vw, 48px);
  text-align: center;
  box-shadow: 0 1px 2px rgba(7, 22, 52, 0.06);
}

.portfolio-title {
  max-width: 100%;
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--foreground);
}

.portfolio-desc {
  margin-top: 8px;
  max-width: 900px;
  font-size: clamp(1.15rem, 2.6vw, 2rem);
  line-height: 1.25;
  color: var(--sub);
}

.portfolio-btn-wrapper {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Reward Active Section (Inserted Below Central White Box) */
.reward-section-wrapper {
  margin-top: 24px;
  width: 100%;
}

.reward-active-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-left: 5px solid var(--cta);
  padding: 32px 36px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.reward-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reward-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reward-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cta);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  text-transform: uppercase;
  border-radius: 0;
}

.reward-card-title {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 800;
  color: var(--foreground);
  margin: 0 0 20px 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.reward-boxes-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  width: 100%;
}

.reward-box {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.reward-box-nft {
  background-color: var(--marble);
  border: 1px solid var(--border);
}

.dark .reward-box-nft {
  background-color: rgba(255, 255, 255, 0.04);
}

.reward-box-rwa {
  background-color: var(--card);
  border: 1.5px solid var(--cta);
}

.reward-box-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reward-box-val {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reward-box-val-nft {
  color: var(--foreground);
}

.reward-box-val-rwa {
  color: #b98510;
}

.dark .reward-box-val-rwa {
  color: var(--cta);
}

.reward-plus-operator {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--sub);
  text-align: center;
  flex-shrink: 0;
  user-select: none;
}

.reward-card-desc {
  font-family: var(--font-sans);
  font-size: 15.5px;
  color: var(--foreground);
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
}

/* Image wrapper and responsive vector view */
.reward-active-img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .reward-active-card {
    padding: 22px 18px;
    border-left-width: 4px;
  }
  .reward-card-title {
    font-size: 19px;
    margin-bottom: 16px;
  }
  .reward-boxes-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .reward-plus-operator {
    padding: 2px 0;
  }
  .reward-card-desc {
    font-size: 14px;
  }
}

/* Wallet Connected State Details */
.connected-profile-section {
  display: none;
  width: 100%;
}

.connected-profile-section.visible {
  display: block;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 24px;
  text-align: left;
}

.stat-box {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--foreground);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(6, 8, 15, 0.65);
  backdrop-filter: blur(4px);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(6, 8, 15, 0.35);
  transform: translateY(12px) scale(0.98);
  transition: transform 180ms ease;
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
}

.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--sub);
  border: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.modal-close-btn:hover {
  color: var(--foreground);
  border-color: var(--border);
}

.modal-body {
  padding: 20px;
}

.wallet-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background-color: var(--card);
  transition: background-color 150ms ease, border-color 150ms ease;
  cursor: pointer;
}

.wallet-option-item:hover {
  background-color: var(--hover);
  border-color: var(--line-strong);
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.wallet-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.wallet-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--cta);
  background: rgba(217, 157, 24, 0.12);
  padding: 2px 6px;
}

/* Add Arc Details List */
.network-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 20px;
}

.network-info-table tr {
  border-bottom: 1px solid var(--border);
}

.network-info-table td {
  padding: 10px 4px;
}

.network-info-table td:first-child {
  color: var(--sub);
  font-weight: 500;
  width: 40%;
}

.network-info-table td:last-child {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-weight: 600;
}

.btn-primary-action {
  width: 100%;
  height: 38px;
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 150ms ease;
}

.btn-primary-action:hover {
  filter: brightness(0.92);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(6, 8, 15, 0.18);
  font-size: 13px;
  font-weight: 600;
  animation: toastIn 200ms ease-out;
}

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