/* PISIM – estilos basados en el formato de ciccsamexico.com
   Raleway (títulos) + Montserrat ligera (texto), header oscuro,
   acento tomado del rojo del logotipo PISIM. */

:root {
  --dark: #24272d;
  --dark-2: #2b2e35;
  --ink: #3f3f3f;
  --text: #5a5d62;
  --muted: #8a8d92;
  --line: #e4e4e4;
  --bg: #ffffff;
  --bg-alt: #f6f6f6;
  --accent: #e32526;
  --accent-dark: #b81c1d;
  --header-h: 84px;
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 15px/1.85 Montserrat, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: Raleway, Arial, Helvetica, sans-serif; font-weight: 500; color: var(--ink); margin: 0; line-height: 1.25; }
p { margin: 0 0 1.2em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 110px 0; }
.section--alt { background: var(--bg-alt); }

.h-display { font-size: clamp(34px, 4.4vw, 47px); text-transform: uppercase; letter-spacing: .01em; }
.rule { width: 135px; height: 2px; border: 0; background: var(--line); margin: 40px 0; }
.lead { font-size: 18px; font-weight: 400; line-height: 1.85; color: var(--ink); }
.eyebrow { display: inline-block; font: 500 13px/1 Montserrat, sans-serif; letter-spacing: .2em; color: var(--accent); margin-bottom: 14px; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  background: var(--dark);
  transition: background .3s, box-shadow .3s;
}
.header.is-scrolled { box-shadow: 0 2px 18px rgba(0,0,0,.25); }
.header__inner { height: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.header__logo img { height: 52px; width: auto; }
.nav { display: flex; align-items: center; gap: 34px; }
.nav a { color: #fff; text-transform: uppercase; font-size: 14px; letter-spacing: .03em; transition: color .2s; }
.nav > a, .nav__parent { position: relative; padding: 30px 0; }
.nav > a::after, .nav__parent::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 22px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .25s;
}
.nav > a:hover::after, .nav__drop:hover .nav__parent::after, .nav a.is-current::after { transform: scaleX(1); }
.nav__drop { position: relative; }
.nav__parent { padding-right: 16px !important; }
.nav__parent::before {
  content: ""; position: absolute; right: 1px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.nav__sub {
  position: absolute; top: 100%; left: -20px; min-width: 270px;
  background: var(--dark-2); border-top: 2px solid var(--accent);
  padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav__drop:hover .nav__sub, .nav__drop:focus-within .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__sub a { display: block; padding: 10px 22px; font-size: 13px; }
.nav__sub a:hover { color: var(--accent); background: rgba(255,255,255,.03); }

.header__toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.header__toggle span { display: block; width: 26px; height: 2px; background: #fff; margin: 6px 0; transition: transform .25s, opacity .25s; }
.header__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.header__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--header-h) + 40px) 24px 80px;
  overflow: hidden; color: #fff;
}
.hero__bg, .contact__bg, .banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,22,26,.55), rgba(20,22,26,.72)); }
.hero__content { position: relative; z-index: 1; display: flex; align-items: center; gap: 48px; max-width: 1100px; }
.hero__logo { width: clamp(150px, 18vw, 230px); height: auto; flex: none; }
.hero__divider { display: block; width: 1px; align-self: stretch; min-height: 120px; background: rgba(255,255,255,.65); flex: none; }
.hero__title { color: #fff; font-size: clamp(26px, 3.6vw, 50px); font-weight: 400; line-height: 1.25; }
.hero__scroll {
  position: absolute; z-index: 1; bottom: 34px; left: 50%; width: 26px; height: 42px; margin-left: -13px;
  border: 2px solid rgba(255,255,255,.7); border-radius: 14px;
}
.hero__scroll::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: scrollDot 1.8s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Quiénes somos ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 56px; align-items: start; }
.about__col p { text-align: justify; hyphens: auto; }
.about__col--mid { padding-top: 120px; }
.about__col--mid img { width: 100%; aspect-ratio: 4/4.4; object-fit: cover; margin-bottom: 26px; }
.about__thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.about__thumbs img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }

