/* ============================================================
   PORTFOLIO — BASE & ANIMATION STYLES
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Original+Surfer&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Share+Tech&display=swap');

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

html, body {
  height: 100%;
  font-family: "Original Surfer", cursive, sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

p {
  font-family: "Share Tech", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  cursor: crosshair;
  background: #f9fafb;
}

main { flex: 1; }

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

nav.nav-scrolled {
  background: rgba(251, 146, 60, 0.88) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(251, 146, 60, 0.35);
}

.nav-active {
  background-color: rgba(0, 0, 0, 0.2) !important;
}

#logo {
  font-family: "Original Surfer", cursive;
  letter-spacing: 0.02em;
}

/* Mobile menu slide-down animation */
@keyframes menuSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Language switcher (flag buttons) ── */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  font-family: inherit;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lang-btn:active {
  transform: scale(0.95);
}

.lang-btn.lang-active {
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.lang-btn .lang-flag {
  font-size: 1rem;
  line-height: 1;
}

/* Mobile: shown inside the hamburger menu (see .mobile-menu-actions) */
.lang-switcher-mobile {
  display: inline-flex;
}

@media (min-width: 640px) {
  .lang-switcher-mobile { display: none; }
}

/* ── Mobile menu actions row (lang + theme toggle inside hamburger menu) ── */
.mobile-menu-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.mobile-menu-actions .lang-switcher,
.mobile-menu-actions .theme-toggle { margin-left: 0; }

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
}

@keyframes zoomOut {
  0%   { opacity: 0; transform: scale(1.4); }
  8%   { opacity: 1; }
  75%  { opacity: 1; transform: scale(1.0); }
  90%  { opacity: 0; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.0); }
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  animation: zoomOut 18s ease-in-out infinite;
  z-index: 0;
}

.slide-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

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

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

#hero-image {
  border: 3px solid rgba(251, 146, 60, 0.6);
  box-shadow: 0 0 40px rgba(251, 146, 60, 0.45), 0 0 80px rgba(251, 146, 60, 0.15);
  transition: box-shadow 0.4s ease, transform 0.3s ease;
}

#hero-image:hover {
  box-shadow: 0 0 60px rgba(251, 146, 60, 0.7), 0 0 120px rgba(251, 146, 60, 0.3);
  transform: scale(1.06) !important;
}

@keyframes floatImg {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* Hero entrance animations (CSS-driven, no JS dependency) */
@keyframes heroFadeDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroPopIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 0.9; transform: scale(1); }
}

#hero-title {
  animation: heroFadeDown 0.7s ease 0.15s both;
}
#hero-subtitle {
  animation: heroFadeDown 0.7s ease 0.35s both;
}
#hero-image {
  animation: heroFadeUp 0.8s cubic-bezier(0.34,1.26,0.64,1) 0.55s both, floatImg 4s ease-in-out 1.5s infinite;
}

/* Typewriter cursor */
.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #fed7aa;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blinkCursor 0.8s step-end infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   ABOUT & SECTION HEADINGS
   ============================================================ */
#about-me, #portfolio-description {
  text-align: center;
  margin: 0 auto;
  padding: 0 1rem;
}

#hero h1, #about, #languages, #portfolio, #contact {
  font-family: "Original Surfer", cursive;
}

h1 {
  color: white;
}

/* ============================================================
   SKILL BARS
   ============================================================ */
.skill-row {
  margin-bottom: 1.1rem;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-family: "Share Tech", sans-serif;
}

.skill-bar-track {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.skill-bar-fill {
  height: 100%;
  width: 0%;               /* animated to data-width */
  background: linear-gradient(90deg, #f97316, #fb923c, #fed7aa);
  border-radius: 999px;
  position: relative;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.5);
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35));
  border-radius: 0 999px 999px 0;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { opacity: 0.4; }
  50%  { opacity: 1;   }
  100% { opacity: 0.4; }
}

