/* Portfolio V2 - Inspired by thariq.io Editorial Style */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Default: Professional Mode (Luxury Deep Midnight Blue / Blue-Grey Theme) */
  --bg-main: #0a1120;
  --bg-card: #131e36;
  --bg-card-hover: #1b2949;
  --text-main: #f1f5f9;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --gold: #e2b842;
  --gold-glow: rgba(226, 184, 66, 0.25);
  --bronze: #c5a059;
  --border-color: rgba(226, 184, 66, 0.25);
  --border-hover: rgba(226, 184, 66, 0.55);
  --shadow-warm: 0 10px 30px rgba(5, 10, 20, 0.6);
  --shadow-hover: 0 14px 40px rgba(5, 10, 20, 0.8);
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Personal Mode (Warm Parchment Light Theme) */
html.mode-personal {
  --bg-main: #fbf9f4;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f4ec;
  --text-main: #2b2723;
  --text-sub: #635c54;
  --text-muted: #8c8378;
  --gold: #b8860b;
  --gold-glow: rgba(184, 134, 11, 0.2);
  --bronze: #8b6b38;
  --border-color: rgba(139, 107, 56, 0.2);
  --border-hover: rgba(184, 134, 11, 0.4);
  --shadow-warm: 0 8px 24px rgba(60, 50, 40, 0.08);
  --shadow-hover: 0 12px 32px rgba(60, 50, 40, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1100px;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

/* Header & Navigation */
header.site-header {
  width: 100%;
  margin-bottom: 3.5rem;
  padding-bottom: 1rem;
}

nav.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-logo:hover {
  color: var(--gold);
}

.v1-switch-link {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.v1-switch-link:hover {
  color: var(--gold);
  border-color: var(--gold);
  background-color: var(--gold-glow);
}

/* Center Mode Toggle Switch inspired by thariq.io */
.mode-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto;
}

.ornament {
  color: var(--gold);
  opacity: 0.6;
  flex-shrink: 0;
}

.mode-toggle {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-warm);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.mode-toggle:hover {
  border-color: var(--border-hover);
}

.toggle-option {
  position: relative;
  z-index: 2;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s ease;
}

.toggle-option.active {
  color: var(--text-main);
  font-weight: 600;
}

.toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: 50%;
  background: var(--gold-glow);
  border: 1px solid var(--gold);
  border-radius: 9999px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

html.mode-personal .toggle-indicator {
  transform: translateX(94%);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.action-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Coin Flip 3D Avatar Section inspired by thariq.io */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 3.5rem;
}

.coin-flip-container {
  perspective: 1000px;
  width: 190px;
  height: 190px;
  margin-bottom: 1.75rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}

.coin-flip-container:hover {
  transform: scale(1.05);
}

.coin-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.coin-flip-container.flipped .coin-flip-inner,
html.mode-personal .coin-flip-inner {
  transform: rotateY(180deg);
}

.coin-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 50%;
}

.coin-front {
  z-index: 2;
}

.coin-back {
  transform: rotateY(180deg);
}

.astrolabe-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.whirl-slow {
  transform-origin: center;
  animation: whirl 30s linear infinite;
}

.whirl-medium {
  transform-origin: center;
  animation: whirl 20s linear infinite reverse;
}

.whirl-fast {
  transform-origin: center;
  animation: whirl 12s linear infinite;
}

.coin-flip-container:hover .whirl-slow,
.coin-flip-container:hover .whirl-medium,
.coin-flip-container:hover .whirl-fast {
  animation-play-state: paused;
}

@keyframes whirl {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.avatar-inner {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-warm);
  border: 2px solid var(--border-color);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.coin-flip-container:hover .avatar-inner {
  border-color: var(--gold);
}

.avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--text-sub);
  max-width: 650px;
  margin: 0 auto 1.5rem auto;
}

.social-links-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.social-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm);
}

/* Gold Celestial Section Dividers */
.gold-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3.5rem 0;
}

.gold-line-left {
  height: 1px;
  width: 80px;
  background: linear-gradient(to right, transparent, var(--gold));
}

.gold-line-right {
  height: 1px;
  width: 80px;
  background: linear-gradient(to left, transparent, var(--gold));
}

.celestial-star {
  color: var(--gold);
  opacity: 0.8;
}

/* Editorial 2-Column Section Layout */
.editorial-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 768px) {
  .editorial-section {
    flex-direction: row;
    gap: 2rem;
  }
  
  .section-sidebar {
    width: 22%;
    flex-shrink: 0;
  }
  
  .section-content {
    width: 78%;
  }
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-main);
  position: sticky;
  top: 2rem;
}

/* Text Content & Links */
.editorial-text {
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--text-sub);
}

.editorial-text p {
  margin-bottom: 1rem;
}

.editorial-text strong {
  color: var(--text-main);
  font-weight: 600;
}

a.illuminated-link {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px dashed var(--gold);
  padding-bottom: 1px;
  transition: all 0.2s ease;
}

a.illuminated-link:hover {
  color: var(--gold);
  border-bottom-style: solid;
  background: var(--gold-glow);
}

/* Grid & Cards (Stuff I've Made / Portfolio) */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ornament-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-warm);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.ornament-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

/* Corner Ornaments SVG */
.corner-svg {
  position: absolute;
  width: 20px;
  height: 20px;
  color: var(--bronze);
  opacity: 0.35;
  pointer-events: none;
  z-index: 2;
}

.corner-top-left { top: 6px; left: 6px; }
.corner-top-right { top: 6px; right: 6px; transform: rotate(90deg); }
.corner-bottom-left { bottom: 6px; left: 6px; transform: rotate(-90deg); }
.corner-bottom-right { bottom: 6px; right: 6px; transform: rotate(180deg); }

.card-banner {
  height: 140px;
  width: 100%;
  background: linear-gradient(135deg, rgba(163, 133, 80, 0.15), rgba(212, 175, 55, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;

}

.card-badge-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gold);
  color: #000;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  z-index: 3;
}

.card-body-content {
  padding: 1.25rem 1.25rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.card-desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-sub);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.mini-tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(163, 133, 80, 0.1);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Timeline / Experience List */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.timeline-logo {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.timeline-info {
  flex-grow: 1;
}

.timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.role-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
}

.company-name {
  color: var(--gold);
  font-weight: 500;
}

.time-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-bullets {
  list-style: disc inside;
  font-size: 1rem;
  color: var(--text-sub);
  line-height: 1.65;
}

.timeline-bullets li {
  margin-bottom: 0.35rem;
}

/* Skills Category Boxes */
.skills-group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .skills-group-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skill-box-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.65rem;
  padding: 1.25rem;
}

.skill-box-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-box-title i {
  color: var(--gold);
}

/* Certificates Links */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cert-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.05rem;
  transition: all 0.2s ease;
}

.cert-link-item:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  color: var(--gold);
  transform: translateX(4px);
}

/* Footer */
footer.site-footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Modal Windows */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-main);
  border: 1px solid var(--gold);
  border-radius: 1rem;
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--gold);
}

/* Command Palette Input */
.cmdk-input-box {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: 0.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  margin-bottom: 1rem;
}

.cmdk-input-box:focus {
  border-color: var(--gold);
}

.cmdk-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cmdk-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--bg-card);
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
}

.cmdk-item-row:hover {
  border-color: var(--gold);
  background: var(--gold-glow);
  color: var(--gold);
}
