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

:root {
  --color-left-bg: #E1E1E1;
  --color-right-bg: #000000;
  --color-text-dark: #1A1A1A;
  --color-text-light: #FFFFFF;
  --color-text-muted: #888888;
}

html, body {
  height: 100%;
  height: 100dvh;
  font-family: 'Montserrat', -apple-system, sans-serif;
  background-color: var(--color-right-bg);
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  overflow: hidden;
}

.panel--left {
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: var(--color-left-bg);
  clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
  display: flex;
  flex-direction: column;
  padding: 50px 10%;
  z-index: 2;
}

.panel--right {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--color-right-bg);
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.info {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 460px;
}

.greeting {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 8px;
}

.name {
  font-size: clamp(2rem, 3.6vw, 3.5rem);
  font-weight: 800;
  color: var(--color-text-dark);
  line-height: 1.1;
  margin-bottom: 12px;
}

.profession {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Layout Helper Classes */
.mobile-only {
  display: none !important;
}
.desktop-only {
  display: flex !important;
}
p.desktop-only {
  display: block !important;
}

.address-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 40px;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.location-icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.address-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.address-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.address {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.contact-link {
  color: inherit !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--color-text-dark);
}

@media (max-width: 1024px) {
  .contact-link:hover {
    color: #ffffff;
  }
}

.overlay-bg {
  display: none;
}

.profile-pic {
  display: none;
}

.fullscreen-divider {
  display: none;
}

.buttons {
  display: flex;
  gap: 20px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--color-left-bg);
  color: #333333;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  /* Soft Neumorphic Shadow */
  box-shadow: 7px 7px 14px #bebebe, 
             -7px -7px 14px #ffffff;
}

.icon-btn svg {
  width: 26px;
  height: 26px;
  transition: transform 0.3s ease;
}

.icon-btn:hover {
  color: #1A1A1A;
  transform: translateY(-3px);
  box-shadow: 10px 10px 20px #b0b0b0, 
             -10px -10px 20px #ffffff;
}

.icon-btn:hover svg {
  transform: scale(1.15);
}

.icon-btn:active {
  transform: translateY(0);
  box-shadow: inset 4px 4px 8px #bebebe, 
              inset -4px -4px 8px #ffffff;
}

.icon-btn .flag {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 800;
  background: var(--color-left-bg);
  color: #1A1A1A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Matching neumorphic shadow for the badge */
  box-shadow: 3px 3px 6px #bebebe, 
             -3px -3px 6px #ffffff;
  z-index: 2;
  line-height: 1;
}