/* ============================================================
   3D TILT CARDS
   ============================================================ */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.4s ease;
  border-radius: 12px;
  overflow: hidden;
}

.tilt-card:hover {
  box-shadow: 0 24px 48px rgba(0,0,0,0.22), 0 8px 16px rgba(251,146,60,0.25);
  z-index: 10;
}

/* Card inner content */
.card-inner {
  transform-style: preserve-3d;
}

/* ============================================================
   PROJECT / PORTFOLIO CARDS
   ============================================================ */
.project-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: box-shadow 0.4s ease;
  position: relative;
}

.project-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.04);
}

.project-card-body {
  padding: 1.2rem 1.4rem 1.4rem;
}

/* Portfolio image overlay */
.portfolio-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
}

.portfolio-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease, filter 0.4s ease;
}

.portfolio-card:hover img {
  transform: scale(1.06);
  filter: brightness(0.65);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: linear-gradient(135deg, rgba(251,146,60,0.75), rgba(217,70,0,0.75));
  text-align: center;
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  color: #fff;
  font-size: 1.3rem;
  font-family: "Original Surfer", cursive;
  margin-bottom: 0.5rem;
  transform: translateY(12px);
  transition: transform 0.4s ease 0.05s;
}

.portfolio-overlay p {
  color: #fff2e8;
  font-size: 0.9rem;
  transform: translateY(12px);
  transition: transform 0.4s ease 0.1s;
}

.portfolio-card:hover .portfolio-overlay h3,
.portfolio-card:hover .portfolio-overlay p {
  transform: translateY(0);
}

.visit-btn {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.4rem 1.1rem;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: "Share Tech", sans-serif;
  transform: translateY(12px);
  transition: transform 0.4s ease 0.15s, background 0.2s ease;
}

.portfolio-card:hover .visit-btn { transform: translateY(0); }
.visit-btn:hover { background: rgba(255,255,255,0.35); }

