* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #e8edf2;
  background: linear-gradient(180deg, #0b0d10, #12151a);
}
.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}
.section {
  padding: 72px 0;
}
h1,
h2 {
  line-height: 1.1;
  margin: 0 0 16px;
}
h2 {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
}
.subtitle {
  color: #a7b0ba;
  margin: 8px 0 24px;
}
.muted {
  color: #a7b0ba;
}
.small {
  font-size: .9rem;
}
.accent {
  color: #5eead4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.2rem;
  border-radius: 12px;
  background: #5eead4;
  color: #062a25;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: .2s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: #e8edf2;
  border: 1px solid #1e2430;
}
.btn--ghost:hover {
  border-color: #5eead4;
  color: #5eead4;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(180%) blur(10px);
  background: rgba(11, 13, 16, .6);
  border-bottom: 1px solid #1e2430;
  z-index: 50;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 0;
}
.logo {
  font-weight: 800;
  text-decoration: none;
  color: #e8edf2;
  font-size: 1.1rem;
}
.logo span {
  color: #5eead4;
}
.nav__menu {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__menu a {
  color: #a7b0ba;
  text-decoration: none;
  padding: .4rem .6rem;
  border-radius: 8px;
}
.nav__menu a:hover,
.nav__menu a.is-active {
  color: #e8edf2;
  background: #12151a;
}
.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid #1e2430;
  color: #e8edf2;
  border-radius: 10px;
  padding: .4rem .6rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 32px;
  align-items: center;
  padding: 56px 0;
}
.hero__img img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: auto;
}
.hero__cta {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}
.social {
  display: flex;
  gap: 12px;
}
.social a {
  color: #a7b0ba;
  text-decoration: none;
}
.social a:hover {
  color: #5eead4;
}

