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

:root {
  /* LIGHT THEME (Pristine Ivory) */
  --bg-app: #F8F7F4;
  --bg-dots: radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-border: rgba(0, 0, 0, 0.08);
  --surface-hover: rgba(16, 185, 129, 0.05);
  
  --emerald: #10B981;
  --emerald-deep: #D1FAE5;
  --gold: #A67C00; /* Muted Gold for Light */
  --gold-glow: rgba(166, 124, 0, 0.2);
  
  --fg-main: #111111;
  --fg-muted: #2D3748; /* 🚀 Much darker charcoal instead of slate gray */
  --fg-accent: var(--gold);
  
  --radius-lg: 20px;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --mesh-grad: radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.05) 0, transparent 50%),
               radial-gradient(at 100% 100%, rgba(166, 124, 0, 0.05) 0, transparent 50%);
}

:root.dark {
  /* DARK THEME (Obsidial Jewel) */
  --bg-app: #050505;
  --bg-dots: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  --surface: rgba(10, 10, 10, 0.8);
  --surface-border: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(16, 185, 129, 0.05);

  --emerald: #10B981;
  --emerald-deep: #064E3B;
  --gold: #C5A059;
  --gold-glow: rgba(197, 160, 89, 0.3);

  --fg-main: #F3F4F6;
  --fg-muted: #94A3B8;
  
  --mesh-grad: radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.1) 0, transparent 50%),
               radial-gradient(at 100% 100%, rgba(197, 160, 89, 0.05) 0, transparent 50%);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  background-image: var(--bg-dots);
  background-size: 40px 40px;
  color: var(--fg-main);
  -webkit-font-smoothing: antialiased;
  line-height: 1.8;
  overflow-x: hidden;
  font-size: 17px; /* 🚀 INCREASED SCALE */
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--emerald); border-radius: 10px; }

.app-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
  position: relative;
}

/* 🕯️ EDITORIAL HEADER */
.app-header.main-header {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  position: relative;
  z-index: 100;
  box-shadow: 
    0 10px 20px -5px rgba(0, 0, 0, 0.1),
    0 20px 40px -10px rgba(0, 0, 0, 0.2),
    0 40px 80px -20px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

:root.dark .app-header.main-header {
  box-shadow: 
    0 10px 30px -5px rgba(0, 0, 0, 0.4),
    0 30px 60px -10px rgba(0, 0, 0, 0.6),
    0 60px 120px -20px rgba(0, 0, 0, 0.8);
}

.header-photo-box {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border-right: 1px solid var(--surface-border);
}

.header-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-header:hover .header-photo-box img {
  transform: scale(1.08);
}

.header-content-box {
  padding: 50px 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-image: var(--mesh-grad);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  position: relative; /* 🚀 Ensure controls are relative to this on mobile */
}

.name {
  font-family: 'Playfair Display', serif;
  font-size: 60px; /* 🚀 LARGER */
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--fg-main);
}

.title {
  font-size: 15px; /* 🚀 LARGER */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 35px;
}

.contact-panel {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 15px 35px;
  max-width: fit-content;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.contact-item:hover { color: var(--emerald); }
.contact-item i { color: var(--emerald); font-size: 15px; flex-shrink: 0; }
.contact-item span { word-break: break-all; }

/* 🌍 CONTROLS */
.header-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 40px; /* 🚀 Space above name */
  z-index: 3000;
}

.control-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 50px;
  padding: 0 16px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-main);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.curr-lang-code {
  font-weight: 800;
  font-size: 13px;
  color: var(--fg-main);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.lang-selector-container.open .chevron-icon {
  transform: rotate(180deg);
}

.control-btn:hover {
  background: var(--emerald-deep);
  border-color: var(--emerald);
  transform: scale(1.1);
}

/* 🧩 ASYMMETRIC BENTO GRID */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 40px; /* 🚀 MORE BREATHABLE */
}

.surface-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 40px; /* 🚀 BALANCED */
  position: relative;
  transition: var(--transition);
}

.surface-card:hover {
  border-color: var(--emerald);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

:root.dark .surface-card:hover { 
  box-shadow: 
    0 10px 20px -5px rgba(0, 0, 0, 0.4),
    0 25px 40px -10px rgba(0, 0, 0, 0.6),
    0 50px 80px -20px rgba(0, 0, 0, 0.8); 
}

.profile-tile { grid-column: span 7; }
.projects-tile { grid-column: span 5; }
.experience-tile { grid-column: span 7; display: flex; flex-direction: column; }
.skills-tile { grid-column: span 5; }

.meta-evolution-box {
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid var(--surface-border);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .meta-evolution-box { grid-template-columns: 1fr; }
}

.tile-heading {
  font-family: 'Playfair Display', serif;
  font-size: 22px; /* 🚀 LARGER */
  font-weight: 700;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.tile-heading::after {
  content: '';
  height: 1px;
  flex-grow: 1;
  background: linear-gradient(to right, var(--gold-glow), transparent);
}

.text-block {
  font-size: 18px; /* 🚀 Slightly larger for philosophy */
  line-height: 1.8;
  color: var(--fg-main);
  margin-bottom: 25px;
  text-align: justify;
}

/* 💎 PROJECTS */
.project-name {
  font-family: 'Playfair Display', serif;
  font-size: 38px; /* 🚀 SCALE UP */
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--fg-main);
}

.project-tech-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 7px 15px;
  background: var(--emerald-deep);
  color: var(--emerald);
  border-radius: 6px;
}

