/* =================================
   CSS VARIABLES
   ================================= */
:root {
  /* Dark Theme (Default) */
  --page: #0B0C0E;                /* Dark page background */
  --page-rgb: 11, 12, 14;         /* RGB version for glassmorphism */
  --section-alt: #131416;         /* Dark banding for alternating sections */
  --ink: #F5F5F6;                 /* Light headlines / primary text */
  --text: #C9CDD2;                /* Light body text */
  --meta: #888D96;                /* Light captions / telemetry */
  --accent: #5B8EF4;              /* Brighter accent for dark mode */
  --keyline: rgba(245, 245, 246, 0.12); /* Light hairlines */
  --keyline-rgb: 245, 245, 246;   /* RGB version for glassmorphism */
  --chrome: #1A1B1E;              /* Dark panel chrome bars */
  
  /* Bento double-border effect - dark mode */
  --bento-moat: var(--page);
  --bento-border: rgba(255, 255, 255, 0.12);
  --bento-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* =================================
   BASE STYLES
   ================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Space Grotesk', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* =================================
   NAVIGATION BAR
   ================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.5rem, 13vw, 300px) 0;
  background: var(--page);
  z-index: 1000;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.8;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 3rem;
}

.navbar-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: box-shadow 0.2s ease;
  cursor: pointer;
  background: var(--page);
  border-radius: 0;
  padding: 0.75rem 1.5rem;
  display: inline-block;
  /* Bento-style double-border effect */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 4px var(--page),
    0 0 0 5px rgba(255, 255, 255, 0.04);
  position: relative;
}

.navbar-link:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 4px var(--page),
    0 0 0 5px rgba(255, 255, 255, 0.06);
}

/* =================================
   LAYOUT
   ================================= */
.container {
  height: 100vh;
  width: 100vw;
  /* Add extra padding (10px) to account for box-shadow borders extending beyond cards */
  /* The double-border extends 5px outward, so 10px padding ensures full visibility */
  padding: calc(64px + 1.5rem + 10px) calc(clamp(1.5rem, 13vw, 300px) + 10px) calc(2.5rem + 10px) calc(clamp(1.5rem, 13vw, 300px) + 10px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 1rem;
  overflow: visible; /* Changed to visible so box-shadows aren't clipped */
}

.left-column {
  grid-column: 1;
  display: grid;
  grid-template-rows: minmax(0, auto) 1fr;
  gap: 1rem;
  min-height: 0;
  overflow: visible; /* Changed to visible so box-shadows aren't clipped */
}

.right-column {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, auto) 1fr 1fr;
  gap: 1rem;
  min-height: 0;
  overflow: visible; /* Changed to visible so box-shadows aren't clipped */
}

/* =================================
   CARD BASE STYLES
   ================================= */
.card {
  background: var(--page);
  border-radius: 12px;
  border: none;
  /* Bento card double-border effect - dark mode */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),      /* Inner hairline */
    0 0 0 4px var(--page),                      /* Dark moat matching page bg */
    0 0 0 5px rgba(255, 255, 255, 0.04),       /* Outer hairline */
    0 8px 24px -4px rgba(0, 0, 0, 0.4),        /* Ambient shadow */
    inset 0 1px 0 rgba(255, 255, 255, 0.03);  /* Inner top highlight */
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.card:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 4px var(--page),
    0 0 0 5px rgba(255, 255, 255, 0.06),
    0 24px 48px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* =================================
   BENTO BOX: PROFILE CARD
   ================================= */
.bento-profile-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 2rem;
  padding: 0;
  position: relative;
  height: 100%;
  overflow: hidden; /* Ensure pattern doesn't overflow rounded corners */
}

/* Concentric circles pattern background using SVG */
.bento-profile-arcs {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 520px;
  height: 520px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.11;
  color: var(--ink);
}

.bento-profile-arcs svg {
  width: 100%;
  height: 100%;
}

.bento-profile-header {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  margin: 1.5rem 0 0 1.5rem;
  position: relative;
  z-index: 1; /* Ensure content appears above background pattern */
}

.bento-profile-content {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  padding: 0 0 1.5rem 1.5rem;
  position: relative;
  z-index: 1; /* Ensure content appears above background pattern */
}

