/* ==========================================================================
   CrashNBurns.com - Alpine & Glacial Tech Design System (Option 1)
   ========================================================================== */

:root {
  /* Default: Alpine Glacial Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  
  --border-subtle: #e2e8f0;
  --border-accent: rgba(14, 165, 233, 0.35);
  --border-verified: rgba(99, 102, 241, 0.4);

  --accent-sky: #0ea5e9;
  --accent-cyan: #06b6d4;
  --accent-ice: #e0f2fe;
  --accent-navy: #0f172a;
  --accent-green: #10b981;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 25px rgba(14, 165, 233, 0.2);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Outfit', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Alpine Dark Glacial Override */
[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(56, 189, 248, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Alpine Vector Background Canvas */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Layout Container */
.site-container {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.site-header {
  padding: 28px 0 20px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo .logo-icon {
  font-size: 1.3rem;
}

.brand-logo .highlight {
  color: var(--accent-sky);
  font-weight: 800;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  gap: 12px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition-fast);
  padding: 6px 14px;
  border-radius: 20px;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-sky);
  background: rgba(14, 165, 233, 0.08);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-sky);
  box-shadow: var(--shadow-glow);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 60px;
}

/* Alpine Glacial Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Profile Hero Card */
.profile-card {
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 36px;
}

.card-glow-bg {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 120%;
  height: 180%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 135px;
  height: 135px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25), 0 0 0 2px var(--accent-sky);
  transition: var(--transition-smooth);
}

.glass-card:hover .profile-avatar {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35), 0 0 0 3px var(--accent-sky);
}

.status-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  background-color: var(--accent-green);
  border: 3px solid var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-pulse {
  width: 100%;
  height: 100%;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-header-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.profile-title {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.profile-handle {
  font-family: var(--font-code);
  font-size: 0.92rem;
  color: var(--accent-sky);
  background: rgba(14, 165, 233, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.profile-handle:hover {
  background: rgba(14, 165, 233, 0.2);
  transform: translateY(-1px);
}

.copy-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 530px;
  line-height: 1.65;
}

.badges-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tech-badge {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Sections */
.section-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Links Grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.link-card {
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 18px;
}

.mastodon-card {
  border-color: var(--border-verified);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, var(--bg-card) 100%);
}

.mastodon-card:hover {
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mastodon-icon {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.domain-icon {
  background: rgba(14, 165, 233, 0.12);
  font-size: 1.6rem;
}

.link-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.link-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-name {
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.verified-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .verified-pill {
  color: #818cf8;
}

.active-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 10px;
  border-radius: 12px;
}

.link-handle {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--accent-sky);
}

.link-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.arrow-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.link-card:hover .arrow-icon {
  color: var(--accent-sky);
  transform: translate(3px, -3px);
}

/* Blog Placeholder Card */
.blog-placeholder-card {
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 4px;
}

.blog-placeholder-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.blog-placeholder-card p {
  color: var(--text-muted);
  max-width: 440px;
  font-size: 0.95rem;
}

.feed-badge {
  margin-top: 8px;
  font-size: 0.8rem;
  font-family: var(--font-code);
  color: var(--accent-sky);
  background: rgba(14, 165, 233, 0.1);
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* Footer */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-sub {
  font-size: 0.8rem;
  opacity: 0.75;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-code);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: var(--transition-smooth);
}

.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .profile-header-group {
    justify-content: center;
  }

  .badges-group {
    justify-content: center;
  }

  .header-inner {
    flex-direction: column;
    gap: 16px;
  }
}
