@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

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

.header,
.section {
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}

.header                { animation-delay: 0.05s; }
.section--bridge-cta   { animation-delay: 0.10s; }
.section--routes       { animation-delay: 0.15s; }
.section--socials      { animation-delay: 0.15s; }
.section--community    { animation-delay: 0.20s; }
.section--email        { animation-delay: 0.25s; }
.section--builders     { animation-delay: 0.20s; }
.section--token        { animation-delay: 0.25s; }

:root {
  --aqua: #6CF9D8;
  --aqua-dim: #44c4a8;
  --aqua-glow: rgba(108, 249, 216, 0.15);
  --purple: #A26CF9;
  --orange: #F97A6C;
  --bg: #2D2E33;
  --card: #34353D;
  --card-mid: #444951;
  --card-hover: #44454c;
  --text: #e0f8f0;
  --text-dim: #9ca3af;
  --border: #4a4b52;
}

[data-theme="light"] {
  --aqua: #05C9AD;
  --aqua-dim: #04A890;
  --aqua-glow: rgba(5, 201, 173, 0.12);
  --bg: #FFFFFF;
  --card: #F0F1F4;
  --card-mid: #E3E5EB;
  --card-hover: #E8EAF0;
  --text: #1C1D22;
  --text-dim: #6B7280;
  --border: #D0D3DC;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px 60px;
}

.container {
  width: 100%;
  max-width: 480px;
}

/* ─── Desktop: bento grid, no scroll ─── */
@media (min-width: 1024px) {
  body {
    height: 100vh;
    overflow: hidden;
    padding: 8px 32px;
    align-items: center;
  }

  .container {
    max-width: 1300px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .header {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    min-height: 0;
    padding: 6px 0;
    margin-bottom: 0;
    text-align: left;
    flex-shrink: 0;
  }

  .theme-toggle { margin-left: auto; }

  .header .logo { width: 30px; height: 30px; margin-bottom: 0; }
  .header h1 { font-size: 30px; line-height: 1; margin-bottom: 0; color: var(--aqua); }
  .header p { font-size: 11px; margin-bottom: 0; }

  .header-text {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1;
  }

  /* Bento grid */
  .sections-grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.2fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 4px;
    flex: 1;
    min-height: 0;
  }

  .section {
    margin-bottom: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
  }

  .section-label {
    margin-bottom: 6px;
    padding-left: 0;
    font-size: 10px;
  }

  /* Grid positions */
  .section--socials    { grid-column: 1; grid-row: 1; }
  .section--community  { grid-column: 1; grid-row: 2; }
  .section--email      { grid-column: 1; grid-row: 3; }
  .bridge-column       { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; gap: 4px; }
  .section--builders   { grid-column: 3; grid-row: 1 / 3; }
  .section--token      { grid-column: 3; grid-row: 3; }

  .section--bridge-cta {
    justify-content: flex-start;
    flex: 1;
  }

  .section--bridge-cta .bridge-cta-row {
    margin-bottom: 0;
    width: 100%;
    flex: 1;
    align-items: stretch;
  }

  .section--bridge-cta .bridge-card {
    padding: 14px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .section--routes {
    flex: none;
    justify-content: space-between;
    padding: 10px 12px;
  }

  .section--routes .route-grid  { gap: 4px; }

  .section--routes .route-card {
    padding: 8px 6px;
    border-radius: 10px;
    aspect-ratio: 1;
  }

  .section--routes .route-item  { gap: 3px; }
  .section--routes .route-label { font-size: 9px; }

  .section--bridge-cta .bridge-title { font-size: 15px; }
  .section--bridge-cta .bridge-sub   { font-size: 11px; }

  .section--routes .route-card .label { font-size: 10px; }
  .section--routes .route-logo        { width: 28px; height: 28px; }
  .section--routes .route-logo img,
  .section--routes .route-logo svg    { width: 28px; height: 28px; }
  .section--routes .route-badge       { font-size: 9px; padding: 2px 6px; }

  /* Link cards inside tiles */
  .section .link-card {
    padding: 7px 10px;
    margin-bottom: 2px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border-color: transparent;
  }

  [data-theme="light"] .section .link-card {
    border-color: var(--border);
  }

  [data-theme="light"] .section .link-card--creative {
    border-color: color-mix(in srgb, var(--border) 70%, var(--aqua-dim) 30%);
  }

  .section--community,
  .section--builders,
  .section--token {
    gap: 4px;
  }

  .section--builders .link-card {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
  }

  .section--community .community-grid { gap: 4px; }
  .section--token .community-grid     { gap: 4px; }

  .section--token .community-tile {
    padding: 6px 4px;
    gap: 4px;
    border-radius: 10px;
  }

  .section--token .community-tile-icon,
  .section--token .community-tile-icon svg,
  .section--token .community-tile-icon img {
    width: 18px;
    height: 18px;
  }

  .section--token .community-tile-label { font-size: 10px; }

  .section--community .community-tile {
    padding: 6px 4px;
    gap: 4px;
    border-radius: 10px;
  }

  .section--community .community-tile-icon,
  .section--community .community-tile-icon svg {
    width: 18px;
    height: 18px;
  }

  .section--community .community-tile-label { font-size: 10px; }

  .section .link-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--aqua-dim);
    box-shadow: 0 0 12px 2px rgba(108,249,216,0.25);
  }

  .section .link-card .label { font-size: 12px; }
  .section .link-card .icon  { width: 18px; height: 18px; }
  .section .link-card .icon svg { width: 18px; height: 18px; }

  /* Socials grid */
  .section--socials .social-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  .section--socials .social-btn {
    border-radius: 10px;
    aspect-ratio: 1;
  }

  .section--socials .social-btn img,
  .section--socials .social-btn svg {
    width: 32px;
    height: 32px;
  }

  /* Email tile */
  .section--email { padding: 8px 10px; }
  .section--email .section-label { margin-bottom: 4px; }
  .section--email .email-form { flex: 3; gap: 0; }
  .section--email .blog-btn { flex: 1; border-radius: 8px; margin-top: 4px; }

  .footer { display: none; }
}