.bento-profile-name {
  font-size: calc(2.5rem - 0.5rem - 2px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 0.1rem;
}

.bento-profile-subtitle {
  font-size: calc(1rem - 2px);
  color: var(--meta);
  font-weight: 500;
}

.bento-profile-text {
  font-size: calc(1rem - 2px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
}

.bento-profile-avatar {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 280px;
  height: 280px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  z-index: 1; /* Ensure avatar appears above background pattern */
}

/* =================================
   BENTO BOX: TIKTOK CARD
   ================================= */
.bento-tiktok-card {
  grid-column: 2;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: var(--page);
  position: relative;
  overflow: hidden;
}

.bento-tiktok-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 2px; /* Shift focal point down 2px to show top 1-2px, crop bottom */
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

.bento-tiktok-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  width: 100%;
  height: 100%;
}

.bento-tiktok-card:hover .bento-tiktok-image {
  opacity: 0;
}

.bento-tiktok-card:hover .bento-tiktok-content {
  opacity: 1;
}

.bento-tiktok-card:hover {
  background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
}

.bento-tiktok-card:hover .social-name,
.bento-tiktok-card:hover .social-handle,
.bento-tiktok-card:hover .social-icon-svg {
  color: white;
  fill: white;
}

/* =================================
   BENTO BOX: MENTORSHIP CARD
   ================================= */
.bento-mentorship-card {
  grid-column: 1 / 3;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  height: 100%;
  background: var(--page);
}

.bento-mentorship-header {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  margin: 1.5rem 0 0 1.5rem;
}

.bento-mentorship-label {
  font-size: calc(1rem - 2px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--meta);
  margin-bottom: 0.5rem;
}

.bento-mentorship-title {
  font-size: calc(1rem - 2px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.bento-mentorship-content {
  grid-row: 2;
  display: flex;
  align-items: flex-start;
  padding: 0 0 0 1.5rem;
  min-height: 0;
}

.bento-mentorship-image {
  width: 85%;
  height: auto;
  object-fit: contain;
  max-height: 90%;
}

/* =================================
   BENTO BOX: YOUTUBE VIDEO CARD
   ================================= */
.bento-youtube-card {
  background: #000;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bento-youtube-container {
  width: 100%;
  flex: 1;
  position: relative;
}

.bento-youtube-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
}

.bento-youtube-title {
  padding: 0.75rem 1rem;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.9);
  line-height: 1.3;
}

/* =================================
   BENTO BOX: INSTAGRAM CARD
   ================================= */
.bento-instagram-card {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: var(--page);
  position: relative;
  overflow: hidden;
}

.bento-instagram-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

.bento-instagram-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  width: 100%;
  height: 100%;
}

.bento-instagram-card:hover .bento-instagram-image {
  opacity: 0;
}

.bento-instagram-card:hover .bento-instagram-content {
  opacity: 1;
}

.bento-instagram-card:hover {
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
}

.bento-instagram-card:hover .social-name,
.bento-instagram-card:hover .social-handle,
.bento-instagram-card:hover .social-icon-svg {
  color: white;
  fill: white;
}

/* =================================
   BENTO BOX: CONSULTING CARD
   ================================= */
.bento-consulting-card {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  cursor: pointer;
  background: var(--page);
}

.bento-consulting-label {
  font-size: calc(1rem - 2px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--meta);
  margin: 0 0 0.5rem 0;
}

.bento-consulting-text {
  font-size: calc(1rem - 2px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 1rem 0;
}

.bento-consulting-button {
  width: 100%;
  padding: 0.5rem 1rem;
  background: linear-gradient(180deg, #1A1E26 0%, #0F1116 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: calc(0.875rem - 2px);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(15, 17, 22, 0.5);
  position: relative;
  margin: 0;
}

.bento-consulting-button::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid #0F1116;
  pointer-events: none;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3);
}

.bento-consulting-button:hover {
  transform: translateY(1px);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(15, 17, 22, 0.5);
}

.bento-consulting-button-arrow {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =================================
   SHARED CTA STYLES
   ================================= */
.cta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--meta);
  margin-bottom: 1rem;
}

.cta-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.cta-description {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  flex-grow: 1;
}

.cta-arrow {
  align-self: flex-end;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--section-alt);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  transition: transform 0.3s ease;
}

.card:hover .cta-arrow {
  transform: translateX(4px);
}

/* =================================
   ERROR HANDLING
   ================================= */
.error-banner {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(220, 38, 38, 0.1);
  border-bottom: 1px solid rgba(220, 38, 38, 0.3);
  z-index: 999;
  padding: 1rem clamp(1.5rem, 13vw, 300px);
  backdrop-filter: blur(10px);
}

.error-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
}

.error-message {
  color: var(--ink);
  font-size: 0.875rem;
  flex: 1;
}

.error-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.error-retry-btn {
  padding: 0.5rem 1rem;
  background: rgba(220, 38, 38, 0.2);
  color: var(--ink);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.error-retry-btn:hover {
  background: rgba(220, 38, 38, 0.3);
  border-color: rgba(220, 38, 38, 0.6);
}

.error-dismiss-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
  opacity: 0.7;
}

.error-dismiss-btn:hover {
  color: var(--ink);
  opacity: 1;
}

/* Adjust container padding when error banner is visible */
body:has(.error-banner[style*="display: block"]) .container {
  padding-top: calc(64px + 4rem + 10px);
}

/* =================================
   SOCIAL SHARED STYLES
   ================================= */
.social-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 0.75rem;
}

.social-icon-svg {
  transition: fill 0.3s ease, color 0.3s ease;
}

.social-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.3s ease;
}

.social-handle {
  font-size: 0.8rem;
  color: var(--meta);
  transition: color 0.3s ease;
}

/* =================================
   RESPONSIVE
   ================================= */
@media (max-width: 1200px) {
  .cta-title {
    font-size: 1.15rem;
  }

  .bento-profile-text {
    font-size: 0.9rem;
  }

  .bento-profile-avatar {
    width: 80px;
    height: 80px;
  }

  .bento-profile-name {
    font-size: 1.5rem;
  }
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  body {
    overflow: auto;
  }

  .left-column {
    grid-column: 1;
    grid-row: auto;
  }

  .right-column {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .community-card {
    grid-column: 1;
  }

  .consulting-card {
    grid-column: 1;
  }

  .bento-profile-avatar {
    width: 70px;
    height: 70px;
  }

  .bento-profile-name {
    font-size: 1.35rem;
  }
}