/* Portfolio card body — outcome + testimonial */
.portfolio-card { background: #fff; }

.portfolio-media {
  position: relative;
  overflow: hidden;
}

.portfolio-card-body {
  padding: 1.1rem 1.4rem 1.3rem;
  border-top: 1px solid #fed7aa;
  background: #fff;
}

.portfolio-outcome {
  font-family: "Share Tech", sans-serif;
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.55;
}

.testimonial {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  background: #fff7ed;
  border-left: 3px solid #fb923c;
  border-radius: 6px;
}

.testimonial p {
  font-family: "Share Tech", sans-serif;
  font-style: italic;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.testimonial cite {
  font-family: "Share Tech", sans-serif;
  font-style: normal;
  color: #ea580c;
  font-size: 0.8rem;
  font-weight: 600;
}

.testimonial-empty { display: none; }

/* ============================================================
   BADGE / TECH TAG
   ============================================================ */
.tech-tag {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-size: 0.75rem;
  font-family: "Share Tech", sans-serif;
  margin: 0.2rem 0.15rem 0;
}

/* ============================================================
   SCROLL ANIMATION HELPERS
   (no CSS hiding — GSAP sets initial state; elements stay
    visible if JS fails or hasn't run yet)
   ============================================================ */
.anim-fade-up  {}
.anim-scale-in {}

/* ============================================================
   SECTION ICONS (floating)
   ============================================================ */
.section-icon {
  animation: floatIcon 3.5s ease-in-out infinite;
}

.section-icon:nth-child(odd) { animation-delay: 0.8s; }

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 1.2rem 1rem;
}

footer img {
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: brightness(0.9);
}

footer img:hover {
  transform: scale(1.2) rotate(-5deg);
  filter: brightness(1.1) drop-shadow(0 0 6px rgba(255,255,255,0.6));
}

/* ============================================================
   FORMS
   ============================================================ */
input, textarea {
  box-shadow: 0.25rem 0.25rem 5px rgba(0,0,0,0.08);
  border: 1px solid #d1d5db;
  padding: 0.6rem 0.75rem;
  font-family: "Share Tech", sans-serif;
  font-size: 1rem;
  width: 100%;
  max-width: 600px;
  display: block;
  margin: 0.5rem auto;
  border-radius: 8px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input:focus, textarea:focus {
  border-color: #fb923c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.2);
}

/* ============================================================
   GLOW HEADINGS
   ============================================================ */
.glow-text {
  text-shadow: 0 0 24px rgba(251, 146, 60, 0.4);
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 768px) {
  #my-portfolio { height: auto; }

  .tilt-card {
    /* disable 3D tilt on touch; keep shadow hover */
    transform: none !important;
  }

  .portfolio-overlay {
    opacity: 1;
    background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 60%);
    justify-content: flex-end;
    padding-bottom: 1rem;
  }

  .portfolio-overlay h3 { transform: translateY(0); font-size: 1rem; }
  .portfolio-overlay p  { display: none; }
  .visit-btn            { transform: translateY(0); }

  @keyframes floatImg { 0%, 100% { transform: none; } }

  #hero-image { animation: none; }
}

/* ============================================================
   SCROLLBAR (optional polish)
   ============================================================ */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #fb923c; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #ea580c; }

/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection { background: rgba(251,146,60,0.3); color: inherit; }

/* ============================================================
   FLOATING WHATSAPP BUTTON (draggable)
   ============================================================ */
#whatsapp-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background-color: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(0,0,0,0.15);
  cursor: grab;
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#whatsapp-fab:hover { transform: scale(1.08); box-shadow: 0 10px 24px rgba(37, 211, 102, 0.55), 0 4px 10px rgba(0,0,0,0.2); }
#whatsapp-fab:active { cursor: grabbing; }
#whatsapp-fab.is-dragging { transition: none; cursor: grabbing; transform: scale(1.05); }
#whatsapp-fab svg { width: 32px; height: 32px; pointer-events: none; }
#whatsapp-fab::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 2px solid rgba(37, 211, 102, 0.4);
  opacity: 0;
  animation: wa-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (max-width: 640px) {
  #whatsapp-fab { width: 54px; height: 54px; left: 14px; bottom: 14px; }
  #whatsapp-fab svg { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  #whatsapp-fab::after { animation: none; }
  #whatsapp-fab { transition: none; }
}

/* ============================================================
   THEME TOGGLE BUTTON (sun / moon)
   ============================================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.25s ease, color 0.2s ease;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.28); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 18px; height: 18px; display: block; transition: transform 0.4s ease; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }
.theme-toggle-mobile { margin-left: 6px; }
@media (min-width: 640px) {
  .theme-toggle-mobile { display: none; }
}

/* ============================================================
   DARK MODE OVERRIDES
   Applied when <html> has the `dark` class.
   Selectors prefixed with html.dark beat the matching Tailwind
   utility classes via higher specificity.
   ============================================================ */
html.dark { color-scheme: dark; }

html.dark body {
  background: #0b1220;
  color: #e5e7eb;
}

/* Section backgrounds */
html.dark .bg-white       { background-color: #111827 !important; }
html.dark .bg-gray-50     { background-color: #0d1626 !important; }
html.dark .bg-gray-100    { background-color: #0f172a !important; }
html.dark .bg-gray-200    { background-color: #1f2937 !important; }
html.dark .bg-orange-50   { background-color: rgba(251, 146, 60, 0.10) !important; }
html.dark .bg-orange-100  { background-color: rgba(251, 146, 60, 0.18) !important; }
/* Orange accent backgrounds stay vivid — only nudged slightly for contrast */
html.dark .bg-orange-400  { background-color: #ea580c !important; }
html.dark .bg-orange-500  { background-color: #c2410c !important; }
html.dark .bg-orange-600  { background-color: #9a3412 !important; }

/* Hover utilities */
html.dark .hover\:bg-orange-300:hover { background-color: #f97316 !important; }
html.dark .hover\:bg-orange-500:hover { background-color: #c2410c !important; }

/* Text colors */
html.dark .text-gray-400 { color: #6b7280 !important; }
html.dark .text-gray-500 { color: #9ca3af !important; }
html.dark .text-gray-600 { color: #cbd5e1 !important; }
html.dark .text-gray-700 { color: #e2e8f0 !important; }
html.dark .text-gray-800 { color: #f1f5f9 !important; }
html.dark .text-gray-900 { color: #f8fafc !important; }
/* Keep orange accents but lift them a touch for dark legibility */
html.dark .text-orange-400 { color: #fb923c !important; }
html.dark .text-orange-500 { color: #fb923c !important; }
html.dark .text-orange-600 { color: #fdba74 !important; }
html.dark .hover\:text-orange-300:hover { color: #fed7aa !important; }

/* Borders */
html.dark .border-gray-100 { border-color: #1f2937 !important; }
html.dark .border-gray-200 { border-color: #334155 !important; }
html.dark .border-orange-400 { border-color: #ea580c !important; }

/* Navigation (orange stays, just deepen scrolled state) */
html.dark nav.nav-scrolled {
  background: rgba(154, 52, 18, 0.88) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

/* Cards / generic white surfaces inside dark sections */
html.dark .project-card,
html.dark .portfolio-card-body {
  background: #111827;
  border-color: #1f2937;
}

html.dark .project-card { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45); }

/* Skill bar track */
html.dark .skill-bar-track {
  background: #1f2937;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Tech tag */
html.dark .tech-tag {
  background: rgba(251, 146, 60, 0.12);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.45);
}

/* Testimonials */
html.dark .testimonial {
  background: #1a2436;
  border-left-color: #fb923c;
}
html.dark .testimonial p { color: #cbd5e1; }
html.dark .testimonial cite { color: #fdba74; }

/* Forms */
html.dark input,
html.dark textarea {
  background: #111827;
  color: #e5e7eb;
  border-color: #334155;
  box-shadow: 0.25rem 0.25rem 5px rgba(0, 0, 0, 0.35);
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #64748b; }
html.dark input:focus,
html.dark textarea:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.25);
}

/* Selection + scrollbar */
html.dark ::selection { background: rgba(251, 146, 60, 0.45); color: #fff; }
html.dark ::-webkit-scrollbar-track { background: #0f172a; }
html.dark ::-webkit-scrollbar-thumb { background: #ea580c; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #fb923c; }

/* Hero — already overlays a dark gradient on the slideshow; just deepen it */
html.dark .slide-bg::after { background: rgba(0, 0, 0, 0.60); }
html.dark #hero-image {
  border-color: rgba(251, 146, 60, 0.75);
  box-shadow: 0 0 40px rgba(251, 146, 60, 0.55), 0 0 90px rgba(0, 0, 0, 0.55);
}

/* Glow heading: brighter halo on dark bg */
html.dark .glow-text { text-shadow: 0 0 26px rgba(251, 146, 60, 0.55); }

/* Footer (orange) — slight darken */
html.dark footer { background-color: #9a3412 !important; }
html.dark footer .text-orange-200 { color: rgba(255, 255, 255, 0.55) !important; }

/* Resume / case-study page “paper” cards stay readable */
html.dark .shadow-lg { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important; }
html.dark .shadow-sm { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important; }
html.dark .shadow-md { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important; }

/* Generic helpers used on case-study / resume */
html.dark .border-blue-500   { border-color: #60a5fa !important; }
html.dark .border-green-600  { border-color: #34d399 !important; }
html.dark .border-yellow-500 { border-color: #facc15 !important; }
html.dark .border-red-500    { border-color: #f87171 !important; }
html.dark .text-blue-500     { color: #60a5fa !important; }
html.dark .text-green-600    { color: #34d399 !important; }
html.dark .text-yellow-500   { color: #facc15 !important; }
html.dark .text-red-500      { color: #f87171 !important; }
