/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --bg: #E0E5EC;
  --text: #3D4852;
  --text-muted: #6B7280;
  --accent: #6C63FF;
  --accent-light: #8B84FF;
  --accent-glow: rgba(108, 99, 255, 0.25);
  --teal: #38B2AC;

  --sh-light: rgba(255, 255, 255, 0.7);
  --sh-dark: rgba(163, 177, 198, 0.6);
  --sh-light-h: rgba(255, 255, 255, 0.8);
  --sh-dark-h: rgba(163, 177, 198, 0.7);

  --raised: 9px 9px 16px var(--sh-dark), -9px -9px 16px var(--sh-light);
  --raised-lg: 12px 12px 20px var(--sh-dark-h), -12px -12px 20px var(--sh-light-h);
  --raised-sm: 5px 5px 10px var(--sh-dark), -5px -5px 10px var(--sh-light);
  --raised-xs: 3px 3px 6px var(--sh-dark), -3px -3px 6px var(--sh-light);

  --well: inset 6px 6px 10px var(--sh-dark), inset -6px -6px 10px var(--sh-light);
  --well-deep: inset 10px 10px 20px var(--sh-dark-h), inset -10px -10px 20px var(--sh-light-h);
  --well-sm: inset 3px 3px 6px var(--sh-dark), inset -3px -3px 6px var(--sh-light);

  --space-xs: clamp(4px, 1vw, 8px);
  --space-sm: clamp(8px, 2vw, 16px);
  --space-md: clamp(16px, 3.5vw, 28px);
  --space-lg: clamp(24px, 5vw, 40px);
  --space-xl: clamp(32px, 7vw, 56px);

  --radius-card: 28px;
  --radius-btn: 16px;
  --radius-inner: 12px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[dir="rtl"] { text-align: right; }

.font-display {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent) !important;
  border-radius: inherit;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: var(--space-sm);
  padding-top: 76px;
  padding-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 768px) {
  .page {
    max-width: 680px;
    padding-top: 92px;
    gap: var(--space-md);
  }
}

@media (min-width: 1024px) {
  .page { max-width: 820px; }
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  pointer-events: none;
}

.nav-pill {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--raised);
  pointer-events: all;
}

@media (min-width: 768px) { .nav-pill { max-width: 680px; } }
@media (min-width: 1024px) { .nav-pill { max-width: 820px; } }

.logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(16px, 3.5vw, 20px);
  letter-spacing: 0.02em;
  color: var(--accent);
}

.nav-actions { display: flex; gap: 8px; }

/* ============================================
   ICON BUTTON
   ============================================ */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.icon-btn:hover { color: var(--accent); transform: translateY(-1px); box-shadow: var(--raised); }
.icon-btn:active { transform: translateY(1px); box-shadow: var(--well-sm); }
.icon-btn svg { width: 20px; height: 20px; }

/* ============================================
   BENTO GRID — The core layout system
   ============================================ */
.bento-row {
  display: grid;
  gap: var(--space-sm);
}

.bento-card {
  background: var(--bg);
  border-radius: var(--radius-card);
  box-shadow: var(--raised);
  padding: var(--space-md);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--raised-lg);
}

/* Small icon in top-left of content cards */
.bento-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-inner);
  background: var(--bg);
  box-shadow: var(--well-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}

.bento-card-icon svg {
  width: 18px;
  height: 18px;
}

.bento-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ── Identity Row (Photo + Name) ── */
.bento-identity {
  grid-template-columns: 120px 1fr;
  align-items: stretch;
}

@media (min-width: 400px) {
  .bento-identity { grid-template-columns: 140px 1fr; }
}

@media (min-width: 768px) {
  .bento-identity { grid-template-columns: 180px 1fr; }
}

/* Photo tile */
.bento-photo {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--well-deep);
  aspect-ratio: auto;
}

.bento-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 20px;
  box-shadow: var(--raised-sm);
}

.bento-photo:hover {
  transform: none;
  box-shadow: var(--well-deep);
}

.bento-photo:hover img {
  transform: scale(1.03);
  transition: transform 0.5s ease;
}

/* Name tile */
.bento-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-md) var(--space-md);
}

.bento-name .greeting {
  font-size: clamp(13px, 3vw, 15px);
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
  display: block;
}

.bento-name h1 {
  font-size: clamp(24px, 5.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.bento-name .role {
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Info Row (Bio + Contact) ── */
.bento-info {
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .bento-info {
    grid-template-columns: 1.2fr 1fr;
  }
}

.bento-bio p {
  font-size: clamp(14px, 3vw, 15px);
  color: var(--text-muted);
  line-height: 1.7;
}

/* Contact stack */
.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  background: var(--bg);
  box-shadow: var(--raised-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.contact-chip svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--raised);
  color: var(--accent);
}

.contact-chip:active {
  transform: translateY(1px);
  box-shadow: var(--well-sm);
}

/* ── Skills Card ── */
.bento-skills {
  /* full width, no grid needed */
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--bg);
  box-shadow: var(--raised-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.3s ease;
  cursor: default;
  white-space: nowrap;
}

.skill-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--raised-sm);
  color: var(--accent);
}

.skill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.bento-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-sm);
}

.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.bento-section-header h2 {
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.service-card {
  background: var(--bg);
  border-radius: var(--radius-card);
  box-shadow: var(--raised);
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--raised-lg);
}

.service-card.active {
  box-shadow: var(--raised-lg);
}

