/* ============================================================
   Infinity Portal — styles.css
   Mobile-first. Scales up via min-width breakpoints.
   ============================================================ */

/* ── Custom properties ─────────────────────────────────────── */
:root {
  --bg:              #09090d;
  --bg-card:         rgba(255, 255, 255, 0.04);
  --bg-card-hover:   rgba(255, 255, 255, 0.08);
  --border:          rgba(255, 255, 255, 0.07);
  --border-hover:    rgba(6, 182, 212, 0.5);

  --cyan:            #06b6d4;
  --cyan-glow:       rgba(6, 182, 212, 0.2);
  --cyan-dim:        rgba(6, 182, 212, 0.55);

  --text-primary:    #f0f4f8;
  --text-secondary:  rgba(240, 244, 248, 0.5);
  --text-dim:        rgba(240, 244, 248, 0.28);

  --radius-card:     14px;
  --radius-badge:    6px;
  --transition:      0.25s ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse at 50% 0%, #0b1018 0%, #020305 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

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

/* ── Ambient background grid ────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 120vw);
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.09) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout wrapper ─────────────────────────────────────────── */
.portal-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.125rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--border);
}

.back-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.back-link:hover {
  color: var(--cyan);
}

.portal-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-logo img {
  width: 28px;
  height: 28px;
}

.portal-logo-text {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

/* ── Main ───────────────────────────────────────────────────── */
.portal-main {
  flex: 1;
  padding: 2.5rem 0 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ── Hub / Hero ─────────────────────────────────────────────── */
.portal-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

/* Central hub ring */
.hub-ring {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-ring::before,
.hub-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.hub-ring::after {
  inset: -12px;
  border-color: rgba(6, 182, 212, 0.1);
}

.hub-ring-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow:
    0 0 24px rgba(6, 182, 212, 0.18),
    inset 0 0 16px rgba(6, 182, 212, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--cyan);
}

.portal-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #e8f0f8 30%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portal-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.portal-tagline {
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-top: -0.25rem;
}

/* ── Section labels ─────────────────────────────────────────── */
.apps-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

.section-label--dim {
  color: var(--text-dim);
}

/* ── App grid — mobile: 1 column ────────────────────────────── */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

/* ── App card ───────────────────────────────────────────────── */
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  padding: 1.375rem 1.25rem 1.125rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all var(--transition);
}

/* Glow layer */
.app-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 30%, var(--cyan-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

/* Active state */
.app-card--active {
  cursor: pointer;
}

.app-card--active:hover,
.app-card--active:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 12px 40px rgba(6, 182, 212, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(6, 182, 212, 0.12);
}

.app-card--active:hover .app-card-glow,
.app-card--active:focus-visible .app-card-glow {
  opacity: 1;
}

.app-card--active:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Disabled state */
.app-card--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.375rem;
}

.badge--live {
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge--soon {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

/* ── App icon symbol ────────────────────────────────────────── */
.app-icon-symbol {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.375rem;
}

/* ── Card text ──────────────────────────────────────────────── */
.app-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.app-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ── Card action ────────────────────────────────────────────── */
.app-card-action {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cyan-dim);
  transition: color var(--transition), gap var(--transition);
}

.app-card--active:hover .app-card-action,
.app-card--active:focus-visible .app-card-action {
  color: var(--cyan);
  gap: 0.5rem;
}

.launch-arrow {
  display: inline-block;
  transition: transform var(--transition);
}

.app-card--active:hover .launch-arrow,
.app-card--active:focus-visible .launch-arrow {
  transform: translateX(4px);
}

/* ── Coming soon badge ──────────────────────────────────────── */
.coming-soon-badge {
  margin-top: 0.625rem;
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-badge);
  padding: 0.25rem 0.6rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.portal-footer {
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer-text a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

/* ============================================================
   BREAKPOINTS — scale up from mobile base
   ============================================================ */

/* Tablet: 2 columns */
@media (min-width: 600px) {
  .portal-wrap {
    padding: 0 1.5rem;
  }

  .portal-title {
    font-size: 2.25rem;
  }

  .hub-ring {
    width: 96px;
    height: 96px;
  }

  .hub-ring-inner {
    width: 76px;
    height: 76px;
    font-size: 2rem;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .app-card {
    padding: 1.5rem 1.375rem 1.25rem;
  }

  .app-icon-symbol {
    font-size: 2.25rem;
  }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
  .portal-wrap {
    padding: 0 2rem;
  }

  .portal-logo img {
    width: 36px;
    height: 36px;
  }

  .portal-logo-text {
    font-size: 1rem;
  }

  .portal-title {
    font-size: 2.75rem;
    letter-spacing: 0.1em;
  }

  .portal-subtitle {
    font-size: 1.0625rem;
  }

  .portal-main {
    padding: 3.5rem 0 4rem;
    gap: 3.5rem;
  }

  .apps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .app-card--active:hover {
    transform: translateY(-8px) scale(1.02);
  }
}
