/* ==========================================================================
   Arbab Usmani Portfolio & Playbooks - CSS Stylesheet
   Design Inspiration: prateekm.com (Ultra-clean, modern, dark/light aesthetic)
   ========================================================================== */

:root {
  --bg-primary: #0f1115;
  --bg-secondary: #161920;
  --bg-card: #1c202a;
  --bg-hover: #242936;
  
  --text-primary: #f0f3f8;
  --text-secondary: #9da6b8;
  --text-muted: #626d82;
  
  --accent-color: #3b82f6;
  --accent-light: #60a5fa;
  --accent-bg: rgba(59, 130, 246, 0.12);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f9fafb;
  --bg-secondary: #f3f4f6;
  --bg-card: #ffffff;
  --bg-hover: #e5e7eb;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  --accent-color: #2563eb;
  --accent-light: #3b82f6;
  --accent-bg: rgba(37, 99, 235, 0.08);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Base Page Layout */
.page-shell {
  min-height: 100vh;
  padding: 60px 20px 80px 20px;
  display: flex;
  justify-content: center;
}

.content-column {
  width: 100%;
  max-width: 660px;
  position: relative;
}

/* Floating Theme Switcher */
.top-controls {
  display: flex;
  align-items: center;
}

.theme-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Header & Animated Profile Picture */
.home-header {
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.career-head-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-avatar-head {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-light);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  vertical-align: middle;
}

.home-title:hover .profile-avatar-head,
.career-head-slot:hover .profile-avatar-head {
  transform: scale(1.25) rotate(6deg);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.65);
}

.career-wave {
  display: inline-block;
  animation: waveAnimation 2.5s infinite;
  transform-origin: 70% 70%;
}

@keyframes waveAnimation {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-links a {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.social-links a:hover {
  color: var(--accent-light);
  background: var(--bg-secondary);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Monospace Section Labels */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.intro-section,
.home-section {
  margin-bottom: 44px;
}

/* Bio Copy & Paragraphs */
.bio-copy p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  margin-bottom: 18px;
  line-height: 1.68;
}

.bio-copy p:last-child {
  margin-bottom: 0;
}

.highlight-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--accent-bg);
  color: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: inline-block;
}

.accent-text {
  color: var(--accent-light);
}

.text-link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.text-link:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

/* Company Badges & Press Coverage */
.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  margin: 0 3px;
  vertical-align: baseline;
  transition: all var(--transition-fast);
}

.company-badge:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.company-badge-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
}

.company-badge-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.uppskill-icon { background: #6366f1; }
.uc-icon { background: #ec4899; }
.fa-icon { background: #8b5cf6; }
.iim-icon { background: #10b981; }
.client-icon { background: #475569; }
.uc-bg { background: #ec4899; }

.press-mentions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  vertical-align: middle;
}

.press-mentions a {
  display: inline-flex;
  opacity: 0.7;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.press-mentions a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.press-mentions img {
  border-radius: 3px;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.mail-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Work Timeline Section */
.timeline-list {
  list-style: none;
  margin-bottom: 16px;
}

.timeline-item {
  border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-row {
  display: grid;
  grid-template-columns: 32px 210px 1fr 60px;
  align-items: center;
  padding: 14px 0;
  gap: 12px;
}

.timeline-logo-frame {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.timeline-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.consultant-bg { background: #3b82f6; }
.fa-bg { background: #8b5cf6; }
.mentor-bg { background: #10b981; }
.uppskill-bg { background: #6366f1; }

.timeline-company {
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-role {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.timeline-years {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

.timeline-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.92rem;
}

/* Notes Folders & Tree Structure */
.notes-folder {
  margin-bottom: 24px;
}

.folder-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  position: relative;
}

.folder-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.folder-toggle:hover {
  color: var(--text-primary);
}

.folder-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.notes-folder.collapsed .folder-chevron {
  transform: rotate(-90deg);
}

.folder-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-light);
}

.folder-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.98rem;
  flex: 1;
}

/* Share Menu Popover */
.share-menu-wrapper {
  position: relative;
}

.share-trigger {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.share-trigger:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.share-trigger svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.share-popover {
  position: absolute;
  right: 0;
  top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 20;
  animation: popIn 0.15s ease-out;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.share-option {
  background: var(--bg-secondary);
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.share-option:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.share-option svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Note List items */
.note-list {
  list-style: none;
  padding-left: 32px;
  margin-top: 6px;
  transition: all var(--transition-normal);
}

.notes-folder.collapsed .note-list {
  display: none;
}

.note-item {
  margin-bottom: 8px;
}

.note-link,
.note-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-block;
  padding: 2px 0;
  transition: color var(--transition-fast);
}

.note-link:hover,
.note-list a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

/* Side Projects Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
  transform: translateY(-2px);
}

.project-preview {
  height: 90px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px dashed var(--border-color);
}

.logo-dark-mode { display: block; }
.logo-light-mode { display: none; }

[data-theme="light"] .logo-dark-mode { display: none; }
[data-theme="light"] .logo-light-mode { display: block; }

.brrr-mini {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
}

.brrr-mini span { display: block; color: var(--text-muted); font-size: 0.75rem; }
.brrr-mini strong { color: var(--accent-light); }
.brrr-mini b { font-weight: 700; color: var(--text-primary); }

.growth-signal-mini strong { color: #3b82f6; }

.flows-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.flows-mini span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8b5cf6;
}

.flows-mini div {
  display: flex;
  gap: 6px;
}

.flows-mini i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border-color);
  display: inline-block;
}

.flows-mini i:nth-child(1) { background: #3b82f6; }
.flows-mini i:nth-child(2) { background: #8b5cf6; }
.flows-mini i:nth-child(3) { background: #10b981; }

.project-meta strong {
  display: block;
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.project-meta span {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Footer */
.home-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  text-align: center;
}

.home-footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Interactive Note Modal / Reader */
.note-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.note-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.note-modal[aria-hidden="false"] .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-meta {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.modal-category {
  color: var(--accent-light);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.modal-readtime {
  color: var(--text-muted);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-close-btn svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.modal-body h1 {
  font-size: 1.45rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
}

.modal-body p {
  margin-bottom: 16px;
}

.modal-body ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
}

.copy-toast {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #10b981;
}

/* Responsive Rules */
@media (max-width: 600px) {
  .page-shell {
    padding: 30px 16px 60px 16px;
  }

  .home-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .timeline-row {
    grid-template-columns: 28px 160px 1fr 50px;
    font-size: 0.88rem;
  }

  .timeline-years {
    font-size: 0.78rem;
  }

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