.service-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.service-icon-well {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--well-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all 0.3s ease;
}

.service-card.active .service-icon-well {
  box-shadow: var(--raised-sm);
}

.service-icon-well svg {
  width: 22px;
  height: 22px;
}

.service-header-text {
  flex: 1;
  min-width: 0;
}

.service-header-text h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(15px, 3.5vw, 18px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.service-header-text p {
  font-size: clamp(12px, 2.8vw, 14px);
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-card.active .service-header-text p {
  -webkit-line-clamp: unset;
}

.expand-chevron {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--raised-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-muted);
}

.service-card.active .expand-chevron {
  box-shadow: var(--well-sm);
  transform: rotate(180deg);
}

.expand-chevron svg {
  width: 14px;
  height: 14px;
}

.service-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.service-card.active .service-detail {
  max-height: 350px;
  opacity: 1;
}

.service-detail-inner {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 2px solid rgba(163, 177, 198, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.detail-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  background: var(--bg);
  box-shadow: var(--well-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-top: 1px;
}

.detail-check svg {
  width: 11px;
  height: 11px;
}

/* ============================================
   PHONE CONTACT MENU
   ============================================ */
.phone-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(224, 229, 236, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phone-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) {
  .phone-menu-overlay { align-items: center; }
}

.phone-menu {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border-radius: var(--radius-card);
  box-shadow: var(--raised-lg);
  padding: var(--space-md);
  transform: translateY(30px);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.phone-menu-overlay.open .phone-menu {
  transform: translateY(0);
}

.phone-menu-header {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(163, 177, 198, 0.2);
}

.phone-menu-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.phone-menu-header p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.phone-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  background: var(--bg);
  box-shadow: var(--raised-sm);
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.3s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

body[dir="rtl"] .phone-menu-item { text-align: right; }

.phone-menu-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--raised);
  color: var(--accent);
}

.phone-menu-item:active {
  transform: translateY(1px);
  box-shadow: var(--well-sm);
}

.phone-menu-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-inner);
  background: var(--bg);
  box-shadow: var(--well-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phone-menu-icon svg { width: 18px; height: 18px; }
.phone-menu-icon.whatsapp { color: #25D366; }
.phone-menu-icon.telegram { color: #0088cc; }
.phone-menu-icon.viber { color: #7360F2; }
.phone-menu-icon.call { color: var(--teal); }
.phone-menu-icon.copy { color: var(--accent); }

.phone-menu-cancel {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-btn);
  background: var(--bg);
  box-shadow: var(--raised-sm);
  border: none;
  cursor: pointer;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.phone-menu-cancel:hover { color: var(--text); box-shadow: var(--raised); }
.phone-menu-cancel:active { box-shadow: var(--well-sm); }

/* Copied toast */
.copied-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  background: var(--bg);
  box-shadow: var(--raised);
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.copied-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   LANGUAGE MODAL
   ============================================ */
.lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(224, 229, 236, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lang-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lang-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg);
  border-radius: 32px;
  box-shadow: var(--raised-lg);
  padding: var(--space-lg) var(--space-md);
  transform: scale(0.92) translateY(16px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lang-overlay.open .lang-card {
  transform: scale(1) translateY(0);
}

.lang-card-header {
  text-align: center;
  margin-bottom: var(--space-md);
}

.lang-card-header h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.lang-card-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

body[dir="rtl"] .lang-option { text-align: right; }

.lang-option:hover { transform: translateY(-1px); box-shadow: var(--raised); }
.lang-option:active { transform: translateY(1px); box-shadow: var(--well); }

.lang-flag {
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--well-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lang-text-group { display: flex; flex-direction: column; }
.lang-primary { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 14px; color: var(--text); }
.lang-secondary { font-size: 12px; color: var(--text-muted); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: var(--space-md) 0 0;
}

.footer p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in skill cloud */
.skills-cloud .reveal:nth-child(1) { transition-delay: 0.02s; }
.skills-cloud .reveal:nth-child(2) { transition-delay: 0.04s; }
.skills-cloud .reveal:nth-child(3) { transition-delay: 0.06s; }
.skills-cloud .reveal:nth-child(4) { transition-delay: 0.08s; }
.skills-cloud .reveal:nth-child(5) { transition-delay: 0.10s; }
.skills-cloud .reveal:nth-child(6) { transition-delay: 0.12s; }
.skills-cloud .reveal:nth-child(7) { transition-delay: 0.14s; }
.skills-cloud .reveal:nth-child(8) { transition-delay: 0.16s; }

/* ============================================
   AMBIENT DECORATION
   ============================================ */
.ambient {
  position: fixed;
  border-radius: 50%;
  background: var(--bg);
  z-index: -1;
  pointer-events: none;
}

.ambient-1 {
  width: clamp(180px, 35vw, 350px);
  height: clamp(180px, 35vw, 350px);
  top: -8%;
  right: -12%;
  box-shadow: var(--raised-lg);
  animation: float-slow 8s ease-in-out infinite;
}

.ambient-2 {
  width: clamp(100px, 20vw, 200px);
  height: clamp(100px, 20vw, 200px);
  bottom: 12%;
  left: -8%;
  box-shadow: var(--well-deep);
  animation: float-slow 10s ease-in-out infinite reverse;
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

/* ============================================
   iOS SAFE AREAS
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .page {
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
  .header {
    padding-top: calc(var(--space-xs) + env(safe-area-inset-top));
  }
}
