/**
 * Cutting-Edge Design System 2026
 * Inspired by: Linear, Vercel, Stripe
 * For: Marko Stokić Consulting
 */

/* ===========================
   DESIGN TOKENS (Linear-inspired)
   =========================== */

:root {
  /* Colors - Sophisticated Neutrals */
  --color-bg: #fafafa;
  --color-bg-secondary: #ffffff;
  --color-text-primary: #18181b;
  --color-text-secondary: #52525b;
  --color-text-tertiary: #a1a1aa;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;

  /* Spacing Scale (8px base) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-24: 6rem;    /* 96px */

  /* Typography (Linear-style hierarchy) */
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;

  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  --text-7xl: 4.5rem;      /* 72px */

  /* Shadows (Subtle) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   BASE STYLES
   =========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  /* scroll-behavior handled by Lenis for smoother control */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
}

/* ===========================
   MODERN HERO (with visible photo)
   =========================== */

.hero-cutting-edge {
  position: relative;
  min-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-8);
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-text {
  z-index: 10;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid #e4e4e7;
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  letter-spacing: -0.01em;
}

.hero-title {
  font-size: var(--text-6xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
  text-wrap: balance;
}

.hero-title-gradient {
  background: linear-gradient(135deg, var(--color-accent) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-8);
  max-width: 540px;
}

.hero-cta-group {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--color-accent);
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25),
              0 0 20px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35),
              0 0 30px rgba(37, 99, 235, 0.25),
              0 0 45px rgba(37, 99, 235, 0.1);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  border: 1px solid #e4e4e7;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: #fafafa;
  border-color: #d4d4d8;
}

.hero-photo {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ===========================
   BENTO GRID (2026 Trend)
   =========================== */

.section-modern {
  padding: var(--space-24) var(--space-8);
  max-width: 1400px;
  margin: 0 auto;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 50%, #fafafa 100%);
  position: relative;
}

.section-modern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-5xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.section-description {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.bento-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06),
              0 1px 3px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(12px)) {
  .bento-card {
    background: rgba(255, 255, 255, 0.98);
  }
}

.bento-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(37, 99, 235, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-4px);
}

.bento-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #3b82f6 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  font-size: 24px;
  color: white;
}

.bento-card-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.bento-card-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ===========================
   GLASSMORPHISM CHAT (Modern)
   =========================== */

#ai-chatbot-overlay {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.4);
}

#ai-chatbot-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-xl);
}

