:root {
  --bg: #0b0f1f;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --text: #f3f4ff;
  --muted: #b0b6dc;
  --accent: #ffcf5c;
  --accent-hover: #ffd97a;
  --radius: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  --gap: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #0b0f1f;
}

/* Background Effects */
.bg-shapes span {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
}
.bg-shapes span:nth-child(1) { width: 60vw; height: 60vw; top: -20%; left: -20%; background: #4f46e5; }
.bg-shapes span:nth-child(2) { width: 50vw; height: 50vw; bottom: -20%; right: -20%; background: #06b6d4; }
.bg-shapes span:nth-child(3) { width: 40vw; height: 40vw; top: 30%; left: 30%; background: #f59e0b; opacity: 0.15; }

.bg-canvas { display: none; }

/* Layout Grid Container */
.page-container {
  display: grid;
  width: 100%;
  min-height: 100vh;
  padding: var(--gap);
  gap: var(--gap);
  /* Desktop default: 4 cols, auto rows */
  grid-template-columns: repeat(4, 1fr);
  /* Use minmax to ensure rows expand to fit content, but try to be 1fr if space allows */
  grid-template-rows: repeat(4, minmax(min-content, 1fr));
}

/* Hero Section */
.hero-item {
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero__text h1 { 
  margin: 12px 0; 
  font-size: clamp(32px, 4vw, 56px); 
  line-height: 1.1;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.eyebrow { 
  font-size: 14px; 
  color: var(--accent); 
  letter-spacing: 2px; 
  text-transform: uppercase; 
  font-weight: 700;
  opacity: 0.9;
}
.hero__lead { 
  color: var(--muted); 
  font-size: 16px; 
  margin: 12px 0 20px; 
  line-height: 1.6; 
  max-width: 90%;
}

.hero__features {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  opacity: 0.8;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}

/* Brand Cards */
.brand-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.25s ease;
  position: relative;
  /* Removed overflow: hidden to prevent clipping content like shadows or tooltips, 
     but keeping border-radius on container clips bg. 
     If content overflows, it should expand the card. */
}
.brand-card:hover { 
  background: var(--surface-hover); 
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  z-index: 2; /* Bring to front on hover */
}

.brand-card__header { display: flex; align-items: center; height: 48px; margin-bottom: 4px; }
.brand-card__logo-wrapper {
  height: 100%;
  width: 100px; /* Fixed width */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.brand-card__logo { 
  max-height: 100%; 
  max-width: 100%; 
  object-fit: contain; 
}
.brand-card__logo--text { 
  background: var(--accent);
  color: #0b0f1f;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 100%;
  border-radius: 8px;
  font-weight: 800; 
  font-size: 20px; 
}

.brand-card__info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.brand-card__title { 
  margin: 0; 
  font-size: 18px; 
  color: #fff; 
  font-weight: 700; 
  line-height: 1.3;
}
.brand-card__desc { 
  margin: 0; 
  font-size: 14px; 
  color: var(--muted); 
  line-height: 1.5; 
}

/* Links */
.brand-links { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  margin-top: auto; 
  align-content: flex-start;
}
.link-group { width: 100%; font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 500; opacity: 0.8; }
.link-chip {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px; /* Larger touch target */
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 12px;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  flex: 1; 
  min-width: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.link-chip:hover { 
  background: var(--accent); 
  color: #0b0f1f; 
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 207, 92, 0.3);
}

/* PC Layout: Traditional Landing Page */
@media (min-width: 769px) {
  .page-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: min-content; /* Allow content to flow naturally */
    grid-template-rows: unset; /* Remove fixed rows */
    max-width: 1200px; /* Standard container width */
    margin: 0 auto; /* Center page */
    padding: 40px 24px;
    height: auto;
    overflow-y: visible;
    gap: 24px;
  }

  /* Custom Scrollbar */
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

  /* Hero Section - Full Width Banner Style */
  .hero-item {
    grid-column: 1 / -1; /* Span full width */
    grid-row: auto;
    min-height: 320px;
    margin-bottom: 24px;
    align-items: center; /* Center content horizontally */
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  }
  
  /* Remove fancy glow from previous attempt if present */
  .hero-item::before { display: none; }

  .hero__text h1 {
    font-size: 48px;
    margin: 16px 0;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .hero__lead {
    font-size: 18px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero__features {
    display: flex;
    gap: 32px;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    margin-top: 24px;
    width: 100%;
    max-width: 800px;
  }
  
  .hero__features li {
    display: flex;
    align-items: center;
    font-size: 14px;
  }

  /* Brand Cards - Standard Grid */
  .brand-card {
    height: 100%;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.04);
  }
  
  .brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
  }
}

/* Wide Screen adjustment (5 cols) */
@media (min-width: 1400px) {
  .page-container {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1400px;
  }
}

/* Tablet / Smaller Desktop adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .page-container {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, auto);
  }
  .hero-item {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
  }
}

/* Mobile Layout */
@media (max-width: 768px) {
  :root {
    --gap: 12px;
    --radius: 16px;
  }

  /* Reset Grid for Mobile */
  .page-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content; /* Critical: allow rows to grow */
    grid-template-rows: unset; /* Remove fixed rows */
    gap: 12px;
    padding: 12px;
    height: auto;
    min-height: 100vh;
    overflow-y: visible; /* Let body scroll */
  }

  /* Hero Section - Compact Height */
  .hero-item {
    grid-column: 1 / -1; /* Full width */
    height: auto;
    min-height: 200px; /* Reduced min-height */
    margin: -12px -12px 0 -12px;
    width: calc(100% + 24px);
    border-radius: 0 0 24px 24px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 24px 20px;
    justify-content: flex-start;
  }

  .hero__text h1 { font-size: 28px; margin: 8px 0; }
  .hero__lead { font-size: 14px; margin-bottom: 12px; }
  .hero__features { padding-top: 12px; font-size: 12px; }

  .brand-card {
    padding: 16px;
    gap: 12px;
  }

  .brand-card__header { height: 32px; }
  .brand-card__logo-wrapper { width: 80px; }
  .brand-card__title { font-size: 15px; }
  .brand-card__desc { font-size: 12px; }
  
  .link-chip { 
    padding: 8px 12px; 
    font-size: 12px; 
    border-radius: 8px;
  }
}