/* ---------- Mosaico de especialidades ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); }
.tile { position: relative; aspect-ratio: 1/1.05; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.tile::before { content: ""; position: absolute; inset: 0; background: rgba(28,30,35,.6); z-index: 1; transition: background .35s; }
.tile h4 {
  position: relative; z-index: 2; color: #fff; text-transform: uppercase; font-size: 19px; letter-spacing: .06em; line-height: 1.45;
  padding: 18px 10px; border-top: 1px solid rgba(255,255,255,.5); border-bottom: 1px solid rgba(255,255,255,.5);
  transition: border-color .35s;
}
.tile:hover img { transform: scale(1.06); }
.tile:hover::before { background: rgba(227,37,38,.62); }
.tile:hover h4 { border-color: #fff; }

/* ---------- Carta ---------- */
.letter { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; }
.letter__company { font: 500 22px/1.3 Raleway, sans-serif; color: var(--ink); margin-bottom: 24px; }
.letter__body > p { text-align: justify; }
.letter__goal {
  margin: 34px 0; padding: 26px 30px; background: #fff;
  border-left: 3px solid var(--accent); color: var(--ink); font-weight: 400;
}
.letter__goal span { display: block; font: 500 12px/1 Montserrat, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.letter__sign { margin-top: 46px; padding-top: 18px; border-top: 1px solid #cfcfcf; max-width: 380px; }
.letter__sign strong { display: block; font: 500 16px/1.5 Raleway, sans-serif; color: var(--ink); }
.letter__sign span { color: var(--muted); font-size: 14px; }

/* ---------- Banner tipo encabezado de página ---------- */
.banner { position: relative; height: 420px; display: flex; align-items: center; overflow: hidden; }
.banner--short { height: 340px; }
.banner::after { content: ""; position: absolute; inset: 0; background: rgba(20,22,26,.6); }
.banner__content { position: relative; z-index: 1; width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.banner h2 { color: #fff; font-size: clamp(36px, 5vw, 58px); text-transform: uppercase; }
.banner p { color: rgba(255,255,255,.85); margin: 10px 0 0; font-size: 17px; }

/* ---------- Detalle de especialidades ---------- */
.spec { padding: 100px 0; }
.spec__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.spec--reverse .spec__media { order: 2; }
.spec__media { margin: 0; position: relative; }
.spec__media img { width: 100%; aspect-ratio: 4/3.3; object-fit: cover; box-shadow: 0 20px 40px -24px rgba(0,0,0,.45); }
.spec__media figcaption { position: absolute; left: 0; bottom: 22px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; padding: 9px 18px; }
.spec__text h3 { font-size: clamp(28px, 3vw, 38px); margin-bottom: 22px; }
.spec__text p { text-align: justify; }

.checks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.checks--cols { grid-template-columns: 1fr 1fr; column-gap: 28px; }
.checks li { position: relative; padding-left: 28px; color: var(--ink); font-weight: 400; line-height: 1.6; }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
.stats div { border-top: 2px solid var(--accent); padding-top: 14px; }
.stats strong { display: block; font: 500 40px/1 Raleway, sans-serif; color: var(--ink); margin-bottom: 8px; }
.stats span { font-size: 13px; line-height: 1.5; display: block; }

/* ---------- Proyectos ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 64px; }
.filters button {
  font: 400 13px/1 Montserrat, sans-serif; letter-spacing: .05em; text-transform: uppercase;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  padding: 13px 20px; cursor: pointer; transition: all .2s;
}
.filters button:hover { border-color: var(--accent); color: var(--accent); }
.filters button.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 72px 56px; }
.project { display: flex; flex-direction: column; text-align: center; }
.project[hidden] { display: none; }
.project h4 { font-size: clamp(22px, 2.3vw, 31px); font-weight: 400; color: var(--ink); min-height: 2.5em; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.project__img { position: relative; display: block; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: #ddd; box-shadow: 0 6px 22px rgba(0,0,0,.12); }
.project__img img { width: 100%; aspect-ratio: 5/3.2; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.project__img::after { content: ""; position: absolute; inset: 0; background: rgba(227,37,38,0); transition: background .3s; }
.project__img:hover img { transform: scale(1.04); }
.project__img:hover::after { background: rgba(20,22,26,.18); }
.project p { margin: 20px 0 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

/* ---------- Contacto ---------- */
.contact { position: relative; padding: 130px 0; color: #fff; overflow: hidden; }
.contact::after { content: ""; position: absolute; inset: 0; background: rgba(20,22,26,.8); }
.contact__inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 56px; }
.contact__brand img { width: 210px; height: auto; }
.contact .hero__divider { min-height: 220px; }
.contact__info h2 { color: #fff; font-size: clamp(34px, 4vw, 46px); text-transform: uppercase; margin-bottom: 26px; }
.contact__line { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 400; margin-bottom: 12px; transition: color .2s; }
.contact__line svg { width: 20px; height: 20px; fill: var(--accent); flex: none; }
.contact__line:hover { color: #ffb3b3; }
.btn {
  display: inline-block; margin-top: 22px; padding: 15px 30px;
  background: var(--accent); color: #fff; font: 500 13px/1 Montserrat, sans-serif; letter-spacing: .12em; text-transform: uppercase;
  transition: background .2s;
}
.btn:hover { background: var(--accent-dark); }

/* ---------- Footer ---------- */
.footer { background: var(--dark-2); color: #b3b6bb; font-size: 13px; padding: 26px 0; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer a:hover { color: #fff; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 44px; height: 44px;
  background: var(--dark-2); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s, background .2s;
}
.to-top::before { content: ""; position: absolute; left: 50%; top: 52%; width: 10px; height: 10px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: translate(-50%, -30%) rotate(45deg); }
.to-top.is-visible { opacity: .9; visibility: visible; }
.to-top:hover { background: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12,13,16,.94); display: flex; align-items: center; justify-content: center; padding: 40px 70px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 1200px; text-align: center; }
.lightbox img { max-width: 100%; max-height: 80vh; margin: 0 auto; }
.lightbox figcaption { color: #fff; font: 400 18px/1.4 Raleway, sans-serif; margin-top: 16px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lightbox__close { top: 14px; right: 22px; font-size: 44px; line-height: 1; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 64px; padding: 10px 16px; }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll::after { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { gap: 22px; }
  .nav a { font-size: 13px; }
  .about { grid-template-columns: 1fr 1fr; }
  .about__col--lead { grid-column: 1 / -1; }
  .about__col--mid { padding-top: 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile { aspect-ratio: 16/10; }
}

@media (max-width: 900px) {
  :root { --header-h: 70px; }
  .header__logo img { height: 42px; }
  .header__toggle { display: block; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--dark); padding: 10px 24px 40px; overflow-y: auto;
    transform: translateX(100%); transition: transform .3s ease;
  }
  .nav.is-open { transform: none; }
  .nav > a, .nav__parent { display: block; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
  .nav > a::after, .nav__parent::after, .nav__parent::before { display: none; }
  .nav__sub { position: static; opacity: 1; visibility: visible; transform: none; background: transparent; border: 0; padding: 0 0 8px 14px; min-width: 0; }
  .nav__sub a { padding: 10px 0; color: #c9cbcf; }

  .section, .spec { padding: 76px 0; }
  .hero__content { flex-direction: column; text-align: center; gap: 28px; }
  .hero__divider { width: 90px; min-height: 0; height: 1px; align-self: center; }
  .letter, .spec__grid { grid-template-columns: 1fr; gap: 36px; }
  .spec--reverse .spec__media { order: 0; }
  .rule { margin: 28px 0; }
  .projects { gap: 56px 32px; }
  .contact__inner { flex-direction: column; text-align: center; gap: 30px; }
  .contact .hero__divider { min-height: 0; }
  .contact__line { justify-content: center; }
  .banner { height: 300px; }
  .banner--short { height: 240px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { aspect-ratio: 16/9; }
  .projects { grid-template-columns: 1fr; }
  .project h4 { min-height: 0; }
  .checks--cols { grid-template-columns: 1fr; }
  .about__col p, .spec__text p, .letter__body > p { text-align: left; }
  .lightbox { padding: 20px 8px; }
  .lightbox__nav { font-size: 44px; top: auto; bottom: 10px; transform: none; }
  .footer__inner { flex-direction: column; text-align: center; }
}