.chatbot-header {
  background: linear-gradient(135deg, var(--color-accent) 0%, #3b82f6 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.chatbot-input-wrapper {
  background: var(--color-bg);
  border: 2px solid #e4e4e7;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.chatbot-input-wrapper:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
  .hero-cutting-edge {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding: var(--space-12) var(--space-6);
  }

  .hero-photo {
    height: 400px;
    order: -1;
  }

  .hero-title {
    font-size: var(--text-5xl);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: var(--text-4xl);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===========================
   PROJECTS SECTION
   =========================== */

.bento-grid--projects {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.bento-grid--projects .bento-card {
  display: flex;
  flex-direction: column;
}

.project-tagline {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.tech-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: #f4f4f5;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.tech-badge--ai {
  background: #eff6ff;
  color: #1d4ed8;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-6);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: gap var(--transition);
}

.project-link:hover {
  gap: var(--space-3);
}

.project-link--disabled {
  color: var(--color-text-tertiary);
  cursor: default;
}

.project-link--disabled:hover {
  gap: var(--space-2);
}

.project-links {
  display: flex;
  gap: var(--space-6);
  margin-top: auto;
  padding-top: var(--space-6);
}

.project-links .project-link {
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 768px) {
  .bento-grid--projects {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   THEMED PROJECT CARDS
   =========================== */

/* Eternity - Dark cosmic/star theme */
.bento-card--eternity,
.bento-card--eternity .bento-card-title {
  color: #f1f5f9;
}

.bento-card--eternity {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  border-color: rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.bento-card--eternity::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 50%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(255, 255, 255, 0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 90%, rgba(255, 255, 255, 0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(255, 255, 255, 0.35) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 55%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 75%, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.bento-card--eternity > * {
  position: relative;
  z-index: 1;
}

.bento-card--eternity:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2),
              0 0 0 1px rgba(99, 102, 241, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bento-card--eternity .bento-card-description {
  color: #94a3b8;
}

.bento-card--eternity .project-tagline {
  color: #818cf8;
}

.bento-card--eternity .bento-card-icon {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

.bento-card--eternity .tech-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.bento-card--eternity .tech-badge--ai {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.bento-card--eternity .project-link {
  color: #818cf8;
}

/* Psychosis - Clinical mint/teal theme */
.bento-card--psychosis {
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f7f5 50%, #ecfdf5 100%);
  border-color: rgba(20, 184, 166, 0.2);
  position: relative;
  overflow: hidden;
}

.bento-card--psychosis::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(0deg, transparent 49.5%, rgba(20, 184, 166, 0.06) 49.5%, rgba(20, 184, 166, 0.06) 50.5%, transparent 50.5%),
    linear-gradient(90deg, transparent 49.5%, rgba(20, 184, 166, 0.06) 49.5%, rgba(20, 184, 166, 0.06) 50.5%, transparent 50.5%);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.bento-card--psychosis > * {
  position: relative;
  z-index: 1;
}

.bento-card--psychosis:hover {
  border-color: rgba(20, 184, 166, 0.4);
  box-shadow: 0 12px 40px rgba(20, 184, 166, 0.12),
              0 0 0 1px rgba(20, 184, 166, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bento-card--psychosis .project-tagline {
  color: #0d9488;
}

.bento-card--psychosis .bento-card-icon {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.bento-card--psychosis .tech-badge--ai {
  background: #e0f7f5;
  color: #0d9488;
}

.bento-card--psychosis .project-link {
  color: #0d9488;
}

/* ClaudeMD - Neo-brutalist theme */
.bento-card--claudemd {
  background: #fafaf9;
  border: 3px solid #18181b;
  box-shadow: 4px 4px 0px #18181b;
}

.bento-card--claudemd:hover {
  border-color: #18181b;
  box-shadow: 6px 6px 0px #18181b;
  transform: translate(-2px, -2px);
}

.bento-card--claudemd .bento-card-icon {
  background: #18181b;
  border-radius: var(--radius-sm);
}

.bento-card--claudemd .project-tagline {
  color: #18181b;
  font-weight: 600;
}

.bento-card--claudemd .tech-badge {
  background: #18181b;
  color: #fafaf9;
  border-radius: 2px;
}

.bento-card--claudemd .tech-badge--ai {
  background: #2563eb;
  color: #fff;
}

/* Job Alerts - Telegram blue theme */
.bento-card--jobalerts {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: rgba(33, 150, 243, 0.2);
}

.bento-card--jobalerts:hover {
  border-color: rgba(33, 150, 243, 0.4);
  box-shadow: 0 12px 40px rgba(33, 150, 243, 0.15),
              0 0 0 1px rgba(33, 150, 243, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bento-card--jobalerts .project-tagline {
  color: #1565c0;
}

.bento-card--jobalerts .bento-card-icon {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.bento-card--jobalerts .tech-badge--ai {
  background: rgba(33, 150, 243, 0.15);
  color: #1565c0;
}

/* ===========================
   EXPLORE MORE SECTION
   (Talks & Publications)
   =========================== */

#projects {
  padding-bottom: var(--space-8);
}

#explore {
  padding-top: var(--space-8);
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  max-width: 900px;
  margin: 0 auto;
}

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

.explore-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06),
              0 1px 3px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.explore-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(37, 99, 235, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-4px);
}

.explore-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #3b82f6 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  font-size: 22px;
  color: white;
}

.explore-card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.explore-card-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  flex-grow: 1;
}

.explore-card-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition);
}

.explore-card:hover .explore-card-link {
  gap: 10px;
}