.lang-toggle {
  position: absolute;
  top: 40px;
  right: 40px;
  background: transparent;
  border: 2px solid var(--color-text-light);
  color: var(--color-text-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.lang-toggle:hover {
  background: var(--color-text-light);
  color: var(--color-right-bg);
}

.photo {
  max-height: 90vh;
  max-width: 45vw;
  object-fit: contain;
  object-position: bottom right;
  margin-right: 8%;
}

/* RTL Support */
[dir="rtl"] .panel--left {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 25% 100%);
  align-items: flex-start;
  text-align: right;
  padding-left: 0;
  padding-right: 10%;
  left: auto;
  right: 0;
}

[dir="rtl"] .panel--right {
  right: auto;
  left: 0;
}

[dir="rtl"] .photo {
  margin-right: 0;
  margin-left: 8%;
  object-position: bottom left;
}

[dir="rtl"] .lang-toggle {
  right: auto;
  left: 40px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
  p.mobile-only {
    display: block !important;
  }

  html, body {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .card {
    display: block;
    background-color: var(--color-right-bg);
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    touch-action: none;
  }

  .panel--left {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    clip-path: none;
    padding: 0;
    z-index: 2;
    pointer-events: none;
  }

  .panel--left > * {
    pointer-events: auto;
  }

  .overlay-bg {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    transform: translateY(calc((1 - var(--scroll-ratio, 0)) * 65vh));
    will-change: transform;
    z-index: 0;
  }

  .overlay-bg::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
  }

  @supports (backdrop-filter: blur(1px)) {
    .overlay-bg {
      background: rgba(0, 0, 0, 0.72);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
  }

  .panel--right {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    justify-content: center;
    align-items: flex-start;
    clip-path: none;
    background: var(--color-right-bg);
  }

  .photo {
    width: 100%;
    /* Photo now covers the full height, allowing the overlay to show it underneath */
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: top center;
    margin: 0;
  }

  /* Lang toggle moves to left where logo was */
  .lang-toggle {
    top: 30px;
    right: auto;
    left: 30px;
    z-index: 20;
    border-color: #ffffff;
    color: #ffffff;
    background: transparent;
  }

  .profile-pic {
    display: block;
    position: absolute;
    top: -160px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    opacity: var(--scroll-ratio, 0);
    pointer-events: none;
  }

  @media (min-height: 800px) {
    .profile-pic {
      top: -210px;
      width: 200px;
      height: 200px;
    }
  }

  @media (min-height: 900px) {
    .profile-pic {
      top: -230px;
      width: 200px;
      height: 200px;
    }
  }

  .fullscreen-divider {
    display: block;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    height: 2px;
    margin: calc(var(--scroll-ratio, 0) * 16px) 0;
    opacity: var(--scroll-ratio, 0);
    pointer-events: none;
  }

  .info {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 60px);
    max-width: 320px;
    margin: 0;
    z-index: 1;
    text-align: start;
    transform: translateX(-50%) translateY(calc(-50% + (1 - var(--scroll-ratio, 0)) * var(--info-offset, 30vh)));
    will-change: transform;
  }

  .greeting {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 4px;
  }

  .name {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    color: #ffffff;
    margin-bottom: 8px;
  }

  .profession {
    font-size: 0.95rem;
    color: #eeeeee;
    margin-bottom: 12px;
  }

  .address-container {
    gap: 16px;
    margin-bottom: 18px;
  }

  .address-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 0.85rem;
  }

  .address-buttons {
    display: flex;
    gap: 12px;
  }

  .address {
    font-size: 1em;
    color: #dddddd;
  }

  /* Vertical white outline icons for mobile */
  .icon-btn {
    width: 2.2em;
    height: 2.2em;
    background: rgba(255, 255, 255, calc(0.03 + var(--scroll-ratio, 0) * 0.05));
    border: 1px solid rgba(255, 255, 255, calc(0.06 + var(--scroll-ratio, 0) * 0.12));
    border-radius: 50%;
    color: #ffffff;
    box-shadow: none;
    margin: 0;
  }

  .icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: none;
    box-shadow: none;
  }

  .icon-btn:active {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(1px);
  }

  .icon-btn svg {
    width: 1.0em;
    height: 1.0em;
  }

  /* Hide flag badges in mobile */
  .icon-btn .flag {
    display: none;
  }

  /* Adjust RTL for mobile layout */
  [dir="rtl"] .panel--left {
    clip-path: none;
    padding: 0;
  }
  [dir="rtl"] .photo {
    margin: 0;
    object-position: bottom center;
  }
  [dir="rtl"] .lang-toggle {
    left: auto;
    right: 30px;
  }
  [dir="rtl"] .info {
    text-align: start;
  }

  .location-icon {
    color: #dddddd;
  }
}

@media (max-width: 480px) {
  .greeting {
    font-size: calc(0.95rem + var(--scroll-ratio, 0) * 0.15rem);
  }
  .name {
    font-size: calc(1.6rem + var(--scroll-ratio, 0) * 0.5rem);
  }
  .profession {
    font-size: calc(0.85rem + var(--scroll-ratio, 0) * 0.2rem);
  }
  .address-block {
    font-size: calc(0.75rem + var(--scroll-ratio, 0) * 0.15rem);
  }
}

@media (max-width: 1024px) and (min-height: 800px) {
  .greeting {
    font-size: calc(1.05rem + var(--scroll-ratio, 0) * 0.15rem);
  }
  .name {
    font-size: calc(1.7rem + var(--scroll-ratio, 0) * 0.5rem);
  }
  .profession {
    font-size: calc(0.95rem + var(--scroll-ratio, 0) * 0.20rem);
  }
  .address-block {
    font-size: calc(0.85rem + var(--scroll-ratio, 0) * 0.15rem);
  }
}

/* Tablet Responsiveness */
@media (min-width: 481px) and (max-width: 1024px) {
  .info {
    max-width: 520px;
  }

  .profile-pic {
    width: 240px;
    height: 240px;
    top: -260px;
  }

  .greeting {
    font-size: calc(1.2rem + var(--scroll-ratio, 0) * 0.2rem);
  }

  .name {
    font-size: calc(2.2rem + var(--scroll-ratio, 0) * 0.8rem);
  }

  .profession {
    font-size: calc(1.1rem + var(--scroll-ratio, 0) * 0.25rem);
  }

  .address-block {
    font-size: calc(1.0rem + var(--scroll-ratio, 0) * 0.15rem);
  }
}

@media (min-width: 481px) and (max-width: 1024px) and (min-height: 800px) {
  .profile-pic {
    top: -260px;
    width: 240px;
    height: 240px;
  }
}

@media (min-width: 481px) and (max-width: 1024px) and (min-height: 1000px) {
  .profile-pic {
    top: -300px;
    width: 260px;
    height: 260px;
  }
}
