:root {
  --bg: #0e0f10;
  --card: #1b1b1d;
  --deep: #141416;
  --pill: #151516;
  --border: #2a2a2e;
  --text: #f2f2f3;
  --muted: #b9b9be;
  
  --content-card-bg: #202123;
  --content-p-bg: #161616;
  --btn-bg: #2a2a2e;
  --btn-text: #d8d8d8;
  --btn-border: #3e3e3e;
  --icon-color: #e6e6e8;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --text-shadow: 0 0 50px rgba(255, 255, 255, 0.25);
  --text-shadow-hover: 0 0 30px rgba(255, 255, 255, 0.59);
  --pill-highlight: rgba(255, 255, 255, 0.1);
  --underline-hover: rgb(255, 255, 255);
  --icon-box-shadow: 0 0 10px rgb(0, 0, 0);
  --content-card-icon-color: invert(90%);
}

body.light-mode {
  --bg: #f5f5f7;
  --card: #ffffff;
  --deep: #f0f0f2;
  --pill: #eaeaec;
  --border: #d1d1d6;
  --text: #1d1d1f;
  --muted: #86868b;

  --content-card-bg: #ffffff;
  --content-p-bg: #f2f2f7;
  --btn-bg: #e5e5e5;
  --btn-text: #1d1d1f;
  --btn-border: #d1d1d6;
  --icon-color: #1d1d1f;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --text-shadow: none;
  --text-shadow-hover: 0 0 30px rgba(0, 0, 0, 0.1);
  --pill-highlight: rgba(0, 0, 0, 0.05);
  --underline-hover: #000000;
  --icon-box-shadow: 0 0 1px rgb(0, 0, 0);
  --content-card-icon-color: invert(0%);
}

/* Intro Animation */
#intro-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease-out, visibility 0.6s;
}

.intro-content {
  text-align: center;
}

.intro-title {
  font-size: 4rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  font-family: 'Source Sans 3', sans-serif;
  opacity: 0;
  transform: scale(0.9);
  animation: intro-title-anim 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.3s;
}

.intro-subtitle {
  font-size: 1.5rem;
  color: var(--muted);
  margin-top: 15px;
  font-family: 'Montserrat', sans-serif;
  opacity: 0;
  transform: translateY(20px);
  animation: intro-subtitle-anim 0.8s ease-out forwards 1s;
}

@keyframes intro-title-anim {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes intro-subtitle-anim {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: 1100px;
  margin: 52px auto 48px;
  padding: 0 48px;
}

.profile-card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 50px 10px var(--shadow-color);
  gap: 20px;
}

.identity { display: flex; align-items: center; gap: 18px; }
.avatar { width: 172px; height: 172px; flex: 0 0 172px; background: white; border-radius: 50%; border: 1px solid #878787;}

.titles h1 {
  margin: 0 0 6px 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-family: 'Source Sans 3', ui-sans-serif, system-ui;
  text-shadow: var(--text-shadow);
  transition: all 0.3s ease-in-out
}

.titles h1:hover {
    letter-spacing: 3px;
    text-shadow: var(--text-shadow-hover);
}

.titles .subtitle {
  margin-top: -10px;
  font-size: 16px;
  color: var(--muted);
  font-family: 'Montserrat', ui-sans-serif, system-ui;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.contact-stack { display: flex; flex-direction: column; gap: 12px; }
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--pill);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px 6px 6px;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 var(--pill-highlight);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  font-family: inherit;
}

.contact-pill:hover {
    transform: scale(1.05);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
  padding: 0 20px 20px 20px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  display: flex;
  flex-direction: column;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.4);
  border-color: var(--text);
}

.project-image {
  height: 160px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-icon {
  font-size: 48px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  transition: transform 0.5s ease;
}

.project-card:hover .project-icon {
  transform: scale(1.2) rotate(-5deg);
}

.project-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text);
}

.project-content p {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  flex: 1;
}

.project-link {
  margin-top: 20px;
  display: inline-flex;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--underline-hover);
  text-decoration: underline;
}

.contact-pill:active {
    transform: scale(1);
}

.contact-pill .icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--icon-box-shadow);
  color: var(--icon-color);
}
.contact-pill .label {
  font-size: 14px;
  font-family: 'Source Sans 3', ui-sans-serif, system-ui;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.304);
}

