/* ============================================================================
 * iSurvive.live — Dark Obsidian & Gold Glassmorphic Brand Hub Stylesheet
 * Zero external CDNs; strict CSP (`style-src 'self'`) compliant.
 * ============================================================================ */

:root {
  /* Core Ignis Obsidian Surfaces */
  --bg-obsidian: #07080c;
  --bg-obsidian-2: #0c0e15;
  --surface-glass: rgba(16, 19, 28, 0.72);
  --surface-glass-strong: rgba(13, 16, 24, 0.88);
  --surface-elevated: rgba(24, 28, 40, 0.78);
  --surface-inset: rgba(7, 9, 14, 0.68);

  /* Metallic Gold & Warm iSurvive Ember Accents */
  --gold-bright: #f5d87d;
  --gold-mid: #d4af37;
  --gold-deep: #9c7216;
  --gold-glow: rgba(212, 175, 55, 0.24);
  --gold-soft: rgba(212, 175, 55, 0.10);

  --ember-dark: #1a0e12;
  --ember-mid: #994220;
  --ember-bright: #f2b571;
  --ember-soft: rgba(153, 66, 32, 0.18);
  --ember-border: rgba(242, 181, 113, 0.28);

  /* Borders & Hairlines */
  --border-subtle: rgba(212, 175, 55, 0.16);
  --border-gold: rgba(212, 175, 55, 0.30);
  --border-gold-strong: rgba(245, 216, 125, 0.56);
  --border-muted: rgba(255, 255, 255, 0.08);

  /* Ink Hierarchy */
  --text-primary: #f4f1ea;
  --text-secondary: #b0b5c3;
  --text-muted: #767c8e;

  /* Telemetry Emerald */
  --emerald: #34d399;
  --emerald-bg: rgba(52, 211, 153, 0.12);
  --emerald-border: rgba(52, 211, 153, 0.34);

  /* Typography */
  --font-sans: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Geometry & Motion */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --blur-glass: 18px;
  --shadow-glass: 0 24px 60px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(245, 216, 125, 0.09);
  --shadow-gold: 0 0 0 1px rgba(212, 175, 55, 0.26), 0 14px 36px rgba(212, 175, 55, 0.16);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 75% 55% at 50% -10%, rgba(212, 175, 55, 0.13), transparent 70%),
    radial-gradient(ellipse 55% 45% at 85% 22%, rgba(153, 66, 32, 0.16), transparent 68%),
    radial-gradient(ellipse 60% 50% at 15% 85%, rgba(26, 14, 18, 0.45), transparent 70%);
}

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

a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ============================================================================
 * Ambient Architectural Backdrop
 * ============================================================================ */

.ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(212, 175, 55, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 175, 55, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 28%, #000 30%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 28%, #000 30%, transparent 92%);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
}

.ambient-orb-gold {
  top: -120px;
  left: 50%;
  width: 520px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.30), transparent 70%);
}

.ambient-orb-ember {
  top: 220px;
  right: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(153, 66, 32, 0.28), transparent 70%);
}

/* ============================================================================
 * Shell & Top Bar
 * ============================================================================ */

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 8, 12, 0.78);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-emblem-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(26, 14, 18, 0.92), rgba(13, 16, 24, 0.92));
  border: 1px solid var(--border-gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(242, 181, 113, 0.16);
}

.brand-logo-sm {
  display: block;
  width: 32px;
  height: auto;
  aspect-ratio: 799 / 851;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.brand-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.brand-wordmark {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #fff5d6 0%, var(--gold-bright) 48%, var(--ember-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.domain-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--gold-bright);
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--surface-glass);
  border: 1px solid var(--border-gold);
  box-shadow: inset 0 1px 0 rgba(245, 216, 125, 0.12);
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.nav-cta:hover {
  transform: translateY(-1px);
  border-color: var(--border-gold-strong);
  background: rgba(212, 175, 55, 0.16);
  box-shadow: var(--shadow-gold);
}

.nav-cta-arrow {
  color: var(--gold-bright);
  transition: transform 180ms var(--ease-out);
}

.nav-cta:hover .nav-cta-arrow {
  transform: translateX(3px);
}

/* ============================================================================
 * Hero Banner
 * ============================================================================ */

.main-content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.4rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-medallion {
  position: relative;
  margin-bottom: 1.75rem;
  padding: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(245, 216, 125, 0.22), rgba(26, 14, 18, 0.85) 60%, rgba(7, 8, 12, 0.96) 100%);
  border: 1px solid var(--border-gold);
  box-shadow:
    0 0 0 1px rgba(153, 66, 32, 0.25),
    0 24px 64px rgba(0, 0, 0, 0.68),
    0 0 48px rgba(212, 175, 55, 0.16),
    inset 0 1px 0 rgba(245, 216, 125, 0.24);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
}

.hero-medallion-ring {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(26, 14, 18, 0.92), rgba(7, 8, 12, 0.96));
  border: 1px solid rgba(242, 181, 113, 0.26);
  padding: 12px;
}

.hero-logo {
  display: block;
  width: 144px;
  height: auto;
  aspect-ratio: 799 / 851;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.72));
}