.task-list { list-style: none; padding: 0; }
.task-list li {
  position: relative;
  padding-left: 25px;
  font-size: 17px; /* 🚀 Equal to main text for readability */
  margin-bottom: 12px;
  color: var(--fg-muted);
}

.task-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--emerald);
  font-weight: 900;
}

.project-actions {
  display: flex;
  gap: 15px;
  margin-top: 40px;
}

.action-link {
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-main);
  padding: 15px 30px;
  border: 1px solid var(--surface-border);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-link:hover {
  background: var(--fg-main);
  color: var(--bg-app);
}

/* 🧬 SKILLS */
.sub-heading {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 25px;
}

.expertise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 35px;
}

.expertise-tags li {
  font-size: 15px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--surface-border);
  color: var(--fg-muted);
  transition: var(--transition);
}

.skill-progress { margin-bottom: 25px; }
.skill-progress .label {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.skill-progress .bar { height: 3px; background: var(--surface-border); }
.skill-progress .fill { height: 100%; background: var(--emerald); position: relative; }
.skill-progress .fill::after {
  content: '';
  position: absolute;
  right: -5px; top: -5px;
  width: 12px; height: 12px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold-glow);
}

/* 💼 EXPERIENCE */
.job-item { 
  margin-bottom: 50px; 
  padding-left: 30px;
  border-left: 2px solid var(--surface-border);
}

.job-role { font-size: 24px; font-weight: 800; color: var(--fg-main); margin-bottom: 5px; }
.job-period { font-size: 13px; font-weight: 800; color: var(--gold); letter-spacing: 0.1em; }
.job-org { font-size: 16px; color: var(--fg-muted); margin-bottom: 20px; font-weight: 500; }

/* 🌍 i18n Dropdown Fixed */
.lang-selector-container { position: relative; display: flex; align-items: center; }
.selected-lang-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  color: var(--fg-main);
  padding: 0 5px;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  width: 240px;
  background: var(--bg-app);
  backdrop-filter: blur(50px);
  border: 1px solid var(--emerald);
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  padding: 10px;
  z-index: 99999;
}

.lang-selector-container.open .lang-dropdown-menu { display: flex; animation: slideUp 0.2s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.lang-option {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg-muted);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  background: transparent;
  width: 100%;
  border: none;
  cursor: pointer;
}

.lang-option:hover { background: rgba(16, 185, 129, 0.1); color: var(--fg-main); }
.lang-option.selected { color: var(--emerald); background: rgba(16, 185, 129, 0.05); }

/* SVG Flags */
.flag-container { width: 20px; height: 15px; display: flex; align-items: center; }

/* RESPONSIVE */
@media (max-width: 1200px) {
  .app-header.main-header { grid-template-columns: 1fr; }
  .header-photo-box { 
    height: auto; 
    border-radius: 0; /* 🚀 No rounding as requested */
    border: none;
    overflow: hidden;
    background: transparent;
  }
  .header-photo-box img {
    width: 100%;
    height: auto;
    display: block;
    object-position: center 20%;
    border-radius: 0;
  }
  .header-content-box { padding: 40px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .profile-tile, .projects-tile, .experience-tile, .skills-tile { grid-column: span 12; }
}

@media (max-width: 768px) {
  .app-wrapper { padding: 0 0 40px 0; } /* 🚀 Remove top padding, keep bottom */
  .app-header.main-header { 
    border-radius: 0; 
    border-left: none; 
    border-right: none; 
    margin-bottom: 30px;
  }

  .name { font-size: 38px; } 
  .title { font-size: 13px; letter-spacing: 0.2em; margin-bottom: 25px; }
  .contact-panel { grid-template-columns: 1fr; gap: 15px; }
  
  .header-controls {
    justify-content: flex-end;
    margin-bottom: 30px;
    width: 100%;
  }

  .header-content-box { padding: 40px 60px; } /* 🚀 60px total = 20px (grid) + 40px (card inner) */
  
  /* Keep other cards with padding if they are not edge-to-edge */
  .tiles-grid { padding: 0 20px; gap: 20px; }
}

@media (max-width: 480px) {
  .name { font-size: 32px; }
  .header-content-box { padding: 30px 40px; } /* 🚀 40px = 20px grid + 20px card */
  .surface-card { padding: 20px; }
  .tiles-grid { padding: 0 20px; }
  .action-link { padding: 12px 20px; font-size: 12px; }
}