.content-card {
  margin-top: 24px;
  background: var(--content-card-bg);
  border-radius: 14px;
  min-height: fit-content;
  box-shadow: 0 0 50px 10px var(--shadow-color);
  padding: 12px;
}

.content-card h2 {
    margin-top: 6px;
    text-shadow: var(--text-shadow);
    padding-left: 30px;
    transition: all 0.3s ease-in-out;
}

.content-card h2:hover {
    transform: scale(1.05);
}

.content-card p {
    padding: 15px;
    margin-right: 20px;
    margin-left: 20px;
    border-radius: 12px;
    background-color: var(--content-p-bg);
}

.content-card .icon {
    width: 24px;
    height: 24px;
    filter: var(--content-card-icon-color);
    filter: var(--content-card-icon-color);
}

.section-buttons {
    display: flex;
    padding: 15px;
    margin-right: 20px;
    margin-left: 20px;
    margin-top: -10px;
    gap: 12px;
    flex-wrap: wrap;
}

.section-buttons button {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 2px solid var(--btn-border);
    padding: 8px;
    padding-left: 12px;
    padding-right: 12px;
    font-weight: 700;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.section-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.section-buttons button:active {
    transform: scale(1);
    box-shadow: none;
}

.underlined-text{
 text-decoration: underline;
 text-decoration-color: transparent;
 transition: 0.3s;

 -webkit-text-decoration-color: transparent;
 -moz-text-decoration-color: transparent;
 width: fit-content;
}

.underlined-text:hover{
 text-decoration-color: var(--underline-hover);
 
 -webkit-text-decoration-color: var(--underline-hover);
 -moz-text-decoration-color: var(--underline-hover);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.modal.active {
  display: block;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 1px solid var(--border);
  z-index: 1001;
  transition: all 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.modal-content.cv-mode {
    max-width: 1000px;
    width: 95%;
    height: 90vh;
    padding: 20px;
}

.modal-content.cv-mode #cv-result {
    flex: 1;
    overflow: hidden;
    display: flex !important; 
    flex-direction: column;
    min-height: 0; 
}

.modal-content.cv-mode #pdf-container {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    height: 100% !important; 
    background: #525659;
    border-radius: 4px;
    padding: 10px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal h3 {
  margin-top: 0;
  color: var(--text);
  font-family: 'Source Sans 3', sans-serif;
  margin-bottom: 15px;
}

.modal p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.h-captcha {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.phone-display {
  margin-top: 20px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding: 0 20px 20px 20px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 0; 
  transform: translateY(20px);
}

.skill-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px -10px rgba(0,0,0,0.3);
  border-color: var(--text);
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
  transform: translateX(-100%);
  transition: 0.5s;
}

.skill-card:hover::before {
  transform: translateX(100%);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--pill);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text);
  transition: all 0.3s ease;
}

.skill-card:hover .card-icon {
  background: var(--text);
  color: var(--bg);
  transform: scale(1.1) rotate(5deg);
}

.skill-card h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
}

.skill-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  background: transparent;
  padding: 0;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--pill);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s;
}

.skill-card:hover .skill-tag {
  border-color: var(--muted);
  color: var(--text);
}

.skill-tag:hover {
  background: var(--text);
  color: var(--bg) !important;
  transform: scale(1.05);
}

.site-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-link {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text);
}

.legal-text h4 {
    color: var(--text);
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 16px;
}

.legal-text p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.legal-text a {
    color: var(--text);
    text-decoration: none;
}

.legal-text a:hover {
    text-decoration: underline;
}

#pdf-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@media (max-width: 768px) {
  .page {
    margin: 20px auto;
    padding: 0 16px;
  }
  
  .profile-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .identity {
    flex-direction: column;
    gap: 16px;
  }
  
  .avatar {
    margin: 0 auto;
  }
  
  .contact-stack {
    width: 100%;
    align-items: stretch;
  }
  
  .contact-pill {
    justify-content: center;
    width: 100%;
  }

  .projects-grid, .skills-grid {
    padding: 0;
  }
  
  .content-card p {
    margin: 0;
    padding: 10px;
  }
  
  .section-buttons {
    margin: 10px 0 0 0;
    padding: 10px;
    justify-content: center;
  }
  
  .titles h1 {
    font-size: 28px;
  }
}