/* ─── Community 2×2 grid ─── */
.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}

.community-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  padding: 12px 8px;
  transition: all 0.2s ease;
}

.community-tile:hover { background: rgba(255,255,255,0.09); border-color: var(--aqua-dim); }

.community-tile--discord:hover  { box-shadow: 0 0 14px 3px #5865F2aa; border-color: #5865F260; }
.community-tile--reddit:hover   { box-shadow: 0 0 14px 3px #FF4500aa; border-color: #FF450060; }
.community-tile--telegram:hover { box-shadow: 0 0 14px 3px #2AABEEaa; border-color: #2AABEE60; }
.community-tile--x:hover        { box-shadow: 0 0 14px 3px #ffffffaa; border-color: #ffffff60; }

.community-tile-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.community-tile-icon svg,
.community-tile-icon img {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.community-tile-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* ─── Blog button ─── */
.blog-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
  padding: 9px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.blog-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--aqua-dim);
  color: var(--text);
}

/* ─── Email signup form ─── */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(10, 233, 199, 0.35);
  border-radius: 8px;
  overflow: hidden;
}

.email-form input {
  flex: 1;
  background: #2D2E33;
  border: none;
  border-bottom: 1px solid rgba(10, 233, 199, 0.2);
  border-radius: 0;
  padding: 10px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.email-form input::placeholder { color: #9299A5; }

.email-form input:focus { background: #2D2E33; outline: none; }

.email-form:focus-within { border-color: rgba(10, 233, 199, 0.65); }

.email-form input:-webkit-autofill,
.email-form input:-webkit-autofill:hover,
.email-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #2D2E33 inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.email-form button {
  width: 100%;
  background: #2F383B;
  color: #06E7C7;
  border: none;
  border-radius: 0 0 8px 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.email-form button:hover { opacity: 0.85; }

/* Light mode: email form */
[data-theme="light"] .email-form input        { background: #FFFFFF; }
[data-theme="light"] .email-form input:focus  { background: #FFFFFF; }

[data-theme="light"] .email-form input:-webkit-autofill,
[data-theme="light"] .email-form input:-webkit-autofill:hover,
[data-theme="light"] .email-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #FFFFFF inset;
}

[data-theme="light"] .email-form button { background: #D4F5EE; color: #038C76; }

/* Light mode: bridge home card */
[data-theme="light"] .bridge-card--home {
  background: var(--card-mid);
  border-color: var(--border);
}

[data-theme="light"] .bridge-card.bridge-card--home .bridge-title { color: var(--text); }
[data-theme="light"] .bridge-card.bridge-card--home .bridge-sub   { color: var(--text-dim); }
[data-theme="light"] .bridge-card--home:hover { background: var(--card-hover); }

/* Light mode: invert white icons */
[data-theme="light"] .social-btn img,
[data-theme="light"] .social-btn svg,
[data-theme="light"] .community-tile-icon img[src="img/x-communities.svg"] {
  filter: invert(1) brightness(0.25);
}

/* ─── Theme toggle ─── */
.theme-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover { color: var(--text); border-color: var(--aqua-dim); }

.theme-toggle svg { width: 15px; height: 15px; display: block; }

.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ─── Header ─── */
.header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-align: left;
  position: relative;
}

.logo { width: 40px; height: 40px; flex-shrink: 0; }

.header h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--aqua);
}

.header p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Mobile only */
@media (max-width: 1023px) {
  .header {
    justify-content: center;
    min-height: 72px;
    margin-bottom: 12px;
  }

  .theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .section { margin-bottom: 12px; }
}

/* ─── Section label ─── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--aqua-dim);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* ─── Section base ─── */
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

/* Builders condensed on mobile */
.section--builders .link-card { padding: 10px 14px; }

/* ─── Link cards ─── */
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.link-card:hover {
  background: var(--card-hover);
  border-color: var(--aqua-dim);
  transform: translateY(-1px);
  box-shadow: 0 0 12px 2px rgba(108,249,216,0.25);
}

.link-card--creative {
  border-color: color-mix(in srgb, var(--border) 70%, var(--aqua-dim) 30%);
}

.link-card--creative:hover {
  border-color: var(--aqua-dim);
  box-shadow: 0 0 10px 2px rgba(108,249,216,0.18);
}

.link-card .icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-card .icon svg { width: 22px; height: 22px; fill: var(--text); }

.link-card:hover .icon svg { fill: var(--aqua); }

.link-card .label {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

.link-card .arrow {
  color: var(--text-dim);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.link-card:hover .arrow { transform: translateX(3px); color: var(--aqua); }

/* ─── Bridge CTA row ─── */
.bridge-cta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* ─── Bridge cards ─── */
.bridge-card {
  display: block;
  padding: 20px;
  background: var(--aqua);
  border: none;
  border-radius: 16px;
  text-decoration: none;
  color: var(--bg);
  transition: all 0.2s ease;
  flex: 1;
}

.bridge-card--home {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: #e0e0e0;
}

.bridge-card.bridge-card--home .bridge-title { color: #ffffff; }
.bridge-card.bridge-card--home .bridge-sub   { color: #b0b0b0; }

.bridge-card--home:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.1);
  border-color: var(--aqua-dim);
  box-shadow: 0 6px 24px rgba(108, 249, 216, 0.15);
}

.bridge-card--bridge:hover {
  transform: translateY(-2px);
  background: #8ffce6;
  box-shadow: 0 6px 24px rgba(108, 249, 216, 0.35);
}

.bridge-card .bridge-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--bg);
}

.bridge-card .bridge-sub { font-size: 13px; color: #3a5a50; }

/* ─── Route highlights ─── */
.route-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  align-content: start;
  gap: 10px;
  flex: 1;
}

.route-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
}

.route-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.route-card:hover { transform: translateY(-2px); filter: brightness(1.1); }

.route-card--hyperliquid { background: #0b1e14; border-color: #0ED88F40; }
.route-card--hyperliquid:hover { border-color: #0ED88F; }

.route-card--solana { background: #1a0e2e; border-color: #9945FF40; }
.route-card--solana:hover { border-color: #9945FF; }

.route-card--base { background: #00001a; border-color: #0052FF40; }
.route-card--base:hover { border-color: #0052FF; }

.route-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-logo img, .route-logo svg { width: 40px; height: 40px; }

.route-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}

.route-card--hyperliquid .route-badge { background: rgba(14, 216, 143, 0.15); color: #0ED88F; }
.route-card--solana .route-badge      { background: rgba(153, 69, 255, 0.15); color: #9945FF; }
.route-card--base .route-badge        { background: rgba(0, 82, 255, 0.15); color: #4d8aff; }

.route-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.route-item .route-card { flex: 1; }

.route-label {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  color: var(--text-dim);
  line-height: 1.3;
}

.route-card .label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* ─── Social grid ─── */
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 22%;
  text-decoration: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.social-btn:hover { transform: scale(1.08); }

.social-btn img,
.social-btn svg {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.social--x:hover         { box-shadow: 0 0 14px 3px #ffffffaa; border-color: #ffffff60; }
.social--instagram:hover { box-shadow: 0 0 14px 3px #E1306Caa; border-color: #E1306C60; }
.social--threads:hover   { box-shadow: 0 0 14px 3px #ffffffaa; border-color: #ffffff60; }
.social--facebook:hover  { box-shadow: 0 0 14px 3px #1877F2aa; border-color: #1877F260; }
.social--linkedin:hover  { box-shadow: 0 0 14px 3px #0A66C2aa; border-color: #0A66C260; }
.social--tiktok:hover    { box-shadow: 0 0 14px 3px #ffffffaa; border-color: #ffffff60; }
.social--youtube:hover   { box-shadow: 0 0 14px 3px #FF0000aa; border-color: #FF000060; }
.social--farcaster:hover { box-shadow: 0 0 14px 3px #8A63D2aa; border-color: #8A63D260; }
.social--twitch:hover    { box-shadow: 0 0 14px 3px #9146FFaa; border-color: #9146FF60; }

.social-btn .social-label { display: none; }

/* ─── Footer (mobile only) ─── */
@media (max-width: 1023px) {
  .footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }
}

.footer a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer a:hover { color: var(--aqua); }

/* ─── Responsive ─── */
@media (max-width: 360px) {
  .social-grid { grid-template-columns: repeat(3, 1fr); }
}
