@import url('./components/theme-language-toggle.css');
@import url('./components/back-to-top.css');
@import url('./sections/career.css');
@import url('./sections/projects-showcase.css');
@import url('./sections/contact.css');

:root {
  /* Light theme */
  --bg-main: #FAF9F7;
  --bg-secondary: #F8F7FB;
  --surface: rgba(255, 255, 255, 0.82);
  --text-primary: #111;
  --text-secondary: #666;
  --text-tertiary: #8A8495;
  --border-soft: rgba(91, 76, 132, 0.15);
  --accent: #7446EF;
  --section-top-padding: 48px;
  --hero-text: #FFFFFF; /* Text light on dark video */
  --hero-icon-filter: brightness(0) invert(1); /* White icons */
}

[data-theme="dark"] {
  --bg-main: #0F1115;
  --bg-secondary: #151821;
  --surface: rgba(26, 30, 40, 0.88);
  --text-primary: #F5F2FA;
  --text-secondary: #C7C0D9;
  --text-tertiary: #9B94AE;
  --border-soft: rgba(255, 255, 255, 0.08);
  --accent: #9B6DFF;
  --hero-text: #F7F4FB;
  --hero-icon-filter: brightness(0) invert(1);
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

html, body {
  margin: 0;
  padding: 0;
}

.section-divider {
  display: flex;
  width: min(210px, 56vw);
  align-items: center;
  gap: 16px;
  margin: 22px auto;
}

.section-divider::before,
.section-divider::after {
  content: "";
  display: block;
  height: 1.5px;
  flex: 1;
  background: linear-gradient(90deg, transparent 0%, rgba(116, 70, 239, 0.48) 100%);
}

.section-divider::after {
  background: linear-gradient(90deg, rgba(116, 70, 239, 0.48) 0%, transparent 100%);
}

.section-divider span {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  background: #6953bd;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 2px 5px rgba(105, 83, 189, 0.25));
}

[data-theme="dark"] .section-divider::before {
  background: linear-gradient(90deg, transparent 0%, rgba(151, 126, 255, 0.62) 100%);
}

[data-theme="dark"] .section-divider::after {
  background: linear-gradient(90deg, rgba(151, 126, 255, 0.62) 0%, transparent 100%);
}

.featured-section-title {
  position: relative;
  display: inline-block;
  margin: 0;
  color: var(--text-primary);
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(3rem, 5vw, 4.3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.featured-section-title::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -8px;
  bottom: 2px;
  left: 18%;
  height: 11px;
  border-radius: 50%;
  background: rgba(116, 70, 239, 0.24);
  filter: blur(5px);
}

[data-theme="dark"] .featured-section-title::after {
  background: rgba(155, 109, 255, 0.28);
}

.load-error {
  margin: 2rem;
  color: #b42318;
  text-align: center;
}

/* Hero */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

[data-theme="dark"] .hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 17, 21, 0.2), rgba(15, 17, 21, 0.52));
  pointer-events: none;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.hero-contact-button {
  font-family: 'Inter', system-ui, sans-serif;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid var(--hero-text);
  background: rgba(174, 171, 171, 0.415);
  backdrop-filter: blur(10px);
  color: var(--hero-text);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-contact-button:hover {
  background: rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
  transform: scale(1.05);
}

.hero video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -1;
}

.hero-bottom-left {
  font-style: normal;
  position: absolute;
  bottom: 50px;
  left: 50px;
  color: var(--hero-text);
  line-height: 1;
  z-index: 1;
  text-align: left;
  transition: color 0.6s ease;
}

[data-theme="dark"] .hero-bottom-left .hero-title {
  color: #D3CADF;
}

[data-theme="dark"] .hero-contact-button,
[data-theme="dark"] .toggle-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(15, 17, 21, 0.3);
  box-shadow: 0 10px 30px rgba(5, 6, 9, 0.18);
}

.hero-name {
  font-family: 'Canela', serif;
  font-optical-sizing: auto;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
  
  font-size: 150px;
  font-weight: 700;
  margin: 0;
  margin-left: -0.04em;
}

.hero-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-optical-sizing: auto;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
  font-size: 40px;
  font-weight: 400;
  margin: 0;
  margin-top: 10px;
}

.hero-social-links {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  align-items: center;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.hero-social-links a {
  display: block;
  width: 40px;
  height: 40px;
  overflow: visible;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
  position: relative;
  cursor: pointer;
}

/* Custom tooltip that follows cursor */
.custom-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hero-social-links a img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
  filter: var(--hero-icon-filter);
}

.hero-social-links a:hover img {
  transform: scale(1.2);
  opacity: 0.8;
  filter: var(--hero-icon-filter);
}

@media (max-width: 640px) {
  .hero {
    height: 100svh;
    min-height: 560px;
  }

  .hero-buttons {
    top: max(14px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    left: max(16px, env(safe-area-inset-left));
    justify-content: flex-end;
    gap: 10px;
  }

  .lang-selector {
    margin-right: auto;
    font-size: 14px;
  }

  .lang-selector button + button {
    margin-left: 14px;
  }

  .lang-selector button + button::before {
    left: -9px;
  }

  .toggle-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 11px;
  }

  .toggle-btn::before {
    width: 21px;
    height: 21px;
  }

  .hero-contact-button {
    min-height: 44px;
    padding: 9px 15px;
    font-size: 14px;
    white-space: nowrap;
  }

  .hero-bottom-left {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
    left: max(20px, env(safe-area-inset-left));
  }

  .hero-name {
    font-size: clamp(4rem, 20vw, 6.5rem);
    line-height: 0.92;
  }

  .hero-title {
    margin-top: 14px;
    font-size: clamp(1.25rem, 6vw, 1.8rem);
    line-height: 1.2;
  }

  .hero-social-links {
    gap: 15px;
    margin-top: 18px;
  }

  .hero-social-links a {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 380px) {
  .hero-buttons {
    gap: 8px;
  }

  .hero-contact-button {
    padding-inline: 12px;
    font-size: 13px;
  }

  .toggle-btn {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    height: 100svh;
    min-height: 400px;
  }

  .hero-bottom-left {
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .hero-name {
    font-size: clamp(3.5rem, 13vw, 6rem);
  }

  .hero-title {
    margin-top: 8px;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
  }

  .hero-social-links {
    margin-top: 12px;
  }
}