.hero-kicker {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ember-bright);
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 0.95rem;
  font-size: clamp(2.6rem, 5.5vw, 3.85rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff9e6 0%, var(--gold-bright) 52%, var(--gold-mid) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.18));
}

.hero-subtitle {
  margin: 0;
  max-width: 600px;
  font-size: 1.06rem;
  color: var(--text-secondary);
}

/* ============================================================================
 * Application Portal Grid & Cards
 * ============================================================================ */

.portal-section {
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  margin: 0;
  font-size: 0.86rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  white-space: nowrap;
}

.section-rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--border-gold), transparent);
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.85rem;
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.portal-card-featured {
  border-color: var(--border-gold);
  background:
    linear-gradient(160deg, rgba(24, 28, 40, 0.82) 0%, rgba(13, 16, 24, 0.88) 65%, rgba(26, 14, 18, 0.72) 100%);
}

.portal-card-featured:hover {
  transform: translateY(-3px);
  border-color: var(--border-gold-strong);
  box-shadow: var(--shadow-glass), var(--shadow-gold);
}

.portal-card-community {
  background:
    linear-gradient(165deg, rgba(16, 19, 28, 0.76) 0%, rgba(26, 14, 18, 0.62) 100%);
  border-color: rgba(242, 181, 113, 0.20);
}

.portal-card-community:hover {
  transform: translateY(-2px);
  border-color: var(--ember-border);
}

.card-top-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--ember-bright), var(--gold-deep));
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.card-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.16), rgba(12, 14, 21, 0.92));
  border: 1px solid var(--border-gold);
  box-shadow: inset 0 1px 0 rgba(245, 216, 125, 0.18);
  flex-shrink: 0;
}

.card-icon-ember {
  color: var(--ember-bright);
  background: linear-gradient(145deg, rgba(153, 66, 32, 0.26), rgba(26, 14, 18, 0.92));
  border-color: var(--ember-border);
}

.status-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-live {
  color: var(--emerald);
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse-live 2.2s ease-in-out infinite;
}

.status-ember {
  color: var(--ember-bright);
  background: var(--ember-soft);
  border: 1px solid var(--ember-border);
}

.status-dot-ember {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ember-bright);
}

.host-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
}

.card-body {
  flex: 1 0 auto;
}

.card-title {
  margin: 0 0 0.65rem;
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.portal-card-community .card-title {
  font-size: 1.28rem;
}

.card-description {
  margin: 0 0 1.35rem;
  font-size: 0.96rem;
  color: var(--text-secondary);
}

.feature-chips {
  list-style: none;
  margin: 0 0 1.65rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-bright);
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.09);
  border: 1px solid rgba(212, 175, 55, 0.24);
}

.chip-ember {
  color: var(--ember-bright);
  background: rgba(153, 66, 32, 0.16);
  border-color: rgba(242, 181, 113, 0.26);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.btn-gold-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.45rem;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #120d05;
  background: linear-gradient(135deg, #f8e296 0%, var(--gold-mid) 58%, #b9891e 100%);
  border: 1px solid rgba(255, 241, 189, 0.55);
  box-shadow:
    0 10px 28px rgba(212, 175, 55, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out),
    filter 180ms var(--ease-out);
}

.btn-gold-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 14px 34px rgba(212, 175, 55, 0.38),
    0 0 24px rgba(245, 216, 125, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-gold-primary:active {
  transform: translateY(0);
}

.btn-arrow {
  transition: transform 180ms var(--ease-out);
}

.btn-gold-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.local-preview-slot {
  display: inline-flex;
  align-items: center;
}

.local-preview-slot[hidden] {
  display: none;
}

.local-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.local-preview-pill:hover {
  background: rgba(52, 211, 153, 0.20);
  transform: translateY(-1px);
}

.card-footnote {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.footnote-label {
  color: var(--text-muted);
}

.footnote-link {
  font-family: var(--font-mono);
  color: var(--ember-bright);
  transition: color 160ms var(--ease-out);
}

.footnote-link:hover {
  color: var(--gold-bright);
}

/* ============================================================================
 * Footer
 * ============================================================================ */

.footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 8, 12, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.footer-sep {
  color: var(--gold-mid);
}

.footer-domain {
  font-family: var(--font-mono);
  color: var(--gold-bright);
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.footer-link {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  transition: color 160ms var(--ease-out);
}

.footer-link:hover {
  color: var(--gold-bright);
}

.security-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--border-subtle);
}

/* ============================================================================
 * Keyframes & Responsive Breakpoints
 * ============================================================================ */

@keyframes pulse-live {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.88);
  }
}

@media (max-width: 860px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 2.5rem 1.15rem 3rem;
  }
}

@media (max-width: 540px) {
  .topbar-inner {
    padding: 0.75rem 1rem;
  }

  .domain-pill {
    display: none;
  }

  .hero-medallion-ring {
    width: 146px;
    height: 146px;
  }

  .hero-logo {
    width: 120px;
  }

  .portal-card {
    padding: 1.4rem;
  }

  .btn-gold-primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
