/* ==========================================================================
   COMPONENTS & REUSABLE UI ELEMENTS — LIGHT & VIBRANT THEME
   ========================================================================== */

/* Floating Glass Dynamic Dock Navbar */
.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none; /* Allows click-through outside dock */
}

/* Three separate floating pills: brand · nav tabs · preferences.
   The wrapper only positions them; each pill carries its own glass surface. */
.nav-wrapper {
  pointer-events: none; /* gaps between pills stay click-through */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  max-width: 1220px;
  width: calc(100% - 48px);
}

/* Shared glass treatment for each of the three pills. */
.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(2, 132, 199, 0.15),
    0 0 30px rgba(2, 132, 199, 0.1);
  transition: var(--transition-normal);
}

.site-header.scrolled .nav-pill {
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.15),
    0 0 0 1px rgba(2, 132, 199, 0.25),
    0 0 40px rgba(244, 63, 94, 0.15);
}

/* Left pill — brand. Sits first in the DOM so it leads in both directions. */
.nav-pill-brand {
  gap: 12px;
  padding: 7px 20px 7px 8px;
  flex-shrink: 1;
  min-width: 0;
}

/* Centre pill — section tabs. */
.nav-pill-menu {
  gap: 4px;
  padding: 6px;
  flex-shrink: 0;
}

/* Right pill — theme, language, and the primary CTA. */
.nav-pill-actions {
  gap: 10px;
  padding: 7px 8px;
  flex-shrink: 0;
}

.brand-logo {
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

/* Name over role, matching the avatar height. */
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-role {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-avatar-wrapper {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-flutter), var(--blue-flutter));
  color: var(--text-on-accent);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-avatar-wrapper svg {
  width: 19px;
  height: 19px;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-logo:hover .brand-avatar-wrapper {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--cyan-flutter), var(--coral-accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-code);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
  transition: var(--transition-fast);
}

.brand-logo:hover .brand-icon {
  transform: rotate(180deg) scale(1.08);
}

.nav-menu {
  gap: 4px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--cyan-flutter);
  background: rgba(2, 132, 199, 0.08);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan-flutter), var(--blue-flutter));
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.nav-link.active::after {
  display: none; /* Replaced traditional underline with floating capsule pill */
}

.nav-actions {
  gap: 10px;
}

.nav-cta-mobile {
  display: none;
}

/* Mobile Menu Toggle — hidden on desktop, shown at <=768px */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.menu-toggle:hover {
  border-color: var(--cyan-flutter);
  color: var(--cyan-flutter);
}

/* Availability Badge */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  color: #059669;
  font-size: 0.85rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--emerald-success);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Button System — Cheerful Gradient & Crisp Shadows */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-flutter) 0%, #0369a1 50%, var(--violet-accent) 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(2, 132, 199, 0.45);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover {
  background: var(--surface-inset);
  border-color: var(--cyan-flutter);
  transform: translateY(-2px);
  color: var(--cyan-flutter);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

/* Official Store Badge Buttons */
.store-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000000;
  color: #ffffff !important;
  padding: 8px 18px;
  border-radius: 10px;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

.store-badge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  background: var(--surface-invert);
}

.store-badge-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.store-badge-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.store-badge-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

/* Cheerful Glassmorphism Card System */
.glass-card {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: var(--transition-normal);
  position: relative;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--cyan-flutter);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08), var(--shadow-glow-cyan);
  transform: translateY(-4px);
}

/* Tech Tag Pills */
.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.06);
  border: 1px solid rgba(2, 132, 199, 0.15);
  color: var(--cyan-flutter);
  font-family: var(--font-code);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.tech-pill:hover {
  border-color: var(--cyan-flutter);
  color: #fff;
  background: var(--cyan-flutter);
}


/* Two-column layouts that must collapse on narrow screens.
   Defined as classes (not inline styles) so media queries can override them. */
.split-2col {
  grid-template-columns: 1fr 1fr;
}

/* About profile: portrait keeps its natural proportion, copy sits beside it */
.about-profile-grid {
  /* Size the portrait column to the image itself so no dead space is left
     between it and the copy. */
  grid-template-columns: auto 1fr;
}

/* Keep the portrait a natural size instead of stretching to fill the column */
.about-portrait-frame {
  width: 340px;
  max-width: 100%;
}

.form-row-2col {
  grid-template-columns: 1fr 1fr;
}

/* Process timeline and capability cards — column counts live here so
   media queries can collapse them (inline styles cannot be overridden). */
.process-grid {
  grid-template-columns: repeat(5, 1fr);
}

.process-card-text {
  font-size: 0.8rem;
}

.capability-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* Footer contact links: padded so each is a comfortable tap target */
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
}

/* Card padding lives here rather than inline so the mobile breakpoints can
   reduce it — an inline style would outrank them. */
.project-card,
.contact-card {
  padding: 48px;
}

/* Project screenshots are wide marketing shots. Cropping them to a fixed
   380px box cut up to 44% off the sides in a narrow column, so fit the whole
   image inside the box instead. */
.project-media {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
}

/* Form Controls */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
}

/* Placeholder contrast is set explicitly — the browser default is tuned for
   light backgrounds and washes out on the dark theme. */
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--cyan-flutter);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  outline: none;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Code Snippet Container — Crisp Dark Editor Slate Theme */
.code-block {
  background: var(--surface-invert);
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-family: var(--font-code);
  font-size: 0.88rem;
  color: var(--text-on-invert);
  overflow-x: auto;
  line-height: 1.6;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.12);
}

.code-keyword { color: #f43f5e; }
.code-type { color: #38bdf8; }
.code-string { color: #34d399; }
.code-function { color: #c084fc; }
.code-comment { color: #64748b; font-style: italic; }

/* Direct Contact Channel Buttons — WhatsApp / Email / LinkedIn */
.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.contact-channel-btn {
  width: 100%;
  padding: 16px 26px;
  font-size: 1.02rem;
}

.contact-channel-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #12b350 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.32);
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(37, 211, 102, 0.42);
  color: #ffffff;
}

.btn-linkedin {
  background: linear-gradient(135deg, #0a66c2 0%, #084d94 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(10, 102, 194, 0.32);
}

.btn-linkedin:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(10, 102, 194, 0.42);
  color: #ffffff;
}

.contact-channels-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.contact-channels-divider::before,
.contact-channels-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}


/* ==========================================================================
   THEME & LANGUAGE TOGGLES
   ========================================================================== */
.pref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pref-btn:hover {
  color: var(--cyan-flutter);
  border-color: var(--cyan-flutter);
  background: var(--cyan-glow);
}

.pref-btn svg {
  width: 18px;
  height: 18px;
}

.pref-btn-lang {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

/* Sound: muted by default, so the button offers "turn on". */
.pref-icon-sound-on { display: block; }
.pref-icon-sound-off { display: none; }

#sfx-mute-btn[aria-pressed="true"] .pref-icon-sound-on { display: none; }
#sfx-mute-btn[aria-pressed="true"] .pref-icon-sound-off { display: block; }

/* Show the icon for the theme the button switches TO. */
.pref-icon-moon { display: block; }
.pref-icon-sun { display: none; }

[data-theme="dark"] .pref-icon-moon { display: none; }
[data-theme="dark"] .pref-icon-sun { display: block; }