.highlights {
  display: grid;
  gap: .4rem;
  padding-left: 1.2rem;
}
.highlights li {
  color: #a7b0ba;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: .45rem .7rem;
  border: 1px solid #1e2430;
  border-radius: 999px;
  color: #e8edf2;
  background: #0f1319;
  font-size: .9rem;
}
.chip.is-active {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  background: #0f1319;
  border: 1px solid #1e2430;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.card__img {
  aspect-ratio: 16/9;
  background: #0c1117;
}
.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card__body {
  padding: 14px;
}
.card__title {
  margin: 0 0 6px;
  font-weight: 700;
}
.card__desc {
  margin: 0 0 10px;
  color: #a7b0ba;
}
.card__tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card__badges {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.badge {
  font-size: .75rem;
  padding: .25rem .5rem;
  border: 1px dashed #1e2430;
  border-radius: 8px;
  color: #a7b0ba;
}
.card__actions {
  display: flex;
  gap: .6rem;
  margin-top: auto;
}
.card__actions a {
  flex: 1;
  text-align: center;
}

.filters {
  display: flex;
  gap: .5rem;
  margin-bottom: 16px;
}
.contact-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

.site-footer {
  border-top: 1px solid #1e2430;
  padding: 22px 0;
  margin-top: 40px;
}
.footer__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.to-top {
  text-decoration: none;
  color: #a7b0ba;
}
.to-top:hover {
  color: #5eead4;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .nav__toggle {
    display: inline-block;
  }
  .nav__menu {
    position: absolute;
    right: 4%;
    top: 64px;
    background: #12151a;
    border: 1px solid #1e2430;
    padding: 10px;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    width: min(240px, 92vw);
  }
  .nav__menu.open {
    display: flex;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Sección Portafolio */
.portafolio {
  padding: 60px 20px;
  background: #fdeef4;
  text-align: center;
}

.portafolio .titulo {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #be185d;
}

.portafolio .subtitulo {
  font-size: 1.1rem;
  margin-bottom: 40px;
  color: #000000;
}

.portafolio .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(40px);
  color: #4b5563;
}

.card h3 {
  color: #db2777;
  margin-bottom: 15px;
}

.card ul {
  list-style: none;
  padding: 0;
  margin-bottom: 15px;
}

.card ul li {
  margin: 8px 0;
}

.card .precio {
  font-size: 1.3rem;
  font-weight: bold;
  color: #10b981;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Botón WhatsApp */
.btn-wsp {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;
  background: #25D366;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.btn-wsp i {
  margin-right: 6px;
}

.btn-wsp:hover {
  background: #1ebe5b;
}

/* === Projects Grid === */
.projects-grid{
  display:grid;
  gap:24px;
  grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
  margin-top:12px;
}

/* === Card === */
.project-card{
  background:#111418; /* oscuro a juego con tu screenshot */
  border:1px solid #1f242b;
  border-radius:16px;
  overflow:hidden;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.project-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  border-color:#2b313a;
}

/* Thumb */
.project-thumb{
  aspect-ratio: 16/9;
  background: linear-gradient(135deg,#1a1f26,#0f1317);
  display:flex; align-items:center; justify-content:center;
}
.thumb-fallback{
  color:#a4b1c0; font-weight:600; letter-spacing:.2px;
}

/* Body */
.project-body{ padding:16px 16px 18px; }
.project-title{ font-size:1.1rem; color:#e8eef6; margin:0 0 6px; }
.project-desc{ color:#b8c3cf; line-height:1.6; margin:0 0 12px; }

/* Tags */
.project-tags{ display:flex; flex-wrap:wrap; gap:8px; list-style:none; margin:0 0 14px; padding:0; }
.project-tags li{
  font-size:.78rem; color:#b9c6d6; background:#0d1116; border:1px solid #232a33;
  padding:6px 10px; border-radius:999px;
}

/* Links */
.project-links{ display:flex; gap:10px; }
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:36px; padding:0 14px; border-radius:10px; font-weight:600; font-size:.92rem;
  border:1px solid transparent; text-decoration:none;
}
.btn-live{
  background:#0ea5e9; color:#071018; /* celestito */
  border-color:#38bdf8;
}
.btn-live:hover{ filter:brightness(1.05); }
.btn-ghost{
  background:transparent; color:#cbd5e1; border-color:#334155;
}
.btn-ghost:hover{ background:#0b1117; }

/* === Responsive Enhancements (2025-09) === */
/* === Accessibility & Typography ===================== */
:root{
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
}
h1{ font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
p{ line-height: 1.6; }

/* Keyboard focus */
:where(a, button, [role="button"], .btn):focus-visible{
  outline: 2px solid #5eead4;
  outline-offset: 3px;
  border-radius: 10px;
}

/* Reduce motion if user prefers */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* === Header/Nav small fixes ========================= */
.site-header{ inset: auto 0 0 0; }
.nav{ flex-wrap: wrap; }
.nav__menu a{ line-height: 1.2; }

/* === Hero image & layout ============================ */
.hero__img{ display: flex; justify-content: center; }
.hero__img img{
  width: clamp(120px, 20vw, 220px);
  height: clamp(120px, 20vw, 220px);
}

/* Prevent overly wide paragraphs on huge screens */
.container{ max-width: 1100px; }

/* === Cards tap target improvement =================== */
.card .btn, .project-card .btn{ min-height: 42px; padding: 0 .95rem; }

/* === Extra breakpoints ============================== */
@media (max-width: 480px){
  .section{ padding: 56px 0; }
  .hero{ gap: 16px; padding: 40px 0; }
  .hero .subtitle{ font-size: 1rem; }
  .social{ gap: 10px; }
  .contact-actions{ gap: .6rem; }
  .nav{ padding: 10px 0; }
  .nav__menu{ top: 56px; }
}

/* === Portfolio light block readability ============== */
.portafolio{
  color: #1f2937; /* enforce readable dark text over light bg */
}
.portafolio .card{
  opacity: 1;                 /* start visible on mobile to avoid pop-in */
  transform: translateY(0);   /* animation handled progressively */
}
