/* ============================================================
   FaKeZ — Portafolio. Apple-inspired dark, BaltiaMC palette.
   ============================================================ */

:root {
  --bg: #000000;
  --bg-soft: #0a0a0c;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-mute: #6e6e73;
  --accent: #bf5af2;
  --accent-2: #a855f7;
  --accent-3: #7c3aed;
  --grad: #bf5af2;

  --radius: 22px;
  --radius-lg: 32px;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --maxw: 1200px;
  --pad: clamp(20px, 4vw, 56px);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ============================================================
   BACKGROUND DECOR
   ============================================================ */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  z-index: -2;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  top: -300px; left: 50%;
  width: 1100px; height: 1100px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 30% 40%, rgba(191, 90, 242, 0.22), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(124, 58, 237, 0.16), transparent 55%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  animation: float 18s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateX(-50%) translateY(0) scale(1); }
  to   { transform: translateX(-50%) translateY(40px) scale(1.05); }
}

/* ============================================================
   NAV — Glass / Apple style
   ============================================================ */
.nav {
  position: fixed;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: min(96%, 1080px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--border);
  border-radius: 999px;
  z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
              top 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(12, 12, 14, 0.78);
  border-color: var(--border-strong);
  box-shadow: 0 12px 40px -12px rgba(0,0,0,0.6);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px;
  letter-spacing: 0.01em;
}
.brand-logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(191, 90, 242, 0.4);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.brand:hover .brand-logo {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 6px 22px rgba(191, 90, 242, 0.6);
}
.brand-name {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 2px;
}
.nav-links a {
  position: relative;
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 500;
  transition: color 0.25s var(--ease);
  z-index: 2;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(191, 90, 242, 0.7);
  animation: underlineIn 0.35s var(--ease);
}
@keyframes underlineIn {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.nav-right {
  display: flex; align-items: center; gap: 10px;
}
.nav-right .cta {
  background: var(--text);
  color: #000;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-right .cta:hover { background: #fff; transform: translateY(-1px); }

.lang-toggle {
  position: relative;
  display: flex; align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  cursor: pointer;
  font-family: inherit;
}
.lang-toggle .lang-opt {
  position: relative;
  z-index: 2;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  padding: 5px 10px;
  border-radius: 999px;
  transition: color 0.3s var(--ease);
}
.lang-toggle .lang-opt.active { color: #000; }
.lang-toggle .lang-pill {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.4s var(--ease);
  z-index: 1;
}
.lang-toggle[data-lang="en"] .lang-pill { transform: translateX(calc(100% + 0px)); }
.lang-toggle[data-lang="es"] .lang-pill { transform: translateX(0); }

@media (max-width: 820px) {
  .nav { grid-template-columns: auto auto; }
  .nav-links { display: none; }
}

/* ============================================================
   LAYOUT
   ============================================================ */
main { width: 100%; }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) var(--pad);
}

.section-head {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 72px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(191, 90, 242, 0.3);
  border-radius: 999px;
  background: rgba(191, 90, 242, 0.08);
}
.section-head h2 {
  font-size: clamp(34px, 5.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 16ch;
}
.section-sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 50ch;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: auto;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(120px, 16vh, 180px) var(--pad) clamp(60px, 8vh, 100px);
  position: relative;
}
.hero-inner {
  text-align: center;
  max-width: 720px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.hero-logo-wrap {
  position: relative;
  width: 96px; height: 96px;
  display: grid; place-items: center;
  margin-bottom: 4px;
  opacity: 0; transform: translateY(20px) scale(0.9);
  animation: rise 1s var(--ease) 0s forwards;
}
.hero-logo {
  width: 100%; height: 100%;
  border-radius: 22px;
  object-fit: cover;
  position: relative; z-index: 2;
  box-shadow:
    0 20px 60px -10px rgba(191, 90, 242, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.6s var(--ease);
}
.hero-logo-wrap:hover .hero-logo { transform: rotate(-6deg) scale(1.04); }

.hero-logo-glow {
  position: absolute; inset: -30px;
  background: radial-gradient(circle, rgba(191, 90, 242, 0.55), transparent 65%);
  filter: blur(30px);
  z-index: 1;
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  opacity: 0; transform: translateY(20px);
  animation: rise 1s var(--ease) 0.1s forwards;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: rgba(191, 90, 242, 0.1);
  border: 1px solid rgba(191, 90, 242, 0.25);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  opacity: 0; transform: translateY(20px);
  animation: rise 1s var(--ease) 0.1s forwards;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 {
  font-size: clamp(32px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 22ch;
  opacity: 0; transform: translateY(30px);
  animation: rise 1.1s var(--ease) 0.25s forwards;
}
.hero-sub {
  display: block;
  margin-top: 10px;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent { color: var(--accent); }

.lead {
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--text-dim);
  max-width: 56ch;
  line-height: 1.6;
  opacity: 0; transform: translateY(30px);
  animation: rise 1.1s var(--ease) 0.45s forwards;
}

.hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  opacity: 0; transform: translateY(30px);
  animation: rise 1.1s var(--ease) 0.6s forwards;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 28px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease), color 0.25s var(--ease);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--text);
  color: #000;
  box-shadow: 0 10px 30px -10px rgba(255,255,255,0.3);
}
.btn-primary:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 14px 38px -10px rgba(255,255,255,0.45); }
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }

.hero-stats {
  display: flex; gap: clamp(28px, 5vw, 64px);
  margin-top: 30px;
  flex-wrap: wrap; justify-content: center;
  opacity: 0; transform: translateY(30px);
  animation: rise 1.1s var(--ease) 0.75s forwards;
}
.hero-stats > div {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hero-stats strong {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.hero-stats span {
  font-size: 13px; color: var(--text-mute);
  letter-spacing: 0.02em;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 40px);
  max-width: 920px;
  margin: 0 auto;
}
.about-grid p {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-dim);
  line-height: 1.7;
}
.about-grid strong { color: var(--text); font-weight: 600; }
.about-grid em { color: var(--accent); font-style: normal; font-weight: 500; }
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease),
              border-color 0.4s var(--ease);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(191,90,242,0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 22px;
  color: var(--accent);
  background: rgba(191,90,242,0.14);
  border-radius: 14px;
  margin-bottom: 18px;
}
.card h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.card p {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.g-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: #111;
  border: 1px solid var(--border);
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease),
              box-shadow 0.4s var(--ease);
  grid-column: span 4;
  aspect-ratio: 16 / 10;
}
.g-item:nth-child(7n+1) { grid-column: span 8; aspect-ratio: 16 / 9; }
.g-item:nth-child(7n+2) { grid-column: span 4; }
.g-item:nth-child(7n+5) { grid-column: span 6; }
.g-item:nth-child(7n+6) { grid-column: span 6; }

@media (max-width: 900px) {
  .g-item,
  .g-item:nth-child(7n+1),
  .g-item:nth-child(7n+5),
  .g-item:nth-child(7n+6) { grid-column: span 6; }
}
@media (max-width: 600px) {
  .g-item,
  .g-item:nth-child(7n+1),
  .g-item:nth-child(7n+5),
  .g-item:nth-child(7n+6) { grid-column: span 12; }
}

.g-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
  filter: saturate(1.05);
}
.g-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-4px); }
.g-item:hover img { transform: scale(1.06); filter: saturate(1.2); }

.g-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 20px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  display: flex; flex-direction: column; gap: 2px;
  transform: translateY(8px);
  opacity: 0.9;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.g-item:hover figcaption { transform: translateY(0); opacity: 1; }
.g-item figcaption span {
  font-size: 15px; font-weight: 600; color: #fff;
  letter-spacing: -0.01em;
}
.g-item figcaption small { font-size: 12px; color: var(--text-dim); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  max-width: 900px; margin: 0 auto;
}
.skills li {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              transform 0.25s var(--ease), color 0.25s var(--ease);
  font-family: "JetBrains Mono", monospace;
}
.skills li:hover {
  background: rgba(191,90,242,0.14);
  border-color: rgba(191,90,242,0.4);
  color: var(--accent);
  transform: translateY(-2px);
}
.skills .skill-more {
  background: linear-gradient(135deg, rgba(191,90,242,0.18), rgba(124,58,237,0.18));
  border-color: transparent;
  color: var(--text);
  font-style: italic;
}

/* ============================================================
   CONTACT
   ============================================================ */
.section-contact { padding-top: 60px; }
.contact-card {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(50px, 8vw, 90px) clamp(30px, 5vw, 70px);
  background:
    radial-gradient(circle at 20% 0%, rgba(191,90,242,0.18), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(124,58,237,0.14), transparent 60%),
    var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  box-shadow: var(--shadow);
}
.contact-card h2 {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 18ch;
}
.contact-card p { color: var(--text-dim); font-size: 17px; max-width: 50ch; }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  padding: 40px var(--pad);
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 40px;
}
.lightbox.open { display: flex; animation: fade 0.3s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  object-fit: contain;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-strong);
  color: #fff;
  width: 48px; height: 48px;
  border-radius: 999px;
  font-size: 22px;
  cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(20px);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.lb-close { top: 24px; right: 24px; }
.lb-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.18); }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }

/* ============================================================
   REVEAL ON SCROLL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .eyebrow, .hero h1, .lead, .hero-cta, .hero-stats, .hero-logo-wrap,
  .reveal { opacity: 1 !important; transform: none !important; }
}
